fix(updates): allow notify endpoint past CSRF + portable JSON parse in release.sh

- csrf-protection: skip CSRF validation on /api/system/update-notify. The
  endpoint has its own X-DashCaddy-Notify-Secret auth and is only ever called
  machine-to-machine; browsers never reach it. Without this, the CSRF cookie
  check rejects the notify POST before the secret comparison runs.
- release.sh: the verify step piped curl into `node -p ".../dev/stdin"` which
  works on Linux but blows up on Windows/git-bash. Replaced with portable
  grep+sed extraction so the same script works on both publisher OSes.
This commit is contained in:
Sami
2026-05-16 23:55:08 -07:00
parent 850db40479
commit 7e23cb5b06
2 changed files with 7 additions and 3 deletions
+4 -1
View File
@@ -122,7 +122,10 @@ function csrfValidationMiddleware(req, res, next) {
'/api/totp/verify-setup',
'/api/totp/setup',
'/health',
'/api/health'
'/api/health',
// Machine-to-machine: publishing host POSTs here with its own shared-secret
// header (X-DashCaddy-Notify-Secret) — browsers never reach this endpoint.
'/api/system/update-notify'
];
// Normalize /api/v1/... to /api/... so exclusions work with both prefixes