fix(desktop): commit staging env with explicit VITE_APP_URL (MUL-5025) (#5680)

* fix(desktop): commit staging env with explicit VITE_APP_URL (MUL-5025)

Staging desktop dev relied on a hand-maintained local .env.staging, where
the web-origin var was misnamed VITE_WEB_URL. Desktop only reads
VITE_APP_URL, so appUrl silently fell back to the API-origin derivation
and copy-link URLs pointed at multica-api.copilothub.ai (404).

Track apps/desktop/.env.staging with the correct names (mirroring the
mobile precedent), and fill in mobile's EXPO_PUBLIC_WEB_URL now that the
staging web host is committed rather than living on a teammate's machine.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* chore(desktop): mark staging envs internal, clarify VITE_APP_URL semantics (MUL-5025)

Per review: state in both tracked .env.staging files that the staging
environment is internal (not a public support target), and spell out that
VITE_APP_URL is the web app origin for copy-link/open-in-browser URLs,
never the API host.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
Naiyuan Qing
2026-07-21 14:08:23 +08:00
committed by GitHub
parent 5a11232c47
commit 181e21f2d0
3 changed files with 19 additions and 4 deletions

5
.gitignore vendored
View File

@@ -23,6 +23,11 @@ dist-electron
# Desktop production config is public (backend URL, etc.) — track it so
# `pnpm package` produces a release-ready build without extra setup.
!apps/desktop/.env.production
# Desktop staging config is public (staging API/web URLs) — track it so
# `pnpm dev:desktop:staging` works from a fresh checkout instead of relying
# on a hand-written local env file (MUL-5025: a misnamed VITE_ var there
# silently broke copy-link URLs).
!apps/desktop/.env.staging
# Mobile staging config is public (staging API URL) — track it so a fresh
# checkout can run `pnpm dev:mobile:staging` / `ios:mobile*:staging` without
# the user having to copy `.env.example` first.

11
apps/desktop/.env.staging Normal file
View File

@@ -0,0 +1,11 @@
# Internal staging environment; not a public support environment.
# Used by `pnpm dev:desktop:staging` (`electron-vite dev --mode staging`).
# Personal overrides go in .env.staging.local.
VITE_API_URL=https://multica-api.copilothub.ai
# VITE_APP_URL is the web app origin used for copy-link/open-in-browser URLs.
# Do not point it at the API host. It must be explicit here: the `api.<host>`
# derivation in shared/runtime-config.ts doesn't match this deployment's
# `multica-api.<domain>` naming and would fall back to the API origin
# (MUL-5025).
VITE_APP_URL=https://multica-app.copilothub.ai

View File

@@ -1,10 +1,9 @@
# Internal staging environment; not a public support environment.
# Used by `pnpm dev:mobile:staging` and the `ios:device:staging[:release]`
# scripts. Loaded via `dotenv-cli` (see package.json), NOT by Expo's auto-
# loader — Expo only auto-loads .env.<NODE_ENV>.local files.
EXPO_PUBLIC_API_URL=https://multica-api.copilothub.ai
# Optional. Enables "Copy link" / "Open on web" actions in issue / project /
# comment menus. Without it those menu items just don't appear. Fill in the
# staging web host when you have it (canonical value lives in
# apps/desktop/.env.staging on a teammate's machine).
# EXPO_PUBLIC_WEB_URL=https://<staging-web-host>
# comment menus. Without it those menu items just don't appear.
EXPO_PUBLIC_WEB_URL=https://multica-app.copilothub.ai