Files
youtube-generator/wrangler.jsonc
T
poli0981andClaude Opus 5.5 a70580e703 ci: security, licensing and style gates; pin every action by SHA
New checks
- security.yml: dependency-review blocks PRs that add a high/critical
  advisory; actionlint + zizmor lint the workflows themselves (template
  injection, permissions, credential persistence, unpinned uses); OpenSSF
  Scorecard weekly and on main (published, not uploaded as alerts).
- compliance.yml: REUSE lint over the whole repo (REUSE.toml + LICENSES/,
  no per-file headers) and Conventional-Commit PR titles.
- rust.yml (src-tauri changes + weekly): rustfmt, clippy -D warnings,
  cargo test, and cargo-deny for RustSec advisories, licenses and sources.
- ci.yml `check` gains: coverage thresholds (src/engine, worker),
  check:licenses, check:bundle, and a `wrangler deploy --dry-run`.

Licensing
- THIRD_PARTY_NOTICES.md is now generated from package.json, the installed
  packages and Cargo.toml/Cargo.lock (`npm run generate:third-party`); CI
  fails when it is stale or when anything bundled into the app carries a
  license outside the allowlist. It had drifted to React 18 / Vite 7 /
  Tailwind 3.
- Vite's build.license emits the full text of every bundled package's
  license to /licenses/third-party.md (served publicly, before the gate).

Bundle budget
- scripts/check-bundle-size.ts measures what CLAUDE.md's "500KB" never
  defined: initial load (everything index.html references) <= 280 KB gzip
  (197 KB today) and no JS chunk over 500 KB raw.

Coverage
- @vitest/coverage-v8; thresholds sit just under today's numbers. The
  engine is at 89% lines / 64% functions — not the 100% CLAUDE.md claimed.

Supply chain
- Every third-party action pinned to a commit SHA (Dependabot updates the
  SHA and its version comment); checkout never persists credentials.
- Release workflows: a `verify` job (typecheck, tests, version sync, Tauri
  alignment, tag == package version) gates the build; no dependency caches
  in release jobs; permissions granted per job.
- Reusable Discord workflows receive only the secrets they declare instead
  of `secrets: inherit` (which exposed the Android signing keys to them).
- Rust: cargo-deny found RUSTSEC-2026-0194/0195 (quick-xml DoS, via plist)
  that Dependabot had not raised; plist 1.10 brings quick-xml 0.41.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 19:46:24 +07:00

62 lines
2.3 KiB
JSON

// Cloudflare Workers configuration for https://ytgenerator.stream.
//
// This is the only deployment file in the repo: Workers Builds (connected to
// this GitHub repository in the Cloudflare dashboard) runs `npx wrangler
// deploy` on every push to `main`, and `build.command` below produces `dist/`.
// There is no GitHub Actions deploy workflow. See docs/HOSTING.md.
{
"$schema": "node_modules/wrangler/config-schema.json",
// Must match the Worker the repository is connected to in the dashboard.
"name": "youtube-generator",
// The Turnstile gate + security headers in front of the static build.
"main": "worker/index.ts",
// Keep at or below the date the pinned wrangler's local runtime supports.
"compatibility_date": "2026-09-25",
// Serve the site only on the custom domain. `wrangler deploy` detaches any
// custom domain that is not listed here, so this entry is load-bearing.
"workers_dev": false,
"preview_urls": true,
"routes": [{ "pattern": "ytgenerator.stream", "custom_domain": true }],
"build": { "command": "npm run build" },
"assets": {
"directory": "./dist",
"binding": "ASSETS",
// NOT the SPA fallback: any path excluded from the Worker below would then
// get index.html without passing the gate. The Worker serves the app shell
// itself for gated routes; misses on public paths get dist/404.html.
"not_found_handling": "404-page",
// Everything goes through the Worker first, except content-hashed build
// output and the public files crawlers, browsers and the manifest fetch
// without cookies. Negative patterns win.
"run_worker_first": [
"/*",
"!/assets/*",
"!/icons/*",
"!/.well-known/*",
"!/favicon.svg",
"!/favicon.ico",
"!/apple-touch-icon.png",
"!/og-image.png",
"!/manifest.webmanifest",
"!/robots.txt",
"!/sitemap.xml",
"!/theme-init.js",
"!/licenses/*",
"!/404.html"
]
},
"vars": {
// Public by design — the widget embeds it in the page. The matching
// secret is the dashboard Secret TURNSTILE_SECRET (never committed).
"TURNSTILE_SITE_KEY": "0x4AAAAAAFKFAMUx9rQ5H6bQ",
// How long a passed check lasts before the gate shows again.
"GATE_TTL_SECONDS": "86400"
},
"observability": { "enabled": true }
}