diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6472cf6..4161e31 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,3 +47,7 @@ jobs: fi done echo "All 7 pages present in dist/" + if [ ! -f dist/_headers ]; then + echo "MISSING: dist/_headers" + exit 1 + fi diff --git a/README.md b/README.md index 0ce786e..b8fe69a 100644 --- a/README.md +++ b/README.md @@ -50,28 +50,19 @@ GitHub Actions runs on every push and pull request to `master`: 1. Prettier format check 2. Full build 3. Fail if `dist/` does not match a clean rebuild -4. Verify all 7 HTML pages are present in `dist/` +4. Verify all 7 HTML pages and `_headers` are present in `dist/` -Step 3 matters because the server serves the committed `dist/` and never runs a +Step 3 matters because Cloudflare serves the committed `dist/` and never runs a build. Without it, `src/` and `dist/` can drift apart and CI stays green while the live site is stale. A sibling site ran 20 months behind `master` before anyone noticed. ## Deployment -The site runs on a Vultr VPS behind Cloudflare. Apache serves the committed -`dist/` from `/var/www/integrumsys.com/dist` — **the server never runs a build**, -so whatever is committed under `dist/` is what visitors get. - -Deployment is a manual pull: - -```sh -ssh linuxuser@integrumsys.com -cd /var/www/integrumsys.com -sudo git pull --ff-only origin master -``` - -No restart is needed; Apache reads the files on each request. +The site is a Cloudflare Worker with static assets only: Cloudflare serves the +committed `dist/` and never runs a build (`wrangler.jsonc`). Workers Builds +deploys on every push to `master`, so whatever is committed under `dist/` is +what visitors get. A source change is only live once the rebuilt `dist/` is committed too: @@ -81,26 +72,14 @@ npm run build git add dist/ && git commit ``` -### Server notes - -- SSH is key-only; password authentication is disabled and `PermitRootLogin` is - `prohibit-password`. `linuxuser` has passwordless sudo, so that key alone is - root. Its password is deliberately left set — it is the only Vultr console - fallback if the key ever fails. -- fail2ban guards SSH with escalating bans. Before it was installed the box was - taking roughly 9,000 failed authentication attempts per day. -- ufw allows 22 and 80 from anywhere, but **443 only from Cloudflare's published - ranges**, so the origin cannot be reached directly. Refresh the ranges from - and `ips-v6` if the site becomes - intermittently unreachable — Cloudflare adds ranges occasionally, and a missing - one fails for a subset of edges rather than outright. -- **Port 80 must stay open.** Certbot uses the `apache` authenticator (HTTP-01), - so restricting port 80 breaks certificate renewal — and the failure surfaces up - to 90 days later as a browser warning, with no email since Let's Encrypt - stopped expiry notifications. Closing it requires moving to DNS-01 first. - Verify any firewall or vhost change with - `sudo /snap/bin/certbot renew --dry-run` (certbot is a snap; non-interactive - SSH needs the full path). +Response headers (HSTS, CSP, framing) live in `src/_headers`, which the build +copies to `dist/_headers`. The CSP ships as `Content-Security-Policy-Report-Only` +until a pass over every page shows no violations in the browser console. + +Cloudflare serves each page at its extensionless path: `/about.html` answers +with a 307 to `/about`, and `/` serves `index.html`. The internal `.html` +links still work, through that redirect. `html_handling: "none"` would keep +the `.html` paths but returns 404 for `/`. ## License diff --git a/dist/_headers b/dist/_headers new file mode 100644 index 0000000..e6eb55a --- /dev/null +++ b/dist/_headers @@ -0,0 +1,7 @@ +/* + Strict-Transport-Security: max-age=31536000 + X-Content-Type-Options: nosniff + X-Frame-Options: DENY + Referrer-Policy: strict-origin-when-cross-origin + Permissions-Policy: camera=(), geolocation=(), microphone=(), payment=(), usb=() + Content-Security-Policy-Report-Only: default-src 'self'; script-src 'self' https://cdn.jsdelivr.net; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://fonts.googleapis.com; font-src 'self' https://cdn.jsdelivr.net https://fonts.gstatic.com; img-src 'self' data:; connect-src 'self'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'; object-src 'none' diff --git a/dist/contact.html b/dist/contact.html index 2398803..b1994c7 100644 --- a/dist/contact.html +++ b/dist/contact.html @@ -55,35 +55,10 @@

Get in touch.

- Form submission is being set up. Reach us directly at  + Email us directly at  contact@integrumsys.com
- -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
-
-
-

Email   diff --git a/scripts/render-assets.js b/scripts/render-assets.js index 1e38850..a3761c2 100644 --- a/scripts/render-assets.js +++ b/scripts/render-assets.js @@ -8,4 +8,5 @@ module.exports = function renderAssets() { const destPath = upath.resolve(upath.dirname(__filename), '../dist/.'); sh.cp('-R', sourcePath, destPath); + sh.cp(upath.resolve(upath.dirname(__filename), '../src/_headers'), destPath); }; diff --git a/src/_headers b/src/_headers new file mode 100644 index 0000000..e6eb55a --- /dev/null +++ b/src/_headers @@ -0,0 +1,7 @@ +/* + Strict-Transport-Security: max-age=31536000 + X-Content-Type-Options: nosniff + X-Frame-Options: DENY + Referrer-Policy: strict-origin-when-cross-origin + Permissions-Policy: camera=(), geolocation=(), microphone=(), payment=(), usb=() + Content-Security-Policy-Report-Only: default-src 'self'; script-src 'self' https://cdn.jsdelivr.net; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://fonts.googleapis.com; font-src 'self' https://cdn.jsdelivr.net https://fonts.gstatic.com; img-src 'self' data:; connect-src 'self'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'; object-src 'none' diff --git a/src/pug/contact.pug b/src/pug/contact.pug index 9089cc6..9702c13 100644 --- a/src/pug/contact.pug +++ b/src/pug/contact.pug @@ -37,36 +37,10 @@ html(lang="en") .col-lg-7 // Direct email notice .alert.mb-4(style="background-color: #e6f7f8; border: 1px solid #0e9aa7; color: #0b1220") - | Form submission is being set up. Reach us directly at  + | Email us directly at  a.fw-500(href="mailto:contact@integrumsys.com" style="color: #0b7f89") contact@integrumsys.com - // Contact form - form(action="mailto:contact@integrumsys.com" method="GET") - // Name - .form-floating.mb-3 - input#name.form-control(type="text" placeholder="Full name" required) - label(for="name") Full name - - // Email - .form-floating.mb-3 - input#email.form-control(type="email" placeholder="name@example.com" required) - label(for="email") Email address - - // Phone (optional) - .form-floating.mb-3 - input#phone.form-control(type="tel" placeholder="Phone number (optional)") - label(for="phone") Phone number (optional) - - // Message - .form-floating.mb-4 - textarea#message.form-control(placeholder="Message" required style="height: 10rem") - label(for="message") Message - - .d-grid - button.btn.btn-primary.btn-lg(type="submit") Send message - // Direct contact - hr.my-4(style="border-color: #d7dee8") p.mb-1 span.font-mono.small(style="color: #3b4a5e") Email | diff --git a/wrangler.jsonc b/wrangler.jsonc new file mode 100644 index 0000000..d24ea0c --- /dev/null +++ b/wrangler.jsonc @@ -0,0 +1,9 @@ +// Assets-only Worker: Cloudflare serves the committed dist/ directly. +// There is no Worker script and no build step on Cloudflare's side. +{ + "name": "integrumsys-com", + "compatibility_date": "2026-11-01", + "assets": { + "directory": "./dist", + }, +}