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.

deploy/cloud-init/vole.yaml +32−16

@@ -41,16 +41,12 @@ write_files:
41 41 public_url = "https://${hostname}"
42 42 acme_email = "${admin_email}"
43 43
44 # The only write transport: Git over SSH, authenticated by key.
44 # The only write transport: Git over SSH, authenticated by key. With
45 # SSH_PORT=22 the system sshd authenticates and Vole answers on a socket,
46 # so no clone URL carries a port; ssh_addr is then only what the URLs say.
45 47 ssh_addr = "0.0.0.0:${ssh_port}"
46
47 # Or put the system sshd in front, so no clone URL carries a port. The
48 # package creates the `git` account and ships the sshd drop-in but does not
49 # install it: /usr/share/vole/sshd/vole.conf on the machine has the four
50 # steps. Then uncomment these and set ssh_addr to 0.0.0.0:22.
51 #
52 # ssh_listen = "socket"
53 # ssh_public_host_key_file = "/etc/ssh/ssh_host_ed25519_key.pub"
48 ssh_listen = "${ssh_listen}"
49 ssh_public_host_key_file = "${ssh_public_host_key_file}"
54 50
55 51 instance_name = "${instance_name}"
56 52
@@ -67,14 +63,11 @@ write_files:
67 63 public_url = "https://${hostname}"
68 64 # git_http_client_ip_header = "X-Forwarded-For"
69 65
70 # The only write transport: Git over SSH, authenticated by key.
66 # The only write transport: Git over SSH, authenticated by key. See the note
67 # in vole.acme.toml: SSH_PORT=22 puts the system sshd in front.
71 68 ssh_addr = "0.0.0.0:${ssh_port}"
72
73 # See the note in vole.acme.toml: ssh_listen = "socket" moves SSH behind
74 # sshd, and then ssh_addr names port 22.
75 #
76 # ssh_listen = "socket"
77 # ssh_public_host_key_file = "/etc/ssh/ssh_host_ed25519_key.pub"
69 ssh_listen = "${ssh_listen}"
70 ssh_public_host_key_file = "${ssh_public_host_key_file}"
78 71
79 72 instance_name = "${instance_name}"
80 73
@@ -122,7 +115,30 @@ write_files:
122 115 rm -f /opt/vole-deploy/vole.deb
123 116 fi
124 117
118 # Checked before anything is written: a package without the drop-in cannot
119 # serve the front door, and a configuration that says otherwise is a forge
120 # nobody can push to.
121 SSH_FRONT_DOOR='${ssh_front_door}'
122 if [ "$SSH_FRONT_DOOR" = "true" ] && [ ! -f /usr/share/vole/sshd/vole.conf ]; then
123 echo "SSH_PORT=22 needs /usr/share/vole/sshd/vole.conf: not in this package" >&2
124 exit 1
125 fi
126
125 127 install -m 0644 "/opt/vole-deploy/vole.$TLS_MODE.toml" /etc/vole/vole.toml
128
129 # The front door is a change to sshd, so it is made here rather than by the
130 # package. The drop-in must be last: a Match block applies to everything
131 # after it, and an Include placed above other settings would scope them to
132 # the matched user.
133 if [ "$SSH_FRONT_DOOR" = "true" ]; then
134 if ! grep -q 'Include /usr/share/vole/sshd/vole.conf' /etc/ssh/sshd_config; then
135 printf '\nInclude /usr/share/vole/sshd/vole.conf\n' >>/etc/ssh/sshd_config
136 fi
137 sshd -t
138 systemctl reload sshd
139 echo "sshd now fronts Vole: SSH_PORT=${ssh_port}"
140 fi
141
126 142 if [ "$TLS_MODE" = "acme" ]; then
127 143 install -d -m 0755 /etc/systemd/system/vole.service.d
128 144 install -m 0644 /opt/vole-deploy/bind.conf /etc/systemd/system/vole.service.d/bind.conf