n8n on PostgreSQL, Outbound Bridge & Forgejo-MCP Sync
Move n8n off SQLite onto shared PostgreSQL 17, isolate public ingress via an edge gateway and ngrok Heartbeat loop, and sync Forgejo repos safely.
Once webhooks and CTI enrichment flows started firing concurrently, running n8n on its default local SQLite database hit two walls: write-lock bottlenecks under load, and native Could not locate the bindings file: node_sqlite3.node breakage after Node.js upgrades inside the Proxmox LXC.
My native systemd n8n LXC has evolved quite a bit since my early n8n in Turnkey Linux Node.js experiments. Pointing it at the shared PostgreSQL 17 container (infra-postgres on dockge-cti) with isolated schemas (n8n_brain and n8n_gateway) killed the SQLite table locks and gave both n8n instances a shared persistence tier:
DB_TYPE=postgresdb
DB_POSTGRESDB_HOST=<DOCKGE_CTI_HOST>
DB_POSTGRESDB_PORT=5432
DB_POSTGRESDB_DATABASE=n8n
DB_POSTGRESDB_USER=n8n
DB_POSTGRESDB_SCHEMA=n8n_brain
For external connectivity (bridging lab automation out to enterprise tooling or receiving incoming Telegram and WhatsApp Evolution API webhooks), exposing the internal reasoning LXC directly to the internet is asking for trouble. Just like dealing with dynamic residential IPs and tunnels, public ingress terminates on an edge Docker gateway (yaoc2-gateway) using an ngrok sidecar.
Finally, for source control and AI assistant collaboration: internal Forgejo stays the authoritative source of truth on the enterprise branch, selective mirrors push out to GitHub over SSH keys, and an internal forgejo-mcp SSE container (with internal CA TLS handling) lets local agents inspect issues and files without exposing raw repository tokens in scripts.
See ya later. Happy tinkering!