feat(hub): let users upload their own avatar

POST/DELETE /v1/account/avatar (session, exact Origin, CSRF) and public
GET /v1/avatars/<id>. Uploads are sniffed, size and dimension limited,
fully decoded, re-encoded to a 256x256 PNG without metadata and stored in
SQLite, one per account. avatar_url in the session points to it, with the
provider avatar as fallback.
This commit is contained in:
Loki 2026-10-24 21:43:44 +02:00
parent fea876654b
commit e59fa9c713
15 changed files with 1332 additions and 13 deletions

View file

@ -23,6 +23,8 @@ uuid = { workspace = true, features = ["serde"] }
sqlx = { version = "0.9", default-features = false, features = ["sqlite", "runtime-tokio", "migrate", "macros"] }
lettre = { version = "0.11.23", default-features = false, features = ["builder", "smtp-transport", "tokio1-rustls", "aws-lc-rs", "webpki-roots"] }
url = "2"
# Avatar re-encoding: only PNG, JPEG and WebP decoders and the PNG encoder; no GIF, SVG or other formats.
image = { version = "0.25.10", default-features = false, features = ["png", "jpeg", "webp"] }
reqwest.workspace = true
sha2.workspace = true