Profile pictures: upload + serving, initials fallback, admin kebab with Delete user #758

Merged
Cordy merged 13 commits from feat-757 into main 2026-09-26 00:24:23 +00:00
Owner

Closes #757

  • Server (avatars.go, created by the one-shot): PUT /api/v1/me/avatar decodes JPG/PNG (10 MB cap), center-crops square, re-encodes to a 256px JPEG — EXIF/GPS die at the server. Flat avatars/<user>.jpg beside the runtime state (#138 migrates it); traversal-proof path mapping (RED-tested: sanitised names stay flat inside the dir). GET /api/v1/avatar/{user} authenticated with ETag/304; missing → honest 404. Self + admin (requireAdmin) deletes, 204-idempotent.
  • Web: applyAvatar layers a background image over the untouched #657 initials lines (qa2/qa749 pins intact); on 404 nothing changes. Shows on the avatar button, menu identity block, and shareAvatar chips (guarded typeof call so the lifted-function tests keep executing). Profile gains the OpenCloud-style picture card (centered, Upload/Remove, hint) above Display name.
  • Admin kebab (Nikola's pre-greenlight change): Users → Accounts row actions collapse into ⋮ — local: Reset password / role toggle / Remove picture / Delete user (renamed from "Remove", danger-styled, separated); directory: role (disabled-with-reason when group/config-owned) / Remove picture. All three new destructive confirms use the askDanger fact-row canon.
  • i18n ×4.

Three extra runs, all census-class: my own traversal assertion tested the wrong property (".." substring vs staying-inside-dir), qa693's askDanger census 8→11, qa7's accent-on census 11→12. New ledger rule below.

Closes #757 - **Server (`avatars.go`, created by the one-shot):** `PUT /api/v1/me/avatar` decodes JPG/PNG (10 MB cap), center-crops square, re-encodes to a 256px JPEG — EXIF/GPS die at the server. Flat `avatars/<user>.jpg` beside the runtime state (#138 migrates it); traversal-proof path mapping (RED-tested: sanitised names stay flat inside the dir). `GET /api/v1/avatar/{user}` authenticated with ETag/304; missing → honest 404. Self + admin (`requireAdmin`) deletes, 204-idempotent. - **Web:** `applyAvatar` layers a background image over the untouched #657 initials lines (qa2/qa749 pins intact); on 404 nothing changes. Shows on the avatar button, menu identity block, and `shareAvatar` chips (guarded `typeof` call so the lifted-function tests keep executing). Profile gains the OpenCloud-style picture card (centered, Upload/Remove, hint) above Display name. - **Admin kebab (Nikola's pre-greenlight change):** Users → Accounts row actions collapse into ⋮ — local: Reset password / role toggle / Remove picture / **Delete user** (renamed from "Remove", danger-styled, separated); directory: role (disabled-with-reason when group/config-owned) / Remove picture. All three new destructive confirms use the askDanger fact-row canon. - i18n ×4. Three extra runs, all census-class: my own traversal assertion tested the wrong property (".." substring vs staying-inside-dir), qa693's askDanger census 8→11, qa7's accent-on census 11→12. New ledger rule below.
chore(#757): one-shot — RED gates, splice, verify, commit, self-remove
Some checks failed
fix-757 / fix (push) Failing after 51s
scout-757 / scout (push) Successful in 1s
e3c2235a6d
test(#757): traversal assertion checks the real property — result stays inside Dir (flat .._.. names are safe)
Some checks failed
fix-757 / fix (push) Failing after 14s
scout-757 / scout (push) Successful in 2s
62a46391d1
test(#757): qa693 confirm census 8 → 11 — the three avatar removals join the fact-row canon
Some checks failed
fix-757 / fix (push) Failing after 9s
scout-757 / scout (push) Successful in 1s
025ab160fe
test(#757): qa7 accent-on census 11 → 12 — .avbig initials text joins the accent fills
All checks were successful
fix-757 / fix (push) Successful in 14s
scout-757 / scout (push) Successful in 1s
80ca43d061
PUT /api/v1/me/avatar decodes JPG/PNG (10 MB cap), center-crops square and re-encodes to a 256px JPEG so EXIF/GPS never leave the server; files live in avatars/ beside the runtime state (#138 migrates them). GET /api/v1/avatar/{user} serves any authenticated user with ETag/304; a missing picture is an honest 404 and the frontend keeps the #657 initials rule (applyAvatar layers a background image over the untouched initials lines). Pictures show on the avatar button, the account-menu identity block and shareAvatar chips; the Profile card gains centered picture + Upload/Remove. Admin Users > Accounts rows collapse into a kebab: Reset password / role toggle / Remove picture / Delete user (renamed from Remove, danger-styled) on local rows, role + Remove picture on directory rows; DELETE /api/v1/admin/avatar/{user} is the moderation path. i18n x4.
chore(#757): changelog one-shot for v0.6.281
All checks were successful
chg-757 / chg (push) Successful in 4s
7a0b2c4af2
docs: changelog for v0.6.281 (#757)
All checks were successful
ci / test-and-build (pull_request) Successful in 1m36s
32b279f8db
Cordy merged commit e60ba3d61a into main 2026-09-26 00:24:23 +00:00
Cordy deleted branch feat-757 2026-09-26 00:24:26 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#758
No description provided.