Commit graph

59 commits

Author SHA1 Message Date
Alexis Loskoutoff
f1bd157438 Add test for certificate validation with view-only permission 2026-10-13 19:32:53 +02:00
Alexis Loskoutoff
6acf346262 Add test for unauthenticated certificate validation 2026-10-13 18:35:50 +02:00
Jamie Curnow
717877db3f Fix flakey cypress test 2026-10-09 22:35:02 +10:00
Jamie Curnow
2afd723cd8 Fix access list rules and SSL missing from re-rendered host configs
Some paths rendered host configs without fully loading the relations
the templates depend on, silently dropping access rules (and SSL):

- Enabling a proxy host loaded the access list without its clients or
  auth items, so the host came back with no access restrictions.
- Requesting a Let's Encrypt certificate re-rendered every host sharing
  its domains from bare rows, dropping access rules and SSL.

generateConfig now loads any referenced certificate or access list that
isn't fully loaded, so no caller can render a partial config. The two
callers above also fetch the relations themselves, and a warning is
logged when a host's access list is missing or has no rules.

Adds integration tests covering access lists across disable/enable.

Fixes #5919, #4286, #5710

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 22:13:31 +10:00
Amit Yadav
a54b73f153 fix: omit certificate_key from certificate API responses
The private key of custom certificates was returned in meta by GET /api/nginx/certificates and GET /api/nginx/certificates/{id}. Add meta.certificate_key to omissions(), the same way meta.dns_provider_credentials is hidden. The key stays in the database and is still written to /data/custom_ssl on upload.
2026-09-25 20:35:32 +05:30
Jamie Curnow
2cfd3395cf Adds integration tests for per path access lists, fixes ipv6 jsv,
and enforces host-wide access list when location access list is not set
2026-09-24 12:21:49 +10:00
José M. Requena Plens
1ffe3609f4
Invalidate tokens issued before a password change
Tokens are stateless JWTs, so changing a password left every session that
the old one had opened working until its own expiry, up to a day later.
That is the case the password change is meant to close: an administrator
resetting a compromised account did not evict whoever was already in it.

The auth row already records when the password last changed, so no
migration is needed: `Access.init()` reads it alongside the user it
already loads and refuses a token whose `iat` is older. Both sides are
compared as whole seconds, which is all `iat` carries, so a token minted
in the same second as the change is kept. Postgres stores that column to
the microsecond, which is why the comparison is not done in milliseconds.

It is reported as 401 rather than the usual 403 because that is what the
frontend clears the session on, so the browser holding the dead token
lands on the login page instead of a page full of errors, and `can()`
lets that one error through unwrapped for the same reason.

Only the password does this. A user row changing (a rename, an avatar,
permissions) does not, and a user with no password auth row, which is
what a login through an external provider looks like, is not affected.
2026-09-06 19:48:02 +02:00
Jamie Curnow
a62c2a6dc3 Adds support for custom admin port via env var #3808
and documentation
2026-06-10 11:24:53 +10:00
Jamie Curnow
7e9cc32f97 Fix cypress suite
- split out cypress tests for plugins to be isolated
- use updated testca image from proper location
2026-05-27 07:25:24 +10:00
Jamie Curnow
03c70e3902 Fixes for upgraded debian trixie
- 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
2026-05-25 07:37:24 +10:00
Jamie Curnow
c354238c35 Testing mkcert in test suite 2026-05-20 08:05:24 +10:00
Jamie Curnow
dff978a63c Tests: install mkcert before generating 2026-05-20 07:52:46 +10:00
Jamie Curnow
11955e5dff Cypress improvements, move mkcert back to command line 2026-05-19 08:51:52 +10:00
Jamie Curnow
f53bf88f4d Update cypress docker version, generate custom certs each time 2026-05-19 08:04:49 +10:00
Jamie Curnow
15896132ff Update all deps 2026-03-05 06:37:10 +10:00
Jamie Curnow
e8224ff0af Update all dependencies 2026-02-20 11:02:56 +10:00
Jamie Curnow
8ea8286cec More cypress fixes 2026-01-27 14:02:23 +10:00
Jamie Curnow
7ca48f876b Ugh cypress changed their exec result format. 2026-01-27 11:55:54 +10:00
Jamie Curnow
7c3c59c79f Fix cypress logger 2026-01-27 11:41:12 +10:00
Jamie Curnow
ef7f444404 Update docker image to match js version 2026-01-27 11:27:21 +10:00
Jamie Curnow
f509e0bdba Missing export 2026-01-27 11:26:54 +10:00
Jamie Curnow
9b7af474bb Cypress ... 2026-01-27 11:22:16 +10:00
Jamie Curnow
4af0a968f0 Cypress module conversion and updated chalk 2026-01-27 08:45:23 +10:00
Jamie Curnow
316b758455
Tweaks to cypress suite 2025-11-18 07:21:06 +10:00
Jamie Curnow
cf7306e766
Tweaks to showing new version available
- Added frontend translation for english
- Moved frontend api logic to hook and backend api space
- Added swagger schema for the new api endpoint
- Moved backend logic to its own internal file
- Added user agent header to github api check
- Added cypress integration test for version check api
- Added a memory cache item from github check to avoid hitting it too
  much
2025-11-13 11:20:31 +10:00
Jamie Curnow
b9a34ebb7e
Revert to cypress 14, 15 was causing problems with executing external commands 2025-11-03 12:53:23 +10:00
Jamie Curnow
7642d0a000
Cleanup cypress tests 2025-11-03 12:35:58 +10:00
Jamie Curnow
a5d50f9588
Update test deps 2025-11-03 10:52:53 +10:00
Jamie Curnow
906ce8ced2
Swagger/openapi schema mega fixes and Cypress validation/enforcement 2025-10-30 11:50:51 +10:00
Jamie Curnow
18537b9288
404 hosts add update complete, fix certbot renewals
and remove the need for email and agreement on cert requests
2025-10-02 08:12:37 +10:00
Jamie Curnow
fb2708d81d
Fix cypress tests following user wizard changes 2025-10-02 08:12:09 +10:00
Jamie Curnow
8c9d2745e2
Fix remote execution bug where email address can contain malicious code
also convert almost all cmd execs for certificates to properly escape arguments
2025-08-20 10:57:24 +10:00
Jamie Curnow
c97b8a339d
Some auto formatting changes suggested by ide 2025-07-09 11:34:57 +10:00
Jamie Curnow
ec81f2489a
Add cypress test to list streams 2025-06-30 11:10:45 +10:00
Jamie Curnow
5e66d677f1
Adds test for dashboard endpoints 2025-03-24 14:34:45 +10:00
Jamie Curnow
6a60627833
Cypress test for Streams
and updated cypress + packages
2025-02-05 16:02:17 +10:00
Jamie Curnow
b4793d3c16
Adds testssl.sh and mkcert to cypress stack 2025-02-05 08:10:11 +10:00
Jamie Curnow
ca3ee98c68
Postgres Support
- Combines #4086 and #4087 PRs
- Adds authentik in CI stack
2024-12-24 16:48:48 +10:00
Jamie Curnow
edbed1af90
Adds tests for settings endpoints
and reenables dns cert test
and fixes problems with schema
2024-10-17 08:48:47 +10:00
Jamie Curnow
fe2d8895d6
Cypress test for http and dns cert provision 2024-10-16 14:53:57 +10:00
Jamie Curnow
f48e1b46a8
Updated swagger cypress package,
which works with proxies
2024-10-16 08:32:49 +10:00
Jamie Curnow
351ba8dacd
More tests for certificates, fixed schema problems 2024-10-16 08:32:49 +10:00
Jamie Curnow
81b89185f2
Squid ci fixes 2024-10-13 22:15:18 +10:00
Jamie Curnow
b01817bc7f
Adds squid to dev/CI stacks
- for testing forwarded ip address later
2024-10-13 21:54:58 +10:00
Jamie Curnow
c39d5433bc
Fix CVE-2024-46256 and CVE-2024-46257
- Schema validate against bad domain characters
- Integration test for CVE POC examples
- Cypress rewrite of plugins for file upload
2024-10-11 11:31:57 +10:00
Jamie Curnow
4572b205c9
Openapi Schema improvements
- Return proper booleans in api responses
- Update jsonschemavalidation to latest draft
2024-10-10 15:53:11 +10:00
Jamie Curnow
6ac9a82279 Major update to cypress
- Updated cypress
- Ground work for testing DNS certs in CI
2024-05-21 12:53:07 +10:00
Jamie Curnow
9225d5d442
Tweak test 2023-03-30 13:00:22 +10:00
Jamie Curnow
308a7149ed
Tweak test 2023-03-30 12:55:20 +10:00
Jamie Curnow
8a4a7d0caf
Allow 201 as success in test result 2023-03-30 12:51:26 +10:00