fix(web): use public api origin for browser-side SSE subscriber #216

Merged
YousifShkara merged 1 commit from fix/BUNYIP-192-sse-public-origin into main 2026-06-24 11:55:43 +02:00
Owner

The SSE subscriber injected into every authenticated shell opened
new EventSource(api_origin + '/v1/events') against cfg.api_url,
which is the SERVER-SIDE outbound origin (e.g. http://bunyip-api-app:4401
on docker compose). On HTTPS production pages the browser refused that
URL as Mixed Content; the dashboard never received live updates.

Split the two: BUNYIP_API_URL keeps its role as the BFF's outbound
origin to bunyip-api; new BUNYIP_API_PUBLIC_ORIGIN is the URL the
BROWSER hits and is what install_sse_api_origin now pins. Defaults
to api_url so dev (where loopback IS the public URL) is unaffected.
Production sets BUNYIP_API_PUBLIC_ORIGIN=https://api.<apex> on the
bunyip-web compose service to point the EventSource at Traefik's
HTTPS-terminated public hostname.

#BUNYIP-192

The SSE subscriber injected into every authenticated shell opened `new EventSource(api_origin + '/v1/events')` against `cfg.api_url`, which is the SERVER-SIDE outbound origin (e.g. `http://bunyip-api-app:4401` on docker compose). On HTTPS production pages the browser refused that URL as Mixed Content; the dashboard never received live updates. Split the two: `BUNYIP_API_URL` keeps its role as the BFF's outbound origin to bunyip-api; new `BUNYIP_API_PUBLIC_ORIGIN` is the URL the BROWSER hits and is what `install_sse_api_origin` now pins. Defaults to `api_url` so dev (where loopback IS the public URL) is unaffected. Production sets `BUNYIP_API_PUBLIC_ORIGIN=https://api.<apex>` on the bunyip-web compose service to point the EventSource at Traefik's HTTPS-terminated public hostname. #BUNYIP-192
fix(web): use public api origin for browser-side SSE subscriber
All checks were successful
E2E / Playwright against deployment (pull_request) Successful in 45s
Check / fmt + clippy + build + tests (pull_request) Successful in 4m50s
Create release / Create release from merged PR (pull_request) Has been skipped
fad749cab2
The SSE subscriber injected into every authenticated shell opened
`new EventSource(api_origin + '/v1/events')` against `cfg.api_url`,
which is the SERVER-SIDE outbound origin (e.g. `http://bunyip-api-app:4401`
on docker compose). On HTTPS production pages the browser refused that
URL as Mixed Content; the dashboard never received live updates.

Split the two: `BUNYIP_API_URL` keeps its role as the BFF's outbound
origin to bunyip-api; new `BUNYIP_API_PUBLIC_ORIGIN` is the URL the
BROWSER hits and is what `install_sse_api_origin` now pins. Defaults
to `api_url` so dev (where loopback IS the public URL) is unaffected.
Production sets `BUNYIP_API_PUBLIC_ORIGIN=https://api.<apex>` on the
bunyip-web compose service to point the EventSource at Traefik's
HTTPS-terminated public hostname.

#BUNYIP-192
YousifShkara deleted branch fix/BUNYIP-192-sse-public-origin 2026-06-24 11:55:43 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/bunyip!216
No description provided.