Commit Graph

399 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
e8ae8812ff Merge branch 'bcrooker-main' 2026-03-04 19:42:54 +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
fc11432b87 feat: change email by cli (#611)
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **New Features**
  * New CLI command to change user email addresses with impact preview and validation.

* **Accessibility**
  * Improved settings form with proper label-input associations and email field type validation.

<!-- 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
10303b6596 fix(use-mobile): use sync external storage to wait before initial render (#610) 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
4ed554c039 chore: web-haptics 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
Nicolas Meienberger
1724429fb0 refactor: ensure server preloading 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
Nicolas Meienberger
e0eb490636 refactor: add error components at page level 2026-03-04 18:48:47 +01:00
Nicolas Meienberger
d07306cb86 chore: improve ssr data loading 2026-03-04 18:48:47 +01:00
Nico
8691cf8c1f style: improve repo details layout (#596) 2026-03-04 18:48:47 +01:00
Nico
c5aacd30e3 feat: separate global admin page (#595) 2026-03-04 18:48:47 +01:00
Nicolas Meienberger
7881f818ae test: *.xyz include pattern 2026-03-04 18:48:47 +01:00
Nicolas Meienberger
58fee9914b refactor: render repo stats directly in ssr if cache is available 2026-03-04 18:48:47 +01:00
Nicolas Meienberger
70352e9f91 refactor: render cached data directly if available during ssr 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
Nico
4a601d157d refactor(sso): extract sso code into it's own module (#617) 2026-03-04 18:47:24 +01:00
Nico
7dc017f4b6 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:45:01 +01:00
Nico
fb3c5b33c0 feat: change email by cli (#611)
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **New Features**
  * New CLI command to change user email addresses with impact preview and validation.

* **Accessibility**
  * Improved settings form with proper label-input associations and email field type validation.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-03 21:46:47 +01:00
Nico
cb405f1790 refactor: sso utils (#608) 2026-03-03 21:28:39 +01:00
Nico
cdc15ef488 fix(use-mobile): use sync external storage to wait before initial render (#610) 2026-03-03 21:27:22 +01:00
Nico
f511095fde 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-03 20:27:50 +01:00
Nicolas Meienberger
b082afe761 chore: web-haptics 2026-03-03 19:27:43 +01:00
Nicolas Meienberger
1db50e41f9 test: increase coverage for existing controllers 2026-03-02 21:16:48 +01:00
Nicolas Meienberger
5ef2026b61 refactor: ensure server preloading 2026-03-02 21:13:32 +01:00
Nico
2ff6451f37 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-01 15:10:50 +01:00
Nicolas Meienberger
e86fcf1b9a refactor: add error components at page level 2026-02-28 17:05:27 +01:00
Nicolas Meienberger
39469cb08b chore: improve ssr data loading 2026-02-28 16:47:02 +01:00
Nico
67eca589d8 style: improve repo details layout (#596) 2026-02-28 14:16:50 +01:00
Nico
f686c1aa16 feat: separate global admin page (#595) 2026-02-28 12:32:43 +01:00
Nicolas Meienberger
84a088a42e test: *.xyz include pattern 2026-02-28 11:16:04 +01:00
Nicolas Meienberger
73c0511167 refactor: render repo stats directly in ssr if cache is available 2026-02-28 10:17:55 +01:00
Nicolas Meienberger
66076e5841 refactor: render cached data directly if available during ssr 2026-02-28 00:59:05 +01:00
Nico
bba61c2a37 fix: restic glob pattern in include (#594)
Closes #590

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

## Summary by CodeRabbit

* **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-02-28 00:02:00 +01:00
Nico
7a3932f969 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-02-27 23:13:54 +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
b2d2f28b40 style: redesign dashboard (#586)
style: redesign dashboard

style(tables): same height row in all pages
2026-02-26 19:57:39 +01: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
3113af8ce8 fix(repo): add a custom key after creation with the configured hostname (#583)
Closes #456
2026-02-26 19:46:25 +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
Nicolas Meienberger
907bc57c2d fix(restic-dto): allow missing current_files in schema 2026-02-25 23:07:53 +01:00