Commit graph

8 commits

Author SHA1 Message Date
Sebastian Almberg
877e3005bc Fix download modal: use per-backup modals for CSP/Turbo compatibility
- Replace shared modal + inline JS with per-backup modals that have
  filename pre-set in hidden fields (no JavaScript needed)
- Add data-turbo="false" to download forms for native browser handling
- Add data-bs-dismiss="modal" to submit button to auto-close modal
- Add hidden username field for Chrome accessibility best practice
- Fix test: GET on POST-only route returns 404 not 405
2026-03-06 08:41:43 +01:00
Sebastian Almberg
dd8698840d Harden backup security: password confirmation, CSRF, env toggle
Address security review feedback from jbtronics:

- Add IS_AUTHENTICATED_FULLY to all sensitive endpoints (create/delete
  backup, delete log, download backup, start update, restore)
- Change backup download from GET to POST with CSRF token
- Require password confirmation before downloading backups (backups
  contain sensitive data like password hashes and secrets)
- Add DISABLE_BACKUP_DOWNLOAD env var (default: disabled) to control
  whether backup downloads are allowed
- Add password confirmation modal with security warning in template
- Add comprehensive tests: auth checks, env var blocking, POST-only
  enforcement, status/progress endpoint auth
2026-03-05 19:06:54 +01:00
Sebastian Almberg
c16b6c7fac Fix CSRF tests: extract tokens from rendered page HTML 2026-03-04 12:18:01 +01:00
Sebastian Almberg
095f3ae776 Fix CSRF tests: initialize session before getting tokens 2026-03-04 11:58:12 +01:00
Sebastian Almberg
61f54d359e Improve test coverage for update manager controller
Add happy-path tests for backup creation, deletion, download,
and log deletion with valid CSRF tokens. Also test the locked
state blocking backup creation.
2026-03-04 11:31:40 +01:00
Sebastian Almberg
b15074ea44 Fix auth test: expect 401 instead of redirect for HTTP Basic auth 2026-03-03 21:09:41 +01:00
Sebastian Almberg
d411f15feb Fix test failures: add locale prefix to URLs, correct log directory path 2026-03-03 21:09:41 +01:00
Sebastian Almberg
f442f45b81 Add tests for backup/update manager improvements
- Controller tests: auth, CSRF validation, 404 for missing backups, restore disabled check
- UpdateExecutor: deleteLog validation, non-existent file, successful deletion
- BackupManager: deleteBackup validation for missing/non-zip files
2026-03-03 21:09:41 +01:00