Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,23 @@
# Public origin of the deployed bridge (the Void platform URL). Update this if a
# custom domain is later attached with `void domain add`.
PUBLIC_BASE_URL=https://registry-bridge.viteplus.dev

# GitHub Actions OIDC publishing (RFC 0002). Public identifiers, not secrets.
# All four must be set together; a partial config returns 503 for every publish,
# including admin-token ones.
#
# The numeric ids are what anchor trust: OIDC_TRUSTED_WORKFLOWS embeds a
# repository NAME, and names can be renamed, transferred, or released and
# reclaimed by someone else. Read them back with:
# gh api repos/voidzero-dev/vite-plus --jq '{repo: .id, owner: .owner.id}'
#
# NOTE: `pnpm deploy:staging` deploys with the same `void deploy`, so staging
# inherits this file (which is also why PUBLIC_BASE_URL above points at prod).
# Staging therefore shares this audience and allowlist. That is not an
# escalation while both are identical, but it does mean staging cannot be given
# a looser allowlist for testing without that workflow also being able to
# publish to production.
OIDC_AUDIENCE=https://registry-bridge.viteplus.dev
OIDC_TRUSTED_WORKFLOWS=voidzero-dev/vite-plus/.github/workflows/publish-preview-register.yml@refs/heads/main
OIDC_TRUSTED_REPOSITORY_ID=943901988
OIDC_TRUSTED_OWNER_ID=149750581
12 changes: 12 additions & 0 deletions env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,16 @@ export default defineEnv({
WORKSPACE_PACKAGES: string(),
// Bearer token guarding the admin endpoints. Secret: `void secret put ADMIN_TOKEN`.
ADMIN_TOKEN: string().secret().optional(),
// GitHub Actions OIDC publishing (RFC 0002). NOT secrets: all four hold
// public identifiers, and the verification key is GitHub's public JWKS, so
// they live in `.env.production` rather than `void secret put`.
//
// Optional as a group: leaving all four unset disables the OIDC path and
// leaves admin-token publishing untouched. Setting only SOME of them is
// rejected at request time, so a half-configured deploy fails loudly instead
// of silently refusing every token.
OIDC_AUDIENCE: string().optional(),
OIDC_TRUSTED_WORKFLOWS: string().optional(),
OIDC_TRUSTED_REPOSITORY_ID: string().optional(),
OIDC_TRUSTED_OWNER_ID: string().optional(),
})