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 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-02-07 15:35:20 +00:00
parent 8d55469c4e
commit 5ea319e03c
2 changed files with 6 additions and 2 deletions

View File

@ -30,6 +30,8 @@ services:
- DB_POSTGRESDB_DATABASE=n8n - DB_POSTGRESDB_DATABASE=n8n
- DB_POSTGRESDB_USER=n8n - DB_POSTGRESDB_USER=n8n
- DB_POSTGRESDB_PASSWORD=${N8N_DB_PASSWORD:-cosmolocal-n8n-2026} - DB_POSTGRESDB_PASSWORD=${N8N_DB_PASSWORD:-cosmolocal-n8n-2026}
- TWENTY_API_KEY=${TWENTY_API_KEY}
- RESEND_API_KEY=${RESEND_API_KEY:-re_LmVuUSnW_9V1vTF6ASvwL9x17CV3aRR5J}
volumes: volumes:
- n8n-cosmolocal-data:/home/node/.n8n - n8n-cosmolocal-data:/home/node/.n8n
labels: labels:

View File

@ -4,12 +4,14 @@ Import these JSON files into [automate.cosmolocal.world](https://automate.cosmol
## Setup Requirements ## 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 | | Variable | Description | Where to find |
|----------|-------------|---------------| |----------|-------------|---------------|
| `TWENTY_API_KEY` | Twenty CRM API key | crm.cosmolocal.world > Settings > API Keys | | `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). The Listmonk credentials are hardcoded for internal Docker network access (no external exposure).