feat: owner review 2 phase 3: Library on the web panel, photo trash and web upload (#11)
CI / Build and test (push) Successful in 7m25s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 10s
CI / PostgreSQL 16 integration (push) Successful in 5m20s
CI / PostgreSQL 17 integration (push) Successful in 5m22s
CI / Docker image (push) Successful in 50s
Release / Build, test and publish (push) Successful in 12m1s
Release / Server image (push) Successful in 1m26s
CI / Build and test (push) Successful in 7m25s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 10s
CI / PostgreSQL 16 integration (push) Successful in 5m20s
CI / PostgreSQL 17 integration (push) Successful in 5m22s
CI / Docker image (push) Successful in 50s
Release / Build, test and publish (push) Successful in 12m1s
Release / Server image (push) Successful in 1m26s
- Web panel Library: browse, view, delete sequences and photos, mass operations (analyse, proxies, thumbnails, verify, retag, delete, CSV). It never edits the video. - Photo trash with tombstones (migration 0008): crash-safe delete and restore, hash-checked restore with reasons, and emptying only by an explicit fingerprinted job. Sync and uploads keep deleted photos deleted; an explicit "Upload again" brings one back. - Upload from the web panel: in-house SHA-256 in a worker with a fail-closed self-test, capture time from EXIF, chunked, resumable; no folders. - Desktop trash dialog with photo entries and Empty. - Admin files are revalidated (no-cache + ETag). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #11.
This commit is contained in:
1 parent
af9eeaab9b
commit
9aa818ed47
283 files changed
+24922
-293
No files matched your search
+278
-19
@@ -306,7 +306,9 @@ Primary entities (identical concepts in SQLite and PostgreSQL; ids are UUIDv7 st
|
||||
width, height, fps, duration, bytes, created, produced by (client id / server / node).
|
||||
- **Job** — id, kind (scan, rebuild, verify, light-analyse, deep-analyse, proxies,
|
||||
thumbs, render, import, upload-commit, maintenance; backup, cleanup, and the read-only
|
||||
duplicates and orphans reports), target ids, state (queued, running, paused, done, failed,
|
||||
duplicates and orphans reports; empty-trash, stored as 18, which erases exactly the trash
|
||||
entries of a confirmed plan, erases nothing when the trash changed since, and is never
|
||||
scheduled: amended 2026-10-26, R6), target ids, state (queued, running, paused, done, failed,
|
||||
cancelled), progress (done/total, fps, eta), log tail, created by, node id, attempts,
|
||||
error, schedule id (the schedule that queued it; amended 2026-10-26, R10).
|
||||
- **Schedule** (amended 2026-10-26, R10) — id, system key (set, and unique, on a host's
|
||||
@@ -318,6 +320,11 @@ Primary entities (identical concepts in SQLite and PostgreSQL; ids are UUIDv7 st
|
||||
jobs, enabled, next run (none while disabled), last run, last job id, last outcome
|
||||
(queued, skipped-pending, skipped-offline, skipped-nothing, unavailable,
|
||||
failed:<reason>), created by, created, updated.
|
||||
- **FrameRemoval** (amended 2026-10-26, R6) — the tombstone of a photo removed from a
|
||||
sequence: sequence id, sha256, replacement sha256 (the converted file that replaced it,
|
||||
R7), reason (deleted, replaced), removed at. Written from the sidecar's `removed` list (§7)
|
||||
at every index sync, so a rebuild keeps it, leaving out content a frame of the sequence
|
||||
holds again; it goes with its sequence row and outlives the trash entry.
|
||||
- **MediaCard** (client) — id, volume serial, filesystem label, capacity, nickname, camera
|
||||
identity (Make/Model/BodySerial from first file), profile JSON, first/last seen, import
|
||||
history (job ids).
|
||||
@@ -334,7 +341,9 @@ Primary entities (identical concepts in SQLite and PostgreSQL; ids are UUIDv7 st
|
||||
|
||||
Indexes: `frame(sequence_id, index)`, `frame(sha256)`, `frame(captured_at)`,
|
||||
`sequence(archive_id, first_capture)`, `sequence(camera_model)`, tags, jobs by state and by
|
||||
schedule, `schedules(enabled, next_run)` (amended 2026-10-26, R10).
|
||||
schedule, `schedules(enabled, next_run)` (amended 2026-10-26, R10),
|
||||
`frame_removals(sequence_id, sha256)` (the key) and `frame_removals(sha256)` (migration 0008;
|
||||
amended 2026-10-26, R6).
|
||||
Paging everywhere (keyset pagination on `(first_capture, id)`).
|
||||
|
||||
---
|
||||
@@ -411,7 +420,8 @@ The archive is the source of truth; the database is an index that can be rebuilt
|
||||
├── .chronos/
|
||||
│ ├── archive.json { id, name, schemaVersion, created, layoutTemplates, proxyPolicy }
|
||||
│ ├── index-snapshot.bin optional accelerator for rebuild (all sidecars concatenated + hash); ignored if stale
|
||||
│ └── locks/ lease files for concurrent writers (server + client on same share)
|
||||
│ ├── locks/ lease files for concurrent writers (server + client on same share)
|
||||
│ └── trash/ deleted sequences and photos, kept until Empty (below; amended 2026-10-26, R6)
|
||||
├── 2026/
|
||||
│ └── 2026-09-28 Canon EOS R5 - Harbour sunset/ folder = expanded FolderTemplate
|
||||
│ ├── originals/ IMG_0001.CR2 … names = expanded FileTemplate
|
||||
@@ -421,13 +431,48 @@ The archive is the source of truth; the database is an index that can be rebuilt
|
||||
│ ├── sequence.json sidecar manifest (below)
|
||||
│ ├── analysis.json full deep-analysis report
|
||||
│ ├── project.json render settings (the "project")
|
||||
│ └── thumbs.pack packed thumbnails (one file per sequence, indexed; avoids 100k tiny files on SMB)
|
||||
│ ├── thumbs.pack packed thumbnails (one file per sequence, indexed; avoids 100k tiny files on SMB)
|
||||
│ └── *.pending.json journals of an ingest, a photo deletion or a restore a crash interrupted (below)
|
||||
```
|
||||
|
||||
`sequence.json` (canonical, versioned, written atomically):
|
||||
`{ id, title, camera, lens, frames: [{ i, file, size, sha256, capturedAt, exposure, fNumber,
|
||||
iso, focal, bias, wb, orientation, w, h, format, previewOffset, previewLength, flags }],
|
||||
tags, rating, notes, status, versions, createdBy, updatedAt }`.
|
||||
iso, focal, bias, wb, orientation, w, h, format, previewOffset, previewLength, flags, source? }],
|
||||
tags, rating, notes, status, versions, createdBy, updatedAt, removed? }`. Amended 2026-10-26,
|
||||
R6: `removed: [{ sha256, replacement?, reason: Deleted | Replaced, at }]` holds the tombstones
|
||||
of the photos removed from the sequence (§5 FrameRemoval), left out when there are none;
|
||||
`frames[].source: { sha256, format, file, size }` names the file a converted frame was made
|
||||
from, reserved for R7 (read and written, nothing acts on it yet). A build that does not know
|
||||
either field keeps it and writes it back unchanged.
|
||||
|
||||
Trash (amended 2026-10-26, R6). Nothing in it is erased except by *Empty* (§12.5, §14.8):
|
||||
- `trash/<id>[-<time>[-n]]/` with `<name>.json` beside it: a deleted sequence folder, whole
|
||||
(originals, proxies, exports, sidecars), and its record (the index row, renders and
|
||||
tombstones the sidecar may lack).
|
||||
- `trash/photos/<id>-<time>[-n]/originals/…` with `<name>.json` beside it: photos deleted
|
||||
from sequence `<id>`, each original with its XMP companion when no photo that stays shares
|
||||
it, and the record: each photo's frame record, each file's former place, size and SHA-256,
|
||||
the sequence's title and folder, who deleted them, when, and the kind (photos, or replaced
|
||||
for originals a conversion replaced, R7). A photo never hashed is hashed as it goes; one
|
||||
whose original was already missing goes with its record alone.
|
||||
- `trash/.erasing/`: entries moved aside by Empty before they are deleted, so a listing never
|
||||
sees half an entry; leftovers are deleted by the next Empty.
|
||||
- In a sequence's `.chronos/`, `remove.pending.json` is written before a photo deletion's
|
||||
first move and `restore.pending.json` before a restore's; until the sidecar is written the
|
||||
entry's record is `<name>.json.pending`, which the trash never lists, restores or empties.
|
||||
The next writer of the sequence (any `ReadLocked`, a scan, a sequence delete) undoes a
|
||||
deletion the sidecar does not show yet (files back, record and folder gone) and completes
|
||||
one it shows, and settles an interrupted restore under the entry's lease (files back into
|
||||
the entry, or the record without the photos the sidecar lists again). A restore into a new
|
||||
sequence stages each original in `<entry>/.restoring/` (never the archive's staging) and
|
||||
puts it back on any failure.
|
||||
|
||||
Deleting photos writes the sidecar without them (frames version + 1) and with a tombstone of
|
||||
each SHA-256 no photo that stays holds, and clears what covered the frames (light and deep
|
||||
analysis, thumbnails, proxies), which follow as jobs; proxies are renamed and `thumbs.pack`
|
||||
is re-keyed so the frames that stay keep theirs (while a thumbnail pass holds the pack, that
|
||||
pass draws them again). Filing a photo into the sequence again (an import, a restore, an
|
||||
explicit upload again, §14.4) drops its tombstone; emptying the trash does not.
|
||||
|
||||
Rules: originals are immutable (never rewritten; edits are settings); every write of a
|
||||
sidecar goes to a temp file, `fsync`, rename; the folder name is derived from templates at
|
||||
@@ -754,6 +799,12 @@ player smoke test on Windows CI.
|
||||
Upload, Download, Delete, Export list as CSV).
|
||||
- Filters are chips; saved views (e.g. "Night, 4K, not rendered"); search is instant
|
||||
(indexed columns); everything virtualized (in-house `VirtualizingWrapPanel`).
|
||||
- Photos deleted from a sequence (amended 2026-10-26, R6; on the admin panel, §14.8, or by
|
||||
another program sharing the archive) leave it at its next index sync: its count follows,
|
||||
a cover whose photo went is cleared, the project's positions on those photos (exclusions,
|
||||
hero, keyframes) wait as pending frames until a restore brings the photos back, and the
|
||||
others follow their photos without a settings edit. *Delete…* still moves whole sequences
|
||||
into the archive's trash, which lists photo entries too (§12.5).
|
||||
|
||||
### 12.3 Edit (amended 2026-10-16, R7; formerly "Sequence editor")
|
||||
|
||||
@@ -870,6 +921,23 @@ is a Job (resumable, cancellable, logged). Recurring scans, integrity checks, th
|
||||
proxies, analyses, maintenance, backups, clean-ups and reports are schedules in Jobs ›
|
||||
Scheduled (§12.6, §14.6); the buttons here run them once (amended 2026-10-26, R10).
|
||||
|
||||
Maintenance › *Trash…* (amended 2026-10-26, R6) lists the archive's trash (§7), newest
|
||||
first: deleted sequences and photos deleted from sequences, each with its kind, photos,
|
||||
size, folder and when it went, and *Restore*. A sequence goes back as its folder is (into
|
||||
its old place, or "folder (2)" when that is taken; its photos are not re-hashed, Verify does
|
||||
that). Photos are re-hashed against their record and go back into their sequence with their
|
||||
frame records (a name taken since gets `_2`, its companion following), or into a new
|
||||
sequence when theirs is gone, every entry of that sequence joining the same new one. A photo
|
||||
that stays in the trash says why (its files no longer match their record, they could not be
|
||||
moved back, the sequence holds that content already, or its file was missing when it was
|
||||
deleted): one sentence on the dialog's line, or how many stayed when the reasons differ, and
|
||||
the tooltip with each reason and the first names. When no file of an entry matches, nothing
|
||||
moves and the line says so. *Empty…* measures every entry (dry run), lists them, asks for the
|
||||
number of entries to be typed, then queues the *Empty trash* job. The job erases exactly
|
||||
those entries and nothing when the trash changed since; an entry that changes while it runs
|
||||
is kept, and the job then fails after erasing the others. It is the only way the product
|
||||
erases trash entries; no schedule runs it (§14.6).
|
||||
|
||||
### 12.6 Jobs
|
||||
|
||||
Two tabs, a *Queue | Scheduled* segmented control first in the toolbar (amended 2026-10-26,
|
||||
@@ -1036,22 +1104,26 @@ Advanced, §12.8).
|
||||
```
|
||||
POST /api/v1/auth/login {username,password,clientName} → {token,user,mustChangePassword}
|
||||
POST /api/v1/auth/logout · POST /auth/password · GET /auth/me
|
||||
GET /api/v1/server/info name, version, apiVersion, capabilities, tlsFingerprint, formats, limits
|
||||
GET /api/v1/server/info name, version, apiVersion, capabilities, tlsFingerprint, formats, limits, extensions
|
||||
GET /health
|
||||
|
||||
GET /api/v1/users · POST · GET/PATCH/DELETE /users/{id} · POST /users/{id}/reset-password (admin)
|
||||
|
||||
GET /api/v1/sequences?year&camera&status&tag&q&cursor&limit
|
||||
GET /api/v1/sequences?year&camera&status&rendered&tag&q&cursor&limit
|
||||
GET /api/v1/sequences/facets years, camera models (with their label) and tags of the archive, each with its count
|
||||
POST /api/v1/sequences create (title, camera hint) → id
|
||||
GET /api/v1/sequences/{id} · PATCH (title, tags, rating, settings) · DELETE
|
||||
GET /api/v1/sequences/{id}/manifest frames with hashes/sizes/versions (sync)
|
||||
GET /api/v1/sequences/{id}/manifest frames with hashes/sizes/versions, tombstones (sync)
|
||||
GET /api/v1/sequences/{id}/analysis · GET /stats · GET /renders
|
||||
GET /api/v1/sequences/{id}/frames?cursor&limit
|
||||
GET /api/v1/sequences/{id}/thumb the hero frame's thumbnail, else the first frame's (ETag, 304)
|
||||
POST /api/v1/sequences/{id}/frames/delete {frameIds, expectedFramesVersion, dryRun} → {photos, bytes, framesVersion, frameCount, trashEntry}
|
||||
POST /api/v1/sequences/bulk/delete {ids, dryRun} · /bulk/retag {ids, add, remove} · /bulk/jobs {ids, kind} → an item per id
|
||||
GET /api/v1/frames/{id}/original · /proxy · /thumb (streamed, Range supported)
|
||||
|
||||
POST /api/v1/uploads {sequenceId|null, fileName, size, sha256, capturedAt?} → {uploadId, chunkSize, received[]} | 200 {alreadyExists}
|
||||
POST /api/v1/uploads {sequenceId|null, fileName, size, sha256, capturedAt?, sessionKey?, restore?} → {uploadId, chunkSize, received[]} | 200 {alreadyExists, frameId?}
|
||||
PUT /api/v1/uploads/{id}/chunks/{n} body bytes (idempotent) → {received}
|
||||
POST /api/v1/uploads/{id}/complete → frame id (server verifies sha256, commits into layout, updates manifest)
|
||||
POST /api/v1/uploads/{id}/complete[?restore=true] → frame id (server verifies sha256, commits into layout, updates manifest)
|
||||
GET /api/v1/uploads/{id} resume state
|
||||
DELETE /api/v1/uploads/{id}
|
||||
|
||||
@@ -1063,9 +1135,66 @@ WS /api/v1/events {type: jobProgress|jobState|sequenceCh
|
||||
POST /api/v1/nodes/register · POST /nodes/{id}/heartbeat · POST /nodes/{id}/claim → job · POST /nodes/{id}/jobs/{jobId}/result (chunked upload of output)
|
||||
|
||||
GET/PUT /api/v1/archive/settings · POST /archive/scan · /rebuild · /verify · GET /archive/stats · POST /archive/maintenance (admin)
|
||||
GET /api/v1/archive/trash · POST /archive/trash/{name}/restore · POST /archive/trash/empty {names?, dryRun, fingerprint} (admin)
|
||||
GET /api/v1/i18n/{culture} strings for the web admin
|
||||
```
|
||||
|
||||
Library and trash (amended 2026-10-26, R6):
|
||||
- `frames/delete` needs the Delete permission and the sequence's owner or an admin, like
|
||||
deleting the sequence. It takes 1–100,000 ids, under a body limit of its own (100,000 × 48
|
||||
bytes + 4 KiB, about 4.8 MB; other JSON bodies stay at 1 MiB); a dry run answers the
|
||||
photos, bytes and the frames version now, a deletion the frames version after it (the next
|
||||
request's `expectedFramesVersion`), the frame count and the trash entry's name. Errors: 400
|
||||
`bad_request` (`frameIds`); 404 `not_found` (`sequence`); 409 `frames_conflict` (the frames
|
||||
changed since `expectedFramesVersion`, or an id is not the sequence's; details: the frames
|
||||
version now), `sequence_busy` (a job works on it, as for deleting it), `would_empty` (every
|
||||
photo would go: delete the sequence), `photo_unreadable` (a photo never hashed whose
|
||||
original is on disk but cannot be read, so it could leave no tombstone; details: how many,
|
||||
the message naming the first), `sidecar_mismatch`, `folder_in_use`; 413 `too_large`; 503
|
||||
`archive_offline`. Audited `frames_deleted`; publishes `sequenceChanged` `frames`.
|
||||
- The bulk routes take 1–1,000 distinct ids and answer `{items, ok, skipped, dryRun, photos,
|
||||
bytes, job}`, one item per id in the request's order: `ok`, or `skipped` with the reason's
|
||||
code and sentence. *delete* (Delete) moves each sequence as `DELETE /sequences/{id}` does,
|
||||
whole or not at all, and skips `not_found`, `forbidden` (another user's, unless an admin),
|
||||
`sequence_busy`, `archive_root`, `contains_sequences`, `sidecar_mismatch`, `folder_missing`,
|
||||
`archive_offline`, `folder_in_use`. *retag* (Edit) is the PATCH tag edit (trimmed, at most
|
||||
64 characters, at most 50 a sequence, case-insensitive, up to 3 attempts on a settings
|
||||
conflict) and skips `not_found`, `bad_request`, `settings_conflict`. *jobs* (Edit; kind
|
||||
`analyse`, `deep`, `proxies`, `thumbnails` or `verify`) queues one job at user priority over
|
||||
the sequences found (202; 200 when none), a verify targeting their archive with the
|
||||
sequences in its parameters, as `POST /jobs` with `verify` now does too; 400
|
||||
`invalid_job_kind`, 409 `job_unavailable`. 400 `bad_request` (`ids`, `tags`).
|
||||
- `GET /archive/trash` (ManageArchive, like the rest of the trash) answers the entries newest
|
||||
first, `{name, kind: sequence|photos|replaced, sequenceId, title, folder, photos, files,
|
||||
bytes, deletedBy, deletedAt}`, and their total bytes. A name is
|
||||
`<32 hex>[-<14 digits>[-n]]` (a sequence) or `photos-<32 hex>-<14 digits>[-n]` (photos),
|
||||
checked against that shape and never a path.
|
||||
- Restore answers `{name, kind, sequenceId, photos, kept, newSequence, keptReasons,
|
||||
message}`: the photos that stayed and, in the same order, why (`mismatch`, `not_moved`,
|
||||
`in_sequence`, `no_file`), with one sentence per reason in the request's language. Errors:
|
||||
404 `not_found` (`trash_entry`); 409 `sequence_in_library`, `sequence_busy`,
|
||||
`sidecar_mismatch` (the sidecar of the sequence the photos return to is damaged or
|
||||
another's), `folder_in_use`; 422 `trash_mismatch` (no file matches its record any more, or a
|
||||
deleted sequence's own sidecar no longer names it); 503 `archive_offline`. Audited
|
||||
`trash_restored`; publishes `sequenceChanged` `created` (a sequence, or a new one) or
|
||||
`frames`.
|
||||
- Empty: a dry run answers the entries measured on disk, their photos, files and bytes, the
|
||||
plan's `fingerprint` and the names asked for that the trash does not hold (`unknown`); the
|
||||
erase sends the fingerprint back and answers 202 with the `empty-trash` job. Errors: 400
|
||||
`bad_request` (`names`, `fingerprint`); 409 `trash_changed` (details: the fingerprint now),
|
||||
`job_unavailable`; 503 `archive_offline` (offline, and for the erase also read-only; the
|
||||
listing answers it too, offline). The request is audited `trash_empty_requested`; what the
|
||||
job erased is in its log.
|
||||
- The manifest gains `removed: [{sha256, replacement, reason: deleted|replaced, at}]` (null
|
||||
when there are none; covered by its ETag, since a deletion moves the frames version).
|
||||
|
||||
Uploads (amended 2026-10-26, R3, R6): `server/info` lists `extensions`, the photo file
|
||||
extensions the archive files (lower case, no dot), which the admin panel's dialog keeps to. A
|
||||
frame upload whose file name starts with `.` is 400 `invalid_file_name`. A start whose
|
||||
SHA-256 the target sequence tombstoned (and none of its frames holds) answers 200
|
||||
`alreadyExists` without a `frameId`, unless `restore` is true; the completion checks again
|
||||
unless `?restore=true` and answers 409 `photo_removed`, the upload cancelled (§14.4).
|
||||
|
||||
Schedules (amended 2026-10-26, R10; ManageArchive, every change audited): `PUT` and
|
||||
`PATCH` change the fields given; an invalid field is 400 `invalid_schedule` with the field
|
||||
as details (`name`, `recurrence`, `parameters.percent`…); a system schedule is never
|
||||
@@ -1096,6 +1225,53 @@ answers 507 with the upload still receiving, so the client completes it again on
|
||||
room; render uploads and render-node results are checked the same way at completion, and a
|
||||
volume that cannot be measured refuses nothing (amended 2026-10-26, R2).
|
||||
|
||||
Deleted photos (amended 2026-10-26, R6): a photo deleted from a sequence is not filed into it
|
||||
again by an upload. `POST /uploads` answers a SHA-256 the target sequence tombstoned, and none
|
||||
of its frames still holds, with `alreadyExists` and no frame id, so an old client syncing a
|
||||
copy that still has it, or a watch folder sending it again, neither sends it nor counts a
|
||||
failure. `complete` checks again once the upload stops receiving, and the ingest checks the
|
||||
sidecar's tombstones a third time under the sequence's lease, which a deletion takes: a photo
|
||||
deleted while its bytes were on the way is not filed, its upload is cancelled and the answer
|
||||
is 409 `photo_removed` (the protocol client reports it as not sent). Only an explicit user
|
||||
action brings such a photo back by upload: `restore: true` on the start and `?restore=true`
|
||||
on the completion, sent by the admin panel's *Upload again* alone (never by sync, the
|
||||
Uploader or a card import); it is then filed into its own sequence whatever other sequences
|
||||
hold, and filing it drops the tombstone, also after the trash was emptied. A frame upload
|
||||
whose file name starts with `.` (the AppleDouble `._` files a Mac leaves on cards, hidden
|
||||
files) is refused for every client (400 `invalid_file_name`), as the archive scanner leaves
|
||||
such files out.
|
||||
|
||||
The admin panel uploads through the same path (amended 2026-10-26, R3; the dialog, §14.8):
|
||||
- It hashes each photo in the browser with an in-house incremental SHA-256 (FIPS 180-4,
|
||||
`sha256.js`) in a same-origin module worker (`hash-worker.js`, under the panel's
|
||||
`script-src 'self'`) that reads the file in 8 MiB blocks. Before its first hash the worker
|
||||
runs the FIPS 180-4 known answers (the empty message, "abc", the 448- and 896-bit messages,
|
||||
one million "a"), whole and fed in uneven pieces, and, where `crypto.subtle` exists,
|
||||
compares a 1 MiB random buffer with it; on any mismatch it refuses every hash and the
|
||||
dialog uploads nothing (fail closed). The server verifies every upload again.
|
||||
- Each start carries the photo's capture time: the Exif DateTimeOriginal of a JPEG or a
|
||||
TIFF-based file (TIFF, DNG, most RAW formats) read from its first 256 KiB, else the file's
|
||||
modification time as local wall time without an offset; the ingest uses it only for a
|
||||
photo that records no time of its own (a PNG, an export stripped of Exif).
|
||||
- At most two photos and two chunks per photo travel at once (four requests, half the
|
||||
server's eight per account). A call that got no answer, 429 or 503 is retried after 1, 2
|
||||
and 4 s; a completion refused with 409 `upload_state` (another completion is filing that
|
||||
upload) is read again after 1, 2, 4 and then every 8 s, about a minute in all. Two copies
|
||||
of one photo in a run go one after the other, so the second finds the first.
|
||||
- `alreadyExists` with a frame is *Already there*; without one, *Deleted before*, whose row
|
||||
offers *Upload again* between runs (the `restore` above). A quota or permission refusal
|
||||
(401, 403), no space (507), the target sequence gone (404 `sequence`) or a failed self-test
|
||||
stops the remaining photos (*Not sent*) with the server's message. A new target sequence is
|
||||
created once (`POST /sequences`, never retried) and stays the dialog's target.
|
||||
- Cancel aborts, stops the worker and deletes the uploads the run started and did not
|
||||
complete; a photo that failed otherwise keeps its upload receiving, so the next run resumes
|
||||
it, and abandoned uploads expire after the upload retention. While photos are sent, leaving
|
||||
the page asks first and Esc is held, so only Cancel stops the run.
|
||||
- Only files whose extension `server/info` lists, not empty, not starting with `.` and no
|
||||
larger than `limits.maxUploadBytes` are taken. Folders dropped on the dialog are counted
|
||||
(*Folders skipped*) and left out, and it has no folder picker: importing a whole folder
|
||||
stays a desktop feature (R9).
|
||||
|
||||
### 14.5 Sync
|
||||
|
||||
Manifest diff per sequence: originals are content-addressed (never conflict); settings and
|
||||
@@ -1105,6 +1281,22 @@ are uploaded on request. "Edit with proxies, render where the originals are": a
|
||||
open a remote sequence with proxies only and submit a render job to the server, which runs
|
||||
it itself (managed formats) or hands it to a render node.
|
||||
|
||||
Removed photos (amended 2026-10-26, R6). A photo deleted on one side leaves a tombstone there
|
||||
(sidecar `removed`, index `frame_removals`, manifest `removed`), and sync never offers it back:
|
||||
no upload of a photo the server deleted, no download of one this PC deleted; sync never
|
||||
deletes local files either way. A tombstone leaves a photo out only while its own side holds
|
||||
no matching photo (by hash, or by size and capture time while unhashed), so a duplicate that
|
||||
stays or a file put back by hand still syncs. A photo replaced by a converted file (R7)
|
||||
counts as its replacement on both sides, an alias followed up to 8 steps, for the
|
||||
comparison, the transfers and the frame positions. Content known only once hashed is checked
|
||||
then: a download skips an unhashed server frame this PC deleted (or holds as its
|
||||
replacement), and an upload skips an unhashed local frame the server deleted and then runs
|
||||
the archive verify, so the index gets the hashes and the next comparison leaves it out.
|
||||
Known limitations: until the server verifies such a frame, the sync table still counts it as
|
||||
missing here and *Download* fetches and drops it each time; a photo never hashed whose
|
||||
original was already missing when it was deleted leaves no tombstone, so a copy elsewhere
|
||||
(another PC, a card) is not known to be deleted and can come back.
|
||||
|
||||
### 14.6 Job engine
|
||||
|
||||
Persistent queue in the DB; jobs run one at a time, and the parallelism (configurable,
|
||||
@@ -1209,19 +1401,22 @@ available and says so in the job log.
|
||||
┌─────────────┬────────────────────────────────────────────────────────────────────────────┐
|
||||
│ Chronos │ Dashboard │
|
||||
│ ● Dashboard │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
|
||||
│ Users │ │ 9.4 TB │ │ 412 seq │ │ 3 jobs │ │ 2 nodes │ │
|
||||
│ Archive │ │ of 16 TB │ │ 618k pho │ │ running │ │ online │ │
|
||||
│ Jobs │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
|
||||
│ Logs │ Storage by year ▁▂▃▅▇█ Uploads last 30 days ▂▁▃▆▇▅▂ │
|
||||
│ │ Recent: alberto uploaded 1,020 frames · node "studio-pc" rendered 4K HEVC │
|
||||
│ Library │ │ 9.4 TB │ │ 412 seq │ │ 3 jobs │ │ 2 nodes │ │
|
||||
│ Users │ │ of 16 TB │ │ 618k pho │ │ running │ │ online │ │
|
||||
│ Archive │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
|
||||
│ Jobs │ Storage by year ▁▂▃▅▇█ Uploads last 30 days ▂▁▃▆▇▅▂ │
|
||||
│ Logs │ Recent: alberto uploaded 1,020 frames · node "studio-pc" rendered 4K HEVC │
|
||||
│ │ │
|
||||
│ Settings │ │
|
||||
│ (A) admin ⏻ │ │
|
||||
└─────────────┴────────────────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
Pages: Login · Dashboard · Users (table; create/edit/disable/reset/roles/quota) · Archive
|
||||
(path, templates, proxy policy, scan/rebuild/verify, stats) · Jobs (two tabs in the header,
|
||||
amended 2026-10-26, R10: *Queue*, the queue/history/nodes with cancel/retry, where
|
||||
Pages: Login · Dashboard · Library (amended 2026-10-26, R6; below) · Users (table;
|
||||
create/edit/disable/reset/roles/quota) · Archive (path, templates, proxy policy,
|
||||
scan/rebuild/verify, stats, and *Trash*, which opens the Library's trash view; R6) · Jobs
|
||||
(two tabs in the header, amended 2026-10-26, R10: *Queue*, the queue/history/nodes with
|
||||
cancel/retry, where
|
||||
`#/jobs?job=<id>` opens a job's log and a job a schedule queued carries a *Scheduled* pill
|
||||
linking to it; *Scheduled* (`#/jobs?tab=schedules`), every schedule of the server, its
|
||||
system schedules first and marked System, with when it runs (in the panel's language), its
|
||||
@@ -1249,6 +1444,68 @@ desktop rail, the choice kept in the browser and the links' tooltips then naming
|
||||
on narrow screens it stays the top bar, Settings at its end (amended 2026-10-16, R1;
|
||||
2026-10-26, R4). Settings has the desktop's gear icon (§12.1).
|
||||
|
||||
Library (amended 2026-10-26, R6), the second page of the sidebar. The panel manages the
|
||||
library and never edits a video: it has no project settings and no render. It browses,
|
||||
views and deletes sequences and photos, restores them from the archive's trash and runs mass
|
||||
operations; it queues no deep analysis (the API's `bulk/jobs` takes `deep`).
|
||||
- `#/library` lists the sequences as cards (DESIGN §4: 16:9 cover, count badge, status
|
||||
glyphs, check box) or a list, the choice kept in the browser; search over title, camera
|
||||
and tag; Year, Camera, Status and Tag filters whose menus come from
|
||||
`GET /sequences/facets`, each value with its count (a camera named as on the desktop, the
|
||||
brand once), Status offering analysed or not, proxies or none, rendered or not, verified or not,
|
||||
warnings and errors; sort newest, oldest, title, most photos, largest; *Load more* by
|
||||
cursor. The filters live in the address, so Back from a sequence finds them again. A cover
|
||||
is the sequence's thumbnail at an address that changes with its cover and its frames
|
||||
version, cached an hour.
|
||||
- Selection by check box, Shift range or the keyboard (one tab stop for the grid, arrows,
|
||||
Space, Shift+Space, Enter opens, Ctrl+A, Esc), and *Select all N* of the filter. The
|
||||
selection's bar: *Analyse*, *Proxies*, *Thumbnails* and *Verify* (one job per 1,000
|
||||
sequences, the toast saying how many were queued), *Tags…* (add and remove), *Export CSV*
|
||||
(title, camera, photos, bytes, first and last capture, tags; built in the browser, a cell
|
||||
a spreadsheet would run as a formula starting with an apostrophe) and *Delete…* (a dry
|
||||
run, then a dialog listing the sequences that cannot go with why, then those that go, at
|
||||
most 500 names; no typed confirmation, since the trash keeps them). Bulk requests are sent
|
||||
in chunks of 1,000.
|
||||
- `#/library?id=<sequence>`: title (edited in place), tags, rating and notes, saved with the
|
||||
same conflict-checked PATCH as the desktop; its facts; its photos in pages of 500 with lazy
|
||||
thumbnails; a photo viewer (the proxy, else the thumbnail; ← and →, Esc; time, exposure,
|
||||
aperture, ISO, focal length, size in pixels and bytes, format, flags, SHA-256); *Set
|
||||
cover*; *Download* the original; *Delete…* of the selected photos (a dry run, then a
|
||||
confirmation that asks for their number to be typed when more than 20 go, the sequence's
|
||||
frames version sent so a changed sequence refuses); *Delete…* of the sequence; its
|
||||
renders, to download; *Add photos* (the upload dialog, R3).
|
||||
- `#/library?view=trash`, also opened from Archive: the trash's entries (kind, sequence,
|
||||
photos, size, deleted by and when), each with *Restore*, whose answer says which photos
|
||||
stayed and why; *Empty…* measures the trash (dry run), lists what goes, asks for the word
|
||||
"empty" in the panel's language (any case), sends back the plan's fingerprint and follows
|
||||
the empty-trash job to its end, reading it again after a reconnect of the events or when
|
||||
it ended before the request answered.
|
||||
- The pages follow `sequenceChanged` and `jobState`: the list reads every loaded row again
|
||||
(1,000 a request) with its filters; a sequence reads itself and its renders again after a
|
||||
job ends (at most every 1.5 s), redraws only what changed, keeps the keyboard focus, and
|
||||
asks again for thumbnails not built yet (from 2 s up to 60 s apart, at most 8 times).
|
||||
`jobState` carries no kind or target, so a page reacts to any job that ends.
|
||||
- The audit log and the Dashboard name photo deletions, trash restores and emptyings asked
|
||||
for.
|
||||
|
||||
Upload (amended 2026-10-26, R3): Library › *Upload* (no sequence) and a sequence's *Add
|
||||
photos* open the upload dialog (§14.4), a module the pages import only on demand.
|
||||
- Target: the given sequence, or a choice between an existing sequence (a search box, then a
|
||||
list) and a new one (title optional), fixed once the first run starts.
|
||||
- Photos: the file picker (several files, the photo extensions only) or a drop on the dialog.
|
||||
Folders, files that are not photos (hidden dot files among them) and files above the size
|
||||
limit are counted in chips and left out.
|
||||
- Each photo shows its state: waiting, hashing %, starting, uploading %, verifying, uploaded,
|
||||
already there, deleted before (with *Upload again*), failed (the reason in the tooltip),
|
||||
cancelled, not sent; a total bar shows photos and bytes.
|
||||
- Buttons: *Upload*, which sends whatever is not on the server yet; *Cancel* while sending;
|
||||
*Close* otherwise. Esc closes only while nothing is being sent.
|
||||
|
||||
The panel's files (amended 2026-10-26, R6) are served with `Cache-Control: no-cache` and an
|
||||
ETag of their content: the browser asks again before each use and an unchanged file costs a
|
||||
304 (`If-None-Match` lists, weak `W/` tags and `*` count), so after an upgrade it never runs
|
||||
new modules next to old cached ones.
|
||||
|
||||
Storage (Dashboard and Archive) shows the space volume: the folder `CHRONOS_SPACE_PATH`
|
||||
names (§14.9) when it can be measured, else the archive's own volume. When a space path is
|
||||
in use and the archive's own volume (the write volume, where uploads land; on Unraid the
|
||||
@@ -1731,6 +1988,8 @@ questions asked and the answers; DECISIONS rows give the reasons.
|
||||
| 2026-10-26 | Owner review 2, R9 | §12.4, §13 | Import › Folder… can group the folder as *Whole folder*: one sequence per file format whatever the cameras and pauses, titled after the folder, with a session key per PC, folder and format so a repeated import adds to the same sequence; desktop only. |
|
||||
| 2026-10-26 | Owner review 2, R10 | §5, §6.2, §7, §12.5, §12.6, §12.8, §14.3, §14.6, §14.8, §14.9, §19.6 | Scheduled jobs: a Schedule entity (migration 0007, `jobs.schedule_id`) with an in-house recurrence form, a scheduler per host that claims runs by compare-and-set, with catch-up and DST rules; every timer that queued work is a visible system schedule (server: archive scan, upload clean-up every 6 h, index backup at 03:00, job history and audit log clean-ups; desktop: archive scan, daily index backup, housekeeping with cache trim), seeded once and kept as the user edits it; new Backup and Cleanup job kinds and duplicates/orphans report jobs; Jobs has Queue and Scheduled tabs on the desktop and the admin panel; `/api/v1/schedules` and the `scheduleChanged` event; one backup retention; the audit retention is the audit clean-up schedule's; Settings › Archive › Rescan every and the admin Settings' job history are gone; the trash is only reported, never emptied. |
|
||||
| 2026-10-26 | Owner review 2, R11 | §12.8, §14.1, §14.3, §14.8, §14.9, §19.6 | Log settings: file and console levels apart on the server (`CHRONOS_LOG_LEVEL` locks both, `CHRONOS_LOG_CONSOLE_LEVEL` the console), retention, a file size limit with numbered parts, a total size limit, daily or hourly rotation, audit retention and the diagnostics share, in the admin panel's Settings › Logs (applied at once, `lockedBy` naming the variable) and the desktop's Settings › Advanced (from the first log line); the server's files take Debug and Trace when asked; logging never fails a job. |
|
||||
| 2026-10-26 | Owner review 2, R6 | §5, §7, §12.2, §12.5, §14.3, §14.4, §14.5, §14.8 | The admin panel manages, never edits: a Library page (filters from facets, cards or list, keyboard selection, mass Analyse, Proxies, Thumbnails, Verify, Tags, Export CSV and Delete), a sequence's page with a photo viewer, cover, downloads and photo deletion, and the trash view with Restore and Empty; photos deleted into `trash/photos` under journals, a photo never hashed hashed as it goes, tombstones in the sidecar (`removed`) and the index (`frame_removals`, migration 0008) that keep sync and uploads from bringing a deleted photo back unless the user restores it or uploads it again on purpose; trash kinds, restore reasons, and Empty as the `empty-trash` job behind a dry run, a typed confirmation and a fingerprint, never scheduled; the library, trash and bulk endpoints; the panel's files revalidated (`no-cache`, ETag). |
|
||||
| 2026-10-26 | Owner review 2, R3 | §14.3, §14.4, §14.8 | Upload from the admin panel into an existing or a new sequence (file picker, drag and drop, no folders), hashed in the browser by a self-tested in-house SHA-256 in a module worker, the capture time read from Exif, sent in resumable chunks through the upload API and verified by the server; `server/info` lists the photo extensions; hidden dot files are refused for every client. |
|
||||
|
||||
## Appendix A — `CLAUDE.md` content (create verbatim in Phase 0, keep updated)
|
||||
|
||||
|
||||
Reference in new issue
Block a user