vibeapp.win

What broke

After a server move, ssh refused our deploy key

After the engine behind this site moved to a new server, its deploy key had mode 0644, so ssh would not use it. From the morning of 20 November every fetch from GitHub failed, and a post due at 07:00 did not go out. The fix sets the key's mode to 0600 before git uses it.

The short version

What went wrongAfter the engine moved from Windows to Linux, its deploy key had mode 0644, so ssh ignored it. Every GitHub fetch failed and the 07:00 post did not go out.

How we found itErrors in the engine's operations view showed the scheduler, refill and fetch failing. The cause was that the Windows bind mount had hidden the key's loose permissions.

The rule nowSet or check a file's mode in code before using it. The engine now sets the key to 0600 before git uses it, and does not count on the copy to keep the mode.

On the morning of 20 November the engine that publishes this site stopped publishing. The scheduler failed, the refill failed and the fetch from GitHub failed. A post set for 07:00 did not go out. The machine it ran on had changed.

What the engine does with the key

The engine behind www.vibeapp.win keeps a queue of approved posts. A scheduler publishes them one at a time. Each time a post goes out, a refill step adds a new approved post to the plan. Both depend on git. The engine fetches from the site’s GitHub repository over ssh. It uses a deploy key that can write to that one repository and nothing else.

The engine runs in a container. Before the move it ran on Windows. By 20 November the apps had moved to a new server. The engine moved too, and so did the key.

What went wrong

On the new server the key file had mode 0644. The owner could read and write it, and everyone else could read it.

ssh does not accept that. It treats a private key that other users can read as unsafe and ignores it. Nothing useful takes its place. The git fetch fails, and so does every step after it.

That is what happened from the morning of 20 November. The changelog entry for the fix lists the scheduler, the refill and the fetch from GitHub as failing, and points to four errors in the engine’s operations view. The code comment Claude wrote with the fix says the same: the scheduler, refill and repo alerts failed all day.

The visible result was the 07:00 post. It was planned, and it was not published.

Why it never showed up on Windows

The comment in the fix explains it in one line: on Windows, the bind mount hid the problem.

On the new server the key arrived as 0644. The material does not say exactly how the file was copied during the move, so we will not guess. What matters is that the engine trusted the file to arrive with safe permissions.

The engine was not the only thing the move broke that day. A separate changelog entry from 20 November covers the job that takes screenshots of app pages each morning. It had run on the Windows PC with Edge and stopped when the apps moved. It now runs on the new server with Chromium. That was a missing job, not a permissions problem. Both have the same cause: moving between machines takes more than copying the code.

The fix

Claude wrote the fix, and it was committed at 15:51 the same day. The commit message:

fix(publish): tighten the deploy key mode before git uses it

It adds a small check to the code that builds the ssh command for git. Before git uses the key for the first time:

  • If the key file does not exist, the check does nothing, and git fails the way it would have anyway.
  • If the file’s mode gives any permission to group or others (any bit in 0o077 set), the engine sets it to 0600 and logs a warning that others could read the key.
  • After that, a flag keeps the check from running again for the rest of the process.

The comment above the function gives the reason: tighten the key before use instead of trusting how the file was copied. The engine no longer assumes the file system did the right thing. It checks, and it changes only the part that matters to ssh.

The changelog entry for Henning says he has nothing to do, because the engine now tightens the key itself before using it. The same entry says the engine fetches from GitHub again, so scheduled posts are published and the refill runs, and the 07:00 post was set to go out in the next round.

What this cost

One post was late; it was set to go out in the next round. Refill also failed while the fetch was failing. The failures showed up as four errors in the operations view.

The real gap was that the engine trusted the key file as it was copied. On Windows the bind mount hid the problem. On the new server every fetch failed.

The rule

A move between machines carries file permissions as well as code. If something depends on a file’s mode, set or check that mode in code before using the file. Private keys and secrets that tools refuse to read when others can are the main cases. Do not count on the copy to keep the mode.