The catch block in `access.can()` constructed `errs.PermissionError`
without `new`. The error constructors in `backend/lib/error.js` are plain
constructor functions that assign to `this` and return nothing, so calling
one without `new` evaluates to `undefined`.
The statement therefore did `throw undefined`, the express error handler
in `backend/app.js` received undefined (and could not read `.status` or
`.public` off it), and the request fell through to the catch-all 404
handler in `backend/routes/main.js`.
Net effect: every authorization failure raised by `access.can(...)` was
reported to clients as `404 Not Found` instead of `403 Forbidden`.
Line 45 of the same file already used `new` correctly, which shows this
was an oversight rather than deliberate resource-existence hiding. A grep
over `backend/` confirms this was the only error constructor invoked
without `new`.
- Use optional chaining for nullable checks
- Replace template literals with string literals for plain SQL
- Add node: protocol to fs/promises import in setup.js
A Stream Host with an IPv6 address as the Forward Host was accepted and
saved but never activated. The generated stream config rendered
`proxy_pass {{ forwarding_host }}:{{ forwarding_port }}` as e.g.
`fe80::528:3c87:e7bb:ab08:25`, which nginx rejects with
"invalid port in upstream" because an IPv6 literal must be wrapped in
square brackets before the port is appended (`[fe80::...]:25`).
Normalize the stream forward host in generateConfig (alongside the existing
per-host-type data massaging) using net.isIPv6(), so IPv6 hosts render as
`[address]:port` while IPv4 addresses and hostnames are emitted unchanged.
The mutation is applied to the deep-copied render object, so persisted and
audit data are unaffected.
Fixes#5740
When creating a Proxy Host, Redirection Host, or 404 Host and requesting
a brand new Let's Encrypt certificate in the same submission, the
ssl_forced/http2_support/hsts_enabled/hsts_subdomains fields the user
enabled on the form were silently discarded and saved as false.
Root cause: certificate_id is deleted from the payload before the
initial insert (since "new" is not a real certificate id yet), so
cleanSslHstsData() sees no certificate_id and zeroes the SSL toggles
under its "no cert means SSL can't be forced" invariant - even though
a certificate is about to be created moments later in the same
request. The follow-up update() call that attaches the freshly
created certificate_id only passed { id, certificate_id }, so the
user's original toggle values were never re-applied.
Fix: skip the premature cleanSslHstsData() zeroing during the initial
insert when a certificate is being created, and forward the originally
submitted ssl_forced/http2_support/hsts_enabled/hsts_subdomains values
in the follow-up update() call, once the real certificate exists to
validate them against.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Adds request logging in debug mode for some endpoints
- Moves certbot version determination to the startup scripts and removes
bash script encapsulation when installing plugins
- Revert loose domain validation, which was there for a specific reason
addressing CVE's
- Fix Cypress suite for cert generation
- Adds Cypress test that iterates over the entire certbot plugins list
and installs each one, ensuring at the very least that the install
works
- Fixed some plugins based on this
- (!) Still some work to do on this, hostinger is still broken at least
- Improved cypress tests for custom certs; they will generate on each
run instead of being baked in. The baked ones were due to expire soon
When an access list was associated with a template which had users (items) but no rules (clients), a `deny all` directive was inserted to the config. This resulted in all requests, including those with valid credentials, being rejected due to the lack of any `allow` directive.
This commit wraps the access rule configuration inside of an if block, so the `deny all;` directive is only present when at least one rule is configured.