Skip to content
← Back to writing

June 30, 2026

A storefront in a day, and the two times it said done too early

Level Minds CBD went from an empty repo to a deployed storefront on June 30, along with the CI gates on the backup server that had never actually run.

On June 30 I started a headless storefront for Level Minds CBD from an empty repository at 8:49 in the morning, and by 9:53 it was running on my production box behind a password and a 21+ age gate. The last commit of the day landed at 22:42. In between were 63 commits across more than 30 tickets, plus a separate cleanup of the backup server's CI. I had to reopen one ticket, and the checks I was relying on could not see one bug that was sitting in front of them.

The certificates of analysis page as the June 30 build rendered it, rebuilt from that day's final commit: all 22 lab reports listed, each with a link to its PDF.

The morning: a stack I did not plan to use

Level Minds sells CBD, including delta-8 and delta-9 products, and that decided the architecture before I wrote any code. The big hosted checkouts will not carry those products, so commerce had to stay on the shop's existing self-hosted WooCommerce. The new front end is Next.js with shadcn/ui, and it reads the catalog from the WooCommerce Store API, which turned out to be publicly readable. That was the first useful finding of the day: 18 products came straight off the live shop with no scrape and no mirror. Checkout hands the cart back to WooCommerce, so the payment processor never moves and the new site never touches card data.

The CMS was supposed to be Sanity and the hosting Vercel. At 9:06 I had to park the CMS ticket because it needed a Sanity account I did not have set up, and the preview deploy was waiting on a Vercel login for the same reason. I chose to stop renting both. Twenty minutes later Payload CMS was embedded in the Next app on SQLite, with posts, media, and a site settings record that holds the active seasonal theme and a sale banner. By 9:52 there was a Dockerfile, and the container was serving from my box behind Traefik. One thing I pinned early: Node 22, because Node 25 broke Payload's tooling.

Everything after that was a second round of twelve tickets. Each one lived on its own branch and merged into main one at a time. They covered on-site variant selection, product reviews pulled from the Store API, more seasonal theme presets and a sale mode, generated social cards and favicons, a motion pass, a performance pass, Umami analytics hosted on my own server, a newsletter, and a Vitest and Playwright suite with a CI workflow.

The ticket I had to reopen

Ticket 19 was content migration: pull the shop's blog posts and lab reports out of WordPress and into Payload. A certificate of analysis is the lab result for a specific batch, and for a CBD shop it is the most persuasive page on the site. At 19:58 I ran the migration against production, with the web container stopped during the write and the database backed up first. It imported one post and 13 certificate PDFs, and I commented that it was verified live.

At 20:39 I reopened it. The shop's WordPress media library held 22 PDFs and my script had imported 13. The script walked a short hardcoded source list rather than asking WordPress for everything of that file type. The fix, commit 844d330, paginates the media endpoint by mime type. Rebuilding that day's final commit against a fresh database wrote all 22 certificates, which is the page in the screenshot above.

The import reported success and every page loaded, so only a count of the library against my database showed the gap. Ticket 28 then tied each certificate to its product. WooCommerce and Payload share no key, so it matches on filenames, and it is built to prefer showing nothing over showing the wrong report. A product with no confident match falls back to a link to the full library, and the unit tests pin cases like the 400 mg body butter not picking up the 1000 mg certificate.

The images that returned 200

The last ticket of the day, number 34, was the one that taught me something about my own checks. After the password gate went in, images on the home and about pages were broken. My verification up to then had been curl requests that checked for an HTTP 200 on each page, and every page returned 200.

The cause was in the gate. next/image fetches uploaded media from the server's own media route to resize it, and my password gate answered that internal request with a 401, so the optimizer returned a 400 and the browser showed a broken picture. The page itself loaded fine, which is why the curl checks passed. I added the media route to the gate's exclusions, then checked in a real headless browser through an SSH tunnel to the origin. The result was zero broken images across home, about, shop, certificates, FAQs, and a product page. Since then, browser verification has been part of the checklist for that project, because a status code says the server answered and nothing about whether the picture rendered.

A few smaller things belong with that. Docker builds failed twice on the lockfile, first on an incomplete one and then on one missing the optional Linux native packages, so I regenerated it twice. The analytics script silently did nothing in production because NEXT_PUBLIC variables are baked in at build time and my container build never received them, so they are Dockerfile build arguments now. Uploaded media was going into the container filesystem, so I moved it to the data volume. And at 21:58 I put a Cloudflare Access email lock in front of the preview, with the password kept as a second layer. An unauthenticated request now gets a redirect to the login at Cloudflare's edge and never reaches my server.

One more change came out of a failure. Earlier in the build, a botched schema push in development mode broke the newsletter signup. Ticket 33 turned off push in production and put the schema under Payload migrations, with a baseline migration committed, so a schema change is now a reviewed file and not a side effect of starting the server. The newsletter itself started the day on Listmonk and ended it as double opt-in through AgentMail, with subscribers stored in Payload.

The backup server's gates that never ran

The other half of the day was the Eight.ly backup server's CI. Its pull request checks were red. Most of the red was not real, and the most interesting finding was a gate that had never run at all.

The Semgrep step was configured with --config auto, which needs metrics turned on, while the same command also turned metrics off. It had been failing before it ever scanned anything, which meant the code had never been scanned by it. I moved it to the pinned p/default ruleset, and its first real run produced four errors. One was real: a GitHub Actions shell injection in the release workflow, where a tag input was interpolated straight into a shell step. I now pass it through an environment variable. The other three were audited and suppressed, each with a written justification.

The rest of the red was noise I could name. A flaky SMTP test raced its own accept goroutine and now waits up to five seconds. Gitleaks and the SBOM job both scanned clean and failed only because the organization's artifact storage was full, so the uploads no longer fail the job. The license check flagged the project's own AGPL module and its own dashboard package. A scan of the whole git history came back clean, so no secret needed rotating. All 16 required checks passed, the pull request merged at 15:00, and nothing in the product changed.

At 22:31 I committed a fix for the workflows still red on pushes to main. One was an evidence-binder job that failed because the self-hosted runners have no zip command, so it now uses Python's standard library. The other was a deploy workflow pinned to a GitHub-hosted runner pool I could no longer use, so I moved it to the self-hosted runners. That ticket was still open when the day ended.

Smaller work on the marketing site filled the gaps: a README rewritten as a real deploy runbook with three diagrams, a dependency audit that cleared to zero vulnerabilities, and two CI workflow cleanups.

mjashley.com