Container, hosting panel and install
A single image holds the API, the built web app and the panel pages. The dependency stage is the only stage that differs per architecture, because of better-sqlite3. The web and admin builds are plain files, built once on the builder’s architecture. The container runs as uid 1000 under tini, writes only to one volume (/data), and supports amd64 and arm64.
Supervisor
Section titled “Supervisor”supervisor/index.ts runs the app as a child process. It restarts the app with backoff, keeps a ring buffer of the app’s output, and writes rotating, scrubbed logs to /data/logs. It serves the panel on PANEL_HOST:PANEL_PORT, which defaults to 127.0.0.1:8080.
If a required setting is missing, the supervisor does not start the app. It prints a one-time setup token and waits. It sends crashes to Shackworks Net only when incident reports are enabled, and only after scrubbing them.
Settings
Section titled “Settings”server/config.ts is the only code that reads process.env, and lint enforces it. It also holds SETTINGS. The precedence is the environment, then <DATA_DIR>/config.json, then the default.
The panel, the wizard and .env.example all derive from the SETTINGS table. Put each setting’s label and help text in shared/text.json under settings, and update the Settings reference as well. The panel masks secrets and never returns them to the browser. The instance’s identity (name, statistics time zone, accent and logo) is the instance_settings row, managed in server/lib/instance.ts.
The panel pages are in admin/src/pages/: Status, Settings, Instance, Logs, Backups, Shackworks Net and Setup.
- Password. The panel stores a scrypt hash in
panel.json. The password must have at least 12 characters. - Sessions. A session ends after 60 minutes idle or 12 hours in total.
- Request checks. The panel requires a CSRF header and a same-origin check, and it limits sign-in to five attempts.
- Audit. Every change is audited by name, in the app’s audit log or, before a database exists, in
panel-audit.jsonl. - Network. The panel listens on the machine only by default, and the installer refuses a public bind.
- Setup token. The token works once, lasts 24 hours, and is reissued on each start until setup completes.
Installer
Section titled “Installer”The install/ folder contains compose.yaml, Caddyfile, .env.example and install.sh. Caddy is the only service that faces the internet. The script never changes the firewall and never overwrites .env or the compose files, so you can run it again safely. --behind-proxy PORT and --name support a shared host. The path install/install.sh is part of the public download URL, so do not move it.
Data and upgrades
Section titled “Data and upgrades”All state lives in the data volume. Restoring onto a new host loses the Net key, so the club unlinks and links again. To upgrade, run docker compose pull && docker compose up -d, and pin a version with SHACKWORKS_IMAGE. Migrations run at start.
GET /api/health returns 200 only if the database and migrations are healthy. GET /api/version returns {version, build, commit} and instance_env. With INSTANCE_ENV=dev, the app shows a banner, adds [DEV] to the title and sends X-Robots-Tag: noindex.
Every pull request runs typecheck, lint with zero warnings, tests, the web and admin builds, an image build with a smoke test, and a Compose smoke test. The image smoke test (scripts/ci/smoke-image.sh) includes a fresh-container wizard run. The Compose smoke test (smoke-compose.sh) includes a restore rehearsal. Documentation-only changes skip the image job. The arm64 job runs only when the Dockerfile, lockfile, supervisor, CI scripts or install files change, or when CI publishes.
CI stamps build into shared/version.json in the image, so never bump build by hand. Bump version for user-facing releases.