# ============================================================
# 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.42.3
N8N_SANDBOX_VERSION=1.5.0
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

# --- n8n Assistant (instance-ai) ---
N8N_ENABLED_MODULES=instance-ai
N8N_INSTANCE_AI_MODEL=anthropic/claude-opus-5
N8N_INSTANCE_AI_MODEL_API_KEY=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
N8N_INSTANCE_AI_SANDBOX_ENABLED=true
N8N_INSTANCE_AI_SANDBOX_PROVIDER=n8n-sandbox
N8N_INSTANCE_AI_SANDBOX_IMAGE=ghcr.io/n8n-io/n8n-sandbox-service-sandbox:1.5.0
N8N_SANDBOX_SERVICE_URL=http://sandbox-api:8080
N8N_SANDBOX_SERVICE_API_KEY=b9a50ac18dc6f66187abe7b593342c00d4608cddd1151cb73eacfc2d41055bc7

# --- Sandbox service secrets ---
SANDBOX_API_KEYS=b9a50ac18dc6f66187abe7b593342c00d4608cddd1151cb73eacfc2d41055bc7
SANDBOX_API_RUNNER_REGISTRATION_TOKEN=ed769e28fda4e75b5e94b966a4a377f2577ff594634bcf4f4eae6d8e17bcdd4e
SANDBOX_API_RUNNER_API_KEY=5b4fa77d7d799e2cc37526876051c03f225b27f9371caeb0f13c5b92855ea21c

# --- Web search (bundled SearXNG) ---
SEARXNG_SECRET=de8ed15effca703fa756d512498f7b5bfabfaef1b0bbb673958126a48bfa3d43
N8N_INSTANCE_AI_SEARXNG_URL=http://searxng:8080
