From cb37f628ed9d63673d365923828ce7a793192459 Mon Sep 17 00:00:00 2001 From: 4gray Date: Sat, 22 Aug 2026 09:58:06 +0200 Subject: [PATCH] fix(pwa): drop the retired demo URL from backend CORS and og:url defaults MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The public demo deployment is paused for good, so the production CLIENT_URL fallback allowed an origin nobody can reach — a manual (non-Docker) self-host failed every provider request with a CORS error. Default to the documented http://localhost:4333 instead, and point og:url at the project website. Co-Authored-By: Claude Opus 5 --- .changes/pwa-self-hosted-cors-default.md | 9 +++++++++ apps/web-backend/src/app/web-backend-app.ts | 5 ++++- apps/web/src/index.html | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 .changes/pwa-self-hosted-cors-default.md diff --git a/.changes/pwa-self-hosted-cors-default.md b/.changes/pwa-self-hosted-cors-default.md new file mode 100644 index 000000000..48280a8ec --- /dev/null +++ b/.changes/pwa-self-hosted-cors-default.md @@ -0,0 +1,9 @@ +--- +type: fix +area: pwa +--- + +Self-hosted web backends started without `CLIENT_URL` now allow the documented +`http://localhost:4333` origin instead of the retired public demo URL, so a +manual (non-Docker) deployment no longer fails every provider request with a +CORS error. diff --git a/apps/web-backend/src/app/web-backend-app.ts b/apps/web-backend/src/app/web-backend-app.ts index 75ebc8e61..f4994c63a 100644 --- a/apps/web-backend/src/app/web-backend-app.ts +++ b/apps/web-backend/src/app/web-backend-app.ts @@ -575,10 +575,13 @@ function getClientOrigins(): string[] { return configured; } + // Production default matches the documented self-hosted setup + // (docker/docker-compose.yml maps the PWA to port 4333). The Docker image + // sets CLIENT_URL explicitly; this fallback only covers manual runs. return process.env['NODE_ENV'] === 'development' || process.env['NODE_ENV'] === 'dev' ? ['http://localhost:4200'] - : ['https://iptvnator.vercel.app']; + : ['http://localhost:4333']; } function getQueryString(req: Request, key: string): string | undefined { diff --git a/apps/web/src/index.html b/apps/web/src/index.html index dc036d8b7..a70a34f96 100644 --- a/apps/web/src/index.html +++ b/apps/web/src/index.html @@ -12,7 +12,7 @@ /> - +