My concurrency test passed. It proved nothing. When I rewrote the test, the rollback failed 5 times out of 16, and the code before my fix would have recorded all 5 as "success."
This happened while I was building Bonghwa, a tool that deploys to a fully air-gapped Windows server with a single git push. I entered it in an open-source developer contest in Korea. It didn't win anything.
It started when I tried to set up an LLM inside a closed network. Matching libraries and versions was brutal, and installs pulled with git always needed an outbound connection. In a closed network that's blocked. So Bonghwa's goal from day one was zero new things to bring in. It only uses what's already inside.
What it does
Windows Server + IIS with outbound 443 blocked. A GitHub Actions self-hosted runner needs to reach github.com, so that's out. Deployment runs only on what's already installed: Git for Windows, Gitea and MSBuild.
git push → Gitea post-receive hook → MSBuild → release folder
→ switch IIS junction → write history
rollback = point the junction back at the previous release folder
A junction is like a folder shortcut. IIS always looks at the same path, and only the release folder behind it gets swapped.
I don't have a Windows server, so I verified the whole cycle on GitHub Actions Windows runners.
The test that passed proved nothing
I wanted to know what happens when a push deploy and a manual rollback run at the same time. First I started the rollback 300ms later and hoped they'd overlap. The test passed.
But the logs showed they never overlapped once. The push side started about 4 seconds late every time because of git credential manager's host-provider auto-detection (figuring out whether the remote is GitHub, GitLab and so on), so the deploy only ran after the rollback had finished. It wasn't "safe when they overlap." It was "they didn't overlap this time."
Reading the code, something else looked off. deploy.ps1 checks $LASTEXITCODE after mklink, but rollback.ps1 didn't. If mklink failed, it would still print [rollback] DONE and log the rollback as a success, while the junction never moved. So I fixed that first.
Then I stopped relying on timing. I ran the real rollback.ps1 repeatedly from 4 parallel jobs for 3 seconds, forcing them to fight over the same junction. 16 calls in total.
5 of them actually failed in mklink: they collided while deleting and recreating the same junction at the same moment. With the old code, all 5 would have been a silent "success."
The fix (scripts/rollback.ps1):
& cmd /c mklink /J "$($C.LiveJunction)" "$Release" | Out-Null
if ($LASTEXITCODE -ne 0) { throw "junction switch failed (mklink exit $LASTEXITCODE)" }
# ...
catch {
"$(Get-Date -Format o)|ROLLBACK_FAIL|-|$_" | Add-Content $C.HistoryFile
The fixed code logged all 5 as ROLLBACK_FAIL. And after the collisions, the junction always pointed at a valid folder.
The function name that hid every error
I named my history-logging function History. PowerShell has a built-in alias history (Get-History), and when names match, the alias wins over the function. So Get-History ran instead of my function, and every failure showed Cannot bind parameter 'Count' instead of the real error. Every failure path was buried under that one message.
Only after renaming it to Write-BonghwaHistory could I see the real errors.
Does it really run air-gapped
"Works air-gapped" only means something if you actually block the network and run it. I blocked all outbound traffic on the runner with the firewall.
netsh advfirewall firewall add rule name="BonghwaBlockOutbound" dir=out action=block protocol=any
I first confirmed that github.com:443 was blocked, then ran deploy → redeploy → build failure (previous version left intact) → rollback. All passed. That confirmed the deploy path only talks to localhost (Gitea and IIS).
Worth checking
- When your concurrency test passes, do you have logs showing the runs actually overlapped?
- Do you check the exit code after external commands like
mklink? - Does any PowerShell function name collide with a built-in alias?
Get-Alias <name>tells you - Have you actually blocked the network and run it before claiming "air-gapped support"?
Code: github.com/JustJinoIT/bonghwa (MIT)
Top comments (0)