- eslint: errors for ==, unused or shadowed variables, eval and friends,
prefer-const, curly, throw literals, useless catch/escape, constant
conditions (loops allowed), unused expressions (short-circuit allowed);
--max-warnings 0. Fixed the few violations (two unused requires in
server.js, a shadowed mock argument in a test).
- Scan job: scripts/ci/check-web-template.sh fails if public/web_template
differs from upstream at the commit in its VERSION (change it upstream,
then scripts/sync-web-template.sh).
- New job UI screenshots (before/after), PRs only, when public/, views/
or the render/nav code changed: runs the base branch and the PR side by
side with the same seeded data and uploads one before/after image per
page, desktop and phone (scripts/ci/screenshots.js). Not required.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
authenticateSSO and authenticatePage took the user and groups straight
from the Remote-* headers, and the server listens on every interface, so
any LAN host could connect directly, claim any user and group, and run
commands on the workers. It could also write whatever it claimed into the
users table.
Add TRUSTED_PROXIES (addresses or CIDR ranges) and ignore the identity
headers unless the TCP peer is on the list. The peer address is used
rather than a forwarding header, which a client could forge. It fails
closed: unset means no SSO login succeeds, with a startup warning.
Rejected attempts are logged with their source. Worker and Gandalf
API-key routes are unchanged.
Closes#37
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>