fix(edge): route /app and /api on d3ro.chanpaca.net through the NAS tunnel again

Since 2026-09-19 the site bridge worker served every path from Pages, so the
API server on the NAS had no public route: admin login (API_SERVER_URL)
and stt-proxy (D3RO_API_URL) called https://d3ro.chanpaca.net/api/... and
got the landing page's 405.

- The worker passes /app, /api and /health through to the domain origin
  (the kd-nas tunnel) and serves everything else from Pages.
- The kd-nas tunnel sends path ^/app on d3ro.chanpaca.net to the web app
  (NAS 3002); other paths keep going to the API (NAS 5050). No extra
  hostname or DNS record is needed, so WEB_APP_ORIGIN is removed.
- API_PATH_PREFIXES joins WEB_APP_BASE_PATH in packages/core/src/web-urls.ts
  (contract regenerated).

Verified live: /app/login 200, /health and /api/health 200, API login 401 for
an unknown account (was 405), landing/legal/404 unchanged, git/sso/admin
hosts unaffected.
This commit is contained in:
Yun Chan 2026-09-26 20:19:27 +09:00
parent e87ce63440
commit 4aadee8264
4 changed files with 42 additions and 64 deletions

View file

@ -93,10 +93,13 @@ export const PLAN_QUOTA: Readonly<Record<PlanQuotaTier, Readonly<Record<PlanQuot
// packages/core/src/web-urls.ts
// 공개 웹 주소 SSOT — 결제·법률·다운로드·초대 링크는 모두 여기서 만든다.
//
// 한 도메인 아래 두 앱이 있다.
// / 랜딩 사이트(site/, Cloudflare Pages) — 다운로드, 법률 문서, 초대 수락
// /app/... 웹앱(apps/web, Next basePath '/app') — 로그인, 결제, 대시보드
// 사이트 브리지 워커(server/cloudflare-site-bridge)가 /app 요청을 웹앱으로 보낸다.
// 한 도메인 아래 세 서비스가 있다.
// / 랜딩 사이트(site/, Cloudflare Pages) — 다운로드, 법률 문서, 초대 수락
// /app/... 웹앱(apps/web, Next basePath '/app') — 로그인, 결제, 대시보드
// /api, /health API 서버(apps/api-server) — 관리자 인증, STT 중계
// 사이트 브리지 워커(server/cloudflare-site-bridge)가 /app·/api 요청을 도메인 원본
// (Cloudflare Tunnel kd-nas → NAS)으로 흘려보내고, 나머지는 Pages로 보낸다.
// 터널 ingress: d3ro.chanpaca.net path ^/app → NAS 3002, 그 밖 → NAS 5050.
// Deno 쪽 사본은 plan-catalog.ts 와 같은 방식으로 생성된다. 이 파일도 순수 값만 둔다.
@ -107,6 +110,9 @@ export const WEB_APP_BASE_PATH = '/app'
export const WEB_APP_URL = `${PUBLIC_SITE_ORIGIN}${WEB_APP_BASE_PATH}`
/** API 서버(apps/api-server)가 받는 경로. 관리자 로그인·stt-proxy가 이 도메인으로 부른다. */
export const API_PATH_PREFIXES = ['/api', '/health'] as const
export const SITE_URLS = {
home: `${PUBLIC_SITE_ORIGIN}/`,
download: `${PUBLIC_SITE_ORIGIN}/#download`,