Commit Graph
12 Commits
Author SHA1 Message Date
branderson 98b2f1a0bb docs(auth): document trusted header login 2026-10-12 01:05:40 -07:00
branderson 5c5b11722d docs(streaming): document the session manager settings 2026-10-11 01:01:27 -07:00
Darkraise ba62cc91ea docs(ruffle): mention persisted Ruffle in operator docs 2026-08-13 17:49:42 +07:00
Darkraise f6fd7f9bac fix(auth): mark auth cookies Secure per connection, not per NODE_ENV
Cookies were Secure whenever NODE_ENV=production, so browsers discarded them
on any deployment served over plain HTTP and every login bounced back to the
login page. A fixed flag cannot serve a LAN over HTTP and the internet over
HTTPS from the same instance.

Derive the flag from req.secure, which honours X-Forwarded-Proto from a
trusted proxy, and add COOKIE_SECURE=auto|true|false to override it.
2026-08-11 23:49:28 +07:00
Darkraise c09f0c8a83 fix(cors): normalize origins and allow same-origin requests
Browsers omit a scheme's default port when serializing Origin, so a page at
http://host:80 sends "http://host". Comparing that to the raw DOMAIN string
rejected every POST from a deployment served on port 80 or 443 — including
same-origin requests under SERVE_FRONTEND, which surfaced as a CORS error on
login with no way to guess the cause.

Compare normalized origins instead, always allow a request whose Origin
matches its own Host, and accept a comma-separated DOMAIN so one deployment
can be reached over both a LAN address and a public domain. Apply the same
normalization to the domains table, which previously built origins without
ports, and reflect the caller's origin on the game-zip admin routes.
2026-08-11 22:09:59 +07:00
Darkraise 3ba60aedf9 refactor(docker): build and ship a single API + UI image
Collapse the separate backend (Node) and frontend (nginx) images into
one image where the Express backend serves the built React app in
addition to the API and game content, so deployment is a single
container and one origin.

- Add a root Dockerfile with frontend-builder + backend-builder stages
  producing one runtime image; remove backend/ and frontend/ Dockerfiles,
  the nginx config, and the frontend entrypoint
- Serve the frontend dist and SPA fallback from Express (config.serveFrontend
  / FRONTEND_DIST_PATH), before auth/maintenance so the shell always loads and
  before the API 404 so client routes resolve to index.html
- Port the SPA-oriented CSP from nginx into Helmet, gated on serveFrontend;
  keep the strict API-only policy otherwise
- Reduce both compose files to a single flashpoint-web service on WEB_PORT
  -> 3100; drop API_PORT, BACKEND_HOST, BACKEND_PORT
- Build one image in the release workflow instead of a two-service matrix
- Update .env.example, README, workflow README, and env var docs

Also add .gitattributes (*.sh eol=lf) and normalize the entrypoint line
endings — without it, Windows checkouts bake CRLF into the image and the
shebang fails with "no such file or directory".
2026-08-11 16:02:06 +07:00
Darkraise bd2514f1f7 chore(config): centralize and document environment variables
- Read game paths and NODE_ENV through the config module in
  gamezipserver instead of process.env directly
- Harden SQLite cache/mmap parsing with isNaN checks so invalid
  values fall back to defaults instead of NaN
- Pass auth, rate-limit, application, and OpenTelemetry variables
  through both docker-compose files with documented defaults
- Expand env var documentation and .env examples to match
2026-08-11 16:02:06 +07:00
Darkraise 75c69a3210 chore: clean up Docker and build config
- Move health check from Dockerfile to docker-compose
  for easier override
- Remove unused VITE_API_URL build arg from frontend
  Dockerfile
- Simplify build:analyze and check-bundle scripts
- Document PUID/PGID container permissions in
  .env.example
2026-02-10 21:19:25 +07:00
Darkraise 96cf4a5b00 feat: revamp the game serving feature 2026-02-07 23:36:45 +07:00
Darkraise b5feb04604 refactor: simplify Docker config and add db optimizations
- Consolidate docker-compose files: dev.yml builds locally, main uses
  pre-built images; remove redundant prod.yml and images.yml
- Add docker-entrypoint.sh for database copy from network storage
- Add SQLite performance tuning (PRAGMA optimizations, mmap, cache)
- Add cache pre-warming for instant first page load
- Enhance logging with OTEL-compatible JSON format and trace context
- Simplify .env.example with clearer sections and fewer variables
- Remove EXTERNAL_IMAGE_URLS env var (auto-read from FP preferences)
- Hardcode container ports (use docker port mapping to customize)
- Add /api/errors/stats endpoint for admin dashboard
2026-02-02 15:43:31 +07:00
Darkraise 9e9a116f7f fix: frontend nginx 2026-02-01 11:14:02 +07:00
Darkraise e1a691e497 feat: share playlist feature 2026-01-31 17:29:07 +07:00