build: pre-deploy HTML inline-script syntax guard

A missing brace in a home.html inline <script> caused an app-wide login
outage (the whole block failed to parse, so boot never ran). Nothing in the
deploy path checked HTML syntax. Add tools/check-syntax.js: parses (never
runs) every inline <script> in server/public/*.html with vm and exits non-zero
on any syntax error, reporting the file + line.

Wired in two places:
- Dockerfile RUN after COPY server/ ./ — a syntax error now FAILS the build,
  so it can't deploy.
- redeploy.sh pre-flight — fast local feedback before triggering the remote
  build.

Verified: passes on current pages (16 blocks / 9 files); fails with the exact
location when a brace is removed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
SravanandClaude Opus 4.8 committed 2026-11-03 21:33:01 +05:30
1 parent c9bb9c75d1
commit a1f7eef28a
4 files changed
+78 -1

No files matched your search

+5
View File
@@ -16,6 +16,11 @@ RUN npm install --omit=dev --no-audit --no-fund
# App source
COPY server/ ./
# Pre-deploy guard: FAIL the build if any inline <script> in the served HTML pages has a JS syntax error. A
# broken inline script takes down the whole page (one missing brace in home.html once caused an app-wide login
# outage). This turns that into a failed build instead of a production incident. See tools/check-syntax.js.
RUN node tools/check-syntax.js
# Served HTTP port (NPM terminates TLS and proxies here). The DB is Postgres (DATABASE_URL, set via .env);
# the /data volume holds uploads / recordings / transcripts / downloads (see docker-compose.yml).
ENV PORT=8090