Support sub-path deploy via NEXT_PUBLIC_BASE_PATH (loma.chat/pagiva)

Adds basePath config, withBase/appUrl helpers, base-path-aware cookies,
OAuth redirects, manifest, service worker and cron runner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Loma Bot Ops
2026-11-22 16:48:42 +07:00
parent 9d5a029fa5
commit 4a673ebb28
38 changed files with 130 additions and 57 deletions
+3
View File
@@ -10,7 +10,10 @@ META_OAUTH_SCOPES="" # optional — override Facebook Login scopes (comm
META_WEBHOOK_VERIFY_TOKEN="" # any random string, same value in App Dashboard
CRON_SECRET="" # also authenticates scripts/cron-runner.mjs inside the container
UPLOAD_DIR="" # optional — defaults to /app/.data/uploads; mount as a persistent volume
# Public URL incl. base path, no trailing slash (OAuth redirect URIs, webhook URL, upload URLs).
NEXT_PUBLIC_APP_URL="http://localhost:3000"
# Optional sub-path deploy, e.g. "/pagiva" for https://loma.chat/pagiva. Build-time: rebuild after changing.
NEXT_PUBLIC_BASE_PATH=""
# Optional — "เข้าสู่ระบบด้วย Google" on /login (button hidden when empty).
# "เข้าสู่ระบบด้วย Facebook" uses META_APP_ID / META_APP_SECRET above.