Skip to content

Commit

Permalink
some defaults configs
Browse files Browse the repository at this point in the history
  • Loading branch information
compgeniuses committed Feb 4, 2024
1 parent 0087da9 commit 01f1e42
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
4 changes: 3 additions & 1 deletion imageroot/actions/create-module/20configure
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ data = json.load(sys.stdin)
# Setup default values
random_key = secrets.token_hex(16)

random_key = secrets.token_hex(16)
N8N_ENCRYPTION_KEY = data.get("N8N_ENCRYPTION_KEY",random_key)

# Talk with agent using file descriptor.


agent.set_env("N8N_ENCRYPTION_KEY", N8N_ENCRYPTION_KEY)

# Make sure everything is saved inside the environment file
# just before starting systemd unit
Expand Down
9 changes: 5 additions & 4 deletions imageroot/systemd/user/n8n-server.service
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ EnvironmentFile=%S/state/environment
EnvironmentFile=%S/state/database.env
WorkingDirectory=%S/state
Restart=always
TimeoutStopSec=70
ExecStartPre=/bin/mkdir -p config
ExecStartPre=/bin/rm -f %t/n8n-server.pid %t/n8n-server.ctr-id
ExecStartPre=/usr/local/bin/runagent discover-smarthost
ExecStart=/usr/bin/podman run \
--detach \
--conmon-pidfile=%t/n8n-server.pid \
--pod-id-file=%t/n8n.pod-id \
ExecStartPost=/usr/bin/bash -c "while ! /usr/bin/podman exec n8n-server /usr/bin/curl http://127.0.0.1:5678/n8n ; do sleep 3 ; done"
ExecStart=/usr/bin/podman run --conmon-pidfile %t/n8n-server.pid \
--cidfile=%t/n8n-server.ctr-id \
--cgroups=no-conmon \
--pod-id-file=%t/n8n.pod-id \
--replace --name=%N \
--env-file=smarthost.env \
--env=n8n_* \
Expand Down
6 changes: 3 additions & 3 deletions imageroot/systemd/user/n8n.service
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ Environment=PODMAN_SYSTEMD_UNIT=%n
EnvironmentFile=-%S/state/environment
Restart=always
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/n8n-pod.pid %t/n8n.pod-id
ExecStartPre=/usr/bin/podman pod create --infra-conmon-pidfile %t/n8n-pod.pid \
ExecStartPre=/bin/rm -f %t/n8n.pid %t/n8n.pod-id
ExecStartPre=/usr/bin/podman pod create --infra-conmon-pidfile %t/n8n.pid \
--pod-id-file %t/n8n.pod-id \
--name n8n \
--publish 127.0.0.1:${TCP_PORT}:5678 \
--replace
ExecStart=/usr/bin/podman pod start --pod-id-file %t/n8n.pod-id
ExecStop=/usr/bin/podman pod stop --ignore --pod-id-file %t/n8n.pod-id -t 10
ExecStopPost=/usr/bin/podman pod rm --ignore -f --pod-id-file %t/n8n.pod-id
PIDFile=%t/n8n-pod.pid
PIDFile=%t/n8n.pid
Type=forking

[Install]
Expand Down

0 comments on commit 01f1e42

Please sign in to comment.