Repository navigation
feat(site): rework the site, and add sign-ups, privacy and link previews - #4
Merged
Merged
Conversation
Contributor
Author
|
Review: the reviewer found that Cloudflare's invocation logs and traces would keep each visitor's location and browser beside the time of their sign-up, which the privacy page did not cover; they are now off, and only the Worker's own log lines, which never hold an address, are kept. It also fixed the privacy page's description of page views (PostHog does no location lookup in cookieless mode) and made About name Marfa, not Marfa Cloud, as what is free. A visitor without JavaScript whose sign-up fails now lands on /subscribe-failed instead of an unchanged form, and the page-path normalisation lives in one helper. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reworks withmarfa.com after review, and adds a way to sign up for updates.
What changes for a visitor
<details name>).twitter:card, a sitemap listed inrobots.txt,WebSitestructured data on home, andnoindexon the 404 and thank-you pages.Sign-ups
worker/index.tsanswersPOST /api/subscribe;run_worker_first: ["/api/*"]keeps every page a static asset.Origin, limits each IP address to five tries a minute (Workers rate limiting), caps the body at 2 KB, ignores a filled honeypot field, and validates the address loosely.signupstable of D1withmarfa-website(EU jurisdiction; migration applied). Repeat addresses return the same reply, and no address is logged./subscribed, or back to the form.Fixes found on the way
compressHTML: 'jsx'dropped the space before a link that started a new source line ("TheAbout page"). It is nowtrue, which is lossless.vite.build.assetsInlineLimit: 0keeps every script a file.Testing
pnpm check(Astro,wrangler types --check,tsc -p worker) andpnpm buildpass.wrangler devwith a local D1: a valid address (trimmed and lowercased), a duplicate, an invalid address, the honeypot, URL-encoded and multipart bodies, noOrigin, a foreignOrigin,GET, an unknown/apipath, an oversized body, the no-JavaScript redirect, and the rate limit after five tries. Only valid addresses were stored, once each.wrangler versions uploadwith the CI deploy token succeeded, so the token can deploy the D1 and rate-limit bindings. That version was not deployed.