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:
parent
fea876654b
commit
e59fa9c713
15 changed files with 1332 additions and 13 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue