Skip to content

Commit 96e8829

Browse files
authored
chore(audit): execute 2026-06-04 (2055) audit — docs CI config triggers, env-var docs (#125)
* ci(docs): trigger linkcheck on wrangler/bunfig/osv-scanner config changes These files affect the docs build, install behavior, and vuln scan but were absent from the linkcheck push paths, so a config-only push could land on main without the build/linkcheck running. Audit: F002 * docs(docs): document BORINGSTACK_UI_DIR/API_DIR build-time path overrides These env vars override the sibling-app roots used for catalog generation (for shallow clones / worktrees / non-monorepo layouts) but were undocumented. Documented at the resolveTemplateRoot resolution point and the pre-push pass-through site, where a debugger lands. They are internal contributor knobs, not product config, so they stay out of the published docs site. Audit: F004 * docs(api): document optional dev-only PREVIEW_PORT in .env.example preview.ts reads process.env.PREVIEW_PORT directly (outside the validated schema) because it only runs under bun run preview:templates. Documented as a commented stub matching the EMAIL_TEMPLATES_DIR convention — an uncommented key would trip the env-cascade-drift guardrail. Audit: F003
1 parent 92baa54 commit 96e8829

4 files changed

Lines changed: 31 additions & 0 deletions

File tree

.github/workflows/apps-docs-linkcheck.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ on:
1414
- "apps/docs/astro.config.mjs"
1515
- "apps/docs/package.json"
1616
- "apps/docs/bun.lock"
17+
# Build/install/scan config: wrangler (Cloudflare asset + build settings),
18+
# bunfig (install behavior), osv-scanner (vuln allowlist). A config-only
19+
# push must still rebuild + linkcheck so a broken config can't land
20+
# unverified.
21+
- "apps/docs/wrangler.jsonc"
22+
- "apps/docs/bunfig.toml"
23+
- "apps/docs/osv-scanner.toml"
1724
- ".github/workflows/apps-docs-linkcheck.yml"
1825
# Catalog inputs: the generated docs data is derived from sibling-app
1926
# scripts/README.md, package.json scripts, and lint-meta export-catalog.

apps/api/.env.example

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,11 @@ VALKEY_DB=0
210210
# Optional. Override only if you copy the precompiled email templates
211211
# (src/templates/email/dist) to a non-default location in your image.
212212
# EMAIL_TEMPLATES_DIR=/app/src/templates/email/dist
213+
214+
# Optional, dev-only. Port for the email-template preview server
215+
# (`bun run preview:templates`); defaults to 3002. Read directly from the
216+
# environment rather than the validated env schema because it never runs in
217+
# the deployed app — so it stays commented here (an uncommented key would trip
218+
# the env-cascade-drift guardrail, which requires every .env.example key to
219+
# exist in src/config/env/schema.ts).
220+
# PREVIEW_PORT=3002

apps/docs/scripts/docs-catalog-lib.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ import { fileURLToPath } from "node:url";
55

66
const DOCS_ROOT = join(dirname(fileURLToPath(import.meta.url)), "..");
77

8+
/*
9+
* Build-time only. Resolves a sibling template app's root for catalog
10+
* generation. By default it assumes the monorepo layout (apps/<siblingName>
11+
* next to apps/docs). Two optional env overrides exist for setups where that
12+
* assumption breaks — shallow CI clones, isolated worktrees, or docs built
13+
* outside the monorepo:
14+
* - BORINGSTACK_UI_DIR — absolute path to the ui app (sibling default: ../ui)
15+
* - BORINGSTACK_API_DIR — absolute path to the api app (sibling default: ../api)
16+
* Empty/unset falls back to the sibling path. These are internal contributor
17+
* knobs, not product config, so they are documented here at the resolution
18+
* point rather than in the published docs site.
19+
*/
820
export function resolveTemplateRoot(envKey, siblingName) {
921
const fromEnv = process.env[envKey];
1022

apps/docs/scripts/pre-push.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ fail() { c_red "✗ $*"; exit 1; }
2828
ok() { c_green "$*"; }
2929

3030
step "1/4 Docs data (monorepo apps)"
31+
# BORINGSTACK_UI_DIR / BORINGSTACK_API_DIR: optional absolute-path overrides
32+
# for the sibling app roots (defaults: ../ui, ../api). See resolveTemplateRoot
33+
# in scripts/docs-catalog-lib.mjs. Pass-through here so a non-monorepo layout
34+
# (shallow clone / worktree) can still locate the catalog source apps.
3135
BORINGSTACK_UI_DIR="$BORINGSTACK_UI_DIR" \
3236
BORINGSTACK_API_DIR="$BORINGSTACK_API_DIR" \
3337
bun run check:docs-data || fail "docs data drift: run bun run generate:docs-data from apps/docs"

0 commit comments

Comments
 (0)