fix(desktop): keep the Gauzy Cloud API address in the main process (egress audit)
Refs #9517
Summary
The egress audit (node --test tools/egress-audit/static-hostnames.test.mjs) failed on integration/issue-triage-2026-10-31. The cause was packages/desktop-ui-lib/src/lib/time-tracker/web-portal/web-portal-url.ts from #11576, which named Gauzy Cloud's API host once and its web app host twice. Neither is in the baseline. The baseline may only shrink, so the file now names no Ever host, comments included.
What changed
packages/desktop-lib/src/lib/desktop-store.ts:- New exported constant
GAUZY_CLOUD_API_URLreplaces the two literals. - That file's baseline count drops from 2 to 1, which the audit allows. The baseline file itself is unchanged.
- New exported constant
packages/desktop-lib/src/lib/desktop-ipc.ts:- New
GET_GAUZY_CLOUD_API_URLhandler next toGET_LOCAL_WEB_APP_URL. - The channel is added to the matching
removeHandlerlist.
- New
web-portal.service.ts:- Reads both addresses from the main process, with the same fallback as before.
- A main process that cannot answer (no channel) gives
null, so no link comes from that address. - The cloud API address is passed on as
cloudApiUrl.
web-portal-url.ts:- The
GAUZY_CLOUD_API_URLconstant and its default are removed. cloudApiUrlis optional with no default. Without it, no server counts as Gauzy Cloud.- The comments name no host.
- The
Behavior is unchanged in the app:
- The main process answers Gauzy Cloud's API address.
- The link still opens
GAUZY_CLOUD_APPfor Gauzy Cloud, or the web UI the app serves on this computer. - Custom servers still get no link.
Tests
npx jest -c packages/desktop-ui-lib/jest.config.ts --rootDir packages/desktop-ui-lib src/lib/time-tracker/web-portal src/lib/time-tracker/time-tracker.component
# Test Suites: 3 passed, 3 total; Tests: 21 passed, 21 total
web-portal-url.spec.ts:- Passes
cloudApiUrlin each case. - New case: no server counts as Gauzy Cloud without the address, including
nulland a value that is not a URL.
- Passes
web-portal.service.spec.ts:- Each channel gets its own answer.
- New case: a main process without the cloud channel gives no Gauzy Cloud link, and still gives the local web UI link.
npx tsc -p packages/desktop-lib/tsconfig.lib.json --noEmit: clean.npx tsc -p packages/desktop-ui-lib/tsconfig.lib.json --noEmit: only the existinggoogleerrors.- ESLint: no findings on changed lines.
node --test tools/egress-audit/static-hostnames.test.mjs:- Neither this branch's files nor
web-portal-url.tsis reported any more. - It still reports git-ignored local
packages/ui-config/src/lib/environments/environment*.tscopies, which CI does not have. - It also still reports three tracked files this PR does not touch, changed by other commits on the integration branch:
.do/deploy.template.yaml(4e8d701dd6).env.caddy.sample(4e8d701dd6).github/ISSUE_TEMPLATE/config.yml(06f18f6116)
- Those are left to their own branches.
- Neither this branch's files nor
Rollback
Revert this commit. That restores the address literal in web-portal-url.ts, and the egress audit then fails again.
cc @evereq
š¤ Generated with Claude Code
Summary by cubic
Fixes the egress audit failure on the integration branch by keeping Gauzy Cloud's API address in the main process instead of a hardcoded literal in web-portal code. User-visible behavior is unchanged: Gauzy Cloud still opens its web app, the web UI still opens when the app serves one, and custom servers still get no link.
desktop-store.tsnow holds the address once as the exportedGAUZY_CLOUD_API_URL, replacing two literals.- The main process answers it on a new
GET_GAUZY_CLOUD_API_URLIPC channel. WebPortalServicereads it alongside the local web UI channel; without an answer, no server counts as Gauzy Cloud.