diff --git a/.env.example b/.env.example index 3ab4c73..31c102d 100644 --- a/.env.example +++ b/.env.example @@ -156,8 +156,12 @@ LAYA_ENGINE_URL=http://127.0.0.1:8092 # ============================================================================= # Postgres connection string. When set, real Postgres is used and migrations run # at start; when UNSET, an in-memory PGLite fallback is used (data is lost on -# restart). For durable self-host, run Postgres and point this at it, e.g.: -# DATABASE_URL=postgresql://openjev:openjev@db:5432/openjev +# restart). For durable self-host, uncomment the `db` service in +# docker-compose.yml, set POSTGRES_PASSWORD below to a real secret (not the +# word "openjev" — that was only ever a placeholder), and point this at it +# using the SAME password, e.g.: +# POSTGRES_PASSWORD= +# DATABASE_URL=postgresql://openjev:@db:5432/openjev # ============================================================================= # Auth & signing secret (optional — self-host sign-in) diff --git a/SELF-HOSTING.md b/SELF-HOSTING.md index 5f33d36..4cab770 100644 --- a/SELF-HOSTING.md +++ b/SELF-HOSTING.md @@ -30,13 +30,18 @@ downloaded model weights). By default the Node service uses an in-memory PGLite database — data resets on restart. For persistence, uncomment the `db` (Postgres) service and the `pgdata` volume in -`docker-compose.yml`, then set in `.env`: +`docker-compose.yml`, pick your own strong password, and set both in `.env` +(the compose file does not publish Postgres's port to the host — `db` is only +reachable from the other containers on the internal compose network): ```bash -DATABASE_URL=postgresql://openjev:openjev@db:5432/openjev +POSTGRES_PASSWORD= +DATABASE_URL=postgresql://openjev:@db:5432/openjev ``` -Migrations run automatically at container start. +Never leave `POSTGRES_PASSWORD`/`DATABASE_URL` at the old `openjev`/`openjev` default — +that credential pair is public (it was this project's placeholder) and must not be used +on any host reachable by anyone else. Migrations run automatically at container start. ### LLM escalation (optional) diff --git a/docker-compose.yml b/docker-compose.yml index 0617891..7d45b35 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -68,19 +68,21 @@ services: - "8092" # --- Optional durable Postgres ------------------------------------------- - # Uncomment this block AND set DATABASE_URL in .env to: - # postgresql://openjev:openjev@db:5432/openjev + # Uncomment this block, set POSTGRES_PASSWORD in .env to a real secret, and + # set DATABASE_URL in .env to: + # postgresql://openjev:@db:5432/openjev + # No host port is published — the Node service reaches `db` over the + # internal compose network only. Do NOT add a `ports: ["5432:5432"]` + # mapping here; that would expose Postgres on the host's network interface. # db: # image: postgres:16-alpine # restart: unless-stopped # environment: # POSTGRES_USER: openjev - # POSTGRES_PASSWORD: openjev + # POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in .env}" # POSTGRES_DB: openjev # volumes: # - pgdata:/var/lib/postgresql/data - # ports: - # - "5432:5432" volumes: laya-models: