Commit graph

3 commits

Author SHA1 Message Date
Roland
f87921e2a7
Serve the production build in Docker so the PWA service worker ships
The Docker app container ran the CRA dev server (`npm run start`), which
never emits the Workbox service worker, so the PWA had no offline cache when
deployed via Docker (native already serves the build via wrolpi-app.service).

- docker/app/Dockerfile: build the bundle (`npm run build`) and serve it with
  `serve build -c /app/serve.json` (mirrors native; serve.json keeps the SPA
  fallback while serving service-worker.js and epub.html directly).
- docker-compose.yml: drop the dev-server `command`/mounts so the base stack
  serves the production build (what end users run).
- docker-compose.dev.yml: new opt-in override restoring the dev server + hot
  reload for local development:
  `docker compose -f docker-compose.yml -f docker-compose.dev.yml up`
- docker/README.md: document the dev vs production run commands.

Verified: served via Caddy, /service-worker.js now returns real JS
(application/javascript) instead of the SPA index.html fallback; the SW
registers, caches inventory, and serves it offline.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 15:56:40 -06:00
Roland
e0324ce0fc Migrating Controller from port 8087 to 80 so that it is more discoverable. Reformatting Controller dashboard to make header at the top. Reformatting navigation bar to handle the new links which prevented Admin from being visible in some screens. 2026-04-09 15:01:05 -06:00
Roland
fbb71e012d Replace nginx with Caddy for TLS termination and reverse proxying.
- Replace nginx with Caddy as the web server for both Docker and native
  (RPi/Debian) deployments. Caddy handles HTTPS termination, reverse
  proxying to all services (API, React app, Controller, Kiwix, Help, Map),
  and serves the media/download file browsers.
- Generate a Root CA and signed leaf certificates for HTTPS. The Root CA
  uses Name Constraints to restrict signing to local addresses only
  (.local, localhost, and RFC 1918 private IP ranges), mitigating MITM
  risk if the CA key is compromised.
- Add an HTTP landing page that guides users through one-time CA
  certificate installation on iOS, Android, macOS, Windows, Linux, and
  Firefox, with auto-redirect when the cert is already trusted.
- Add trailing-slash redirects for /controller, /docs, /media, and
  /download so bare paths don't fall through to the React catch-all.
- Add a Root CA download link on the Settings page under Configs.
- Update help.sh diagnostics for IPv6 listener detection and HTTP/2
  status codes.
- Remove all nginx config files and the https_proxy Docker container.
- Bump wrolpi-help submodule with certificate documentation.
2026-03-07 18:48:44 -07:00