diff --git a/deploy/docker/docker-compose.yml b/deploy/docker/docker-compose.yml index c32c1862..12052b7b 100644 --- a/deploy/docker/docker-compose.yml +++ b/deploy/docker/docker-compose.yml @@ -9,8 +9,9 @@ services: postgres: condition: service_healthy # Publishing a port as another host port ("18443:8443")? Set TITANO_PUBLIC_HTTPS_PORT (and _HTTP_PORT) below to the - # host port. LAN discovery reaches clients only with "network_mode: host" (then drop "ports"); on this bridge - # network clients add the server by its address. + # host port. LAN discovery reaches clients only with "network_mode: host"; on this bridge network clients add the + # server by its address. With host networking drop "ports", give the postgres service + # ports: ["127.0.0.1:5432:5432"] and set TITANO_DB_HOST to 127.0.0.1: the name "postgres" no longer resolves there. ports: - "8080:8080" - "8443:8443" @@ -23,9 +24,10 @@ services: TITANO_DB_NAME: titano TITANO_DB_USER: titano TITANO_DB_PASSWORD: ${TITANO_DB_PASSWORD:?set TITANO_DB_PASSWORD in .env} - # auto (self-signed), pem or proxy; behind a proxy, TITANO_TRUSTED_PROXIES lists its address if it is not on a - # private network + # auto (self-signed), pem or proxy; behind a proxy, set TITANO_TRUSTED_PROXIES to its address or network (for a + # proxy container on this network, the network's subnet; only loopback is trusted otherwise) TITANO_TLS_MODE: auto + # TITANO_TRUSTED_PROXIES: "172.18.0.0/16" # TITANO_PUBLIC_HTTPS_PORT: "8443" TITANO_SERVER_NAME: Titano Server # Trace, Debug, Information, Warning or Error diff --git a/deploy/docker/entrypoint.sh b/deploy/docker/entrypoint.sh index 8604d26f..3a542c5b 100755 --- a/deploy/docker/entrypoint.sh +++ b/deploy/docker/entrypoint.sh @@ -35,6 +35,14 @@ if [ "$(id -u)" = "0" ]; then exit 1 fi fi + # The server writes into the archive's .titano folders at once (staging, trash, locks); one left to root by an + # earlier run as root, or copied in by root, would stop it in a restart loop. Reported, never chowned. + for dir in "$ARCHIVE/.titano" "$ARCHIVE/.titano"/*/; do + if [ -d "$dir" ] && ! as_user test -w "$dir"; then + echo "error: ${dir%/} is not writable by $PUID:$PGID; give that user write access to it on the host (for example chown -R $PUID:$PGID /.titano)" >&2 + exit 1 + fi + done exec setpriv --reuid="$PUID" --regid="$PGID" --clear-groups -- dotnet /app/Titano.Server.dll "$@" fi diff --git a/deploy/releases-repo/README.md b/deploy/releases-repo/README.md index 399080cd..746792f4 100644 --- a/deploy/releases-repo/README.md +++ b/deploy/releases-repo/README.md @@ -84,10 +84,14 @@ admin panel shows under Settings so you can compare them. and LAN discovery name the ports clients can reach. - LAN discovery (`TITANO_DISCOVERY`, on by default) needs host networking (`network_mode: host` in compose, Network type *Host* on Unraid): on a bridge network its broadcasts never leave the container's network. Without it, add the - server in Titano by its address. + server in Titano by its address. With `network_mode: host` the name `postgres` no longer resolves: remove the + `ports` of the `titano` service, publish PostgreSQL on loopback (`ports: ["127.0.0.1:5432:5432"]` under `postgres`) + and set `TITANO_DB_HOST: 127.0.0.1`. - Behind a reverse proxy (`TITANO_TLS_MODE=proxy`), only the proxies listed in `TITANO_TRUSTED_PROXIES` may set - `X-Forwarded-*` headers (default: loopback and the private networks 10/8, 172.16/12, 192.168/16, fc00::/7). The admin - panel shows *Not via proxy* when a page did not come through a trusted proxy over HTTPS. + `X-Forwarded-*` headers. By default that is loopback only: other machines on your network reach the HTTP port + directly, so they must not choose the address the sign-in limit and the audit log see. List your proxy's address, + or the subnet of the Docker network it shares with Titano (for example `172.18.0.0/16`). The admin panel shows *Not + via proxy* when a page did not come through a trusted proxy over HTTPS. ## Titano Server on Unraid @@ -109,7 +113,9 @@ Choose the *Server* component in the setup, or unpack `Titano-Server-win-x64- prefer auto + Titano Server Information 99