managarten/scripts
Till JS 6c0f88f5a2 chore(infra): pre-commit validator for cloudflared-config.yml
Adds scripts/validate-cloudflared-config.mjs — a node-only validator
that lint-staged runs whenever cloudflared-config.yml is staged. The
goal is to catch the same failure modes that
`cloudflared tunnel ingress validate` would catch on the server, but
without requiring cloudflared to be installed on every dev box.

Checks:
  - YAML parses
  - tunnel: is a uuid
  - credentials-file: ends with .json and contains the tunnel id
    (warning when it doesn't — likely an out-of-sync remnant from a
    previous rebuild, exactly the failure mode that bit us in the
    first locally-managed switch)
  - ingress: is a non-empty array
  - every rule except the last has both hostname AND service
  - the LAST rule is the catch-all `service: http_status:NNN`
  - no duplicate hostnames (the most common copy-paste mistake)
  - service URLs look like http(s):// / ssh:// / http_status:NNN
    / unix:/ / hello_world
  - hostnames are lowercase dot-separated DNS labels (no spaces, no
    weird characters)

Wired into lint-staged.config.js with a single glob entry; the
existing eslint + prettier flow is unchanged.

Tested against the live cloudflared-config.yml (passes, 51 hostnames)
and a synthetic broken file (catches all 6 categories of error +
the credentials-file/tunnel id drift warning).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 18:02:51 +02:00
..
dev chore(dev): add setup-dev-user script for local founder accounts 2026-04-09 12:23:15 +02:00
mac-mini chore(infra): smarter tunnel rebuild — apex via API + sane probes 2026-04-09 17:52:40 +02:00
test-data feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
test-reporting chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
audit-workspace-deps.mjs fix(mana-auth) + chore: rewrite /api/v1/auth/login JWT mint, remove Matrix stack 2026-04-08 16:32:13 +02:00
backup-monitoring.sh feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
check-status.sh feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
create-gift-codes.mjs feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
deploy-metrics.sh fix(deploy): fix image size measurement in deploy metrics 2026-03-20 21:13:03 +01:00
ecosystem-audit.mjs feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
fix-mixed-imports.mjs Fix wrong type 2025-12-04 23:25:25 +01:00
generate-dockerfiles.mjs feat(infra): extend Dockerfile validator to backends and services 2026-03-25 08:57:10 +01:00
generate-env.mjs feat(env): persistent dev secrets via .env.secrets override 2026-04-08 17:50:37 +02:00
generate-status-page.sh refactor(mana): rename inventar → inventory across the codebase 2026-04-09 15:50:24 +02:00
lighthouse-audit.sh feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
run-integration-tests.sh fix(mana-auth): account lockout was structurally dead + add failure-path tests 2026-04-08 18:29:00 +02:00
run-tests-with-coverage.sh feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
setup-databases.sh feat(news): backend ingester service + curated feed API 2026-04-09 15:53:26 +02:00
setup-secrets.mjs feat(env): persistent dev secrets via .env.secrets override 2026-04-08 17:50:37 +02:00
test-chat-auth.sh chore: tidy root files + reorganize a few stale docs 2026-04-08 12:15:27 +02:00
validate-cloudflared-config.mjs chore(infra): pre-commit validator for cloudflared-config.yml 2026-04-09 18:02:51 +02:00
validate-dockerfiles.mjs feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
validate-monorepo.mjs feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00