Skip to content

docs: Secret-not-Plain-text token, R2 optional, VITE_API_BASE for web build#8

Merged
poterpan merged 1 commit into
mainfrom
docs/fork-deploy-clarity
Jun 9, 2026
Merged

docs: Secret-not-Plain-text token, R2 optional, VITE_API_BASE for web build#8
poterpan merged 1 commit into
mainfrom
docs/fork-deploy-clarity

Conversation

@poterpan

@poterpan poterpan commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Doc-only follow-ups (closes the remaining items #2/#5/#6 from the fork-fidelity review). No code/runtime changes.

#2 — DISCORD_BOT_TOKEN must be a Secret, not Plain text (confirmed root cause)

A downstream admin's bot token vanished on every Workers Builds redeploy. Root cause (confirmed by him re-setting it as Secret → now persists): he'd added it as a Plain text variable. wrangler deploy treats wrangler.toml as the source of truth for runtime vars and wipes any dashboard Plain-text var not in the config on each deploy; secrets are never wiped. Our guideline said "Secret" but didn't warn against Plain text or explain why.

  • docs/DEPLOY.md 6-1: explicit Type: Secret (not Plain text) + a warning explaining the wipe.
  • Speed-cheat-sheet row: same caveat.

#6 — R2 is optional, say so consistently

  • docs/DEPLOY.md section-0 inventory + both R2-creation steps now mark R2 optional (drop [[r2_buckets]] to skip).
  • Both READMEs' "provision your own resources" notes mark R2 optional.

#5 — web build requires VITE_API_BASE

Since the build now hard-fails without VITE_API_BASE (merged in #7), the bare pnpm --filter @chippot/web build in the READMEs would fail. Updated quick-start + deploy commands in README.md / README.zh-TW.md to pass it, and updated the DEPLOY.md Pages note + FAQ to say the build now fail-fasts (instead of shipping a white-screen bundle).

Docs only — CI (typecheck/test/build) unaffected; no production deploy.

…VITE_API_BASE for web build

- DISCORD_BOT_TOKEN: the dashboard variable MUST be type Secret, not Plain text.
  Plain-text vars are wiped on every wrangler deploy (wrangler.toml is the
  source of truth); secrets persist. A downstream admin hit exactly this — token
  vanished on each Workers Builds redeploy because it was set as Plain text.
- R2 is optional: mark it so in the section-0 inventory and both R2-creation
  steps (drop [[r2_buckets]] to skip), and in both READMEs' provision notes.
- web build now hard-fails without VITE_API_BASE (vite.config.ts), so the README
  quick-start/deploy commands and the DEPLOY.md Pages note now pass/explain it.
@poterpan poterpan merged commit ce4b112 into main Jun 9, 2026
2 checks passed
@poterpan poterpan deleted the docs/fork-deploy-clarity branch June 9, 2026 04:58
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