omar@omr.sh:~/notes$

From Staging to Production Without Touching the Live Site

2026-09-24 hugo · git · deployment · caddy · devops

I already had omr.sh online. A small static site, hand-written HTML and CSS, doing its job.

The problem was never “how do I put a website online.” It was already online. The problem was: how do I rebuild the whole thing — theme, structure, content model — without doing the redesign directly on the thing people could actually visit.

Development belongs somewhere else

I split the two roles across two machines that already existed for other reasons.

Aurora is where the site is built:

Aurora
- Hugo
- Git
- Claude/Codex
- source files
- local preview
- production build

Pulsar is where the site is served, and nothing more:

Pulsar
- Caddy
- static files
- public runtime
- no Hugo
- no Git
- no development toolchain
Developer
   |
   v
Aurora
Hugo + Git
   |
   | hugo --minify
   v
public/
   |
   | rsync over SSH
   v
Pulsar
staging webroot
   |
   v
Caddy
   |
   v
Internet

Pulsar never gained a copy of the repository, a Hugo binary, or a way to regenerate anything. If someone were to get a shell on the public web server, there is nothing there to rebuild from — just the already-rendered output.

Git became the safety net

Once the rebuild started, I wanted every step to leave a trace I could read back later, and a point I could return to if a change turned out to be wrong.

* a31c441 (HEAD -> main) Fix: images stay in normal flow (no overlap), simplify single-note prompt
* bc09c4f Custom Hugo theme (unixporn/terminal) + first real note: DMZ on OPNsense
* 473b429 Add placeholder test layout to verify hugo->rsync->staging pipeline
* eb969dd Initial Hugo scaffold + reference copy of live site

That’s the whole history so far, and it already tells the story better than I could summarize it: scaffold the project, prove the pipeline actually moves files from Aurora to Pulsar with a throwaway layout, build the real visual identity and write the first real piece of content, then go back and fix two rough edges once I looked at it with fresh eyes.

None of that is remarkable as a Git workflow. That’s the point. I didn’t need branches, tags, or a review process for a one-person site. I needed the ability to see what changed, and to undo it if necessary. git log and git diff cover that completely.

Building is not publishing

The distinction that mattered most through this whole project was simple, and easy to lose track of once things start automating themselves:

editing != build
build   != deploy
deploy  != cutover

Editing a Markdown file changes nothing anyone can see. Running

hugo --minify

turns the source into a public/ directory — static HTML, CSS, the handful of asset files. That still changes nothing anyone can see. public/ sits on Aurora, on a machine nobody outside the LAN can reach.

source
  ↓
build
  ↓
artifact
  ↓
deploy
  ↓
staging
  ↓
verify
  ↓
production

Only the last step actually affects https://omr.sh. Every step before it is reversible for free, just by not doing the next one.

A staging directory nobody could see

Before touching production, I created a second webroot on Pulsar, deliberately not wired into anything:

/var/www/omr.sh-next/

Caddy’s configuration didn’t reference it. No hostname pointed at it specifically. It was a directory that happened to contain files.

That gave me the property I actually wanted: I could deploy to it as many times as I liked, and the live site would not move. rsync running was not, by itself, a release.

rsync -avz --delete \
  -e 'ssh -i ~/.ssh/id_deploy_pulsar' \
  public/ deploy@pulsar:/var/www/omr.sh-next/

The deploy account on Pulsar exists only for this: its own SSH key, no sudo, write access to the destination directory and nothing else it needs to touch. It doesn’t need to be more than that, because deploying files is all it’s ever asked to do.

Looking at the real deployed files

At some point I noticed I’d only ever verified the site through hugo server on Aurora — the development preview, served from source, rebuilt live on every save. That’s not the same artifact that gets deployed. It’s close, but “close” is exactly the kind of gap that bites you later.

I wanted to look at the exact files that had actually landed on Pulsar, served the same way production would serve them, without opening anything to the outside.

caddy file-server \
  --root /var/www/omr.sh-next \
  --listen 127.0.0.1:8080

Bound to loopback, on Pulsar. Then, from my own machine:

ssh -N -L 8080:127.0.0.1:8080 pulsar

and http://127.0.0.1:8080 locally showed me exactly what was sitting in the staging directory — no public staging hostname to remember to remove later, no temporary firewall rule, no NAT, no port opened anywhere, and no change to the Caddy configuration that was actually serving traffic.

The distinction that mattered: I was no longer reviewing the development preview. I was reviewing the deployed artifact.

The cutover was deliberately boring

Once staging had been checked this way, going live was a small, mechanical change.

Before:

omr.sh {
	root * /var/www/omrsh
	file_server
	encode zstd gzip
}

After:

omr.sh {
	root * /var/www/omr.sh-next
	file_server
	encode zstd gzip
}

One line. Everything else in the block — TLS, compression, the file server directive itself — stayed exactly as it was.

The old webroot, /var/www/omrsh, was never deleted. It’s still sitting there. Which means rollback was never a recovery procedure I had to design under pressure — it was just the same three steps in reverse: point the root back, validate, reload.

Verification

Before considering it done:

curl -I https://omr.sh/
systemctl is-active caddy
homepage    200
/notes/     200
article     200
Caddy       active

I also checked the Caddy logs from the reload window itself, not to read every line, but specifically to make sure nothing in that narrow window looked like an error caused by the change I’d just made. There wasn’t one.

One slightly awkward detail

/var/www/omr.sh-next was named for what it was going to become, not for what it is now. After the cutover, it stopped being staging and became the thing actually being served.

Which means today:

rsync -> /var/www/omr.sh-next/

is a production deployment. The -next in the name is a historical artifact of the first version of this pipeline, not a description of its current role. It’s a small thing, but it’s exactly the kind of small thing that causes a mistake six months from now, when the name still says “staging” and the behavior says “production.”

What I would change next

The obvious next step is to stop naming directories after their intent and start naming them after a point in time:

releases/
├── 20260924-001/
├── 20260924-002/
└── ...

current -> releases/20260924-002/

A current symlink flipped atomically, an actual rollback to any previous release rather than just “the one before,” and a staging directory that’s separate from production again instead of being the same directory that used to be one thing and is now another.

None of that exists yet. It’s worth doing precisely because the current setup already worked once, and the failure mode of a system that works is that nobody revisits it until the day the shortcut it took stops being harmless.

What I learned

The useful part of this wasn’t automating anything. I could have scripted the whole sequence and it would have been just as easy to get wrong.

The useful part was keeping the states separate: source, build, artifact, staging, verification, production, rollback. Each one is a different thing, sitting in a different place, and moving between them is a deliberate step rather than a side effect of some other step. As long as that separation holds, it’s hard to modify the wrong thing by accident — and the one time the naming blurred that line a little, I noticed it immediately, because everything else around it was still clear.


← ~/notes