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.

Code

527 commit(s) on main

Put job execution behind an interface Keenan Nemetz · 2h ago de3eec16
source preview history blame raw 9.6 KiB
1# Cloud-init
2
3## Requirements
4
5- A DNS name such as `forge.example.com` that you can point at the server.
6- The SSH public key for the first instance admin.
7- The release `.deb` URL for the server's architecture. Copy it from the
8 [current stable release](https://rodent.software/vole/channels/stable).
9- A Vole source checkout and an [installed Vole binary](../install.md) on your
10 computer for rendering and remote administration.
11- `envsubst`, provided by `gettext-base` on Debian and Ubuntu or `gettext`
12 elsewhere.
13
14!!! warning "Account names are permanent"
15 Choose the admin name before rendering the file. There is no rename command.
16
17## 1. Render the first-boot file
18
19From the source checkout:
20
21```sh
22cd deploy/cloud-init
23
24HOSTNAME=forge.example.com \
25ADMIN_ACCOUNT=admin \
26ADMIN_EMAIL=you@example.com \
27ADMIN_SSH_KEY="$(cat ~/.ssh/id_ed25519.pub)" \
28SSH_PORT=2222 \
29VOLE_PACKAGE_URL=https://rodent.software/vole/releases/v0.2.0/artifacts/vole_0.2.0-1_amd64.deb \
30 ./render.sh > user-data.yaml
31```
32
33This example uses Vole's own listener on 2222, matching the verification commands
34below. Set `SSH_PORT=22` instead to put the system sshd in front of Vole and make
35clone URLs portless;
36[Put sshd in front of Vole](#put-sshd-in-front-of-vole) explains that choice.
37
38Inspect `user-data.yaml` before giving it to a provider. It contains the public
39SSH key, package URL, and complete first-boot configuration.
40
41| Variable | Default | Purpose |
42|---|---|---|
43| `HOSTNAME` | required | DNS name used for `public_url` and passkeys |
44| `ADMIN_ACCOUNT` | required | Permanent name of the first instance admin |
45| `ADMIN_SSH_KEY` | required | That account's public key |
46| `VOLE_PACKAGE_URL` | required | Debian package URL from the [current stable release](https://rodent.software/vole/channels/stable) |
47| `ADMIN_EMAIL` | empty | Contact address for the certificate authority |
48| `INSTANCE_NAME` | `Vole` | Display name for this forge |
49| `TLS_MODE` | `acme` | `acme` manages certificates; `proxy` serves loopback HTTP for your TLS proxy |
50| `SSH_PORT` | `2222` | `22` lets the system sshd authenticate and drops the port from clone URLs; anything else is Vole's own listener |
51
52For `TLS_MODE=proxy`, configure the proxy and client-IP header as described in
53[Running behind a proxy](../configuration.md#running-behind-a-proxy).
54
55## 2. Create the machine
56
57A small team can start with 2 vCPU, 4 GB of memory, and 40 GB of disk. Increase
58disk for large repositories, LFS objects, and CI artifacts. Give the server a
59public IPv4 address and enable provider backups.
60
61Paste `user-data.yaml` into the provider's user-data field:
62
63| Provider | Suggested image and size | User-data location |
64|---|---|---|
65| Hetzner Cloud | Ubuntu 24.04, CX22 | **Add Server → Cloud config** |
66| DigitalOcean | Ubuntu 24.04 LTS x64, Basic 2 vCPU / 4 GB | **Create Droplet → Advanced options → User data** |
67| AWS | Canonical Ubuntu 24.04 LTS, `t3.medium`, 40 GiB encrypted gp3 | **Launch instance → Advanced details → User data** |
68
69On AWS, use a public subnet with auto-assigned public IPv4. Debian 13 is also
70supported on Hetzner and DigitalOcean. Provider names and console layouts can
71change; the requirement is an Ubuntu or Debian machine that accepts cloud-init
72user data.
73
74## 3. Open the required ports
75
76| Direction | TCP port | Allowed source | Purpose |
77|---|---:|---|---|
78| Inbound | 22 | Your administrators | Shell access, and Git over SSH when sshd is the front door |
79| Inbound | 2222 | People who push | Vole Git over SSH when Vole's own listener serves it |
80| Inbound | 80 | Anywhere | ACME challenge and HTTPS redirect |
81| Inbound | 443 | Anywhere | Forge over HTTPS |
82| Outbound | any | Package and certificate providers | Installation and renewal |
83
84With `SSH_PORT=22` there is no inbound 2222 to open: sshd already answers on 22,
85and Vole is reached only through it and over the local socket. Keep 2222 closed
86unless you also run the built-in listener.
87
88Use the provider firewall or AWS security group. Hetzner and DigitalOcean servers
89can be open until a firewall is attached; AWS instances normally require inbound
90rules. For `TLS_MODE=proxy`, expose only the ports your arrangement needs and
91keep Vole's HTTP listener on loopback.
92
93## 4. Point DNS at the server
94
95Create an `A` record for `forge.example.com` with the machine's public IPv4
96address. Vole cannot obtain a certificate until this name resolves to the server.
97
98Cloud-init runs only on first boot. Setup output is written to
99`/var/log/vole-first-boot.log`; service output is available with
100`journalctl -u vole`.
101
102Editing user data after creation does not rerun cloud-init. Change
103`/etc/vole/vole.toml` and restart Vole for configuration updates:
104
105```sh
106sudo -e /etc/vole/vole.toml
107sudo systemctl restart vole
108```
109
110## 5. Verify and enroll the admin
111
112Open `https://forge.example.com`. The first request can take a few seconds while
113Vole obtains its certificate.
114
115From your computer, issue the admin's one-time passkey enrollment link:
116
117```sh
118vole admin --remote ssh://git@forge.example.com:2222 account invite admin
119```
120
121With `SSH_PORT=22` the remote is `ssh://git@forge.example.com` — no port. The
122commands below use `:2222` for the built-in listener shown in step 1; drop it for
123the front door.
124
125Open the link in a private browser window and register a passkey. Then create and
126clone a repository:
127
128```sh
129vole admin --remote ssh://git@forge.example.com:2222 \
130 repo create demo
131vole admin --remote ssh://git@forge.example.com:2222 \
132 acl set-default-role demo reader
133git clone ssh://git@forge.example.com:2222/demo.git
134```
135
136Omit `set-default-role` if `demo` should remain private.
137
138## Put sshd in front of Vole (optional) {: #put-sshd-in-front-of-vole }
139
140Choosing `SSH_PORT=22` in step 1 puts the system sshd on port 22 and configures
141Vole to answer over a local socket. Clone URLs lose `:2222`, sshd owns the host
142key that clients verify, and runners must pin that key instead of Vole's.
143
144### A fresh cloud-init instance
145
146Set `SSH_PORT=22` in the complete render command from step 1. The rendered file
147adds `ssh_listen = "socket"`, appends the sshd include on first boot, and removes
148the port from generated clone URLs. Runners must use `ssh://git@forge.example.com`
149and pin sshd's host key rather than Vole's.
150
151## Set up a runner with cloud-init
152
153From a Vole source checkout on your computer:
154
155### 1. Render the runner's first-boot configuration
156
157```sh
158cd deploy/cloud-init
159FORGE_HOST=forge.example.com \
160SSH_PORT=2222 \
161VOLE_PACKAGE_URL=https://rodent.software/vole/releases/v0.2.0/artifacts/vole_0.2.0-1_amd64.deb \
162 ./render.sh runner > runner-user-data.yaml
163```
164
165Use the same `SSH_PORT` as the forge: `22` for its sshd front door, `2222` for
166Vole's own listener. The rendered runner takes its remote and its `ssh-keyscan`
167from it, so a mismatch fails the first lease.
168
169`render.sh` requires `envsubst`, provided by `gettext-base` on Debian and Ubuntu
170or `gettext` on other distributions. Inspect the rendered file before using it.
171
172### 2. Create the runner machine
173
174Create a machine with your provider and paste `runner-user-data.yaml` into its
175user-data or cloud-config field. Use the same Ubuntu or Debian image and package
176architecture. Allow inbound shell SSH on port 22 only from your addresses; the
177runner makes outbound connections to the forge and container registries.
178
179Size memory for `RUNNER_JOBS × RUNNER_MEMORY`. Leave additional room for the
180runner and host, and size disk for saved checkouts, caches, and OCI images.
181Image storage is bounded by the runtime's own prune: `--image-max-age` (default
182`168h`) sets the age, `0` keeps every image, and `--container-pull never` keeps
183every tagged image because that runner cannot fetch one again.
184
185### 3. Wait for first boot
186
187Setup output is in `/var/log/vole-runner-first-boot.log` on the runner. The
188configuration creates an unprivileged `ci-runner` user, installs rootless Podman,
189generates the runner's SSH key, pins the forge's host key, and enables the
190service.
191
192First boot pins the first host key returned by `ssh-keyscan`. Before allowing
193production jobs, compare `/etc/vole/runner_known_hosts` with the forge's host key
194fingerprint through a trusted channel. Replace the file if it does not match.
195
196### Runner cloud-init settings
197
198| Variable | Default | Purpose |
199|---|---|---|
200| `FORGE_HOST` | required | Forge DNS name; `SSH_PORT` decides what SSH means |
201| `SSH_PORT` | `2222` | `22` reaches the instance through its sshd, with no port in the remote |
202| `VOLE_PACKAGE_URL` | required | Debian package URL from the [current stable release](https://rodent.software/vole/channels/stable) |
203| `RUNNER_HOSTNAME` | `vole-runner` | Machine host name |
204| `RUNNER_RUNTIME` | `podman` | OCI runtime |
205| `RUNNER_NETWORK` | `bridge` | Maximum network offered to jobs |
206| `RUNNER_DIR` | `/var/lib/vole-runner` | Checkouts, caches, and runner home |
207| `RUNNER_LABEL_NAMES` | `linux` | Space-separated labels matched by `runs-on` |
208| `RUNNER_JOBS` | `1` | Concurrent job slots |
209| `RUNNER_MEMORY` | `4G` | Memory limit per job container |
210| `RUNNER_PIDS` | `2048` | Process limit per job container |
211| `RUNNER_TMPFS` | `1G` | Memory-backed `/tmp` size per job |
212| `RUNNER_DISK_RESERVE` | `2G` | Free space preserved below `RUNNER_DIR` |
213
214The unit's `MemoryMax=90%` is a host-level backstop, not a replacement for
215per-job limits. [Running several jobs at once](../runner.md#running-several-jobs-at-once)
216explains how to size concurrent slots.
217
218Register and authorize the runner under [Runners](../runner.md#register-and-authorize-the-runner).
219
220## Next
221
222- [Deploy on Linux](linux.md) — install on a machine you already manage.
223- [Deploy on macOS](macos.md) — Homebrew and launchd.
224- [Deploy on Windows](windows.md) — the MSI and Windows service.
225- [Runners](../runner.md) — register and verify the runner.
226