From 861e65021f335c662b2410a9daae251452ff15c8 Mon Sep 17 00:00:00 2001 From: MangaValk Date: Tue, 17 Nov 2026 13:56:32 +0100 Subject: [PATCH] Docker: fixes from a full test run - roles.sql only touches roles this stack has (the init stopped early before) - internal database link without SSL - Mailpit without an SMTP login (GoTrue refuses one over plain SMTP) - setup.mjs refuses localhost, which the containers can't reach Co-Authored-By: Claude Opus 5.5 --- docker/README.md | 2 +- docker/db/roles.sql | 4 ++-- docker/docker-compose.yml | 9 ++++----- docker/setup.mjs | 5 +++++ 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/docker/README.md b/docker/README.md index ae75c2e..ae92ff2 100644 --- a/docker/README.md +++ b/docker/README.md @@ -14,7 +14,7 @@ Everything runs here: broke, its Postgres database, sign-in and the REST API (th ## First start -1. Pick the address you will open broke on, for example `http://192.168.1.10:3000` (your Unraid IP). Then make the secrets: +1. Pick the address you will open broke on, for example `http://192.168.1.10:3000` (your Unraid IP; not `localhost`, the containers need to reach it too). Then make the secrets: ```bash node docker/setup.mjs --url http://192.168.1.10:3000 diff --git a/docker/db/roles.sql b/docker/db/roles.sql index 8f7161a..0d54f28 100644 --- a/docker/db/roles.sql +++ b/docker/db/roles.sql @@ -1,8 +1,8 @@ --- NOTE: change to your own passwords for production environments +-- From Supabase's self-hosting setup (Apache-2.0), trimmed to the roles this stack runs. +-- Sets the internal roles' passwords to POSTGRES_PASSWORD. \set pgpass `echo "$POSTGRES_PASSWORD"` ALTER USER authenticator WITH PASSWORD :'pgpass'; ALTER USER pgbouncer WITH PASSWORD :'pgpass'; ALTER USER supabase_auth_admin WITH PASSWORD :'pgpass'; -ALTER USER supabase_functions_admin WITH PASSWORD :'pgpass'; ALTER USER supabase_storage_admin WITH PASSWORD :'pgpass'; diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 25183b3..b4e03e2 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -39,7 +39,8 @@ services: NEXT_PUBLIC_SUPABASE_URL: ${PUBLIC_URL} NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY: ${ANON_KEY} SUPABASE_SERVICE_ROLE_KEY: ${SERVICE_ROLE_KEY} - SUPABASE_DB_URL: postgresql://postgres:${POSTGRES_PASSWORD}@db:5432/postgres + # Inside the stack only, so no SSL (broke turns SSL on unless the URL says otherwise). + SUPABASE_DB_URL: postgresql://postgres:${POSTGRES_PASSWORD}@db:5432/postgres?sslmode=disable LOCAL_LLM_BASE_URL: ${LOCAL_LLM_BASE_URL:-http://ollama:11434/v1} LOCAL_LLM_MODEL: ${LOCAL_LLM_MODEL:-} PLAID_CLIENT_ID: ${PLAID_CLIENT_ID:-} @@ -116,8 +117,8 @@ services: # Sign-in links go to Mailpit below by default. Point these at a real mail server to get them in your inbox. GOTRUE_SMTP_HOST: ${SMTP_HOST:-mailpit} GOTRUE_SMTP_PORT: ${SMTP_PORT:-1025} - GOTRUE_SMTP_USER: ${SMTP_USER:-broke} - GOTRUE_SMTP_PASS: ${SMTP_PASS:-broke} + GOTRUE_SMTP_USER: ${SMTP_USER:-} + GOTRUE_SMTP_PASS: ${SMTP_PASS:-} GOTRUE_SMTP_ADMIN_EMAIL: ${SMTP_FROM:-broke@broke.local} GOTRUE_SMTP_SENDER_NAME: broke @@ -146,8 +147,6 @@ services: - "${MAIL_UI_PORT:-8025}:8025" environment: MP_UI_AUTH: broke:${MAIL_PASSWORD} - MP_SMTP_AUTH_ACCEPT_ANY: 1 - MP_SMTP_AUTH_ALLOW_INSECURE: 1 MP_MAX_MESSAGES: 200 # Local AI, full detail stays here. Start with --profile ai, then: docker exec broke-ollama-1 ollama pull diff --git a/docker/setup.mjs b/docker/setup.mjs index d952466..5dec692 100644 --- a/docker/setup.mjs +++ b/docker/setup.mjs @@ -14,6 +14,11 @@ if (!/^https?:\/\/[^/]+$/.test(url)) { console.error("Give the address you will open broke on, with the port: node docker/setup.mjs --url http://192.168.1.10:3000"); process.exit(1); } +// broke's server reaches Supabase through this address too, and inside a container localhost is the container itself. +if (/^https?:\/\/(localhost|127\.|\[::1\]|0\.0\.0\.0)/.test(url)) { + console.error("Use the server's LAN address or name (like http://192.168.1.10:3000), not localhost: the containers can't reach localhost."); + process.exit(1); +} if (existsSync(file) && !process.argv.includes("--force")) { console.error(`${file} already exists. Its secrets protect your data, so it is left alone. Pass --force to replace it (only before first start).`); process.exit(1);