test: use better-auth built-in test plugin
refactor: map auth errors server side
refactor: native trusted providers callback usage
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
## Release Notes
* **New Features**
* Enhanced SSO authentication error messaging with specific guidance for different failure scenarios (account linking required, email verification needed, banned accounts, invite-only access).
* **Chores**
* Updated authentication dependencies to version 1.5.0.
* **Tests**
* Extended test coverage for SSO error code handling and authentication scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Closes#590
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
* **Tests**
* Enhanced test coverage for backup pattern handling and anchoring
* Added end-to-end scenarios validating include patterns, exclusion patterns, and exclude-if-present functionality
* **Refactor**
* Updated pattern processing logic to improve relative path resolution for backup patterns
* Improved asynchronous handling in backup initialization workflow
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Allows users to pass arbitrary restic flags via a new advanced section in the create/edit schedule form. Includes DB migration, schema update, DTO, service, and restic command changes.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **Tests**
* Improved test infrastructure and organization across backup, repository, volume, and utility modules with streamlined mock setup and cleaner test patterns.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
refactor(restic): split each command into its own file
refactor: add missing await before promise expects
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
## Release Notes
* **Tests**
* Improved async assertion handling across test suites for enhanced test reliability
* Expanded test coverage for backup, restore, and other core operations
* **Refactor**
* Reorganized internal utility structure for improved code maintainability
* **Chores**
* Updated linting configuration and TypeScript dependencies
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
When a selected subfolder had the exact same name as its parent volume
mount, the `path.relative` check falsely identified the subfolder path
as an absolute path already inside the volume. This caused the entire
volume root to be backed up instead of the intended subfolder.
Closes#250
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved handling of backup patterns when folder names match volume names.
* Enhanced error handling for snapshot deletion operations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
* refactor: move migrations to new structure
* refactor: convert all findMany to new structure
* fix(backups-schedule): missing null matching for last backup status
* chore: move root lib to server
* feat(db): add support for multiple users and organizations
* feat: backfill entities with new organization id
* refactor: filter all backend queries to surface only organization specific entities
* refactor: each org has its own restic password
* test: ensure organization is created
* chore: pr feedbacks
* refactor: filter by org id in all places
* refactor: download restic password from stored db password
* refactor(navigation): use volume id in urls instead of name
* feat: disable registrations
* refactor(auth): bubble up auth error to hono
* refactor: use async local storage for cleaner context sharing
* refactor: enable user registration vs disabling it
* test: multi-org isolation
* chore: final cleanup
* 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
* fix: prepend mount path location in exclude patterns
* test(backups): add tests suite for backend include & exclude patterns
* test: fix leaking global module mock
* test: backups service
* refactor: create hono app in a separate file
To avoid side effects like db migration or startup scripts when testing
test(backups): add security tests to the backups controller
* ci: run typechecks, build and tests on PR
* test: controllers security tests
* chore: update lock file
* refactor: pr feedbacks
Ensures schedule reordering requests are valid by checking for duplicate and non-existent IDs.
Improves performance by using a transaction for batch updates.
Adds drag-and-drop functionality to reorder backup schedules
Introduces a sort order field to the database schema and implements API endpoints to update the schedule order.
This allows users to visually prioritize their backup jobs.