Nathaniel Lewis | Infrastructure Practice

Projects

Each entry documents a real deployment, migration, or incident — problem, approach, and outcome.

Small-Business Web Presence: Domains, DNS, Email, and SEO

Problem: Small businesses need a domain, a website, and professional email that work on day one. Most owners can’t tell DNS from DKIM, pick names that are hard to spell or easy to confuse, and launch sites that search engines can’t properly read.

Approach: I start with the name. I propose domains that are short, easy to spell, and distinct enough to own their own search results, and when a first choice is taken, I offer workable alternatives instead of awkward hyphenated or misspelled versions. Then I handle the full setup: register the domain, move DNS to Cloudflare, build and host the site, and configure email with SPF, DKIM, and DMARC so mail reaches the inbox. Every site launches search-ready, with unique titles and descriptions, canonical URLs, structured data, social preview cards, a sitemap, a single www-to-apex address, and Search Console and Bing submission. Before launch, prototypes sit behind Cloudflare Access with a one-time-code sign-in and stay blocked from search indexing. Clients buy domains and hosting through ConnectivityPros, my storefront.

Outcome: Three sites delivered: a six-page, mobile-first retail prototype built in one day, a professional resume site with its own domain and email forwarding, and a promotional landing page with full structured data and tracked calls to action. Each deploy hit the NAS vendor’s ACL layer; running the container as an allowed non-root uid fixed it in minutes, using the runbook from the incident below.

Stack: Cloudflare DNS, Registrar, Email Routing, Access, and Tunnel · SPF · DKIM · DMARC · Schema.org · Google Search Console · nginx-unprivileged · Docker

Identity-Gated Analytics Dashboard

Problem: Traffic data for 12 websites sat in 12 separate views, and the API token needed to combine them could never reach a browser.

Approach: Built a single-file Cloudflare Worker that pulls each site’s Web Analytics through the GraphQL API, with a 5-minute edge cache and 7-, 30-, and 90-day views. Cloudflare Access gates all traffic with a single-identity policy, and the Worker validates the Access token itself — signature, audience, issuer, and expiry — and fails closed until configured. Edge hosting keeps the dashboard up if a NAS goes down.

Outcome: 6 of 6 authorization tests passed before go-live: missing, wrong-audience, expired, tampered, valid, and unconfigured. When a credential was briefly exposed during setup, I revoked and rotated it within minutes and stored the replacement as an encrypted secret. A second release removed my own Access sign-in pages from the referrer data so the numbers show real visitors only.

Stack: Cloudflare Workers · Cloudflare Access · GraphQL Analytics API · JavaScript

Three-Application Upgrade With Rollback Plans

Problem: Photo management, the CMS, and file sync had fallen behind. The file-sync platform sat seven major versions back and out of vendor support.

Approach: Backed up each application and tagged rollback images before touching it, then upgraded one service at a time. File sync cannot skip major versions, so a guarded script ran seven upgrades in sequence, with a database dump before each hop and a check that no app was disabled. Fixed what surfaced along the way: a database container that had silently jumped a major version without upgrading its system tables, a stale credential in a compose file that would have taken the site down on its next recreate, and a vendor ACL attribute blocking writes on 2,189 files.

Outcome: Immich v2.7.5 → v3.2.4, WordPress 7.0 → 7.1.2 with checksums verified, and Nextcloud 28 → 35, now supported through September 2027. Downtime ran from seconds to a few minutes per service, and every public endpoint returned 200 at the end. Added HSTS and security headers, brute-force protection, and a pinned database image.

Stack: Docker Compose · PostgreSQL · MariaDB · WP-CLI · Bash · nginx

Hardened EHR Evaluation Deployment

Problem: Evaluate an open-source electronic health record system for a small practice, built to production standards even though it holds only test data.

Approach: Deployed OpenEMR 8.4 in Docker on the secondary node, reachable only through Cloudflare Tunnel and Access. Enforced MFA with a documented emergency-access procedure, moved secrets out of compose files, and set up encrypted nightly backups to a dedicated Backblaze B2 bucket with verification and a monthly restore test. Wrote a full operations runbook covering routine checks, restores, and post-update steps.

Outcome: A gate check — every protected hostname must return a redirect to the Access sign-in — caught two access-policy errors during testing, either of which would have let unapproved users reach the sign-in page. Both fixes went into the routine checks. No real patient data was ever on the system.

Stack: OpenEMR · Docker · MariaDB · Cloudflare Tunnel and Access · rclone · Backblaze B2

Incident: Containers Down After a NAS OS Update

Problem: After a vendor OS update, two production sites went into restart loops. Logs showed Permission denied on configuration files that were world-readable.

Approach: Ruled out standard POSIX permissions and ACLs, then compared file access as root and as the container’s unprivileged user. The mount options revealed a vendor ACL layer enforced by the update. Validated a fix in a throwaway container before touching production.

Outcome: Both sites restored in about an hour, then hardened to a common baseline: read-only root filesystem, all capabilities dropped, no privilege escalation, resource limits, and health checks.

Stack: Docker · nginx-unprivileged · Linux ACLs · Cloudflare Tunnel

WordPress Multisite → Static Sites

Problem: A single WordPress multisite hosted four domains. Every edit meant the admin panel, and every site carried a database, PHP, and plugins it didn’t need.

Approach: Inventoried every site server-side, took a verified full backup, and rebuilt three sites in Hugo with the original designs and URL aliases. Moved the remaining site to its own isolated WordPress instance with WP-CLI. Each site went live only after a private preview behind Cloudflare Access.

Outcome: Four cutovers, zero data loss, 20 of 20 migrated pages validated. Content updates are now a Markdown edit and a one-command rebuild.

Stack: Hugo · Docker · nginx · WP-CLI · MariaDB · Cloudflare Tunnel and Access
Previous architecture: wordpress-multisite-cms on GitHub

Resume Access Control — Serverless Edition (v2: Approval-Based)

Problem: Version 1 (below) replaced three WordPress plugins with a Cloudflare Worker, but access still ran through me by hand. Each request arrived as an email, I sent the resume as an attachment, and from then on the file had no expiry, no download limit, and no record of who held it.

Approach: Rebuilt it as an approval workflow on Cloudflare Workers, D1, and R2. A recruiter submits a short form, checked by Turnstile, a honeypot, and per-visitor and per-site rate limits. I get an email with an HMAC-signed review link; opening it only shows the request, and approving or declining takes a deliberate button press, so email link scanners can’t act on my behalf. On approval, the recruiter gets a private link that works for 7 days and 3 downloads. The PDF sits in a private bucket and streams only after the code checks out, and the database stores only a hash of that code. A decline sends a polite note with no reason given, and requests I don’t answer expire after 14 days with the same note. Data collection is minimal by design: visitor IPs are stored only as salted hashes, message text is never stored, request logs are purged after 90 days, and a kill switch turns the feature off without a redeploy.

Outcome: Live on nathaniellewiscv.com since Nov 8, 2026, and verified end to end: request, approval email, approval, and download, each confirmed in the mail provider’s log. 75 automated tests cover the feature, and 220 cover the order system it runs on. Live testing caught two failures the unit tests couldn’t: Outlook rejected the approval email as spam, fixed with a clear sender name, reply-style wording, and a plain-text link under each button; and browser autofill filled the hidden spam trap, silently dropping real requests, fixed by renaming the field and logging every trap hit. It now ships to clients as part of CV Snapshot’s Snapshot Plus plan.

Stack: Cloudflare Workers · D1 · R2 · Turnstile · HMAC-signed links · Brevo · JavaScript
Code: Private (part of a commercial product).

Resume Access Control — Serverless Edition (v1)

Problem: The invite-only resume request form depended on three WordPress plugins and an SMTP relay.

Approach: Replaced them with a Cloudflare Worker bound to a single path. It verifies Turnstile server-side, filters bots with a honeypot, checks the request origin, strips header-injection attempts, and sends through Cloudflare Email Routing. Deployed with a least-privilege, time-boxed API token from a throwaway container.

Outcome: 6 of 6 test cases passed, including a header-injection attempt. The resume PDF is still never publicly exposed.

Stack: Cloudflare Workers · Turnstile · Email Routing · JavaScript
Original WordPress version: View on GitHub

Troubleshooting: An Outbound-Only Network Failure

Problem: The primary node lost every new outbound connection while existing tunnel connections kept serving visitors.

Approach: Worked layer by layer with read-only tests — DNS, IP reachability, container subnets, policy routing, ARP, firewall chains, connection tracking, and bonded-NIC state — before changing anything.

Outcome: The host was cleared at every layer; the fault sat in the router, and an ordered restart restored service. No host configuration was changed on a guess.

CV Snapshot — Done-for-You Resume Sites

Problem: Professionals benefit from a resume site on their own domain, but most won’t build one, and a resume holds personal data that shouldn’t land on a public page by accident.

Approach: Wrote a zero-dependency Node generator that turns one JSON file per client into a static site on Cloudflare Pages. Every site follows the Snapshot Standard, enforced in the build: no complete resume online, a clear next step on every page, the full resume released only to people the owner approves, and no phone number, email address or home location on the page. The generator escapes all HTML, allows only https and mailto links, and warns when a client file breaks a rule. Recruiters reach the owner through a private contact form and the approval-based resume flow above, both served by one Workers order system. Stripe handles checkout and annual renewal, and CVs arrive through secure, expiring upload links.

Outcome: Concept to live storefront over one weekend, Oct 9–10, 2026, then grown into a two-plan service with client sites in production. Before launch I verified an end-to-end test purchase, then deleted the test coupon and test data. When a key was briefly exposed during setup, I rotated it immediately and deleted the unused key.

Stack: Node.js · Cloudflare Pages · Workers · D1 · R2 · Turnstile · Stripe · Brevo · GitHub
Live: cvsnapshot.com

Email Authentication Hardening

Problem: Business domains sent mail from Microsoft 365 and other services without full authentication, which hurts delivery and leaves the domains open to spoofing.

Approach: Audited SPF, DKIM and DMARC on every domain. Enabled DKIM signing in Microsoft 365, set SPF to the exact senders each domain uses, published DMARC with reporting, and locked domains that never send mail with a reject-all SPF record and a strict DMARC reject policy.

Outcome: Every sending domain signs and aligns its mail, and non-sending domains can’t be spoofed. Each change is recorded in a change log with the date and the verification result.

Stack: Microsoft 365 · Microsoft Defender · Cloudflare DNS · SPF · DKIM · DMARC

Security and Continuity Policies for a Small Business

Problem: A small technology company that hosts client websites and data needed written policies that match how it actually operates, not boilerplate.

Approach: Wrote an information security policy, privacy policy, business continuity and disaster recovery plan, acceptable use policy, and a hosting service level agreement, each tied to the real controls in this environment: Zero Trust access, MFA, encrypted offsite backups, restore testing and incident logging. Built a companion security log for incidents, reviews and changes.

Outcome: Policies in use, published where customers need them, and backed by records that show the controls running.

Stack: Policy writing · Risk assessment · Business continuity planning · Incident and change logging

Self-Hosted Media & Photo Infrastructure

Deployed Jellyfin for media serving and Immich for photo management — both containerized and running continuously. Immich includes machine learning–based photo recognition via a dedicated ML container, with encrypted off-site backups to Backblaze B2.

Stack: Docker · Jellyfin · Immich · Valkey · PostgreSQL · rclone
Code: View on GitHub

How I Use AI in This Work

I use Claude as a diagnostic and build partner. It proposes hypotheses and drafts code; I run every command, verify every result before the next step, and make every risk and design call. That discipline is the point: AI speeds up the work, and verification keeps it correct.