Commit graph

507 commits

Author SHA1 Message Date
Jakub Trávník
37d04d3b61 fix: normalize names for existence checks 2025-12-31 12:06:16 +01:00
Jakub Trávník
0be65dc9b4 fix: normalize notification destination names before checking for existence 2025-12-30 19:14:49 +00:00
Jakub Trávník
3c7419f401 make the isexisting repo in location check for all repos 2025-12-30 14:33:22 +01:00
Jakub Trávník
60c0778b74 refactor: improve config import logging, add CLI JSON output and idempotent re-runs
- Add `--json` flag for machine-readable JSON output
- Add `--log-level` flag to control logging verbosity
- Add `skipped` counter to ImportResult for idempotent operations
- Change "already exists" conditions from warnings to skipped (info logs)
- Recovery key mismatch now errors and stops import early
- Pre-check volumes and notification destinations before creation
- Attachment functions merge missing items instead of overwriting
- Add toError() and mergeResults() helpers to reduce code duplication
- Extract readConfigJson() and createOutput() for cleaner CLI code
- Move fs/path imports to top level in config-import.ts
2025-12-30 12:39:02 +01:00
Jakub Trávník
16ef4b4861 docs: add host-side environment variable interpolation examples for CI/CD 2025-12-30 10:31:18 +01:00
Jakub Trávník
e9424e3145
Merge branch 'main' into config-import-json 2025-12-29 23:55:42 +01:00
James Brink
eded452c83
feat: parameterize PORT and MIGRATIONS_PATH environment variables (#253)
* feat: parameterize PORT and MIGRATIONS_PATH environment variables

Allow configuring the server port (default: 4096) and migrations
folder path via environment variables for flexible deployment.

* fix: address PR review feedback

- Use consistent schema syntax (string? instead of key?)
- Remove config tests per maintainer request
2025-12-29 20:59:38 +01:00
Jakub Trávník
3c32b3ec0f
Merge branch 'main' into config-import-json 2025-12-29 20:56:42 +01:00
Jakub Trávník
f908883784
Fix error handling in repository existence check 2025-12-29 20:54:30 +01:00
Jakub Trávník
e5d8827fd8
Enhance error logging for repo existence check
Improve error handling in repository existence check.
2025-12-29 20:46:21 +01:00
Jakub Trávník
a71009ff78
Increment warning count on volume mount failure 2025-12-29 20:41:01 +01:00
Nico
90f2c0ac06
fix: boot with tini to correctly reap subprocesses and avoid zombies (#258) 2025-12-29 19:11:08 +01:00
Jakub Trávník
5a4f4641b4 feat: improve config import with result tracking and idempotent repository detection
- Add ImportResult type to track succeeded/warnings/errors counts across all import functions
- Implement multi-layer repository duplicate detection:
  - URL-based check (same path/bucket/endpoint already registered)
  - Restic repo check (path is already a restic repository)
  - Name-based fallback check
- Standardize logging between CLI and env var import methods with logImportSummary()
- CLI exits with code 1 when import has errors
- Remove shortId override for local repo migrations (use full path with isExistingRepository instead)
- Update example JSON and README:
  - Document that local repo path is optional (defaults to /var/lib/zerobyte/repositories)
  - Add existing-local-repo example with isExistingRepository: true
  - Add S3 endpoint field to example
  - Expand config behavior docs to explain all repository skip conditions
- Improve .gitignore to exclude all JSON except example template
2025-12-29 18:34:02 +01:00
Jakub Trávník
e4f66de447 linting and SFTP volume support 2025-12-29 11:16:36 +01:00
Jakub Trávník
5cdec5cdaa Merge remote-tracking branch 'origin/main' into config-import-json 2025-12-29 11:06:06 +01:00
Jakub Trávník
45b5c0d752 feat(cli): add import-config command for manual config import
Add CLI command to import configuration from file or stdin, providing
an alternative to the env-var-based automatic import on startup.

Features:
- `import-config --config <path>` to import from a mounted file
- `import-config --stdin` to import from piped input (no file mount needed)
- `import-config --dry-run` to validate config without importing

Changes:
- Add app/server/cli/commands/import-config.ts with new command
- Register importConfigCommand in CLI index
- Refactor config-import.ts: extract runImport() and add applyConfigImport()
  for direct config object import (used by CLI)
- Update docs with both import methods (env var and CLI examples)
2025-12-29 11:04:12 +01:00
Nico
c05aa8d5bf
feat: add support for SFTP volume backend (#249)
* feat: add support for SFTP volume backend

* feat: allow more secure SFTP connection with known hosts

* refactor: make default value for skip host key check to false

* refactor: use os.userInfo when setting uid/gid in mount commands
2025-12-28 18:30:49 +01:00
Nico
ae5233d9fb
refactor: tag snapshots with schedule short_id instead of db id (#248)
* refactor: tag snapshots with schedule short_id instead of db id

* chore: formatting issues
2025-12-28 11:42:25 +01:00
Nico
54068d5269
feat: allow changing the hostname (restic host) (#240) 2025-12-26 21:02:16 +01:00
Nicolas Meienberger
d5c0f91a9f ci: call checks before building docker image 2025-12-26 19:53:11 +01:00
Nicolas Meienberger
52a6ed6070 refactor: import local repositories use path only and not name
Some checks failed
Release Workflow / determine-release-type (push) Has been cancelled
Release Workflow / build-images (push) Has been cancelled
Release Workflow / publish-release (push) Has been cancelled
2025-12-26 17:29:42 +01:00
Nicolas Meienberger
3ecf006977 refactor(login): extract reset password dialog to its own component 2025-12-26 17:13:26 +01:00
Jakub Trávník
7476897f87 feat(config-import): support mirrors, oneFileSystem, and optional flags
- Add mirrors support for backup schedules (copy to secondary repos)
- Add oneFileSystem flag to prevent crossing filesystem boundaries
- Support autoRemount=false for volumes (defaults to true)
- Support enabled=false for notification destinations (defaults to true)
- Optimize: move early return before dynamic imports in importBackupSchedules
- Update example config and README with new fields documentation
2025-12-23 15:29:27 +01:00
Jakub Trávník
9e9edd73a1 Merge remote-tracking branch 'origin/main' into config-import-json 2025-12-23 13:18:14 +01:00
Nicolas Meienberger
3a54f11b6d Merge branch 'tvarohohlavy-snapshots-table-and-detail-enhancement'
Some checks failed
Release Workflow / determine-release-type (push) Has been cancelled
Release Workflow / build-images (push) Has been cancelled
Release Workflow / publish-release (push) Has been cancelled
2025-12-22 21:19:43 +01:00
Nicolas Meienberger
5cc7450ad0 refactor(snapshot-details): make page load faster by not awaiting restic snapshot details 2025-12-22 21:18:56 +01:00
Nico
00f44e4716 fix: allow arbitrary name for repositories and correctly import existing local repos (#197)
* fix: allow arbitrary name for repositories and correctly import existing local repos

* chore: rebase conflicts
2025-12-22 20:52:26 +01:00
Nico
4e0acb5856 feat(schedule-form): allow custom cron expression (#214)
* feat(schedule-form): allow custom cron expression

* refactor: guard against potential undefined cron expression
2025-12-22 20:51:46 +01:00
Nicolas Meienberger
59e0dc0401 chore: small code style changes 2025-12-22 20:51:46 +01:00
Jakub Trávník
64a584f3cd corrected webdav default path to match placeholder 2025-12-22 20:51:46 +01:00
Jakub Trávník
4dd9b7ffcc fix: add missing path property to webdav and rclone default values 2025-12-22 20:51:46 +01:00
Nico
5f01d6f10d feat: reset password cli command (#220)
* feat: reset password cli command

* refactor: wrap user password reset operations in db transaction
2025-12-22 20:51:46 +01:00
Nico
21b0c5e59c feat: server timeout env (#219)
* feat: increase server idle timeout and allow to modify it via env

* chore(app): move auth middleware to individual controller

To clean up de main app.ts file

* chore: remove console.log
2025-12-22 20:51:46 +01:00
Jakub Trávník
cf9357b4f1 feat: display file size in the File component 2025-12-22 20:51:46 +01:00
Nico
ac9de54a7b
fix: allow arbitrary name for repositories and correctly import existing local repos (#197)
* fix: allow arbitrary name for repositories and correctly import existing local repos

* chore: rebase conflicts
2025-12-22 20:50:53 +01:00
Nico
c6b569bed6
feat(schedule-form): allow custom cron expression (#214)
* feat(schedule-form): allow custom cron expression

* refactor: guard against potential undefined cron expression
2025-12-22 19:50:26 +01:00
Nicolas Meienberger
0b050ae06d Merge branch 'tvarohohlavy-file-tree-file-size' 2025-12-22 19:35:21 +01:00
Nicolas Meienberger
01f247c9a0 chore: small code style changes 2025-12-22 19:35:10 +01:00
Nico
91e76ec902
Merge branch 'main' into file-tree-file-size 2025-12-22 19:33:11 +01:00
Nicolas Meienberger
fb43bcff49 Merge branch 'tvarohohlavy-defualt-path-webdav-rclone' 2025-12-22 19:24:56 +01:00
Nico
6cd46445d2 feat: server timeout env (#219)
* feat: increase server idle timeout and allow to modify it via env

* chore(app): move auth middleware to individual controller

To clean up de main app.ts file

* chore: remove console.log
2025-12-22 19:23:52 +01:00
Nico
c69d2b6445
feat: reset password cli command (#220)
* feat: reset password cli command

* refactor: wrap user password reset operations in db transaction
2025-12-22 19:20:37 +01:00
Jakub Trávník
9c8dafd482 feat: display file size in the File component 2025-12-22 17:57:07 +01:00
Nico
55e27ef0b5
feat: server timeout env (#219)
* feat: increase server idle timeout and allow to modify it via env

* chore(app): move auth middleware to individual controller

To clean up de main app.ts file

* chore: remove console.log
2025-12-22 17:34:27 +01:00
Jakub Trávník
883ee49ded Merge remote-tracking branch 'origin/main' into config-import-json 2025-12-22 16:27:52 +01:00
Jakub Trávník
dccb38c70b corrected webdav default path to match placeholder 2025-12-22 15:39:05 +01:00
Jakub Trávník
ff9cfeda78 fix: add missing path property to webdav and rclone default values 2025-12-22 15:17:05 +01:00
Jakub Trávník
65655ebb56 fix: ensure safe access to backup name and volume in snapshot filtering 2025-12-22 14:35:37 +01:00
Jakub Trávník
9caccc969c
Update app/client/components/snapshots-table.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-22 14:26:39 +01:00
Jakub Trávník
068f9d88b3 feat: display backup schedule and volume information in snapshot details 2025-12-22 14:17:34 +01:00