Repository navigation
Hand news and waitlist sign-ups to Utskick over a service binding - #38
Merged
Merged
Conversation
/api/signup keeps all its checks: same origin, JSON only, address, list, country, the hidden bot field and one answer for new and known addresses. It then calls env.UTSKICK.subscribe() instead of writing to the site's own D1. UTSKICK is a service binding to the utskick Worker, so the call stays inside Cloudflare. The lists news and gateway become ftw-news and ftw-box in Utskick; the consent ids stay news-2026-10-30 and gateway-2026-10-30. The site passes the visitor's IP address from CF-Connecting-IP as ip, so Utskick limits sign-ups per visitor, not for the whole site. Without the binding, or when Utskick refuses, the endpoint answers 503 and the forms say sign-up is closed. signups.sql goes: Utskick owns the schema. The tests fake the binding, check what the site sends, and check the 503 when Utskick throws. The privacy notice, in English and Swedish, now names the sender as it promised: Utskick, delivering through Amazon SES in Frankfurt, a one-way hash kept after someone leaves, no open tracking, and clicks counted without device data or IP address. Ported from srcfl/utskick docs/examples/ftw-web.patch, which applied cleanly; the ip field, its tests and the Swedish page are new. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…check Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying ftw with
|
| Latest commit: |
3f7c45f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c1966866.ftw-613.pages.dev |
| Branch Preview URL: | https://utskick-signups.ftw-613.pages.dev |
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.
What this does
/api/signupkeeps every check it has today. It then callsenv.UTSKICK.subscribe()instead of writing to the site's own D1 table.newsandgatewaybecomeftw-newsandftw-boxin Utskick. The consent ids staynews-2026-10-30andgateway-2026-10-30.CF-Connecting-IP) asip, so Utskick limits sign-ups to 10 a minute per visitor, not for the whole site. Utskick keeps no IP address.signups.sqlgoes: Utskick owns the schema.This is
docs/examples/ftw-web.patchfrom srcfl/utskick, and it applied cleanly. Theipfield, its tests and the Swedish page are new here.Before or right after merge
Merging to
maindeploys production through the Pages Git integration. Add a service binding to the Pages projectftwfirst, or right after:Settings → Bindings → Service binding:
UTSKICK→ Workerutskick. Production only, never preview. A preview deployment with the binding would sign people up for real. Until the binding exists, the forms say sign-up is closed.The site's D1 database
ftw-signupsmay already hold sign-ups. Move them to Utskick through/admin/importwith their original time and consent, then delete the site's copy and theSIGNUPS_DBbinding, so each address lives in one place.Tests
node --test tests/*.test.mjs: 44 pass, 0 fail. The sign-up tests fake the binding and check what the site sends, includingipandsource: 'ftw-web', and the 503 when Utskick throws. Utskick tests its own deduplication. I checked the English privacy page in a browser and the Swedish page's markup.For review
privacy.html#emailtogether. This PR changes the text but keeps the ids, as planned.🤖 Generated with Claude Code