Commit Graph

269 Commits

Author SHA1 Message Date
Edouard Vanbelle 1ea3826660 feat(jobs): jobs describe themselves — description, mutates, repair_description
The admin panel had no repair toggle wired to anything but a hardcoded
name list naming the two refcount tenants, so `thumb_derived_import` and
`thumb_attached_import` could not be run in repair mode from the UI at
all despite supporting it. And nothing in the job list said what any
given job does or whether clicking Run on production writes anything.

Three defaulted methods on `JobHandler` and `RecoverableJobHandler`:

    fn description(&self) -> &'static str
    fn mutates(&self) -> Mutates          // Never | Always | OnRepairOnly
    fn repair_description(&self) -> Option<&'static str>

`RecoverableAdapter` forwards them — the registry only holds
`dyn JobHandler`, so a tenant's metadata is invisible otherwise, and
falling back to the defaults would report every recoverable job as
read-only, including the ones that delete files.

Three values rather than a boolean because a job can be read-only by
default and destructive under `?repair=true`; a boolean answers wrongly
for one of its two modes, and `false` on something that unlinks files is
the dangerous direction to be wrong in. `repair_description` returning
`Option` collapses "does it repair" and "what does repair do" into one
method: presence gates the toggle, content is the confirmation text —
which the frontend cannot invent, since correcting a counter and
deleting sidecars are not the same warning.

`OnRepairOnly` with no `repair_description` is rejected at registration:
it claims to mutate only under a flag it does not support.

All 17 registered jobs declare all three. The panel now renders the
description under each name, badges read-only jobs, confirms before a
plain run of a mutating one, and offers the repair variant off the
backend flag instead of the name list.

Descriptions are English in the trait, next to the behaviour: one in
`locales/*.json` rots invisibly the moment a job changes, and a
translator cannot know what `manifests_consistency` reconciles. i18n can
layer on later keyed by job name with these as the fallback.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-30 13:41:05 +02:00
Edouard Vanbelle fd103c46e6 feat(manifests-consistency): add safe repair mode 2026-08-23 23:50:39 +02:00
Edouard Vanbelle d57400f7d3 fix(i18n): fix too literal translation with jobs 2026-08-23 13:27:09 +02:00
Edouard Vanbelle 06e4df5318 fix(upload): fix race condition in front-end 2026-08-22 08:09:21 +02:00
Edouard Vanbelle 537e7f15ef fix(users): /api/admin/users always returns a FullUserDto[] 2026-08-22 00:14:37 +02:00
Edouard Vanbelle a8fa281a02 refactor(user): apply chanoges to hurl tests 2026-08-21 23:56:25 +02:00
Edouard Vanbelle c583b26355 refactor(user): apply change on update entries 2026-08-21 23:18:23 +02:00
Edouard Vanbelle 6a11036d96 feat(admin): show active session/users on dashboard 2026-08-21 23:00:49 +02:00
Edouard Vanbelle 117815ef4d feat(user): show if user is online 2026-08-21 19:34:11 +02:00
Edouard Vanbelle ec9b5087f3 refactor(User): apply changes on frontend 2026-08-21 17:10:02 +02:00
Edouard Vanbelle 543a1a88eb feat(admin > users): UI: correct oidc badge 2026-08-20 10:42:09 +02:00
Edouard Vanbelle 2049535516 feat(session): admin UI showing online sessions 2026-08-20 10:42:09 +02:00
Edouard Vanbelle 1a8306f3db feat(login): prevent login form flash on OIDC callback 2026-08-14 13:38:24 +02:00
Edouard Vanbelle 0d5a726ef4 feat(oidc): explicit rejection reason
Show explicitly login rejection (for example when a user does not have a valid
email reported from OIDC but email verification is set)
2026-08-14 13:38:24 +02:00
Edouard Vanbelle 4154019603 feat(ui:delta): add heartbeat on worker 2026-08-14 01:52:53 +02:00
Edouard Vanbelle 24da7443de feat(ui delta upload): user can change oxi.UPLOAD_BATCH_BYTES
```
oxi.UPLOAD_BATCH_BYTES // get current value
oxi.UPLOAD_BATCH_BYTES=1024*1024 // change values
```

values are stored in localstorage, default is 8*1024*1024
2026-08-14 01:52:14 +02:00
Edouard Vanbelle ef465b99de feat(ui:delta upload): warn user if refresh page during upload 2026-08-14 01:52:14 +02:00
Edouard Vanbelle e357caf43b feat(ui): add a logger to change log level and permit better diagnostics
in this case logs are added in the delta upload worker

you can increase verbosity from console via:

```javascript
// Usage:
oxi.setLogLevel('oxi:upload', 'debug')    // deep dive
oxi.setLogLevel('oxi:upload', 'warn')     // quiet
oxi.log.setLevel('debug')                  // everything to debug
```

values are stored in localstorage

example:

```
oxi.setLogLevel('oxi:upload', 'debug');
'oxi:upload → debug'
deltaUpload.ts:120 [f32ce1] delta start {file: 'Revue de presseg.odp', size: 23658927}
deltaUpload.ts:185 [f32ce1] worker: worker start {file: 'Revue de presseg.odp', size: 23658927}
deltaUpload.ts:186 [f32ce1] worker: wasm loaded
deltaUpload.ts:186 [f32ce1] worker: hashed — blake3=150edbc35f3475a0bdeecd15fe5278dda305ce3b27e53e9c40515a69f0b883f3 (76 chunks)
deltaUpload.ts:186 [f32ce1] worker: negotiate: 76 hashes → 76 missing, 0 dedup'd
deltaUpload.ts:186 [f32ce1] worker: chunk PUT: 28 chunks, 8825338 bytes
deltaUpload.ts:186 [f32ce1] worker: chunk PUT: 29 chunks, 8950230 bytes
deltaUpload.ts:186 [f32ce1] worker: chunk PUT: 19 chunks, 5883663 bytes
deltaUpload.ts:186 [f32ce1] worker: ✅ committed — uploaded 23 658 927 B (no dedup, blake3=150edbc35f3475a0bdeecd15fe5278dda305ce3b27e53e9c40515a69f0b883f3)
deltaUpload.ts:185 [f32ce1] worker: commit HTTP 201 {blake3: '150edbc35f3475a0bdeecd15fe5278dda305ce3b27e53e9c40515a69f0b883f3', uploadedBytes: 23658927, reusedBytes: 0, totalBytes: 23658927, attempt: 0}
deltaUpload.ts:213 [f32ce1] delta done {file: 'Revue de presseg.odp', blake3: '150edbc35f3475a0bdeecd15fe5278dda305ce3b27e53e9c40515a69f0b883f3', savedBytes: 0, uploadedBytes: 23658927}
```
2026-08-14 01:52:03 +02:00
Dionisio Pozo b1493e2d0e Merge pull request #671 from EdouardVanbelle/i18n/context-translation 2026-08-13 16:58:42 +02:00
Edouard Vanbelle 27ab392a35 i18n: fix uncontexted strings
For example jobs where translated into "employment" in other language
Remove english text in other languages
2026-08-13 00:30:55 +02:00
Edouard Vanbelle 5a82aa1511 feat(session): UI: improve admin > sessions view 2026-08-11 23:50:43 +02:00
Edouard Vanbelle 2be2928ddc i18n: update all languages 2026-08-09 20:37:09 +02:00
Edouard Vanbelle c61341b890 test(login): fix login logout test 2026-08-09 16:36:42 +02:00
Edouard Vanbelle a7df46f8f8 feat(sessions): show session origin in admin panel + test 2026-08-09 16:36:42 +02:00
Edouard Vanbelle 763ee82028 security(session): do not expose 'sid' from OIDC
prefer exposing origin of the session: passwod, opaque, magic_link, oidc, unknown
2026-08-09 16:36:42 +02:00
Edouard Vanbelle 950c8c0f38 feat(dpop): provide nonce on immediate login
provide the DPoP nonce via cookie on login, this reduce the amount of API call
and prevent having any first call returning in 401
2026-08-09 16:36:42 +02:00
Edouard Vanbelle 2eb1e8a1d5 feat(logout): improve logout flow 2026-08-09 16:36:19 +02:00
Edouard Vanbelle 321f3ad733 i18n(session): add missing translations 2026-08-09 14:04:42 +02:00
Edouard Vanbelle bbef8afb7b fix(logout): reduce unwanted API call during logout
- stop trying to refresh session
- display "successfully signed out" rather "your session is expired"
2026-08-09 13:51:35 +02:00
Edouard Vanbelle 69c57e1e24 feat(dpop): client now aware if session if bound
this prevent client to try binding and creating
- unnecessary call
- unnecessary warning in server log
2026-08-09 12:05:56 +02:00
Edouard Vanbelle 107dbfc731 fix(login): fix race in autofocus 2026-08-09 11:46:53 +02:00
Edouard Vanbelle 69c342f2ed refactor(dpop): apply typescript prettier 2026-08-09 11:46:53 +02:00
Edouard Vanbelle 62475193ff feat(admin): improve admin panel
normalise admin > users, sessions, drives
2026-08-09 10:41:34 +02:00
Edouard Vanbelle 10d831b204 feat(session): ensure dpop even with OIDC 2026-08-09 10:41:34 +02:00
Edouard Vanbelle bee856fbd0 feat(session): handle sessions for admin 2026-08-09 10:41:34 +02:00
Edouard Vanbelle 93eb67f99b feat(dpop): add service worker to sign requests
this will permit GET to resources and then to remove directly signing requests
2026-08-09 04:18:20 +02:00
Edouard Vanbelle 7529914e32 feat(dpop): test XHR request + test session refresh 2026-08-09 02:25:43 +02:00
Edouard Vanbelle 97a56899df refactor(dpop): apply prettier 2026-08-09 02:09:31 +02:00
Edouard Vanbelle 15da1a50bd fix(dpop): fix issue with sveltekit and playwright
await page.waitForLoadState('networkidle') is the key before starting
2026-08-09 01:56:08 +02:00
Edouard Vanbelle a7653339b1 fix(dpop): sign XmlHttpReq + refresh 2026-08-09 01:56:08 +02:00
Edouard Vanbelle 8222dbbd47 chore(dpop): propagate X-Forwarded-* in vite dev mode 2026-08-09 01:56:08 +02:00
Edouard Vanbelle 8d6e03a4bb feat(DPoP): check requests and 401 on failure 2026-08-09 01:56:07 +02:00
Edouard Vanbelle ed99b08e62 feat(DPoP): UI: bcast events to support multi tab
add also playwright test with the multi tab
2026-08-09 01:56:07 +02:00
Edouard Vanbelle 4c2b244166 feat(DPoP): add logout 2026-08-09 01:56:07 +02:00
Edouard Vanbelle 514bbc35ab feat(DPoP): add nonce on client side 2026-08-09 01:56:07 +02:00
Edouard Vanbelle 8b79e26329 feat(DPoP): bing ceremony on login 2026-08-09 01:56:07 +02:00
Edouard Vanbelle fed265c70f feat(DPoP): add frontend dpop library 2026-08-09 01:56:07 +02:00
Edouard Vanbelle 4c34b25a7b feat(oidc): support of +alias email (clean it up to reconciliate) 2026-08-08 22:21:55 +02:00
Edouard Vanbelle f33d54703c fix(oidc): fix race on logout 2026-08-08 21:19:21 +02:00
Edouard Vanbelle 9d80bddb5f feat(oidc): apply i18n 2026-08-08 20:49:09 +02:00