diff --git a/templates/huginn/0/README.md b/templates/huginn/0/README.md new file mode 100644 index 0000000..2cba211 --- /dev/null +++ b/templates/huginn/0/README.md @@ -0,0 +1,23 @@ +# Huginn + +Your agents are standing by! + +[Huginn](https://github.com/huginn/huginn) is a tool that allows you to automate tasks on the internet and/or your private intranet. + +## Installation + +When huginn first starts up it will create one user named, `admin`, with the password, `password`, along with a number of example agents for that user. Each new user will start off with a set of example agents. + +The Huggin web interface is served in the `huginn_web` container on port `3000`. In order to get web traffic to the container you have to create a Rancher load balancer and route the traffic to the container on port `3000`. + +## Scaling + +The `huginn-web` service *can* be scaled to provide a redundant web interface or to account for a large amount of traffic, but scaling is usually unnecessary. + +The `huginn-agent-runner` service **cannot** be scaled as it is the agent scheduler. Running multiple `huginn-agent-runner` services would result in jobs running multiple times. Running only a single `huginn-agent-runner` container should not be a HA concern because the container does not represent any significant load and because the container will restart automatically in case of a failure. In the event of a container restart, there will a momentary pause in agent scheduling, but that should not represent any issue. + +The `huginn-delayed-job` service can and should be scaled up if you have a large number of agents. This will distribute the tasks over more containers. + +## Configuration + +For more information on configuration options see [this example environment file](https://github.com/huginn/huginn/blob/master/.env.example) from the Huginn project. diff --git a/templates/huginn/0/docker-compose.yml b/templates/huginn/0/docker-compose.yml new file mode 100644 index 0000000..d94586e --- /dev/null +++ b/templates/huginn/0/docker-compose.yml @@ -0,0 +1,114 @@ +version: '2' + +services: + postgres: + image: postgres:9.5 + volumes: + - postgres-data:/var/lib/postgresql/data + environment: + POSTGRES_PASSWORD: ${DB_PASSWORD} + POSTGRES_USER: huginn + POSTGRES_DB: huginn + http_proxy: + https_proxy: + labels: + io.rancher.container.pull_image: always + + huginn-web: + image: huginn/huginn-single-process + restart: always + environment: + DATABASE_ADAPTER: postgresql + POSTGRES_PORT_5432_TCP_ADDR: postgres + POSTGRES_PORT_5432_TCP_PORT: 5432 + DATABASE_ADAPTER: postgresql + DATABASE_NAME: huginn + DATABASE_USERNAME: huginn + DATABASE_PASSWORD: ${DB_PASSWORD} + APP_SECRET_TOKEN: ${APP_SECRET_TOKEN} + DOMAIN: $DOMAIN + INVITATION_CODE: $INVITATION_CODE + SKIP_INVITATION_CODE: $SKIP_INVITATION_CODE + REQUIRE_CONFIRMED_EMAIL: true + SMTP_DOMAIN: $DOMAIN + SMTP_USER_NAME: $SMTP_USER_NAME + SMTP_PASSWORD: $SMTP_PASSWORD + SMTP_SERVER: $SMTP_SERVER + SMTP_PORT: $SMTP_PORT + SMTP_AUTHENTICATION: $SMTP_AUTHENTICATION + SMTP_ENABLE_STARTTLS_AUTO: true + USE_EVERNOTE_SANDBOX: false + EMAIL_FROM_ADDRESS: $EMAIL_FROM_ADDRESS + ADDITIONAL_GEMS: $ADDITIONAL_GEMS + http_proxy: + https_proxy: + labels: + io.rancher.container.pull_image: always + + huginn-agent-runner: + image: huginn/huginn-single-process + restart: always + environment: + DATABASE_ADAPTER: postgresql + POSTGRES_PORT_5432_TCP_ADDR: postgres + POSTGRES_PORT_5432_TCP_PORT: 5432 + DATABASE_ADAPTER: postgresql + DATABASE_NAME: huginn + DATABASE_USERNAME: huginn + DATABASE_PASSWORD: ${DB_PASSWORD} + APP_SECRET_TOKEN: ${APP_SECRET_TOKEN} + DOMAIN: $DOMAIN + INVITATION_CODE: $INVITATION_CODE + SKIP_INVITATION_CODE: $SKIP_INVITATION_CODE + REQUIRE_CONFIRMED_EMAIL: true + SMTP_DOMAIN: $DOMAIN + SMTP_USER_NAME: $SMTP_USER_NAME + SMTP_PASSWORD: $SMTP_PASSWORD + SMTP_SERVER: $SMTP_SERVER + SMTP_PORT: $SMTP_PORT + SMTP_AUTHENTICATION: $SMTP_AUTHENTICATION + SMTP_ENABLE_STARTTLS_AUTO: true + USE_EVERNOTE_SANDBOX: false + EMAIL_FROM_ADDRESS: $EMAIL_FROM_ADDRESS + ADDITIONAL_GEMS: $ADDITIONAL_GEMS + http_proxy: + https_proxy: + labels: + io.rancher.container.pull_image: always + command: /scripts/init bin/agent_runner.rb + + huginn-delayed-job: + image: huginn/huginn-single-process + restart: always + environment: + DATABASE_ADAPTER: postgresql + POSTGRES_PORT_5432_TCP_ADDR: postgres + POSTGRES_PORT_5432_TCP_PORT: 5432 + DATABASE_ADAPTER: postgresql + DATABASE_NAME: huginn + DATABASE_USERNAME: huginn + DATABASE_PASSWORD: ${DB_PASSWORD} + APP_SECRET_TOKEN: ${APP_SECRET_TOKEN} + DOMAIN: $DOMAIN + INVITATION_CODE: $INVITATION_CODE + SKIP_INVITATION_CODE: $SKIP_INVITATION_CODE + REQUIRE_CONFIRMED_EMAIL: true + SMTP_DOMAIN: $DOMAIN + SMTP_USER_NAME: $SMTP_USER_NAME + SMTP_PASSWORD: $SMTP_PASSWORD + SMTP_SERVER: $SMTP_SERVER + SMTP_PORT: $SMTP_PORT + SMTP_AUTHENTICATION: $SMTP_AUTHENTICATION + SMTP_ENABLE_STARTTLS_AUTO: true + USE_EVERNOTE_SANDBOX: false + EMAIL_FROM_ADDRESS: $EMAIL_FROM_ADDRESS + ADDITIONAL_GEMS: $ADDITIONAL_GEMS + http_proxy: + https_proxy: + labels: + io.rancher.container.pull_image: always + command: /scripts/init script/delayed_job run + +volumes: + postgres-data: + driver: ${STORAGE_DRIVER} diff --git a/templates/huginn/0/rancher-compose.yml b/templates/huginn/0/rancher-compose.yml new file mode 100644 index 0000000..bc9030d --- /dev/null +++ b/templates/huginn/0/rancher-compose.yml @@ -0,0 +1,86 @@ +version: '2' +catalog: + name: Huginn + version: 0.1 + description: Web automation framework. Your agents are standing by! + questions: + - variable: DB_PASSWORD + description: The database password + label: Database Password + required: true + type: password + - variable: DOMAIN + description: The domain and port that Huginn will be hosted on + label: Domain + required: true + default: example.com:443 + type: string + - variable: INVITATION_CODE + description: Code that new users must use to register + label: Invitation Code + required: true + default: try-huginn + type: string + - variable: SKIP_INVITATION_CODE + description: Don't require users to have an invitation code to register + label: Skip Invitation Code + required: true + default: false + type: boolean + - variable: REQUIRE_CONFIRMED_EMAIL + description: Require newly registered users to confirm their Email address + label: Require Confirmed Email + required: true + default: true + type: boolean + - variable: SMTP_USER_NAME + label: SMTP Username + required: false + default: you@gmail.com + type: string + - variable: SMTP_PASSWORD + label: SMTP Password + required: false + default: password + type: password + - variable: SMTP_SERVER + label: SMTP Server + required: false + default: smtp.gmail.com + type: string + - variable: SMTP_PORT + label: SMTP Port + required: false + default: 587 + type: string + - variable: EMAIL_FROM_ADDRESS + label: Email From Address + required: false + default: noreply@something.com + type: string + - variable: SMTP_AUTHENTICATION + label: SMTP Authentication Method + default: plain + required: false + type: enum + options: + - plain + - login + - variable: ADDITIONAL_GEMS + description: Additional ruby gems to install. Can be used to provide additional huginn agents + label: Additional Gems + required: false + type: string +services: + postgres: + scale: 1 + start_on_create: true + huginn-web: + scale: 1 + start_on_create: true + huginn-agent-runner: + scale: 1 + start_on_create: true + huginn-delayed-job: + scale: 1 + start_on_create: true diff --git a/templates/huginn/config.yml b/templates/huginn/config.yml new file mode 100644 index 0000000..324f732 --- /dev/null +++ b/templates/huginn/config.yml @@ -0,0 +1,6 @@ +name: Huginn +description: | + Web automation framework. Your agents are standing by! +version: 0.1 +category: Automation +maintainer: Zicklag (zicklag@katharostech.com)