Skip to content

ci(deploy): emit networkDashboardPlatformUrl into deployed config.js#19

Merged
AquiGorka merged 2 commits into
mainfrom
fix/deploy-config-key
May 21, 2026
Merged

ci(deploy): emit networkDashboardPlatformUrl into deployed config.js#19
AquiGorka merged 2 commits into
mainfrom
fix/deploy-config-key

Conversation

@AquiGorka
Copy link
Copy Markdown
Contributor

Summary

The SPA reads c.networkDashboardPlatformUrl from the bundled public/config.js (src/lib/config.ts:13,44-45) to build its WebSocket URL. The deploy workflow was emitting only the legacy councilPlatformUrl key, so the production config.js had no networkDashboardPlatformUrl — the SPA fell into its "no WS configured → disconnected" path on both dashboard-testnet.moonlightprotocol.io and dashboard.moonlightprotocol.io. The backend itself is healthy at v0.1.3 on both envs (https://dashboard-api-testnet.moonlightprotocol.io/api/v1/health and https://dashboard-api.moonlightprotocol.io/api/v1/health both return 200).

This PR wires the new GH secret through both deploy jobs:

  • testnet job: env NETWORK_DASHBOARD_PLATFORM_URLsecrets.NETWORK_DASHBOARD_PLATFORM_URL
  • mainnet job: env NETWORK_DASHBOARD_PLATFORM_URLsecrets.MAINNET_NETWORK_DASHBOARD_PLATFORM_URL

The GH secrets were provisioned in iac (local-only repo) alongside this PR and verified present via gh secret list -R Moonlight-Protocol/network-dashboard.

The two validation loops (presence + https://) and the Deno.env.get(...) config block were all updated to include the new var. councilPlatformUrl is intentionally left in place — separate concern.

Commits

  1. ci(deploy): emit networkDashboardPlatformUrl into config.js for testnet + mainnet
  2. chore: release v0.2.13

Test plan

  • deno fmt --check clean
  • deno lint clean
  • deno task check clean
  • deno task test — 13 passed
  • deno task build clean
  • GH secrets NETWORK_DASHBOARD_PLATFORM_URL and MAINNET_NETWORK_DASHBOARD_PLATFORM_URL are present on the repo (verified pre-PR)
  • After merge: curl -s https://dashboard-testnet.moonlightprotocol.io/config.js | grep networkDashboardPlatformUrl shows the live testnet backend URL
  • After merge: curl -s https://dashboard.moonlightprotocol.io/config.js | grep networkDashboardPlatformUrl shows the live mainnet backend URL
  • After merge: browser load of either dashboard shows the WS connection succeeding, not "disconnected"

Symptom this fixes

Both deployed dashboards currently show a "Disconnected" banner. Cause: config.js missing the key the SPA expects + the GH secret was never set. This PR fixes the deploy pipeline; the iac side already set the secrets.

Driven by /Users/theahaco/repos/pm-theahaco/prompts/wire-network-dashboard-to-platform-1-prompt.md.

AquiGorka added 2 commits May 21, 2026 12:09
…et + mainnet

The SPA reads `c.networkDashboardPlatformUrl` from the bundled public/config.js
(src/lib/config.ts:13,44-45) to build its WebSocket URL. The deploy workflow
was writing only the legacy `councilPlatformUrl` key, so the production
config.js had no networkDashboardPlatformUrl — the SPA fell into its
"no WS configured → disconnected" path on both dashboard-testnet and dashboard
mainnet.

Wire the new GH secret through both jobs:
- testnet job: env NETWORK_DASHBOARD_PLATFORM_URL ← secrets.NETWORK_DASHBOARD_PLATFORM_URL
- mainnet job: env NETWORK_DASHBOARD_PLATFORM_URL ← secrets.MAINNET_NETWORK_DASHBOARD_PLATFORM_URL

Add the var to both presence + https:// validation loops, and emit
networkDashboardPlatformUrl: Deno.env.get('NETWORK_DASHBOARD_PLATFORM_URL')
alongside the existing councilPlatformUrl line.

councilPlatformUrl is intentionally left in place — separate concern.

Driven by wire-network-dashboard-to-platform-1.
@AquiGorka AquiGorka merged commit 313802b into main May 21, 2026
5 checks passed
@AquiGorka AquiGorka deleted the fix/deploy-config-key branch May 21, 2026 15:21
AquiGorka added a commit that referenced this pull request May 21, 2026
## Summary

Tigris' edge serves bucket objects with a default 1-hour cache TTL.
`config.js` carries deploy-time substitutions (WS URL, RPC URL, council
platform URL, etc.) — a 1-hour stale window means users see the previous
deploy's config for up to an hour after a redeploy, with no way to
refresh besides a `Cache-Control: no-cache` bypass.

Hit this directly on the v0.2.13 deploy (PR #19): mainnet refreshed
promptly because the edge cache happened to be cold, testnet served the
pre-deploy config.js for ~1h because the edge cache was warm with the
older object.

## What ships

After each `aws s3 sync` upload, run a targeted follow-up:

```bash
aws s3 cp public/config.js s3://<bucket>/config.js \
  --endpoint-url https://fly.storage.tigris.dev \
  --acl public-read \
  --cache-control "no-cache, max-age=0" \
  --content-type text/javascript \
  --no-progress
```

This overwrites the object metadata with `cache-control: no-cache,
max-age=0`. `content-type` is set explicitly to `text/javascript`
because `aws s3 cp` doesn't always infer the mime type when re-uploading
an object with overridden metadata.

Other bucket assets (app.js, app.js.map, styles.css, index.html,
world-map.svg, health.json) keep the bucket default — `config.js` is the
only deploy-time-substituted artifact that needs the no-cache treatment.

Mirrored on both branches:
- testnet: `s3://network-dashboard/config.js`
- mainnet: `s3://mainnet-network-dashboard/config.js`

## Commits

1. `ci(deploy): force no-cache on config.js to avoid edge-cache lag on
redeploys`
2. `chore: release v0.2.14`

## Test plan

- [x] `deno fmt --check` clean
- [x] `deno lint` clean
- [x] `deno task check` clean
- [x] `deno task test` — 13 passed
- [x] `deno task build` clean
- [ ] After merge: `curl -I
https://dashboard-testnet.moonlightprotocol.io/config.js` shows
`cache-control: no-cache, max-age=0`
- [ ] After merge: `curl -I
https://dashboard.moonlightprotocol.io/config.js` shows `cache-control:
no-cache, max-age=0`
- [ ] Spot-check `curl -I https://dashboard.moonlightprotocol.io/app.js`
still shows `cache-control: public, max-age=3600` (other assets
unchanged)

Driven by
`/Users/theahaco/repos/pm-theahaco/prompts/wire-network-dashboard-to-platform-1-prompt.md`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant