Skip to content

Generate Brief /.well-known/brief.json from env (single source of truth) - #34

Merged
sandervonk merged 2 commits into
mainfrom
cursor/brief-config-from-env-214f
Sep 4, 2026
Merged

Generate Brief /.well-known/brief.json from env (single source of truth)#34
sandervonk merged 2 commits into
mainfrom
cursor/brief-config-from-env-214f

Conversation

@sandervonk

@sandervonk sandervonk commented Sep 4, 2026

Copy link
Copy Markdown
Member

Summary

Stops treating the checked-in public/.well-known/brief.json as source of truth. Build/deploy generates that file from env / the live API so it cannot drift from mvtt-server.

Production SSOT (preferred for cmutt)

Humans edit brochure values only on the server (e.g. .env.cmu-tt). Pages copies the live API at deploy:

BRIEF_FETCH_CONFIG=1
BRIEF_CONFIG_URL=https://api.cmutt.app/api/v1/client-config

Put these in the production deploy .env / .env.local. When BRIEF_FETCH_CONFIG=1, scripts/generate-brief-config.js fetches first (compose / blob / stub are fallbacks).

Other paths

  • Offline CI / forks: discrete BRIEF_* in .env.test (no network)
  • Optional: BRIEF_CLIENT_CONFIG JSON blob

Changes

  • Generator + prebuild / preserve / deploy.js wiring
  • Delete hand-maintained brochure JSON; gitignore generated file
  • README + example.env document Option C as preferred production path

Live Pages

cmutt.app/.well-known/brief.json updates only via npm run deploy with Brief fetch (or compose) env set. CI build does not publish to gh-pages.

Test plan

  • Compose from .env.test writes expected JSON
  • npm run build succeeds; dist/.well-known/brief.json present
  • Production deploy with BRIEF_FETCH_CONFIG=1 copies API client-config to Pages
Open in Web Open in Cursor 

cursoragent and others added 2 commits September 4, 2026 18:29
Stop treating the checked-in public/.well-known/brief.json as source of
truth. Add scripts/generate-brief-config.js (BRIEF_CLIENT_CONFIG or
BRIEF_*/FIREBASE_*/VUE_APP_* compose, optional fetch) and wire it into
prebuild, preserve, and deploy.js so every gh-pages publish refreshes
the brochure from env in sync with mvtt-server client-config.

Co-authored-by: Sander Vonk <sandervonk@users.noreply.github.com>
Document BRIEF_FETCH_CONFIG=1 + BRIEF_CONFIG_URL as the preferred
cmutt deploy path so Pages copies client-config from the API (server
.env is the only human edit). Discrete BRIEF_* remain for offline CI.
When fetch is enabled, the generator tries the remote URL first.

Co-authored-by: Sander Vonk <sandervonk@users.noreply.github.com>
@sandervonk
sandervonk marked this pull request as ready for review September 4, 2026 18:39
@sandervonk
sandervonk merged commit 07c2c5b into main Sep 4, 2026
1 check passed
@sandervonk
sandervonk deleted the cursor/brief-config-from-env-214f branch September 4, 2026 18:41
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.

2 participants