Commit Graph

1 Commits

Author SHA1 Message Date
Claude
6acc8922b1
Phase D: public profiles, without risking the public site
A member fills in a bio, links and a photo, ticks a box, and has a page at
vienalatina.com/su-nombre. Until they tick it there is no page, and an
unpublished profile 404s exactly like a name that was never a member.

The routing was the dangerous part and it is not solved by a list. The
original plan reserved Hugo's paths in the Caddyfile, which is wrong the
first time the site grows one, and the failure is a member's page
silently shadowing part of vienalatina.com. Instead Caddy forwards a
request only when the path is a single segment, is not /comunidad, and
Hugo has built nothing there — `not file` with try_files. The static
site wins every collision because the filesystem answers the question,
so the rule cannot drift. A member called "de" shadows nothing; their
profile is merely unreachable, which is why such names are refused at
sign-up: to protect the member, not the site.

An unknown name 404s from the app and handle_response turns that into
the site's own 404.html, so the public site keeps its error page and the
app never needs a public-facing one. Both directives verified against
Caddy's documentation source, since caddyserver.com is unreachable here.

Links are the injection surface on a public page: anything whose scheme
is not http or https is dropped, which is asserted against javascript:,
data: and vbscript:, including a leading-space variant. They render with
rel="nofollow noopener".

The photo is public, which the existing upload code deliberately is not,
so it gets its own route that serves a file only while a published
profile points at it. Unpublishing takes the picture down with the page,
and a private board image cannot be fetched through it — both tested.

The page does not extend base.html: that is the members-area chrome, and
rendering a public page inside it would put "Área privada" and a Salir
button on something anybody can read. It repeats the brand colours
instead of sharing them, because Hugo fingerprints its stylesheet — a
deliberate duplicate, named as one, with the source of truth in a
comment.

Migration 3 adds the columns. 231 tests.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NizVpJ2dwzCbjCrTLCjeHn
2026-09-29 13:22:43 +00:00