feat: add per-user avatar seed regeneration with irreversible random avatar replacement

Implement a new `avatar_seed` column on the users table that overrides the username-based seed for Multiavatar generation. Introduce a null-safe `avatar_seed(user)` choke point in `avatar.py` that resolves `user.get("avatar_seed") or user.get("username")`, registered as a Jinja global so every render site (`_avatar_link.html`, `avatar_url(...)` calls, SEO `og_image`, issues ad-hoc dicts, devRant payload/PNG) propagates a regenerated seed. Add `POST /profile/{username}/regenerate-avatar` endpoint (owner-or-admin only) that writes a fresh `generate_uid()` to `avatar_seed`, invalidates the target's user cache, and audits `profile.avatar.regenerate`. The previous seed is overwritten and never stored, making regeneration irreversible. Document the feature in `AGENTS.md` and `README.md`, add the API endpoint to `docs_api.py`, and include the `regenerate_avatar` Devii tool in `CONFIRM_REQUIRED`.
This commit is contained in:
2026-06-27 22:31:34 +00:00
parent e773067106
commit 6f340a6818
60 changed files with 1626 additions and 97 deletions
+24
View File
@@ -501,3 +501,27 @@
.game-perks {
margin-top: var(--space-xl);
}
.game-legacy {
margin-top: var(--space-xl);
}
.game-legacy-note {
color: var(--text-muted);
font-size: 0.85rem;
margin: 0 0 var(--space-md);
}
.legacy-card {
border-color: #f5c518;
}
.game-plot-golden {
border-color: #f5c518;
box-shadow: 0 0 0 1px #f5c518 inset, 0 0 12px rgba(245, 197, 24, 0.4);
}
.plot-steal-locked {
color: var(--warning);
font-family: var(--font-mono);
}
+5
View File
@@ -28,6 +28,11 @@
margin: 0 auto;
}
.avatar-regen-btn {
display: block;
margin: 0.5rem auto 0;
}
.profile-name {
font-size: 1.25rem;
font-weight: 700;