From 49db95e15e9c2fcbcfab3e6bf48ed537c396ee2b Mon Sep 17 00:00:00 2001 From: Tomi Turtiainen <10324676+tomi@users.noreply.github.com> Date: Wed, 4 Dec 2024 15:13:52 +0200 Subject: [PATCH] refactor: Rename launcher env vars - `N8N_LAUNCHER_HEALTH_CHECK_PORT` to `N8N_RUNNERS_LAUNCHER_HEALTH_CHECK_PORT` - `N8N_LAUNCHER_LOG_LEVEL` to `N8N_RUNNERS_LAUNCHER_LOG_LEVEL` --- docs/development.md | 2 +- docs/setup.md | 4 ++-- internal/config/config.go | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/development.md b/docs/development.md index e604446..752f9cf 100644 --- a/docs/development.md +++ b/docs/development.md @@ -38,4 +38,4 @@ make run ``` > [!TIP] -> You can use `N8N_LAUNCHER_LOG_LEVEL=debug` for granular logging and `NO_COLOR=1` to disable color output. +> You can use `N8N_RUNNERS_LAUNCHER_LOG_LEVEL=debug` for granular logging and `NO_COLOR=1` to disable color output. diff --git a/docs/setup.md b/docs/setup.md index 73cb162..e88a093 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -44,13 +44,13 @@ Task runner config fields: - It is required to specify an auth token by setting `N8N_RUNNERS_AUTH_TOKEN` to a secret. The launcher will use this secret to authenticate with the n8n instance. You will also pass this `N8N_RUNNERS_AUTH_TOKEN` to the n8n instance as well. -- Optionally, specify the launcher's log level by setting `N8N_LAUNCHER_LOG_LEVEL` to `debug`, `info`, `warn` or `error`. Default is `info`. You can also use `NO_COLOR=1` to disable color output. +- Optionally, specify the launcher's log level by setting `N8N_RUNNERS_LAUNCHER_LOG_LEVEL` to `debug`, `info`, `warn` or `error`. Default is `info`. You can also use `NO_COLOR=1` to disable color output. - Optionally, specify the launcher's auto-shutdown timeout by setting `N8N_RUNNERS_AUTO_SHUTDOWN_TIMEOUT` to a number of seconds, or set it to `0` to disable. Default is `15`. The runner will exit after this timeout if it is idle for the specified duration, and will be re-launched on demand when the next task comes in. - Optionally, specify the task broker's URI (i.e. n8n instance's URI) by setting `N8N_RUNNERS_TASK_BROKER_URI`. Default is `http://127.0.0.1:5679`. -- Optionally, specify the port for the launcher's health check server by setting `N8N_LAUNCHER_HEALTH_CHECK_PORT`. Default is `5680`. When overriding this port, be mindful of port conflicts - by default, the n8n instance uses `5678` for its regular server and `5679` for its task broker server, and the runner uses `5681` for its healthcheck server. +- Optionally, specify the port for the launcher's health check server by setting `N8N_RUNNERS_LAUNCHER_HEALTH_CHECK_PORT`. Default is `5680`. When overriding this port, be mindful of port conflicts - by default, the n8n instance uses `5678` for its regular server and `5679` for its task broker server, and the runner uses `5681` for its healthcheck server. - Optionally, configure [Sentry error tracking](https://docs.sentry.io/platforms/go/configuration/options/) with these env vars: diff --git a/internal/config/config.go b/internal/config/config.go index 5abf382..b9926b4 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -19,13 +19,13 @@ var cfg Config const ( // EnvVarHealthCheckPort is the env var for the port for the launcher's health check server. - EnvVarHealthCheckPort = "N8N_LAUNCHER_HEALTH_CHECK_PORT" + EnvVarHealthCheckPort = "N8N_RUNNERS_LAUNCHER_HEALTH_CHECK_PORT" ) // Config holds the full configuration for the launcher. type Config struct { // LogLevel is the log level for the launcher. Default: `info`. - LogLevel string `env:"N8N_LAUNCHER_LOG_LEVEL, default=info"` + LogLevel string `env:"N8N_RUNNERS_LAUNCHER_LOG_LEVEL, default=info"` // AuthToken is the auth token sent by the launcher to the task broker in // exchange for a single-use grant token, later passed to the runner. @@ -39,7 +39,7 @@ type Config struct { TaskBrokerURI string `env:"N8N_RUNNERS_TASK_BROKER_URI, default=http://127.0.0.1:5679"` // HealthCheckServerPort is the port for the launcher's health check server. - HealthCheckServerPort string `env:"N8N_LAUNCHER_HEALTH_CHECK_PORT, default=5680"` + HealthCheckServerPort string `env:"N8N_RUNNERS_LAUNCHER_HEALTH_CHECK_PORT, default=5680"` // Runner is the runner config for the task runner, obtained from: // `/etc/n8n-task-runners.json`.