hammer-editor/docker/docker-compose.yml
Adam Brown 5acba72867
Some checks are pending
Build CI / build (push) Waiting to run
Build CI / static-analysis (push) Waiting to run
Build CI / android-instrumented-tests (push) Waiting to run
Build CI / iOS compile & test (push) Waiting to run
Build CI / iOS UI tests (push) Waiting to run
PublishInternal / publish-google-play (push) Waiting to run
Tell self-hosters when the server is not serving HTTPS (#800)
Clients are HTTPS-only, but the Docker image serves plain HTTP, so a client
pointed at it fails its TLS handshake and reported only "Network error
connecting to /api/account/create". The handshake is rejected by Jetty's HTTP
parser before any route runs, so nothing about it reaches the server log
either, leaving unrelated UnsupportedProtocolVersionException entries as the
only visible clue.

Split the IOException arm of Api.makeRequest so a TLS failure names HTTPS and
the certificate or reverse-proxy requirement. Detection is expect/actual:
SSLException on JVM, message markers on iOS where NSURLSession carries nothing
else through.

Also fix the server URL field on the way in: cleanUpUrl stripped the scheme
with removeSuffix instead of removePrefix, so a pasted http:// URL failed
validation, and validateUrl required a dotted TLD, rejected capitals, and
admitted ports above 65535 that would crash the unguarded toInt() in url().

Fixes #790
2026-07-30 22:16:41 -07:00

62 lines
2 KiB
YAML

name: hammer
services:
hammer:
image: ghcr.io/darkrock-studios/hammer-editor/server:latest
# To build locally instead: run `./gradlew :server:installDist` from the repo
# root, then swap `image:` above for this.
# build:
# context: ..
# dockerfile: docker/Dockerfile
container_name: hammer-server
restart: unless-stopped
# The JVM handles SIGTERM itself; this only reaps orphans from the embedded
# PostgreSQL process tree.
init: true
ports:
# Loopback by default: this connector is plain HTTP, and published ports
# bypass host firewall rules. Set HAMMER_HTTP_BIND=0.0.0.0 only if nothing
# untrusted can reach the host. HAMMER_HTTP_PORT moves the host-side port.
#
# Clients only speak HTTPS and will not connect to this port. Terminate TLS
# at a reverse proxy in front of it, or configure sslCert and publish 443.
- "${HAMMER_HTTP_BIND:-127.0.0.1}:${HAMMER_HTTP_PORT:-8080}:8080"
# Uncomment alongside the postgres service below.
# depends_on:
# postgres:
# condition: service_healthy
volumes:
- hammer-data:/data
# Optional: manage the config on the host. Copy config.example.toml first.
# - ./config.toml:/data/hammer_data/config.toml:ro
# Only needed for `[storage] type = "remote"`; storage defaults to an
# in-process PostgreSQL. Uncomment the `depends_on` above alongside it.
# postgres:
# image: postgres:18
# container_name: hammer-postgres
# restart: unless-stopped
# environment:
# POSTGRES_DB: hammer
# POSTGRES_USER: hammer
# POSTGRES_PASSWORD: change-me
# volumes:
# # postgres 18+ keeps PGDATA in a versioned subdirectory of this path;
# # mounting at /var/lib/postgresql/data instead aborts startup.
# - hammer-pgdata:/var/lib/postgresql
# healthcheck:
# test: ["CMD-SHELL", "pg_isready -U hammer"]
# interval: 10s
# timeout: 5s
# retries: 5
volumes:
hammer-data:
# Uncomment alongside the postgres service above.
# hammer-pgdata: