Commit Graph

182 Commits

Author SHA1 Message Date
Nicolas Meienberger
7ae5f73783 fix: run repo stats in background
Closes #614
2026-03-05 18:57:28 +01:00
Nicolas Meienberger
6f560ecae9 chore: api client gen 2026-03-04 22:00:04 +01:00
Nicolas Meienberger
157be2d6ab feat: custom flags allowlist 2026-03-04 19:42:08 +01:00
Nico
0c20473e30 refactor(sso): extract sso code into it's own module (#617) 2026-03-04 18:48:47 +01:00
Nico
2f253d4999 fix: move active session to an existing org, when deleting (#612)
### TL;DR

Added session cleanup logic to handle active organization reassignment when user organizations are deleted.

### What changed?

Enhanced the `cleanupUserOrganizations` method in `AuthService` to reassign active organizations for users whose current active organization is being deleted. The method now:

- Identifies users who are members of organizations being deleted
- Finds alternative organizations for each affected user
- Updates their sessions to use a fallback organization or null if no alternatives exist
- Wraps the entire operation in a database transaction for consistency

### How to test?

Run the new test suite:
```bash
bun test app/server/modules/auth/__tests__/auth.cleanup-user-organizations.test.ts
```

The test verifies that when a user's organization is deleted, other members' sessions are properly updated to use their remaining organization memberships as the active organization.

### Why make this change?

Prevents orphaned session references when organizations are deleted. Without this change, users could have sessions pointing to non-existent organizations as their active workspace, leading to potential application errors or inconsistent state.

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

## Release Notes

* **Bug Fixes**
  * Improved organization deletion handling. When an organization is deleted, user sessions are now automatically reassigned to a valid fallback organization, ensuring session state consistency and preventing invalid organization references.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-04 18:48:47 +01:00
Nico
a24c6d825e refactor: sso utils (#608) 2026-03-04 18:48:47 +01:00
Nico
235706b230 fix(sso): prevent auto-linking with an existing account in a different org (#607)
* fix(sso): prevent auto-linking with an existing account in a different org

* chore: lint issue

* chore: bump @better-auth/sso
2026-03-04 18:48:47 +01:00
Nicolas Meienberger
5f6409e0a5 test: increase coverage for existing controllers 2026-03-04 18:48:47 +01:00
Nico
c606099104 test: use better-auth built-in test plugin (#599)
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 -->
2026-03-04 18:48:47 +01:00
Nico
c5aacd30e3 feat: separate global admin page (#595) 2026-03-04 18:48:47 +01:00
Nico
12454ee401 fix: restic glob pattern in include (#594)
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 -->
2026-03-04 18:48:47 +01:00
Nico
29db09bb5b feat: OIDC (#564)
* feat: oidc

feat: organization switcher

refactor: org context

feat: invitations

GLM

* feat: link current account

* refactor: own page for sso registration

* feat: per-user account management

* refactor: code style

* refactor: user existing check

* refactor: restrict provider configuration to super admins only

* refactor: cleanup / pr review

* chore: fix lint issues

* chore: pr feedbacks

* test(e2e): automated tests for OIDC

* fix: check url first for sso provider identification

* fix: prevent oidc provider to be named "credential"
2026-03-04 18:48:00 +01:00
bcrooker
ef51d665c8 feat(backups): add custom restic params to backup schedules
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.
2026-02-27 14:46:47 -05:00
Nico
942bf2b31b refactor: tests (#585)
<!-- 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 -->
2026-02-26 19:54:25 +01:00
Nico
4a812a884b refactor(restic): split each command into its own file (#584)
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 -->
2026-02-26 19:51:24 +01:00
Nico
30f237dc1f fix(local-repo): automatically generate a subfolder for new local repos (#582)
Closes #562

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

## Release Notes

* **New Features**
  * Improved repository setup with context-aware descriptions for new vs. existing repositories
  * Enhanced path handling: unique identifiers automatically appended for new repositories, exact paths preserved when importing existing ones

* **Chores**
  * Updated documentation and build configuration

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-26 19:43:42 +01:00
Nicolas Meienberger
b1a0cdb195 chore: gen api-client 2026-02-25 23:19:34 +01:00
Nico
c4f3300e9b fix(backups): correctly resolve paths when folder name matches volume name (#576)
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 -->
2026-02-25 19:09:32 +01:00
Nico
cc55fee339 refactor: increase rclone mount timeout (#575)
Closes #488
2026-02-25 19:06:07 +01:00
Nico
dd9083ce7a fix: wrong cache key for snapshot retention tags (#574)
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

* **Bug Fixes**
  * Enhanced error handling in retention category calculations to gracefully handle missing or invalid repositories, ensuring the system returns safe defaults instead of failing
  * Optimized repository cache validation and lookup mechanisms for improved performance
  * Strengthened repository validation checks to prevent potential calculation failures
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-25 19:02:44 +01:00
Nico
29967d7e4e fix(discord): do not split each line into individual messages (#573)
Closes #519

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **New Features**
  * Notification destinations can now be tested even when disabled, enabling configuration validation before activation

* **Improvements**
  * Discord notification formatting parameters optimized for enhanced message delivery

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-25 18:54:56 +01:00
Nico
cb92d36c95 feat: cache backup progress (#571)
Closes #412
2026-02-25 18:20:08 +01:00
Nico
00e7118771 fix: report timeout as errors (#569)
Closes #485
2026-02-25 18:02:47 +01:00
Nico
74b21d93d6 fix: add DisableTLS param if server is http (#563)
Closes #561
2026-02-23 21:31:53 +01:00
Nico
a0a813ed09 refactor: short id branded type (#552)
* refactor: short id branded type

* chore: pr feedbacks
2026-02-21 11:16:15 +01:00
Nico
45fd9f9de1 feat: repository used space (#551)
* feat: repository used space

refactor: use a smarter cache key logic for easier invalidations

* chore: pr feedbacks
2026-02-21 10:52:55 +01:00
Nico
182d39a887 feat: restore snapshot as tar (#550)
* feat: export snapshot as tar file

chore(mutext): prevent double lock release

* chore: pr feedbacks

* fix: dump single file no tar

* chore: pr feedbacks
2026-02-21 10:19:20 +01:00
Nico
8681ebc0c0 refactor: always use short id in api calls (#545) 2026-02-19 20:08:40 +01:00
Nico
8fcd446926 refactor: snapshot strip out base path (#542)
* refactor: strip out volume path in snapshot list / restore

chore: lint issue

* test: backups new include patterns
2026-02-18 21:45:19 +01:00
Nico
ebfafa4143 fix(repositories): append short id when using the default path for local repos (#536) 2026-02-17 18:28:33 +01:00
Nicolas Meienberger
0bbdbc85ad Reapply "chore(deps): bump drizzle-orm from 1.0.0-beta.9-e89174b to 1.0.0-beta.15-859cf75 (#501)"
This reverts commit db163a1bb5.
2026-02-17 17:52:25 +01:00
Nicolas Meienberger
440916e312 ci: skip e2e temporarily 2026-02-16 23:59:08 +01:00
Nicolas Meienberger
d58329d86e fix: skip migrating imported repos 2026-02-16 23:50:39 +01:00
Nicolas Meienberger
7bcf380198 test: fix impossible test scenarios 2026-02-16 23:20:33 +01:00
Nicolas Meienberger
db163a1bb5 Revert "chore(deps): bump drizzle-orm from 1.0.0-beta.9-e89174b to 1.0.0-beta.15-859cf75 (#501)"
This reverts commit d53b24bfb4.
2026-02-16 22:18:10 +01:00
Nico
99bb296866 fix: cascade delete not correctly applied (#531) 2026-02-16 21:36:07 +01:00
dependabot[bot]
d53b24bfb4 chore(deps): bump drizzle-orm from 1.0.0-beta.9-e89174b to 1.0.0-beta.15-859cf75 (#501)
* chore(deps): bump drizzle-orm

Bumps [drizzle-orm](https://github.com/drizzle-team/drizzle-orm) from 1.0.0-beta.9-e89174b to 1.0.0-beta.15-859cf75.
- [Release notes](https://github.com/drizzle-team/drizzle-orm/releases)
- [Commits](https://github.com/drizzle-team/drizzle-orm/commits)

---
updated-dependencies:
- dependency-name: drizzle-orm
  dependency-version: 1.0.0-beta.15-859cf75
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* refactor: convert async transactions to sync + .run()

* chore: formatting

* chore: add lefthook dep

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nicolas Meienberger <github@thisprops.com>
2026-02-14 14:18:20 +01:00
Nico
bad944a232 feat: restore progress (#281)
* feat: restore progress

* feat: keep restore progress on reload

* refactor: centralize sse event types

* refactor(sse): generic handler factory
2026-02-14 12:35:16 +01:00
Nico
1017f1a38b feat: edit repository form (#507)
* feat: edit repository form

* refactor: local repo path concat as a code migration

* refactor: server constants

* chore: fix lint issue in test file

* refactor: add auth to getServerConstants
2026-02-14 11:49:33 +01:00
Nico
a4fbe3c8df remove proxy pattern in db and auth (#513)
* refactor: add nitro bootstrap plugin to ensure app is started before first call

* refactor(bootstrap): avoid duplicate event firing

* refactor: extract common setup in initModule function

* refactor: remove proxy pattern for db and auth

Since we migrated away from rr this is not needed anymore as the bundler
correctly split chunks
2026-02-13 21:18:40 +01:00
Nico
297e14ebb2 refactor: add nitro bootstrap plugin to ensure app is started before first call (#512)
* refactor: add nitro bootstrap plugin to ensure app is started before first call

* refactor(bootstrap): avoid duplicate event firing
2026-02-13 20:46:10 +01:00
Nico
ec4cf938bc feat: show progress indicator on mirrors (#499)
* feat: show progress indicator on mirrors

refactor: remove unnecessary useEffects

* refactor: pr feedbacks
2026-02-12 22:27:30 +01:00
Nico
7ebce1166b feat: expand snapshot details with additional info (#505)
* feat: extend snapshot details with more info

Closes #385

* refactor: centralize restic backup schemas

* refactor: pr feedbacks
2026-02-12 18:25:21 +01:00
Nico
825d46c934 refactor: react-router -> tanstack start (#498)
* refactor: move to tanstack start

* refactor: auth flow & volumes

* refactor: repo & snapshot details

* refactor: backups, create repo, volumes

* refactor: create volume & restore snapshot

* refactor: notifications

* refactor: settings

* refactor: breadcrumbs

* fix: ts issues

* refactor: prod deployment

* fix: import css production

* refactor: nitro build

* refactor: winston -> consola

* fix: memory leak is sse events cleanup

* fix: cli usage

* chore: remove rr routes file

* refactor: pr feedbacks

* refactor: patch api client to have a global client per call

* refactor: pr feedbacks

* fix(dockerfile): add explicit port

* fix(e2e): healthcheck under /api
2026-02-11 21:41:06 +01:00
Nico
b45d36e06a refactor: make lock errors cleaner and show unlock button (#493)
* refactor: make lock errors cleaner and show unlock button

* chore: pr feedbacks
2026-02-10 20:18:25 +01:00
Nico
cb7988b8ed refactor(retention badges): use restic forget dry run result instead of manual calc (#494)
* refactor(retention badges): use restic forget dry run result instead of manual calc

* chore: PR feedbacks
2026-02-10 20:14:35 +01:00
Nico
12d0eda6ef feat: dev panel (#489)
* feat: dev panel

* chore: fix typing issue
2026-02-09 22:04:21 +01:00
Nicolas Meienberger
2d0ae89727 fix: get volume if short id is only numbers 2026-02-08 16:33:32 +01:00
Nico
09c1cbbb94 feat: show retention tags in snapshots timeline (#462)
* feat: show retention tags in snapshots timeline

* refactor: use button for accesibility
2026-02-08 16:14:43 +01:00
Nico
0e0eaea946 refactor: split backups module + unit tests (#463)
* refactor: split backups module

* test: backup execution

* test: schedule db
2026-02-03 23:00:25 +01:00