Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

Document the front door and the way back

bca53bdad334204063f07158d6885e22c5eb69ff · Keenan Nemetz · 16d ago · parent 09610c0f

Document the front door and the way back

The feature works and the package ships it, and nothing tells anyone. This is the
deploy page's half: what the front door is, the four steps that turn it on, how to
move an existing instance onto it, and how to move back.

The cloud-init templates needed a fix before they could be documented. SSH_PORT
alone only changed the port in the rendered configuration, so SSH_PORT=22 produced
a machine whose Vole tried to bind 22 itself and lost to sshd on first boot. The
render now derives the mode as well: ssh_listen = "socket", sshd's public host key,
and a guarded block in the first-boot script that appends the Include, runs sshd
-t and reloads. It checks for the drop-in before writing anything, so a package
without it leaves the machine alone with the reason in the log.

The rest is prose that had to become true: the port table, the troubleshooting
rows, the clone-URL examples, the runner's remote and ssh-keyscan in both shapes,
the backup gaining /etc/ssh/ssh_host_ed25519_key, the quickstart saying why a
development instance stays on 2222, and the architecture page naming one SSH
endpoint per instance as a choice.

check-deploy renders both flavours and fails if the front-door one still names
2222, keeps Vole's own listener, or omits any of the three settings that make the
mode work.

The design document itself is not here: #268 has not landed, so there is no
docs/design/sshd-front-door.md on main to mark accepted, and a link to it would be
a dead relative link that check-links rejects.

scripts/check-deploy.py +28−2

@@ -55,6 +55,9 @@ SAMPLE = {
55 55 # sshd front door, and then the derived values are empty so nothing names a
56 56 # port. check_front_door_flavour renders both.
57 57 "ssh_port": "2222",
58 "ssh_listen": "tcp",
59 "ssh_public_host_key_file": "",
60 "ssh_front_door": "false",
58 61 "ssh_url_port": ":2222",
59 62 "ssh_scan_args": "-p 2222",
60 63 }
@@ -303,7 +306,14 @@ def check_front_door_flavour(lists):
303 306 lease, and a clone URL with the wrong port fails at the first push.
304 307 """
305 308 bad = 0
306 overrides = {"ssh_port": "22", "ssh_url_port": "", "ssh_scan_args": ""}
309 overrides = {
310 "ssh_port": "22",
311 "ssh_listen": "socket",
312 "ssh_public_host_key_file": "/etc/ssh/ssh_host_ed25519_key.pub",
313 "ssh_front_door": "true",
314 "ssh_url_port": "",
315 "ssh_scan_args": "",
316 }
307 317 where = "deploy/cloud-init (SSH_PORT=22)"
308 318 for template, names in lists.items():
309 319 rendered = render(template, names, overrides)
@@ -320,9 +330,25 @@ def check_front_door_flavour(lists):
320 330 if "vole.yaml" in lists:
321 331 vole = render("vole.yaml", lists["vole.yaml"], overrides)
322 332 if 'ssh_addr = "0.0.0.0:22"' not in vole:
323 bad |= fail("the forge does not answer on sshd's port with SSH_PORT=22", where)
333 bad |= fail("the forge does not name sshd's port with SSH_PORT=22", where)
334 # The port alone is not the front door: without these two, Vole would try
335 # to bind 22 itself and lose to sshd on first boot.
336 for needed in ('ssh_listen = "socket"',
337 'ssh_public_host_key_file = "/etc/ssh/ssh_host_ed25519_key.pub"',
338 "SSH_FRONT_DOOR='true'",
339 "Include /usr/share/vole/sshd/vole.conf"):
340 if needed not in vole:
341 bad |= fail(f"SSH_PORT=22 renders no {needed!r}", where)
324 342 if f"ssh://git@{SAMPLE['hostname']}/" not in vole:
325 343 bad |= fail("the clone URL still carries a port with SSH_PORT=22", where)
344
345 # And the other direction: the default render must not touch sshd.
346 direct = render("vole.yaml", lists["vole.yaml"])
347 if "Include /usr/share/vole/sshd/vole.conf" not in direct:
348 bad |= fail("the default render does not mention the drop-in at all",
349 "deploy/cloud-init/vole.yaml")
350 if "SSH_FRONT_DOOR='false'" not in direct:
351 bad |= fail("the default render does not guard the sshd change", "deploy/cloud-init/vole.yaml")
326 352 return bad
327 353
328 354