circagraph
Sign inSign up

openchronology/timeline-app on GitHub

The OpenChronology repository on GitHub, mirrored by och-import-github: issues and pull requests as durations (ongoing while open), what happened to them as moments, plus releases, milestones, commits and branches. The Branches view shows the most recently active branches each in a track of its own.

Source: https://github.com/openchronology/timeline-app

3,131 moments · 2026-10-05 CE 20:21:49 UTC – 2026-11-16 CE 12:10:45 UTC · by @athan · @athan

#80 Explain platform startup failures and allow HTTP on private networks

–

  • github
  • github/openchronology/timeline-app
  • github/openchronology/timeline-app#80
  • pull request
  • state:merged

## Problem A `.deb` install configured with `APP_ORIGIN=http://timeline.clark.arpa:5173` serves the pages, but every API route (`/api/session`, `/api/plugins`, `/api/timelines`, `/healthz`) returns an **empty 500**. The packaged launcher always sets `NODE_ENV=production`, and `platformServices()` then throws *"Public production deployments require HTTPS."* Next.js turns that into a bodiless 500, so the website shows "Plugin library isn't available", "Timeline browse isn't available", and "Failed to execute 'json' on 'Response': Unexpected end of JSON input". ## Changes - **Readable startup failures:** `dispatchNextRequest` and `/api/live` now answer **503 JSON** when the platform can't start, and log the cause. Settings the platform can't start with throw a new `ConfigurationError`, whose message is shown (`Server misconfigured: …`); any other error stays generic (`The server is unavailable.`), so database details don't leak. - **`PLUGIN_LIBRARY`:** a missing or invalid file is now a configuration error, with no file path in the message. - **`ALLOW_INSECURE_ORIGIN=1`:** allows a plain-HTTP `APP_ORIGIN` on a trusted private network. Cookies already drop `Secure`/`__Host-` for http origins, so nothing else needed to change. Added to the `.deb` env template (the upgrade notice lists it automatically), `compose.yml`, README.Debian and docs/docker.md. - **`platform/lib/api.js`:** when a response isn't JSON, the client reports `Request failed (HTTP n).` instead of the JSON parse exception. ## Testing - New test in `test/next-route.test.mjs`: with production and an http origin, requests get a 503 JSON response naming the problem; with the opt-in set, `/api/session` returns 200. - `node --test test/*.test.mjs`: 202/202 pass. `typecheck` and prettier pass. - Ran the built standalone platform with `APP_ORIGIN=http://timeline.lan:5173`. Without the opt-in, `/api/session`, `/api/plugins`, `/healthz` and `/api/live` return the 503 message. With `ALLOW_INSECURE_ORIGIN=1`, they return 200, except `/api/live`, which correctly needs a database. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_011fFY8eruEi1xAkkMBni13B https://github.com/openchronology/timeline-app/pull/80

Related

Open #80 Explain platform startup failures and allow HTTP on private networks in the timeline

#80 Explain platform startup failures and allow HTTP on…