# hezarfen_frontend.env — production knobs for the podman compose stack. # # One-time setup ON THE SERVER, by hand: # mkdir -p ~/hezarfen_frontend # cp hezarfen_frontend.env.example ~/hezarfen_frontend/hezarfen_frontend.env # # chmod 0600 ~/hezarfen_frontend/hezarfen_frontend.env # # Nothing automated creates, overwrites or uploads this file — the operator # owns it; compose only reads it (`podman compose --env-file`, plus `env_file` # into the frontend container). Plain KEY=value lines: no quotes, no `export`, # no trailing comment. # # The service declares this file as `env_file:`, so every key below overrides # the image's own ENV defaults (see the ENV block in Containerfile — that block # is the only place the default values are written) with no extra flag, and # nothing is shadowed by a compose default. Values are read when the container # STARTS: after editing, recreate (`podman compose up -d`, or # `systemctl --user restart hezarfen_frontend_compose`). `podman restart` keeps # the old environment. # # The app reads three keys today (server.ts): BACKEND_ORIGIN, PORT, HOST. # ── Backend origin ─────────────────────────────────────────────────────────── # Where the container proxies /api/* — plain HTTP and the exam-room WebSocket # alike. The browser only ever talks to this frontend, so session cookies stay # same-origin. # # The frontend runs with host networking (`network_mode: host` in compose.yaml), # so it shares the host's loopback and this is simply where the backend # listens on this machine: the backend's compose publishes 127.0.0.1:7656. # A bridge network would resolve 127.0.0.1 to the container itself and refuse # the connection. BACKEND_ORIGIN=http://127.0.0.1:7656 # ── Listen address ─────────────────────────────────────────────────────────── # HOST=127.0.0.1 keeps the app on loopback: with host networking there is no # port mapping in front of it, so 0.0.0.0 would put it on every interface and # bypass the reverse proxy. The proxy (Ferron et al.) proxies to # http://127.0.0.1: from this same machine. HOST=127.0.0.1 # ── Listen port ────────────────────────────────────────────────────────────── # The port the app binds (and the port the reverse proxy must target). The # deploy's health gate reads this line back out of this file, so the two cannot # drift. PORT=5173 # ── Image tag ──────────────────────────────────────────────────────────────── # NOT read from here: HEZARFEN_TAG is compose interpolation only and travels in # the deploy-owned stack.env (the second `--env-file`, which wins for duplicate # keys). The systemd unit starts with `--no-build`, so the image must already # exist on the host before the first start: # podman compose build # build it here # podman load -i image.tar # or load one shipped from elsewhere #HEZARFEN_TAG=latest