Part-DB-server/translations
Sebastian Almberg 0d58262e19
Add manual backup creation and delete buttons to Update Manager (#1255)
* Add manual backup creation and delete buttons to Update Manager

- Add "Create Backup" button in the backups tab for on-demand backups
- Add delete buttons (trash icons) for update logs and backups
- New controller routes with CSRF protection and permission checks
- Use data-turbo-confirm for CSP-safe confirmation dialogs
- Add deleteLog() method to UpdateExecutor with filename validation

* Add Docker backup support: download button, SQLite restore fix, decouple from auto-update

- Decouple backup creation/restore UI from can_auto_update so Docker
  and other non-git installations can use backup features
- Add backup download endpoint for saving backups externally
- Fix SQLite restore to use configured DATABASE_URL path instead of
  hardcoded var/app.db (affects Docker and custom SQLite paths)
- Show Docker-specific warning about var/backups/ not being persisted
- Pass is_docker flag to template via InstallationTypeDetector

* 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

* Fix test failures: add locale prefix to URLs, correct log directory path

* Fix auth test: expect 401 instead of redirect for HTTP Basic auth

* 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.

* Fix CSRF tests: initialize session before getting tokens

* Fix CSRF tests: extract tokens from rendered page HTML

* 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

* 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

* Fixed translation keys

* Fixed text justification in download modal

* Hardenened security of deleteLogEndpoint

* Show whether backup, restores and updates are allowed or disabled by sysadmin on update manager

* Added documentation for update manager related env variables

---------

Co-authored-by: Jan Böhmer <mail@jan-boehmer.de>
2026-03-07 19:31:00 +01:00
..
.gitignore Initial commit 2019-02-23 16:49:38 +01:00
frontend.cs.xlf New Crowdin updates (#1227) 2026-02-07 19:14:35 +01:00
frontend.da.xlf New Crowdin updates (#1228) 2026-02-15 22:24:00 +01:00
frontend.de.xlf New Crowdin updates (#1228) 2026-02-15 22:24:00 +01:00
frontend.el.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
frontend.en.xlf New Crowdin updates (#1228) 2026-02-15 22:24:00 +01:00
frontend.es.xlf New Crowdin updates (#1227) 2026-02-07 19:14:35 +01:00
frontend.fr.xlf New Crowdin updates (#1227) 2026-02-07 19:14:35 +01:00
frontend.hu.xlf New Crowdin updates (#1228) 2026-02-15 22:24:00 +01:00
frontend.it.xlf New Crowdin updates (#1227) 2026-02-07 19:14:35 +01:00
frontend.ja.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
frontend.nl.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
frontend.pl.xlf New Crowdin updates (#1227) 2026-02-07 19:14:35 +01:00
frontend.ru.xlf New Crowdin updates (#1227) 2026-02-07 19:14:35 +01:00
frontend.uk.xlf New Crowdin updates (#1228) 2026-02-15 22:24:00 +01:00
frontend.zh.xlf New Crowdin updates (#1228) 2026-02-15 22:24:00 +01:00
messages.cs.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
messages.da.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
messages.de.xlf New Crowdin updates (#1265) 2026-03-01 23:21:02 +01:00
messages.el.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
messages.en.xlf Add manual backup creation and delete buttons to Update Manager (#1255) 2026-03-07 19:31:00 +01:00
messages.es.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
messages.fr.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
messages.hu.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
messages.it.xlf New Crowdin updates (#1265) 2026-03-01 23:21:02 +01:00
messages.ja.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
messages.nl.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
messages.pl.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
messages.ru.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
messages.zh.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
SchebTwoFactorBundle+intl-icu.de.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
SchebTwoFactorBundle+intl-icu.en.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
SchebTwoFactorBundle.de.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
SchebTwoFactorBundle.en.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
security.cs.xlf New Crowdin updates (#1227) 2026-02-07 19:14:35 +01:00
security.da.xlf New Crowdin updates (#1228) 2026-02-15 22:24:00 +01:00
security.de.xlf New Crowdin updates (#1228) 2026-02-15 22:24:00 +01:00
security.el.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
security.en.xlf New Crowdin updates (#1228) 2026-02-15 22:24:00 +01:00
security.es.xlf New Crowdin updates (#1227) 2026-02-07 19:14:35 +01:00
security.fr.xlf New Crowdin updates (#1227) 2026-02-07 19:14:35 +01:00
security.hr.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
security.hu.xlf New Crowdin updates (#1228) 2026-02-15 22:24:00 +01:00
security.it.xlf New Crowdin updates (#1227) 2026-02-07 19:14:35 +01:00
security.ja.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
security.nl.xlf New Crowdin updates (#1228) 2026-02-15 22:24:00 +01:00
security.pl.xlf New Crowdin updates (#1227) 2026-02-07 19:14:35 +01:00
security.ru.xlf New Crowdin updates (#1227) 2026-02-07 19:14:35 +01:00
security.uk.xlf New Crowdin updates (#1228) 2026-02-15 22:24:00 +01:00
security.vi.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
security.zh.xlf New Crowdin updates (#1228) 2026-02-15 22:24:00 +01:00
validators.cs.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
validators.da.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
validators.de.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
validators.el.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
validators.en.xlf New Crowdin updates (#1228) 2026-02-15 22:24:00 +01:00
validators.fr.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
validators.hr.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
validators.hu.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
validators.it.xlf New Crowdin updates (#1265) 2026-03-01 23:21:02 +01:00
validators.ja.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
validators.nl.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
validators.pl.xlf New Crowdin updates (#1228) 2026-02-15 22:24:00 +01:00
validators.ru.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
validators.uk.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00
validators.zh.xlf Remove outdated file source and path notes from translation files (#1225) 2026-02-07 18:33:31 +01:00