new:[n8n] add charm
This commit is contained in:
30
n8n/README.org
Normal file
30
n8n/README.org
Normal file
@@ -0,0 +1,30 @@
|
||||
# -*- ispell-local-dictionary: "english" -*-
|
||||
|
||||
* Info
|
||||
|
||||
From: https://docs.n8n.io/hosting/installation/docker/#starting-n8n
|
||||
|
||||
|
||||
* Usage
|
||||
|
||||
Config info: https://support.rallly.co/self-hosting/configuration-options
|
||||
|
||||
Requires a =smtp-server= provider to be functional, you can use
|
||||
=smtp-stub= charm to provide information to externally managed =SMTP=.
|
||||
|
||||
#+begin_src yaml
|
||||
n8n:
|
||||
options:
|
||||
sender-email: #the sender email (beware the conf of your SMTP server)
|
||||
|
||||
smtp-stub:
|
||||
options:
|
||||
host: smtp.myhost.com
|
||||
port: 465
|
||||
connection-security: "ssl/tls"
|
||||
auth-method: password #IMPORTANT: if not present login password doesn’t work
|
||||
login: myuser
|
||||
password: myp4ssw0rd
|
||||
#+end_src
|
||||
|
||||
|
31
n8n/hooks/init
Executable file
31
n8n/hooks/init
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
## Init is run on host
|
||||
## For now it is run every time the script is launched, but
|
||||
## it should be launched only once after build.
|
||||
|
||||
## Accessible variables are:
|
||||
## - SERVICE_NAME Name of current service
|
||||
## - DOCKER_BASE_IMAGE Base image from which this service might be built if any
|
||||
## - SERVICE_DATASTORE Location on host of the DATASTORE of this service
|
||||
## - SERVICE_CONFIGSTORE Location on host of the CONFIGSTORE of this service
|
||||
|
||||
|
||||
set -e
|
||||
|
||||
sender=$(options-get sender-email) || exit 1
|
||||
|
||||
init-config-add "
|
||||
$SERVICE_NAME:
|
||||
volumes:
|
||||
- $SERVICE_DATASTORE/.n8n:/home/node/.n8n
|
||||
environment:
|
||||
N8N_SMTP_SENDER: \"$sender\"
|
||||
GENERIC_TIMEZONE: "Europe/Paris"
|
||||
TZ: "Europe/Paris"
|
||||
"
|
||||
|
||||
uid=$(docker_get_uid "$SERVICE_NAME" "node")
|
||||
mkdir -p "$SERVICE_DATASTORE/.n8n"
|
||||
chown "$uid" "$SERVICE_DATASTORE/.n8n"
|
||||
|
22
n8n/hooks/postgres_database-relation-joined
Executable file
22
n8n/hooks/postgres_database-relation-joined
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
PASSWORD="$(relation-get password)"
|
||||
USER="$(relation-get user)"
|
||||
DBNAME="$(relation-get dbname)"
|
||||
|
||||
|
||||
config-add "\
|
||||
services:
|
||||
$MASTER_BASE_SERVICE_NAME:
|
||||
environment:
|
||||
DB_TYPE: postgresdb
|
||||
DB_POSTGRESDB_HOST: $TARGET_SERVICE_NAME
|
||||
DB_POSTGRESDB_PORT: 5432
|
||||
DB_POSTGRESDB_DATABASE: $DBNAME
|
||||
DB_POSTGRESDB_USER: $USER
|
||||
DB_POSTGRESDB_PASSWORD: $PASSWORD
|
||||
"
|
||||
|
||||
info "Configured $SERVICE_NAME code for $TARGET_SERVICE_NAME access."
|
20
n8n/hooks/smtp_server-relation-joined
Executable file
20
n8n/hooks/smtp_server-relation-joined
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
host=$(relation-get host) || exit 1
|
||||
port=$(relation-get port) || exit 1
|
||||
user=$(relation-get login) || exit 1
|
||||
password="$(relation-get password)" || exit 1
|
||||
|
||||
|
||||
config-add "\
|
||||
services:
|
||||
$MASTER_BASE_SERVICE_NAME:
|
||||
environment:
|
||||
N8N_SMTP_USER: \"$user\"
|
||||
N8N_SMTP_PASS: \"${password//\$/\$\$}\"
|
||||
N8N_SMTP_HOST: \"$host\"
|
||||
N8N_SMTP_PORT: \"$port\"
|
||||
"
|
||||
|
30
n8n/metadata.yml
Normal file
30
n8n/metadata.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
docker-image: docker.n8n.io/n8nio/n8n:1.23.0
|
||||
|
||||
uses:
|
||||
postgres-database:
|
||||
#constraint: required | recommended | optional
|
||||
#auto: pair | summon | none ## default: pair
|
||||
constraint: required
|
||||
auto: summon
|
||||
solves:
|
||||
database: "main storage"
|
||||
smtp-server:
|
||||
constraint: required
|
||||
auto: summon
|
||||
solves:
|
||||
proxy: "Public access"
|
||||
web-proxy:
|
||||
#constraint: required | recommended | optional
|
||||
#auto: pair | summon | none ## default: pair
|
||||
constraint: recommended
|
||||
auto: pair
|
||||
solves:
|
||||
proxy: "Public access"
|
||||
default-options:
|
||||
target: !var-expand ${MASTER_BASE_SERVICE_NAME}:5678
|
||||
backup:
|
||||
constraint: recommended
|
||||
auto: pair
|
||||
solves:
|
||||
backup: "Automatic regular backup"
|
||||
default-options:
|
Reference in New Issue
Block a user