- JavaScript 75.3%
- CSS 12.7%
- HTML 11.2%
- Shell 0.8%
|
All checks were successful
deploy / deploy (push) Successful in 37s
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> |
||
|---|---|---|
| .claude | ||
| .forgejo/workflows | ||
| .well-known | ||
| assets | ||
| deploy/box-b | ||
| docs | ||
| drafts | ||
| functions | ||
| scripts | ||
| server | ||
| styles | ||
| test | ||
| tools | ||
| .gitignore | ||
| 404.html | ||
| _headers | ||
| _redirects | ||
| admin-login.html | ||
| admin.html | ||
| blog.html | ||
| colophon.html | ||
| cv.html | ||
| favicon.ico | ||
| index.html | ||
| llms.txt | ||
| manifest.json | ||
| MoCipher-SPEC.md | ||
| offline.html | ||
| package-lock.json | ||
| package.json | ||
| privacy.html | ||
| projects.html | ||
| README.md | ||
| robots.txt | ||
| status.html | ||
| sw.js | ||
| wrangler.toml | ||
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 stampsSEC.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,
SAMEORIGINframing, 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)
- Create a KV namespace and an R2 bucket, bind them as
MY_KVSITEandFILES(already declared inwrangler.toml). - Functions must be enabled so
/api/*and/blog/*work. - 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). - First admin password: open
/admin-login.htmland 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 buildwritesdist/. Only the files listed intools/build.mjsare published — neverpackage.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 verifyruns 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
:rootand[data-theme="dark"]tokens instyles/main.css— everything else follows. - Privacy wording:
privacy.html(CH/EU template) — adjust if your process changes. - OG card: regenerate
assets/images/og-card.pngfromtools/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.