File size: 1,137 Bytes
4c98a98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
set -eu
echo "[runner] waiting for n8n http://127.0.0.1:${N8N_PORT:-7860}/healthz"

# Wait for n8n health
for i in $(seq 1 120); do
  if curl -fsS "http://127.0.0.1:${N8N_PORT:-7860}/healthz" >/dev/null 2>&1; then
    echo "[runner] n8n ready"
    break
  fi
  sleep 1
  if [ "$i" -eq 120 ]; then echo "[runner] n8n health timeout, starting runner anyway"; fi
done

# Ensure config exists
if [ ! -f /etc/n8n-task-runners.json ]; then
  echo "[runner] missing /etc/n8n-task-runners.json"
fi

# Export required broker envs for launcher (allowed-env list in json permits these)
export N8N_RUNNERS_TASK_BROKER_URI=${N8N_RUNNERS_TASK_BROKER_URI:-http://127.0.0.1:5679}
export N8N_RUNNERS_AUTH_TOKEN=${N8N_RUNNERS_AUTH_TOKEN:-}
export N8N_VERSION=${N8N_VERSION:-2.39.8}

echo "[runner] launching task-runner-launcher -> $N8N_RUNNERS_TASK_BROKER_URI mode=${N8N_RUNNERS_MODE:-external}"
# Use allowlisted envs only — launcher filters, but broker URI/token must be passed via env file or args
# Launcher reads N8N_RUNNERS_TASK_BROKER_URI etc. via allowed-env; we export them
exec /usr/local/bin/task-runner-launcher javascript python