chadtmiller.com/group-host
atmosphere group host
A group's pictures and who sees its profile, set in the console
MergedThis adds a generic /img/{did}/{cid} route. It serves an image to whoever may read a record that holds it: public repo, listed profile, or a governed space via the console cookie. It also adds Pictures and Who-sees-it sections to the settings page, and shows avatars and banners on the group page and in group lists. The access logic in may_see reads correctly. A switched-off group, ungoverned spaces, non-image MIME types and loose blobs all return 404. The headers are safe: nosniff, a sandboxing CSP, and private caching. updateProfile keeps an image when the key is absent, so uploading one picture does not drop the other. The tests and docs cover the change. I did not run the checks.
One small thing, which does not block approval. In web/src/routes/g/[handle]/settings/+page.server.ts, picture and unpicture use the posted slot as an object key without checking it. A hand-crafted form could post slot=displayName and null or overwrite another profile field. Only a configurer can do this, and the host validates the result, but restricting slot to avatar or banner is a one-line fix.
web/src/routes/g/[handle]/settings/+page.server.tsline 71Outdated
These lines can no longer be read.
slot is used as a profile key as posted. Check it is avatar or banner here and in picture, so a hand-made form can't null or replace displayName or another field.
The only change since my last review is the settings page now opening afresh after saving who sees a group, instead of reloading. That avoids a resubmitted form and looks fine.
My earlier note is still open, and it was never a blocker. picture (line 67) and unpicture (line 71) in +page.server.ts still use the posted slot as a profile key unchecked. A hand-made form from a configurer could null or overwrite displayName or another field. Restricting slot to avatar or banner is a one-line fix.
web/src/routes/g/[handle]/settings/+page.server.tsline 71Outdated
These lines can no longer be read.
slot is still unchecked here and at line 67. Allow only avatar or banner.
What changes
The host serves a group's images, any of them, at
/img/{did}/{cid}, to whoever may see a record that holds the image:listGroupsshows that profile to anyone;Only PNG, JPEG, WebP, GIF and AVIF are served, with
nosniff, a sandboxing CSP, andprivate, immutablecaching, since a CID names its bytes. A group switched off shows none. The lexicon's avatar and banner descriptions now name this URL; the old/img/{did}/avatarthey named was never served here.The console's settings gain two sections:
updateSpace, which also makes or removes the declaration.Avatars and banners show on a group's page and in the lists of groups.
The console passes
/img/on to the host, in its build and invite dev.just devand the e2e world raise the console'sBODY_SIZE_LIMITpast the Node adapter's 512K, andconfig.mdsays a deployment must too, or an upload past it is refused before the host sees it.Host::session_cookieis public, so a test can be signed in to the console as someone, as the host itself signs them in.Why
You asked for avatar upload and a visibility setting in the console; the host had both, but nothing showed them. You also asked that the image route be generic rather than serving only the avatar and banner, so any image a page draws (a photo in a space, say) is served by one rule: who may read a record that holds it.
How it was checked
group_config.rscovers images in a listed profile, in the profile of a hidden group (a member sees them, a stranger and someone not signed in don't), in the public repo, and in a space this host doesn't govern. It also covers a file that is no image, one no record holds, a CID that isn't one, and a group switched off.blobs.rsis at 100% here.listGroupsdrop its name, and shows it again. All 24 flows pass on my machine.Shortcomings
listGroupsstill lists every group on the host, a hidden one by its handle alone. I left that as it is rather than change what the host lists in a console pull./img/actor/..., which this host doesn't serve.🤖 Generated with Claude Code