From 67bb61888ba0b3eb7131d306fee093fad6197bd3 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Sat, 7 Feb 2026 15:35:20 +0000 Subject: [PATCH] Add API keys as Docker env vars for n8n community edition n8n community edition doesn't have Settings > Variables. Pass TWENTY_API_KEY and RESEND_API_KEY as container environment variables instead, accessible via $env.* in workflows. Co-Authored-By: Claude Opus 4.6 --- docker-compose.yml | 2 ++ n8n-workflows/README.md | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index dc82312..9ee27f1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,6 +30,8 @@ services: - DB_POSTGRESDB_DATABASE=n8n - DB_POSTGRESDB_USER=n8n - DB_POSTGRESDB_PASSWORD=${N8N_DB_PASSWORD:-***REDACTED_DB_PASS***} + - TWENTY_API_KEY=${TWENTY_API_KEY} + - RESEND_API_KEY=${RESEND_API_KEY:-***REDACTED_RESEND_KEY***} volumes: - n8n-cosmolocal-data:/home/node/.n8n labels: diff --git a/n8n-workflows/README.md b/n8n-workflows/README.md index 81515bb..66bec9d 100644 --- a/n8n-workflows/README.md +++ b/n8n-workflows/README.md @@ -4,12 +4,14 @@ Import these JSON files into [automate.cosmolocal.world](https://automate.cosmol ## Setup Requirements -Before activating workflows, configure these environment variables in n8n (**Settings > Variables**): +API keys are passed as **Docker environment variables** in `docker-compose.yml` (n8n community edition doesn't support Settings > Variables). The workflows access them via `$env.VARIABLE_NAME`. | Variable | Description | Where to find | |----------|-------------|---------------| | `TWENTY_API_KEY` | Twenty CRM API key | crm.cosmolocal.world > Settings > API Keys | -| `RESEND_API_KEY` | Resend email API key | `ssh netcup "cat ~/.resend_credentials"` | +| `RESEND_API_KEY` | Resend email API key | Already set (or `ssh netcup "cat ~/.resend_credentials"`) | + +To update keys, edit the `environment:` section of the `n8n-cosmolocal` service in `docker-compose.yml` and redeploy. The Listmonk credentials are hardcoded for internal Docker network access (no external exposure).