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 5b87103fdb
commit 67bb61888b
2 changed files with 6 additions and 2 deletions

View File

@ -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:

View File

@ -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).