# ============================================================
# n8n stack configuration — single source of truth.
#
# The `n8n` and `n8n-runner` services load this file via
# `env_file`, so every n8n runtime variable lives here under
# its real name. A few values are also read by Compose for
# interpolation (N8N_VERSION, N8N_HOST_PORT, DB_POSTGRESDB_*),
# which is harmless — Compose interpolation and env_file are
# separate stages that read the same file.
# ============================================================

# --- Image version & host port (read by Compose) ---
N8N_VERSION=2.40.7
N8N_HOST_PORT=5678

# --- Public URL / reverse proxy ---
N8N_HOST=n8n.mildgrim.com
N8N_PROTOCOL=https
N8N_PORT=5678
N8N_WEBHOOK_URL=https://n8n.mildgrim.com/
N8N_EDITOR_BASE_URL=https://n8n.mildgrim.com/
N8N_PROXY_HOPS=1

# --- PostgreSQL ---
DB_TYPE=postgresdb
DB_POSTGRESDB_HOST=n8n-db
DB_POSTGRESDB_PORT=5432
DB_POSTGRESDB_DATABASE=n8n
DB_POSTGRESDB_USER=n8n
DB_POSTGRESDB_PASSWORD=29d9fb0c264cf3ece295d7ddfd04acda35b6f66f9ed08eb9af558f17794732c2

# --- Security ---
# Generate ONCE with: openssl rand -hex 32
# Never change after first run; back it up together with the database.
N8N_ENCRYPTION_KEY=1b857bc942b84351b803329185bd8df19aef1dbdd4a4f58b1cd231b93be8a000
# Generate with: openssl rand -hex 32
N8N_RUNNERS_AUTH_TOKEN=127b84ef5a227ed5c3a5b83159356f3fdfa3985b8a3e85081ac064558f516a30

# --- Timezone ---
GENERIC_TIMEZONE=Europe/Stockholm
TZ=Europe/Stockholm

# --- Task runners ---
N8N_RUNNERS_MODE=external
N8N_RUNNERS_BROKER_LISTEN_ADDRESS=0.0.0.0

# --- Hygiene / hardening ---
N8N_DIAGNOSTICS_ENABLED=false
N8N_SECURE_COOKIE=true
EXECUTIONS_DATA_PRUNE=true
EXECUTIONS_DATA_MAX_AGE=168
