Merge the zip and video upload work into master

80a2a94 · Gabriel Morell · 2026-09-14 03:00

39 files +1438 -134
Message
{commit_body(@commit)}

Files changed

modified .gitignore
+3 −0
@@ -1,5 +1,8 @@
1 1 /target
2 2
3 +# In-flight upload spools — transient, never part of the archive.
4 +/storage/tmp/
5 +
3 6 # Android release signing material. The APK signing key cannot be
4 7 # rotated — Android checks its certificate on every update — so a
5 8 # commit of one is not recoverable by deleting it later. Keep it in
modified Cargo.lock
+51 −0
@@ -1338,6 +1338,7 @@ dependencies = [
1338 1338 "tracing",
1339 1339 "tracing-subscriber",
1340 1340 "uuid",
1341 + "zip",
1341 1342 ]
1342 1343
1343 1344 [[package]]
@@ -1528,6 +1529,7 @@ checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c"
1528 1529 dependencies = [
1529 1530 "crc32fast",
1530 1531 "miniz_oxide",
1532 + "zlib-rs",
1531 1533 ]
1532 1534
1533 1535 [[package]]
@@ -4373,6 +4375,16 @@ version = "1.3.0"
4373 4375 source = "registry+https://github.com/rust-lang/crates.io-index"
4374 4376 checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
4375 4377
4378 +[[package]]
4379 +name = "signal-hook-registry"
4380 +version = "1.4.8"
4381 +source = "registry+https://github.com/rust-lang/crates.io-index"
4382 +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b"
4383 +dependencies = [
4384 + "errno",
4385 + "libc",
4386 +]
4387 +
4376 4388 [[package]]
4377 4389 name = "signature"
4378 4390 version = "2.2.0"
@@ -4885,6 +4897,7 @@ dependencies = [
4885 4897 "libc",
4886 4898 "mio",
4887 4899 "pin-project-lite",
4900 + "signal-hook-registry",
4888 4901 "slab",
4889 4902 "socket2 0.6.0",
4890 4903 "tokio-macros",
@@ -5090,6 +5103,12 @@ version = "0.2.5"
5090 5103 source = "registry+https://github.com/rust-lang/crates.io-index"
5091 5104 checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
5092 5105
5106 +[[package]]
5107 +name = "typed-path"
5108 +version = "0.12.3"
5109 +source = "registry+https://github.com/rust-lang/crates.io-index"
5110 +checksum = "8e28f89b80c87b8fb0cf04ab448d5dd0dd0ade2f8891bae878de66a75a28600e"
5111 +
5093 5112 [[package]]
5094 5113 name = "typeid"
5095 5114 version = "1.0.3"
@@ -5880,6 +5899,38 @@ dependencies = [
5880 5899 "syn 2.0.106",
5881 5900 ]
5882 5901
5902 +[[package]]
5903 +name = "zip"
5904 +version = "8.6.0"
5905 +source = "registry+https://github.com/rust-lang/crates.io-index"
5906 +checksum = "2d04a6b5381502aa6087c94c669499eb1602eb9c5e8198e534de571f7154809b"
5907 +dependencies = [
5908 + "crc32fast",
5909 + "flate2",
5910 + "indexmap",
5911 + "memchr",
5912 + "typed-path",
5913 + "zopfli",
5914 +]
5915 +
5916 +[[package]]
5917 +name = "zlib-rs"
5918 +version = "0.6.7"
5919 +source = "registry+https://github.com/rust-lang/crates.io-index"
5920 +checksum = "34b31d188d9d685a4f9c7b46d6e36631b07058d2cfe190267adce54dc230bf12"
5921 +
5922 +[[package]]
5923 +name = "zopfli"
5924 +version = "0.8.3"
5925 +source = "registry+https://github.com/rust-lang/crates.io-index"
5926 +checksum = "f05cd8797d63865425ff89b5c4a48804f35ba0ce8d125800027ad6017d2b5249"
5927 +dependencies = [
5928 + "bumpalo",
5929 + "crc32fast",
5930 + "log",
5931 + "simd-adler32",
5932 +]
5933 +
5883 5934 [[package]]
5884 5935 name = "zune-core"
5885 5936 version = "0.5.1"
modified Cargo.toml
+4 −1
@@ -19,7 +19,7 @@ path = "src/lib.rs"
19 19 [dependencies]
20 20 axum = { version = "0.8.5", features = ["multipart"] }
21 21 log = "0.4.28"
22 −tokio = "1.47.1"
22 +tokio = { version = "1.47.1", features = ["rt-multi-thread", "macros", "sync", "process", "time"] }
23 23 tower-http = { version = "0.6.6", features = ["fs", "trace"] }
24 24 tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
25 25 anyhow = "1.0.100"
@@ -62,6 +62,9 @@ rten = "0.21"
62 62 rten-imageproc = "0.21"
63 63 qrcode = { version = "0.14", default-features = false, features = ["svg"] }
64 64 reqwest = { version = "0.12", default-features = false, features = ["json", "multipart", "rustls-tls"] }
65 +# Zip ingest. Only the codecs real-world image archives use — "stored" is
66 +# always available, deflate covers everything Finder/Explorer produce.
67 +zip = { version = "8", default-features = false, features = ["deflate"] }
65 68
66 69 [build-dependencies]
67 70 minijinja-embed = "2.12"
modified Dockerfile
+4 −1
@@ -77,8 +77,11 @@ RUN curl -fL --retry 3 -o text-detection.rten https://ocrs-models.s3-accelerat
77 77 # Stage 4 — runtime: minimal Debian slim with the binaries + assets + templates.
78 78 # ---------------------------------------------------------------------------
79 79 FROM debian:bookworm-slim AS runtime
80 +# ffmpeg is here for the `poster` worker, which lifts a still frame out of a
81 +# video so the image-only categorizers have something to read. It is the
82 +# heaviest thing in this layer; drop it only if video uploads go away.
80 83 RUN apt-get update \
81 − && apt-get install -y --no-install-recommends ca-certificates libssl3 \
84 + && apt-get install -y --no-install-recommends ca-certificates libssl3 ffmpeg \
82 85 && rm -rf /var/lib/apt/lists/* \
83 86 && groupadd --system --gid 10001 dms \
84 87 && useradd --system --uid 10001 --gid dms --home /app --shell /usr/sbin/nologin dms \
modified Justfile
+1 −1
@@ -44,7 +44,7 @@ migrate:
44 44 serve:
45 45 cargo run --bin webservice
46 46
47 −# Run a categorizer worker. Usage: just worker thumbnail | ocr | describe | extract_tags
47 +# Run a categorizer worker. Usage: just worker poster | thumbnail | ocr | describe | extract_tags
48 48 worker kind:
49 49 cargo run --bin queue-worker -- --kind {{kind}}
50 50
modified README.md
+89 −2

Click to load diff…

modified assets/f/js/src.js
+49 −0

Click to load diff…

modified compose.yml
+13 −0

Click to load diff…

modified src/bin/queue-worker.rs
+3 −2

Click to load diff…

modified src/bin/webservice.rs
+11 −0

Click to load diff…

modified src/config.rs
+21 −0

Click to load diff…

modified src/handlers/failed.rs
+1 −7

Click to load diff…

modified src/handlers/mod.rs
+4 −2

Click to load diff…

modified src/handlers/uploads.rs
+819 −82

Click to load diff…

modified src/queue/messages.rs
+60 −0

Click to load diff…

modified src/queue/mod.rs
+3 −8

Click to load diff…

modified src/queue/publisher.rs
+1 −8

Click to load diff…

modified src/storage/local.rs
+15 −10

Click to load diff…

modified src/storage/mod.rs
+29 −1

Click to load diff…

modified src/telemetry.rs
+1 −1

Click to load diff…

modified src/workers/describe.rs
+11 −3

Click to load diff…

modified src/workers/mod.rs
+22 −1

Click to load diff…

modified src/workers/ocr.rs
+1 −1

Click to load diff…

added src/workers/poster.rs
+171 −0

Click to load diff…

modified src/workers/thumbnail.rs
+20 −2

Click to load diff…

modified templates/search.html
+6 −0

Click to load diff…

modified templates/uploads/list.html
+18 −1

Click to load diff…

modified templates/uploads/show.html
+7 −0

Click to load diff…

Parents: ad5582c 1df1ebf