From 7f60b51374d4233556b9c62faa09ca865d88118b Mon Sep 17 00:00:00 2001 From: MangaValk Date: Tue, 17 Nov 2026 14:47:15 +0100 Subject: [PATCH] Docker: default to port 3001 Co-Authored-By: Claude Opus 5.5 --- README.md | 8 ++++---- docker/README.md | 8 ++++---- docker/docker-compose.yml | 4 ++-- docker/setup.mjs | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 034fe31..717b591 100644 --- a/README.md +++ b/README.md @@ -33,13 +33,13 @@ Needs Docker with Compose. The steps below use Unraid's IP as the example, but a 2. Make the secrets. Use the address you'll open brokeless on, with your server's LAN IP or name (not `localhost`: the containers need to reach it too): ```bash - cd brokeless && node docker/setup.mjs --url http://192.168.1.10:3000 + cd brokeless && node docker/setup.mjs --url http://192.168.1.10:3001 ``` No Node on the server: ```bash - docker run --rm -v "$PWD":/w -w /w node:22-alpine node docker/setup.mjs --url http://192.168.1.10:3000 + docker run --rm -v "$PWD":/w -w /w node:22-alpine node docker/setup.mjs --url http://192.168.1.10:3001 ``` This writes `docker/.env` with a new database password, signing keys and a Mailpit password. On Unraid, set `DATA_DIR=/mnt/user/appdata/brokeless` in it. @@ -58,7 +58,7 @@ Needs Docker with Compose. The steps below use Unraid's IP as the example, but a Leave out `--profile ai` to run without AI. -4. Open `http://192.168.1.10:3000` and type your email. Open Mailpit on port 8025 (user `broke`, password `MAIL_PASSWORD` from `docker/.env`) and click the sign-in link. +4. Open `http://192.168.1.10:3001` and type your email. Open Mailpit on port 8025 (user `broke`, password `MAIL_PASSWORD` from `docker/.env`) and click the sign-in link. 5. Lock it to you: set `DISABLE_SIGNUP=true` in `docker/.env`, then run the `up -d` command again. @@ -68,7 +68,7 @@ More detail, including what each container does: [docker/README.md](docker/READM ## Keep it private -- Keep port 3000 and 8025 on your LAN or behind a VPN like Tailscale. Don't forward them on your router. +- Keep port 3001 and 8025 on your LAN or behind a VPN like Tailscale. Don't forward them on your router. - Back up `DATA_DIR/db` and `docker/.env` together. The database is useless without the secrets in `.env`. - `docker/.env` is in `.gitignore`. Never commit it. diff --git a/docker/README.md b/docker/README.md index 83ea512..068729a 100644 --- a/docker/README.md +++ b/docker/README.md @@ -4,7 +4,7 @@ Everything runs here: the app, its Postgres database, sign-in and the REST API ( | Container | What it does | Port | | --- | --- | --- | -| gateway | nginx: broke plus `/auth/v1` and `/rest/v1` on one address | `HTTP_PORT` (3000) | +| gateway | nginx: broke plus `/auth/v1` and `/rest/v1` on one address | `HTTP_PORT` (3001) | | broke | the app, built from this checkout | inside only | | db | Supabase's Postgres image | inside only | | auth | Supabase Auth (GoTrue): email sign-in links | inside only | @@ -14,16 +14,16 @@ Everything runs here: the app, its Postgres database, sign-in and the REST API ( ## First start -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: +1. Pick the address you will open broke on, for example `http://192.168.1.10:3001` (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 + node docker/setup.mjs --url http://192.168.1.10:3001 ``` No Node on the server: ```bash - docker run --rm -v "$PWD":/w -w /w node:22-alpine node docker/setup.mjs --url http://192.168.1.10:3000 + docker run --rm -v "$PWD":/w -w /w node:22-alpine node docker/setup.mjs --url http://192.168.1.10:3001 ``` On Unraid, edit `docker/.env` and set `DATA_DIR=/mnt/user/appdata/brokeless`. diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 49cba2a..e564bc7 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,5 +1,5 @@ # brokeless: broke with everything it needs, all on your own server. See README.md in this folder. -# node docker/setup.mjs --url http://192.168.1.10:3000 (once: writes docker/.env with fresh secrets) +# node docker/setup.mjs --url http://192.168.1.10:3001 (once: writes docker/.env with fresh secrets) # docker compose -f docker/docker-compose.yml up -d --build # ... --profile ai up -d (also runs Ollama for local AI) # @@ -18,7 +18,7 @@ services: <<: *hardening image: nginx:1.28-alpine ports: - - "${HTTP_PORT:-3000}:80" + - "${HTTP_PORT:-3001}:80" volumes: - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro depends_on: diff --git a/docker/setup.mjs b/docker/setup.mjs index 19d5f04..a1b9bc9 100644 --- a/docker/setup.mjs +++ b/docker/setup.mjs @@ -1,6 +1,6 @@ #!/usr/bin/env node // Writes docker/.env with fresh secrets for docker-compose.yml. Run once: -// node docker/setup.mjs --url http://192.168.1.10:3000 +// node docker/setup.mjs --url http://192.168.1.10:3001 // No Node on the server? docker run --rm -v "$PWD":/w -w /w node:22-alpine node docker/setup.mjs --url http://... import { createHmac, randomBytes } from "node:crypto"; import { existsSync, writeFileSync } from "node:fs"; @@ -11,12 +11,12 @@ const file = join(dirname(fileURLToPath(import.meta.url)), ".env"); const arg = (name) => { const i = process.argv.indexOf(name); return i > 0 ? process.argv[i + 1] : undefined; }; const url = (arg("--url") ?? "").replace(/\/$/, ""); 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"); + console.error("Give the address you will open broke on, with the port: node docker/setup.mjs --url http://192.168.1.10:3001"); 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."); + console.error("Use the server's LAN address or name (like http://192.168.1.10:3001), not localhost: the containers can't reach localhost."); process.exit(1); } if (existsSync(file) && !process.argv.includes("--force")) {