Repository navigation
build: serve the site from a Cloudflare Worker - #2
Open
CameronBrooks11 wants to merge 3 commits into
Open
CameronBrooks11 wants to merge 3 commits into
CameronBrooks11 wants to merge 3 commits into
Conversation
None of the form's fields had a name attribute and no script handled submit, so "Send message" opened a blank mailto: with nothing the visitor typed. The page now points straight at the address.
The site is static, so an assets-only Worker serves the committed dist/ and Workers Builds deploys on push to master. That replaces the manual git pull on the VPS, which left the favicon commit undeployed. src/_headers adds HSTS, framing, referrer and permissions headers; the CSP ships report-only until every page shows a clean console. CI now fails if the build stops copying _headers into dist/.
Measured with wrangler dev against the committed dist/.
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.
Moves hosting to an assets-only Cloudflare Worker and fixes the contact form.
Contact form
The form posted to
mailto:with nonameon any field and no script handling submit, so "Send message" opened a blank email. It's gone; the page links the address directly.dist/contact.htmlis the only page that changes (26 lines removed).Hosting
wrangler.jsonc: an assets-only Worker serving the committeddist/. No Worker script, no build on Cloudflare's side.src/_headers, copied todist/_headersbyscripts/render-assets.js: HSTS,X-Frame-Options,X-Content-Type-Options,Referrer-Policy,Permissions-Policy. The CSP isContent-Security-Policy-Report-Onlyuntil each page shows a clean console.dist/_headersis missing. Removing the copy line and rebuilding made the check printMISSING: dist/_headersand exit 1; restoring it passes.git pullon the VPS. The pull is why the favicon commit1a4fe2anever reached the live site (/assets/favicon.svgreturns 404 there).Locally:
npm ci, the Prettier check andnpm run buildall pass, and the rebuiltdist/matches what's committed.Before merging
master).*.workers.devpreview: all 7 pages,/assets/favicon.svg, the headers, and what/about.htmlvs/aboutreturn.integrumsys.comandwww.integrumsys.comas custom domains.