diff --git a/templates/huginn/0/README.md b/templates/huginn/0/README.md new file mode 100644 index 0000000..ad2bb0f --- /dev/null +++ b/templates/huginn/0/README.md @@ -0,0 +1,25 @@ +# 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. + +**Warning**: The **Require Confirmed Email** option *must* be **off** when you first start up the stack because the default user has a fake email address and will not allow you to login. If desired, you can upgrade the stack and turn email verification back on after changing the admin's email address. + +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..491135a --- /dev/null +++ b/templates/huginn/0/docker-compose.yml @@ -0,0 +1,110 @@ +version: '2' + +services: + postgres: + image: postgres:9.5 + restart: always + volumes: + - postgres-data:/var/lib/postgresql/data + environment: + POSTGRES_PASSWORD: ${DB_PASSWORD} + POSTGRES_USER: ${DB_USER} + POSTGRES_DB: ${DB_NAME} + http_proxy: + https_proxy: + + huginn-web: + image: huginn/huginn-single-process:fc1daf8b91398929cedd72895cc95647e3ed7b6a + restart: always + external_links: + - postgres:postgres + environment: + DATABASE_ADAPTER: postgresql + POSTGRES_PORT_5432_TCP_ADDR: postgres + POSTGRES_PORT_5432_TCP_PORT: 5432 + DATABASE_NAME: ${DB_NAME} + DATABASE_USERNAME: ${DB_USER} + 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: ${REQUIRE_CONFIRMED_EMAIL} + 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: + + huginn-agent-runner: + image: huginn/huginn-single-process:fc1daf8b91398929cedd72895cc95647e3ed7b6a + restart: always + external_links: + - postgres:postgres + environment: + DATABASE_ADAPTER: postgresql + POSTGRES_PORT_5432_TCP_ADDR: postgres + POSTGRES_PORT_5432_TCP_PORT: 5432 + DATABASE_NAME: ${DB_NAME} + DATABASE_USERNAME: ${DB_USER} + 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: ${REQUIRE_CONFIRMED_EMAIL} + 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: + command: /scripts/init bin/agent_runner.rb + + huginn-delayed-job: + image: huginn/huginn-single-process:fc1daf8b91398929cedd72895cc95647e3ed7b6a + restart: always + external_links: + - postgres:postgres + environment: + DATABASE_ADAPTER: postgresql + POSTGRES_PORT_5432_TCP_ADDR: postgres + POSTGRES_PORT_5432_TCP_PORT: 5432 + DATABASE_NAME: ${DB_NAME} + DATABASE_USERNAME: ${DB_USER} + 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: ${REQUIRE_CONFIRMED_EMAIL} + 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: + 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..22ebff6 --- /dev/null +++ b/templates/huginn/0/rancher-compose.yml @@ -0,0 +1,109 @@ +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: DB_NAME + description: The database name + label: Database Name + required: true + default: "huginn" + type: string + - variable: DB_USER + description: The database username + label: Database Username + required: true + default: "huginn" + type: string + - variable: APP_SECRET_TOKEN + description: The secret token used by Huginn + label: App Secret Token + required: true + type: password + - variable: DOMAIN + description: The domain and port ( if necessary ) that should be used to get to Huginn + label: Domain + required: true + default: example.com + 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: false + 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 + - variable: STORAGE_DRIVER + description: Rancher storage driver to use for database volume + label: Storage Driver + default: local + required: true + 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/catalogIcon-huginn.svg b/templates/huginn/catalogIcon-huginn.svg new file mode 100644 index 0000000..4459427 --- /dev/null +++ b/templates/huginn/catalogIcon-huginn.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/huginn/config.yml b/templates/huginn/config.yml new file mode 100644 index 0000000..f600e9d --- /dev/null +++ b/templates/huginn/config.yml @@ -0,0 +1,8 @@ +name: Huginn +description: | + Web automation framework. Your agents are standing by! +version: "0.1" +category: Automation +license: MIT +maintainer: "Kapono Haws " +projectURL: https://github.com/huginn/huginn/