Skip to content

Add four public pages built to survive being shared - #78

Merged
Flatts3000 merged 3 commits into
mainfrom
marketing-pages
Aug 31, 2026
Merged

Flatts3000 merged 3 commits into
mainfrom
marketing-pages

Conversation

@Flatts3000

Copy link
Copy Markdown
Owner

The deck works for a conversation already in progress. Nothing on the site worked for a link.

What was blocking sharing

No page on relayfunds.org carried a single Open Graph tag, including the root. Every link to it, pasted into Bluesky, Mastodon, Signal, LinkedIn or a group chat, rendered as a bare URL beside the string "Relay" and one generic sentence.

The app is a Vite SPA with no server rendering, so React routes cannot serve per-route tags to a crawler that does not run JavaScript. These are static, built the way /deck is:

URL Written for
/what-is-relay/ anyone; the one to paste into a feed
/need-help/ a person who needs help
/for-groups/ someone who organizes a local group
/for-funds/ someone who helps run a pooled fund

Each has its own tags and its own 1200x630 card, rendered from SVG at build time so a copy change cannot leave a card advertising the old headline. The site root gets tags too, generated into a marked block in frontend/index.html.

docs/social_launch_kit.md carries per-platform post copy, alt text for every card, and a list of things not to say.

/need-help/ opens with a warning, and that is the point

getPublicDirectoryEntries and getDirectoryEntries both filter on a verified hub membership, so a group cannot be listed or receive a request until a fund hub approves one, and none has. Anyone following a "find a group near you" button today reaches an empty list.

Someone in a crisis who is told to ask and gets nothing back has been harmed by the page, not merely underserved. So it says on its first line that it cannot help them today, points at 211, and only then explains what Relay will do. /for-groups/ carries the matching disclosure. The launch kit says not to promote the page until the first groups are live, and to rewrite its opening at the same time.

This accommodates #61 rather than resolving it; it does not close anything.

Written for someone who has not been in the room

Same rule as #72 and #73, applied harder, because a shared page is entered from a link rather than read in order. Mutual aid is defined before it is used. A fund hub is defined on first use on every page separately, since no reader has necessarily seen another. The vocabulary dropped in #69 stays dropped.

Every number is measured. marketing/check-counts.mjs recomputes the figures from deck/counts.mjs, compares them against the committed pages, and CI runs it, so these cannot drift the way the deck did at 187-against-188. The qualifications survive the move to marketing copy: the region and aid category are stated as stored in the clear, the encryption claim is not left blanket, and the status band saying nobody has used this appears on all four pages.

Review

Eight findings, all verified against the tree, none a false positive, all fixed. The two worth naming here:

  • frontend/nginx.conf had drifted from the prod config again. It ships inside the image and is what the root docker-compose.yml runs with no bind mount. Without the mount, /for-groups would have answered Location: http://relayfunds.org/for-groups/, the exact scheme downgrade the change was written to prevent. f01ac7e exists because this pair drifted before.
  • The footer claimed something the README already admitted was false. "Nothing on this site ... loads anything from a third party", above a link to /, while frontend/index.html still loads Google Fonts on every SPA route. Scoped to "These pages", which is where it is true.

Also fixed: esc() not escaping " in attribute values, CI verifying the figures but never that the share cards exist, a silent no-op path in the index.html rewrite, a mobile nav that collapsed to one link, /directory submitted to crawlers as a duplicate of /, and a 139 KB logo rendered at 26px.

The fixes introduced one defect of their own, found by opening the page rather than reading the diff: the logo went in as an absolute production URL, so it 404'd on any local preview and only appeared to work in production.

Verification

  • Chromium at 1280x900 and 390x760, all four pages: one h1 each, four nav links, no horizontal overflow, no console errors.
  • Both nginx configs run in real containers: relative 301, pages 200, /deck keeps its noindex, marketing pages carry none, .png confirmed served immutable for a year, which is why card filenames are content-hashed.
  • The footer link out of the SPA clicked end to end against the real production config and the real dist build. It had to be an <a>, not a react-router <Link>, or it would have rendered NotFound without reaching the server.
  • Both drift guards verified by deliberately breaking them: tampering a figure to 188, and deleting a share card.
  • Typecheck, lint, 191 tests, both guards, frontend build: all pass.

Two pre-existing defects found, not fixed here

  • frontend/index.html links /favicon.svg, and no such file exists anywhere in the tree, so the live site has been 404ing its own icon.
  • The app still loads webfonts from Google, unlike these pages. The fix is pointing it at /fonts/ and fetching the 500 weight it also uses.

Not done

Spanish. The app ships reviewed ES locales and /need-help/ is the page where language is an access issue rather than a nicety, but generating unreviewed Spanish for that audience is worse than not shipping it. pages.mjs is structured so adding it is per-page; it wants a native-speaker review first.

🤖 Generated with Claude Code

https://claude.ai/code/session_017DSai3M3GxBuphu7TykTu5

The deck works for a conversation already in progress. Nothing on the site worked
for a link.

## The thing that had to be fixed first

No page on relayfunds.org carried a single Open Graph tag, including the root. So
every link to it, pasted into Bluesky, Mastodon, Signal, LinkedIn or a group chat,
rendered as a bare URL next to the string "Relay" and one generic sentence. The
deck could not fix that and neither could better copy.

The app is a Vite SPA with no server rendering, so React routes cannot serve
per-route tags to a crawler that does not run JavaScript. These are therefore
static, built the way /deck is:

  /what-is-relay/   anyone; the one to paste into a feed
  /need-help/       a person who needs help
  /for-groups/      someone who organizes a local group
  /for-funds/       someone who helps run a pooled fund

Each has its own tags and its own 1200x630 card, rendered from SVG at build time
so a copy change cannot leave a card advertising the old headline. The site root
gets tags too, generated into a marked block in frontend/index.html.

## /need-help/ opens with a warning, and that is the point

No group has joined, and getPublicDirectoryEntries and getDirectoryEntries both
filter on a verified hub membership, so a group cannot be listed or receive a
request until a fund hub approves one. Anyone following a "find a group near you"
button today reaches an empty list.

Someone in a crisis who is told to ask and gets nothing back has been harmed by
the page, not merely underserved. So the page says on its first line that it
cannot help them today, points at 211, and only then explains what Relay will do.
/for-groups/ carries the matching disclosure: signing up today registers interest
ahead of a pilot rather than switching on a service.

That inversion should be undone when the first groups are live, and not before.
docs/social_launch_kit.md says so, and says not to promote the page until then.

## Written for someone who has not been in the room

Same rule as #72 and #73, applied harder, because a shared page is entered from a
link rather than read in order. Mutual aid is defined before it is used. A fund
hub is defined on first use on every page separately, since no reader has
necessarily seen another. The vocabulary dropped in #69 stays dropped.

Every number is measured. marketing/check-counts.mjs recomputes the figures from
deck/counts.mjs and compares them against the committed pages, and CI runs it, so
these cannot drift the way the deck did at 187-against-188. Verified by tampering
a page down to 188: the check fails, names the page and the discrepancy, and
prints the rebuild command.

The qualifications survive the move to marketing copy: the region and aid category
are stored in the clear, the encryption claim is not left blanket, and the status
band saying nobody has used this appears on all four pages rather than once.

## Serving, verified rather than assumed

absolute_redirect off at the server level. /for-groups redirects to /for-groups/
before it is served, and nginx sits behind Caddy, which terminates TLS, so an
absolute Location would downgrade the scheme and cost a hop back through the HTTPS
redirect. Checked in a real nginx container with the production config: the 301
Location is relative, the pages are 200, /deck still carries its noindex, and the
marketing pages carry none.

Share card filenames carry a content hash because that same config serves .png
with a one-year immutable cache, confirmed in the container. A card edited under a
stable name would keep showing the old image to every crawler that had seen it.

Fonts are served from this origin rather than linked from fonts.googleapis.com the
way frontend/index.html does. That is a privacy decision before a size one: a
webfont request hands a third party the address of every visitor, which CLAUDE.md
rules out and which matters most on /need-help/. These pages make no third-party
requests at all.

## Two pre-existing defects found on the way

frontend/index.html links /favicon.svg, and no such file exists anywhere in the
repository, so the live site has been 404ing its own icon. These pages point at
logo.png; the app is not changed here.

The app still loads webfonts from Google, unlike these pages. The fix is pointing
it at /fonts/ and fetching the 500 weight it also uses. Left alone as an
application change rather than a marketing one.

Verified in Chromium at 1280x900 and 390x760, all four pages: rendered, no
horizontal overflow at mobile, no console errors beyond the favicon 404 above.
Share cards opened and checked rather than assumed.
The four pages linked to each other and nothing linked to them. Every route in
the app that renders PublicFooter - home, directory, privacy, terms, security,
login - offered Privacy, Security, Terms and Built by, and no way at all to reach
/what-is-relay/. So the pages were reachable only by already having the URL,
which is the opposite of the problem they were built for, and exactly the orphan
case rules/common/seo_audit_checklist.md SC-24 exists to catch.

The footer now opens with "What Relay is", pointing at /what-is-relay/, which is
the entry point of the set and links onward to the other three.

## Why it is an anchor and not a Link

/what-is-relay/ is a static file under frontend/public/ and has no route in
App.tsx. A react-router Link would push history, find no match, and render the
not-found page without ever asking the server. A plain anchor does a real
navigation.

That failure would have looked exactly like a working link in review, so it was
checked end to end rather than reasoned about: the real production nginx config
serving the real frontend build, clicking the footer link from the running app.
It lands on /what-is-relay/ with the static page's own title, not on NotFound.

Both locales carry the label; the Spanish follows the wording the app already
uses for its own surfaces rather than inventing a register.

Typecheck, lint and all 39 frontend tests pass.
All eight verified against the tree before being fixed; none was a false
positive.

## The config pair drifted again

frontend/nginx.conf ships inside the image and is what the root
docker-compose.yml runs with no bind mount. It got absolute_redirect off only
inside its ^~ /deck block, so with the production mount absent, /for-groups would
have answered Location: http://relayfunds.org/for-groups/ - the exact scheme
downgrade the new comment in deploy/nginx.prod.conf says it prevents. That file's
own header warns about this pair disagreeing, and f01ac7e exists because it
happened before. Set at server level in both now, and verified by running the
image config in a container: the 301 Location is relative, /deck keeps its
noindex, the marketing pages carry none.

## The footer claimed something the README already admitted was false

It read "Nothing on this site sets a cookie, records who visited, or loads
anything from a third party," directly above a link to /. frontend/index.html
still loads fonts.googleapis.com on every SPA route, which hands Google the
address of everyone opening / or /directory, and marketing/README.md concedes it
in as many words. The claim is true of these four pages and not of the site, so
it now says "These pages". No cookies anywhere, so only the third-party half was
wrong. Verified by parsing all four built pages: the only external reference left
is the clickable GitHub link in the footer, which is not a load.

## The rest

esc() escaped & and < but not ", and every one of its call sites is a
content="..." attribute or a <title>. One quote mark in a headline would have
ended the attribute early and silently truncated the card text in every crawler,
with nothing failing. Latent, since no current string has one.

check-counts.mjs verified the figures and not the images, while build.mjs deletes
a page's previous card whenever it writes a new one. So a rebuild committed with
the HTML staged and frontend/public/share/ left unstaged would have pointed every
og:image at a deleted file and passed CI green. It now resolves every og:image
and twitter:image, on the four pages and on frontend/index.html, against the
disk. Verified by deleting a card: the check names the page and the missing file.

The frontend/index.html rewrite guarded against missing markers but not against a
block whose URL had stopped matching the pattern - that case was a silent no-op
after shareCard had already deleted the old PNG. It throws now. Verified by
rewriting the block to a relative path: the build stops instead of exiting 0.

/directory left the sitemap. It is an SPA route served from frontend/index.html,
so its Open Graph tags are the home page's and it declares og:url of /, which
submits it to crawlers as a duplicate of the root. It also renders empty today.

The mobile nav hid three of its four links under 520px, so every mainstream phone
in portrait saw exactly one - and on /what-is-relay/ that one was the current
page, styled aria-current, a nav bar that navigated nowhere. The header wraps to
two rows and the nav scrolls instead, and stops being sticky at that width rather
than eating 100px of a phone viewport. Verified at 390x760: four links present,
nav scrollable, no page overflow.

logo.png is 682x381 and 139 KB, rendered 26px tall, and was larger than all four
subsetted webfaces combined on pages built for a low-bandwidth audience. These
pages now load a 5 KB resample, and a 2 KB square icon instead of letterboxing a
16:9 wordmark into the favicon slot. The app's copy is untouched.

## One defect the fixes introduced, caught by looking

The logo first went in as https://relayfunds.org/share/logo-<hash>.png, which is
right for og:image and wrong for anything the page loads itself: it hardcodes the
production hostname, so the logo 404s on any local preview or staging domain and
only appears to work in production. Found by opening the page rather than by
reading the diff. writeHashed returns both forms now, absolute for the crawler
tags and root-relative for in-page assets.

Typecheck, lint, 191 tests, both count guards, and the frontend build all pass.
@Flatts3000
Flatts3000 merged commit 7697faf into main Aug 31, 2026
12 checks passed
@Flatts3000
Flatts3000 deleted the marketing-pages branch August 31, 2026 00:45
Flatts3000 added a commit that referenced this pull request Aug 31, 2026
Nineteen of twenty. S-8, one share card for every application route, is left
alone deliberately: it is LOW, the single card is already better than the nothing
that preceded it, and the finding says so.

Each audit now carries a remediation table saying what happened to each finding.
The findings themselves are left as written - the record of what was wrong is the
point of an audit.

## Security

The strict CSP helmet builds only ever reached /api responses, which are JSON and
cannot execute a script, load a font or embed a frame. It is now set on the HTML
in both nginx configs, at server level and repeated inside location ^~ /deck,
because an add_header in a location drops every inherited one. connect-src allows
formspree.io: the home page's contact form posts there with fetch, and without it
the form fails silently, which is how a CSP breaks a site. Verified in a
container - present on / and /deck/, zero violations across four pages, formspree
still permitted, and the directory still renders seeded data.

The anonymous rate-limit key is a keyed HMAC now. The old salt came from the
clock and the code is public, so the digests were reversible by enumerating a
32-bit space. The risk was low - memory only, minutes long, never persisted - but
the comment above it said "we NEVER store the raw IP address", which read as a
far stronger guarantee than it delivered. The key is 32 random bytes generated at
boot and written nowhere.

frontend/package-lock.json is deleted. It was committed once in February 2026,
governed nothing, and produced all 28 open Dependabot alerts including the
critical one, every alert naming a version that npm ci cannot install.

Permissions-Policy set alongside the CSP.

Nothing returns 200 any more if it asks for a file and is not one. No route in
App.tsx contains a dot, so a path with an extension is never an app route; that
needs no route list and so cannot drift. Extensionless typos still reach the app,
and the not-found view carries a noindex now.

deploy/check-nginx-parity.mjs compares six security directives and the CSP value
across both configs, and CI runs it. The pair has drifted twice - f01ac7e and the
review of #78 - and nothing was checking. Verified by tampering both ways:
removing the CSP from one file, and changing it in one file.

## SEO

Every application route told crawlers its canonical identity was the home page,
because index.html is one template with a hardcoded og:url. DocumentTitle now
sets canonical, og:url, og:title, og:description and the Twitter pair per route.
/security is 828 words that could not rank because it declared itself a
duplicate.

Trailing slashes are normalised, so /directory and /directory/ agree. The
description lookup uses the normalised path too - keying it off the raw one would
have given /directory/ a noindex while /directory got a description, which is the
same duplicate handled two opposite ways.

/directory shifted 0.178 of layout against a 0.1 budget, and 0.149 of that was
one event: the footer being displaced when results replaced a centred spinner.
Skeleton cards in the real grid now hold the space. 0.178 -> 0.0154. The skeleton
also announces itself, which the spinner never did.

Organization JSON-LD, static so a crawler sees it without running JavaScript.
SoftwareApplication deliberately omitted - Relay is not a product being sold, and
the audience research is explicit that pitching it as SaaS misreads the people it
depends on.

The home page title was five characters. llms.txt exists, generated from the same
PAGES list so it cannot describe a page set that no longer exists, and it leads
with the fact that no pilot has run.

## Accessibility

<html lang> never followed the switcher, so a screen reader read Spanish through
an English voice. It lands only on the audience this project exists to serve,
which is why it survived. Verified: en-US -> es while the heading becomes "Ayuda
mutua, conectada."

The skip link existed on one route of six and now lives in PublicHeader, with
each main given the id it targets. /login has none on purpose: it renders no
repeated navigation block, so there is nothing to bypass. It does have a main
landmark now, on both return paths including the loading state.

Header navigation and the masthead logo link reach 44px. A-5's original wording
blamed a missing label; it is the logo, named by its image alt, and only the
height was wrong. Corrected in place rather than quietly.

Re-verified after all of it: zero axe violations across ten pages at two
viewports, where the first run had ten failing nodes.

## Also

#80 and #79 are both closed by this. The app self-hosts Inter, including the 500
weight that 45 components use, and makes no third-party requests at all - the
faces were already being fetched for the marketing pages. The icon points at a
file that exists.

Typecheck, lint, 191 tests, all three drift guards, nginx syntax, and both builds
pass.
Flatts3000 added a commit that referenced this pull request Aug 31, 2026
… what it found (#81)

* Audit the public surface for security, SEO and accessibility

Three audits in docs/audits/, measured against a running system rather than read
off the source: the production build served by the real nginx configs in
containers, a live backend, and a seeded database of 12 groups and 1 hub.

Twenty findings. Four were mine, introduced by #78, and are fixed here. The rest
are documented with remediation and left for their own changes.

## The three that matter most

**No Content Security Policy reaches the browser.** backend/src/app.ts configures
helmet with a genuinely strict policy and it works - on /api responses, which are
JSON and cannot execute a script, load a font or embed a frame. The HTML document
is served by nginx behind Caddy, and neither sets a CSP at all. The surface that
can run script has no policy; the surface that cannot has a strict one. That
matters here specifically because the group passphrase is derived and help
requests are decrypted in that document.

**The language switcher never updates <html lang>.** Switching to Spanish takes
the heading from "Mutual aid, connected." to "Ayuda mutua, conectada." with lang
still "en", so a screen reader reads Spanish through an English voice. It lands
entirely on the Spanish-speaking audience the problem brief puts at the center of
this project, and is invisible to anyone testing in English.

**Every application route tells crawlers it is the home page.** #78 added Open
Graph tags to the one SPA template with a hardcoded og:url, so /directory,
/login, /privacy, /security and /terms each serve og:url of "/". All six share
one description and none has a canonical. /security is 828 words that cannot rank
because it declares itself a duplicate. Partly a regression from #78; the fix is
to finish per-route metadata rather than revert.

## The finding that explains a number everyone has been ignoring

Every push prints "28 vulnerabilities, 1 critical" while CI's own npm audit
returns zero at every severity. Both are right. frontend/package-lock.json was
committed once in February 2026 and never touched again; this is a workspaces
monorepo, npm ci runs at the root, and backend has no lockfile at all. All 28
alerts name that orphan. It pins vitest 1.6.1 and vite 5.4.21 against 4.1.11 and
8.2.2 actually installed, so every alert, including the critical, describes a
version that cannot be installed. Deleting one file resolves all of them.

Rated MEDIUM for what it does to the channel rather than for the alerts: a
repository permanently showing a critical count teaches everyone the number means
nothing, and the real alert arrives into that habit.

## Fixed here, because they were mine

Contrast on the IS/KEPT chips was 3.59:1 against a 4.5:1 requirement - the label
distinguishing what Relay is from what it is not, and on /need-help/ what is kept
from what is never kept. Moved to teal-700, an existing token, at 5.25:1.

The masthead was a div, so the logo link belonged to no landmark; it is a header
with a labelled nav now. Nav tap targets 38px to 44px, footer links 23px to 44px,
the latter below even the 24px AA floor.

The sitemap stamped today's date into every lastmod on every build, which is a
false signal and a diff in every commit. Now taken from each page's last commit,
and verified idempotent across two builds.

All four pages now report zero axe violations at 1280x900 and 390x760.

## Method notes worth keeping

The first accessibility run pointed everything at the dev server, where vite's
SPA fallback returns index.html for /what-is-relay/ and friends. It measured the
React app four times and reported it as the marketing pages. Static pages have to
be audited through nginx.

Core Web Vitals were re-measured against the production build with a live API
after the dev-server numbers proved unrepresentative - 13 MB and 134 requests of
unbundled modules versus 186 KB and 6 requests. /directory's CLS of 0.178 held on
both, and the dominant 0.149 of it is the footer being displaced when results
arrive.

deploy/relay-prod.pem is an SSH private key, correctly gitignored, with zero
commits across all history. Not an exposure; recorded so nobody has to check
again.

Typecheck, lint, 191 tests, both count guards and the frontend build all pass.

* Fix every finding the three audits raised

Nineteen of twenty. S-8, one share card for every application route, is left
alone deliberately: it is LOW, the single card is already better than the nothing
that preceded it, and the finding says so.

Each audit now carries a remediation table saying what happened to each finding.
The findings themselves are left as written - the record of what was wrong is the
point of an audit.

## Security

The strict CSP helmet builds only ever reached /api responses, which are JSON and
cannot execute a script, load a font or embed a frame. It is now set on the HTML
in both nginx configs, at server level and repeated inside location ^~ /deck,
because an add_header in a location drops every inherited one. connect-src allows
formspree.io: the home page's contact form posts there with fetch, and without it
the form fails silently, which is how a CSP breaks a site. Verified in a
container - present on / and /deck/, zero violations across four pages, formspree
still permitted, and the directory still renders seeded data.

The anonymous rate-limit key is a keyed HMAC now. The old salt came from the
clock and the code is public, so the digests were reversible by enumerating a
32-bit space. The risk was low - memory only, minutes long, never persisted - but
the comment above it said "we NEVER store the raw IP address", which read as a
far stronger guarantee than it delivered. The key is 32 random bytes generated at
boot and written nowhere.

frontend/package-lock.json is deleted. It was committed once in February 2026,
governed nothing, and produced all 28 open Dependabot alerts including the
critical one, every alert naming a version that npm ci cannot install.

Permissions-Policy set alongside the CSP.

Nothing returns 200 any more if it asks for a file and is not one. No route in
App.tsx contains a dot, so a path with an extension is never an app route; that
needs no route list and so cannot drift. Extensionless typos still reach the app,
and the not-found view carries a noindex now.

deploy/check-nginx-parity.mjs compares six security directives and the CSP value
across both configs, and CI runs it. The pair has drifted twice - f01ac7e and the
review of #78 - and nothing was checking. Verified by tampering both ways:
removing the CSP from one file, and changing it in one file.

## SEO

Every application route told crawlers its canonical identity was the home page,
because index.html is one template with a hardcoded og:url. DocumentTitle now
sets canonical, og:url, og:title, og:description and the Twitter pair per route.
/security is 828 words that could not rank because it declared itself a
duplicate.

Trailing slashes are normalised, so /directory and /directory/ agree. The
description lookup uses the normalised path too - keying it off the raw one would
have given /directory/ a noindex while /directory got a description, which is the
same duplicate handled two opposite ways.

/directory shifted 0.178 of layout against a 0.1 budget, and 0.149 of that was
one event: the footer being displaced when results replaced a centred spinner.
Skeleton cards in the real grid now hold the space. 0.178 -> 0.0154. The skeleton
also announces itself, which the spinner never did.

Organization JSON-LD, static so a crawler sees it without running JavaScript.
SoftwareApplication deliberately omitted - Relay is not a product being sold, and
the audience research is explicit that pitching it as SaaS misreads the people it
depends on.

The home page title was five characters. llms.txt exists, generated from the same
PAGES list so it cannot describe a page set that no longer exists, and it leads
with the fact that no pilot has run.

## Accessibility

<html lang> never followed the switcher, so a screen reader read Spanish through
an English voice. It lands only on the audience this project exists to serve,
which is why it survived. Verified: en-US -> es while the heading becomes "Ayuda
mutua, conectada."

The skip link existed on one route of six and now lives in PublicHeader, with
each main given the id it targets. /login has none on purpose: it renders no
repeated navigation block, so there is nothing to bypass. It does have a main
landmark now, on both return paths including the loading state.

Header navigation and the masthead logo link reach 44px. A-5's original wording
blamed a missing label; it is the logo, named by its image alt, and only the
height was wrong. Corrected in place rather than quietly.

Re-verified after all of it: zero axe violations across ten pages at two
viewports, where the first run had ten failing nodes.

## Also

#80 and #79 are both closed by this. The app self-hosts Inter, including the 500
weight that 45 components use, and makes no third-party requests at all - the
faces were already being fetched for the marketing pages. The icon points at a
file that exists.

Typecheck, lint, 191 tests, all three drift guards, nginx syntax, and both builds
pass.

* Fix eight review findings, one of which blanked the deck

All eight verified against a running system before being fixed; none was a false
positive. The first would have shipped.

## The CSP I added blanked the partner deck

/deck is one self-contained file on purpose: its slide engine is an inline
<script> and its webfonts are base64 data: URIs, so it works offline as an email
attachment. The site-wide policy blocked both, and the failure was silent and
total. Measured before the fix: 15 slides, none activated, nothing visible, 63
characters of text. A funder opening relayfunds.org/deck would have got the
chrome bar and an empty page.

/deck now carries its own policy: the inline script by hash rather than
'unsafe-inline', and data: added to font-src. Measured after: 15 slides, one
active, five fonts loaded, 809 characters, zero CSP blocks.

The hash has to be taken over LF-normalised text. The HTML parser normalises
CRLF to LF before hashing, so the raw bytes of a Windows checkout produce a hash
the browser will never agree with - which is exactly what happened on the first
attempt, and cost a debugging round. check-nginx-parity.mjs recomputes the hash
in CI, so a deck rebuild that changes the script now fails the build rather than
shipping a blank deck. Verified by tampering with the deck's script.

## /help was told it did not exist

publicDescriptions omitted /help, which routes to BroadcastSubmitPage - the
anonymous help broadcast, the one public surface built for someone in a crisis,
and not disallowed in robots.txt. It was being served noindex plus the
description "That page does not exist."

The cause was conflating two questions. Being a real page and being indexable
are different, and the map answered only one. There is now a description map
covering every real page including /help and /login, and a separate noindex set
containing /login alone. meta.login had been added and never referenced, which
was the same omission showing up twice.

## The rest

<html lang> came from i18n.language, which is the detected language, not the
rendered one. With no supportedLngs in the config, a first-time visitor on a
fr-FR browser got English copy from fallbackLng under lang="fr-FR" - a 3.1.1
failure the hardcoded "en" did not have. resolvedLanguage walks the fallback
chain. Verified across three browser locales: fr-FR now reports en with English
copy, es-MX reports es with Spanish copy.

`block ${linkClass(...)}` stopped producing a block when linkClass gained a
leading inline-flex, because Tailwind precedence is stylesheet order and
.inline-flex sits after .block in the built CSS. The mobile menu links had
quietly stopped filling the row, shrinking the tap targets this change was
widening. Now w-full: all four measure 358px.

The skip link I added to PublicHeader pointed at an id that two of its consumers
did not have - the not-found view and BroadcastSubmitPage - so on /help it went
nowhere, which is the defect A-3 was raised to fix. Both have the id now, and
every PublicHeader consumer was checked rather than the four I remembered.

The parity checker compared only the first CSP in each file, which is the
server-level one. The location-level /deck copy is precisely the one that rots,
since a location add_header discards every inherited header. It compares all of
them now.

broadcastCreationRateLimiter runs a one-hour window against a key that rotated
every five minutes, so one client got twelve fresh budgets and "5 broadcasts per
hour" was really 60. Pre-existing, but my comment restated the claim, and the
comment above anonymousKeyGenerator already names this exact hazard for IPv6
prefixes. The bucket matches the window now.

Re-verified after all of it: zero axe violations across eleven pages at two
viewports, the deck rendering, and typecheck, lint, 191 tests, all three drift
guards, nginx syntax and both builds passing.

* Make the deck-hash guard fail loudly instead of quietly

CodeQL flagged js/bad-tag-filter on the new check: the tag pattern was a
lower-case literal that would not match <SCRIPT>. On its own that is a nag,
because the file it parses is one this repository generates.

The consequence here is worse than the usual one, and the tamper test proved it.
The block reads `if (inline) { ...verify the hash... }`, so a pattern that stops
matching does not fail - it skips. Editing the committed deck's tag to <SCRIPT >
made the check pass while the deck's script had changed underneath it, which is
precisely the "guard quietly stops guarding" failure the guard was written to
prevent.

The pattern is case-insensitive and tolerates attributes now, and it excludes a
tag carrying src so an external script is not mistaken for the inline one. More
importantly, finding no inline script is a reported problem rather than a silent
skip: the deck's slide engine is inline by design, and if that ever stops being
true the /deck policy needs revisiting rather than passing unexamined.

Re-tampered with the same uppercase edit: the check now names the mismatch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant