No description https://mocipher.com
  • JavaScript 75.3%
  • CSS 12.7%
  • HTML 11.2%
  • Shell 0.8%
Find a file
CipherOq aa00328b7c
All checks were successful
deploy / deploy (push) Successful in 37s
deploy: pin Box B's host key for the deploy job
The line site.sh deploy-key printed on Box B (its ed25519 host key, at
10.88.0.1 over wg-hub). ship.sh refuses to deploy without it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 11:45:28 +01:00
.claude feat: the site runs on its own Node server, without Cloudflare 2026-11-07 19:34:40 +01:00
.forgejo/workflows feat: the contact form pushes to Box B's own ntfy; Resend is gone 2026-12-05 11:45:12 +01:00
.well-known Round 13: Security, PWA, a11y, caching, SEO hardening 2026-04-07 11:58:09 +02:00
assets fix: clearer search, form errors in words, lighter project images, CV card on Android 2026-12-03 15:35:56 +01:00
deploy/box-b deploy: pin Box B's host key for the deploy job 2026-12-05 11:45:28 +01:00
docs feat: the contact form pushes to Box B's own ntfy; Resend is gone 2026-12-05 11:45:12 +01:00
drafts fix: rollouts of the mirror dropped requests; verifier ran a check twice 2026-07-30 14:47:49 +02:00
functions feat: the contact form pushes to Box B's own ntfy; Resend is gone 2026-12-05 11:45:12 +01:00
scripts feat: the contact form pushes to Box B's own ntfy; Resend is gone 2026-12-05 11:45:12 +01:00
server feat: the contact form pushes to Box B's own ntfy; Resend is gone 2026-12-05 11:45:12 +01:00
styles chore: drop Cloudflare Turnstile from the contact form 2026-12-04 22:56:58 +01:00
test feat: the contact form pushes to Box B's own ntfy; Resend is gone 2026-12-05 11:45:12 +01:00
tools chore: remove the home server's ntfy from the repository 2026-12-04 23:04:46 +01:00
.gitignore feat: deploy to Box B from Forgejo Actions on every push to main 2026-12-04 23:03:56 +01:00
404.html chore: retire /uses; fix the homepage footnote, footer date, projects intro, 404 title 2026-11-07 10:40:39 +01:00
_headers chore: drop Cloudflare Turnstile from the contact form 2026-12-04 22:56:58 +01:00
_redirects chore: retire /uses; fix the homepage footnote, footer date, projects intro, 404 title 2026-11-07 10:40:39 +01:00
admin-login.html feat: one design system across the site and admin, nine fixes, search and covers 2026-12-03 10:24:41 +01:00
admin.html fix: clearer search, form errors in words, lighter project images, CV card on Android 2026-12-03 15:35:56 +01:00
blog.html feat: one design system across the site and admin, nine fixes, search and covers 2026-12-03 10:24:41 +01:00
colophon.html chore: drop Cloudflare Turnstile from the contact form 2026-12-04 22:56:58 +01:00
cv.html chore: retire /uses; fix the homepage footnote, footer date, projects intro, 404 title 2026-11-07 10:40:39 +01:00
favicon.ico redesign: FIELD STATION — full visual rebuild of every page, icons, and PWA 2026-07-04 10:15:16 +02:00
index.html chore: drop Cloudflare Turnstile from the contact form 2026-12-04 22:56:58 +01:00
llms.txt chore: drop Cloudflare Turnstile from the contact form 2026-12-04 22:56:58 +01:00
manifest.json chore: retire /uses; fix the homepage footnote, footer date, projects intro, 404 title 2026-11-07 10:40:39 +01:00
MoCipher-SPEC.md feat: the contact form pushes to Box B's own ntfy; Resend is gone 2026-12-05 11:45:12 +01:00
offline.html feat: one design system across the site and admin, nine fixes, search and covers 2026-12-03 10:24:41 +01:00
package-lock.json feat: commit heatmap from my own Forgejo, on the homepage 2026-08-05 12:31:27 +02:00
package.json chore: remove the home server's ntfy from the repository 2026-12-04 23:04:46 +01:00
privacy.html feat: the contact form pushes to Box B's own ntfy; Resend is gone 2026-12-05 11:45:12 +01:00
projects.html chore: retire /uses; fix the homepage footnote, footer date, projects intro, 404 title 2026-11-07 10:40:39 +01:00
README.md feat: the contact form pushes to Box B's own ntfy; Resend is gone 2026-12-05 11:45:12 +01:00
robots.txt fix: clean URLs, the blog Back trap, the unstyled history grid, and the stale OG card 2026-09-13 11:10:43 +02:00
status.html chore: retire the failover — mirror, watcher and /api/failover go 2026-12-03 15:19:38 +01:00
sw.js chore: retire /uses; fix the homepage footnote, footer date, projects intro, 404 title 2026-11-07 10:40:39 +01:00
wrangler.toml chore: drop Cloudflare Turnstile from the contact form 2026-12-04 22:56:58 +01:00

Mohammed Rahhal — Personal Website (mocipher.com)

A fast, static-first personal site with a small admin panel and Cloudflare Pages Functions + KV + R2 for dynamic content. No front-end framework — HTML, CSS, and vanilla JavaScript.

Design language: Field Station — "paper by day, phosphor by night." Light mode is a dossier (warm paper, ink, amber stamps); dark mode is an ops console (deep space, phosphor teal, amber signals). Two voices: Inter (human) + system monospace (machine). Full detail in MoCipher-SPEC.md.

Highlights

  • Homepage (recruiter-first): hero (name, one still role line, CV + contact), availability band, Experience (highlights strip + full journey), about + skills, what I replaced + commit heatmap, up to four featured projects (+ link to projects.html), certifications (three cards + a fold), contact. Section stamps SEC.01–06.
  • Signature interaction: ⌘K / Ctrl+K command palette (navigate + actions), injected by core.js, CSP-safe.
  • Blog (Field Reports): Tag filters, search (title/excerpt/tags/body), reading progress, lazy per-post code highlighting, related posts, per-post Open Graph/Twitter meta (optional social image).
  • Pages: cv.html (Personnel File — embedded PDF via /api/cv, iOS fallback), projects.html (shareable #project-{id} anchors), colophon.html, privacy.html, llms.txt, plus 404 (SIGNAL LOST radar) and offline (AIR-GAPPED MODE).
  • Admin: Projects, History (/api/timelines, optional Highlight), posts (tags + OG image, file uploads), social links, skills, site settings, and opt-in TOTP 2FA.
  • Security: strict CSP + reporting, SAMEORIGIN framing, PBKDF2 + rate-limiting, honeypot + rate limit on the contact form, SPF/DKIM/DMARC email auth.
  • PWA: cipher-hex icon set (incl. maskable), service worker (network-first navigation/API), offline page, app shortcuts.
  • SEO / feeds: JSON-LD, /api/sitemap, RSS at /api/rss, canonical URLs, designed OG share card (og-card.png).
  • First-party front-end: scripts, styles, fonts from this origin only, and no third-party browser resource at all. (Cloudflare Turnstile was removed on 2026-12-04 with the move off Cloudflare; the honeypot and rate limit remain.) There are no analytics.

Repository layout

mocipher/
├── index.html              # Homepage
├── blog.html               # Blog listing + client-side post view
├── cv.html                 # CV — embedded PDF via /api/cv
├── projects.html status.html colophon.html privacy.html
├── 404.html offline.html   # Redesigned error / offline pages
├── llms.txt                # Context file for assistants
├── manifest.json sw.js     # PWA manifest + service worker
├── _headers _redirects     # Security headers + routes
├── wrangler.toml           # Pages project: KV + R2 + ORIGIN_NAME var
├── admin.html admin-login.html
├── functions/
│   ├── api/                # REST handlers, _lib/ (security, http), auth/ (incl 2fa)
│   └── blog/[slug].js      # Serves blog.html with per-post meta
├── scripts/  styles/  assets/   # first-party JS / CSS / fonts+images+vendor
├── server/                 # the site on Node: Pages routing, KV in SQLite, R2 on disk
├── .forgejo/workflows/     # deploy.yml: every push to main deploys to Box B
├── deploy/box-b/           # pack.sh + ship.sh: a release, handed to Box B over ssh
├── test/                   # node --test suites (API + jsdom page tests)
├── tools/                  # build.mjs (→ dist/), smoke.mjs, import-cloudflare.mjs, og-card.html, render-covers.mjs
├── drafts/                 # unpublished posts (JSON)
└── docs/                   # email-dns.md (no mail; Resend's leftovers), uptime-monitoring.md

Bindings: KV MY_KVSITE, R2 FILES (bucket mocipher-files) — see wrangler.toml.

Setup (Cloudflare)

  1. Create a KV namespace and an R2 bucket, bind them as MY_KVSITE and FILES (already declared in wrangler.toml).
  2. Functions must be enabled so /api/* and /blog/* work.
  3. Secrets (never committed) via wrangler pages secret put: ADMIN_RESET_KEY (password recovery). The contact form sends no email: messages are in the admin's Inbox, and on Box B the site pushes a notice to the owner's phone through Box B's own ntfy (NTFY_URL, NTFY_TOKEN).
  4. First admin password: open /admin-login.html and complete setup, or set one in Settings. Optionally enable 2FA in Settings.

Own server (no Cloudflare)

npm run build && npm run serve   # http://127.0.0.1:8788

server/ runs the same dist/ and functions/ under Node (24+, for node:sqlite), with no dependencies. It routes the functions as Pages does and applies _headers, _redirects, clean URLs and 404.html. KV is SQLite at $SITE_DATA/kv.sqlite, R2 is files under $SITE_DATA/files/, and text is compressed. Behind a proxy, set TRUSTED_PROXIES (its addresses or subnets) and SITE_HOSTS; without them, X-Forwarded-For is ignored and the socket address is the client. The variables the functions read are passed through from the environment (FUNCTION_VARS in server/main.mjs). Back up $SITE_DATA.

Moving the data off Cloudflare:

npm run import:cloudflare -- --dry-run                  # what is in KV and R2; downloads nothing
npm run import:cloudflare -- --to .data/cf-2026-11-08   # the copy
SITE_DATA=.data/cf-2026-11-08 npm run serve

tools/import-cloudflare.mjs copies every KV key (value, metadata, expiry) into kv.sqlite and every R2 object into files/. It reads everything back and compares it, then checks the /api/files/ links in the content. It only sends GETs, signs in as wrangler does (or with CLOUDFLARE_API_TOKEN), and prints key names and counts, never values. The target must be a new directory. It holds the password hash and the 2FA secret, so it is created 0700 and must be one git ignores. For the cutover, copy again into a new directory during a content freeze.

Deploy

Box B — on every push to main. .forgejo/workflows/deploy.yml runs npm ci, npm test and npm run build, packs a release with deploy/box-b/pack.sh (VERSION, package.json, dist/, functions/, server/) and hands it to Box B over ssh with deploy/box-b/ship.sh. Box B validates it, installs it, checks the site's health and rolls back by itself on failure. The BOXB_DEPLOY_KEY secret, the pinned host key and a hand deploy are in deploy/box-b/README.md.

Cloudflare Pages — until the cutover only. A push does not deploy to Pages. Publish with:

npm run deploy      # builds dist/ (public files only, styles/scripts minified + content-hashed), then wrangler pages deploy
  • npm run build writes dist/. Only the files listed in tools/build.mjs are published — never package.json, tests, tooling or local settings.
  • Styles and scripts are named by content hash and every reference is rewritten, so there is no ?v= to bump by hand. The service worker's precache list and cache name are derived from the build too.
  • npm run verify runs the gate: check (syntax) + smoke (pages/CSS integrity) + test (node --test). The pre-commit hook runs all three.

Admin content areas

Area KV key / route Notes
Projects projects GET/POST /api/projects, item PUT/DELETE; image upload; Show on homepage (featured, up to four)
History timeline (/api/timelines) Certifications, jobs, education; highlight drives homepage strip
Blog posts posts Rich HTML body, tags, optional OG image; cover/OG upload
Social links socialLinks Chained-favicon preview
Skills skills Optional category grouping
Settings settings Availability and "At a glance" facts, skill proof links, colleague quotes, recruiter note, hero copy, CV (upload or URL), password, 2FA
Contact contactSubmissions Form posts to /api/contact (no IP stored)

Public API (prefix /api)

  • GET /api/settings — public display settings.
  • GET /api/posts — optional ?limit=N; GET /api/projects, /api/timelines, /api/skills, /api/social-links.
  • GET /api/cv — 302 to the current CV (or bundled fallback).
  • GET /api/files/:key — uploaded file (R2, KV fallback).
  • GET /api/rss, GET /api/sitemap.

Authenticated POST/PUT/DELETE (and /api/upload, /api/export) require a valid session cookie; with 2FA enrolled, login also needs a TOTP code.

Customization

  • Theme: edit the :root and [data-theme="dark"] tokens in styles/main.css — everything else follows.
  • Privacy wording: privacy.html (CH/EU template) — adjust if your process changes.
  • OG card: regenerate assets/images/og-card.png from tools/og-card.html (render command in its header comment).
  • Blog share image: admin post editor → Social share image (1200×630); falls back to the post image, then the profile default.

License

© 2026 Mohammed Rahhal. All rights reserved.