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.
Restructure documentation around reader tasks
348a43c364fbb04be834af44a7cd43a0931fa280 · Keenan Nemetz · 20d ago · parent b7383c19
Restructure documentation around reader tasks Group the site by getting started, collaboration, CI, publishing, and administration. Rewrite the guides as executable procedures and move issue formats, merge semantics, configuration defaults, customization, and access-control mechanics into dedicated references. Verify the quickstart and review flow against a throwaway instance, execute the service recipe, inspect the rendered site, and run the complete verify workflow. Closes: 01M7B6X6RDYBAP3JVA5SYSA1K8
docs/configuration.md +150−395
| @@ -1,42 +1,25 @@ | |||
| 1 | 1 | # Configuration | |
| 2 | 2 | ||
| 3 | Vole is designed to work out of the box. The defaults are enough for a local | ||
| 4 | instance. Change them when you want Vole to listen on another address, limit what | ||
| 5 | people can push, or serve websites. | ||
| 3 | Vole reads one TOML file at startup. The built-in defaults support a loopback | ||
| 4 | instance; configure a public URL and HTTPS before people use browser sign-in. | ||
| 5 | The Admin page's **Configuration** tab shows the effective values read-only. | ||
| 6 | 6 | ||
| 7 | There is no general control panel. One TOML file is the whole configuration. An | ||
| 8 | instance admin can see the effective values and the file they came from on the | ||
| 9 | Admin page's Configuration tab, and that view is read-only. | ||
| 10 | |||
| 11 | The one exception is the customizable repository: `instance_repo` names a | ||
| 12 | private repository whose tree supplies the landing page's introduction, a | ||
| 13 | stylesheet, a favicon, and static assets. It is not written to `vole.toml`, | ||
| 14 | because the packaged service runs with `ProtectSystem=strict` and cannot write | ||
| 15 | its config file. See [Customizing the instance](#customizing-the-instance). | ||
| 16 | |||
| 17 | ## A minimal config | ||
| 18 | |||
| 19 | ```toml | ||
| 20 | data_dir = "./data" | ||
| 21 | http_addr = "127.0.0.1:8080" | ||
| 22 | ssh_addr = "127.0.0.1:2222" | ||
| 23 | # public_url = "https://forge.example.com" | ||
| 24 | ``` | ||
| 7 | Use this guide for common setups. The | ||
| 8 | [configuration reference](reference/configuration.md) lists every setting, | ||
| 9 | default, limit, and refused combination. | ||
| 25 | 10 | ||
| 26 | 11 | ## Which config Vole reads | |
| 27 | 12 | ||
| 28 | Local commands look for a config in this order: | ||
| 13 | Local commands look for a configuration in this order: | ||
| 29 | 14 | ||
| 30 | 15 | 1. `--config <path>` | |
| 31 | 16 | 2. the `VOLE_CONFIG` environment variable | |
| 32 | 17 | 3. `./vole.toml` | |
| 33 | 18 | 4. `~/.vole/vole.toml` | |
| 34 | 19 | ||
| 35 | If none exists, Vole uses the built-in defaults with `data_dir = "./data"`. | ||
| 36 | This is why `vole admin init --dir ~/.vole` works from any directory: later | ||
| 37 | commands find `~/.vole/vole.toml` without repeating the path. For an instance | ||
| 38 | somewhere else, run commands from that directory, pass `--config`, or set | ||
| 39 | `VOLE_CONFIG`: | ||
| 20 | If no file exists, Vole uses its built-in defaults with `data_dir = "./data"`. | ||
| 21 | Initializing `~/.vole` therefore lets later commands find the instance from any | ||
| 22 | directory. For another location, run from that directory or name the file: | ||
| 40 | 23 | ||
| 41 | 24 | ```sh | |
| 42 | 25 | vole admin --config /srv/vole/vole.toml account list | |
| @@ -44,336 +27,112 @@ export VOLE_CONFIG=/srv/vole/vole.toml | |||
| 44 | 27 | vole admin account list | |
| 45 | 28 | ``` | |
| 46 | 29 | ||
| 47 | ## Settings | ||
| 48 | |||
| 49 | | Setting | Default | What it does | | ||
| 50 | |---|---:|---| | ||
| 51 | | `data_dir` | `"./data"` | Where Vole keeps repositories, databases, stored files, and the audit log | | ||
| 52 | | `secrets_key` | `<data_dir>/secrets.key` | The file holding the key that seals each repository's secrets. Point it somewhere a backup of `data_dir` does not reach, so a copy of the database is a copy of ciphertext | | ||
| 53 | | `http_addr` | `"127.0.0.1:8080"` | Address for the web interface and anonymous Git clone; with `https_addr`, the ACME challenge and redirect address | | ||
| 54 | | `https_addr` | empty | Address for automatic HTTPS; setting it enables ACME | | ||
| 55 | | `ssh_addr` | `"127.0.0.1:2222"` | Address for SSH, the authenticated Git transport; its port is also the one the clone link names, while the clone host comes from `public_url` | | ||
| 56 | | `ssh_max_connections` | `64` | Simultaneous connections on that listener; past it a connection is closed before the handshake rather than queued | | ||
| 57 | | `ssh_max_git_processes` | `16` | Git processes across every SSH connection; past it a command waits a short while, then is told to retry | | ||
| 58 | | `ssh_handshake_timeout_seconds` | `20` | How long a connection may take to finish the SSH handshake before it is dropped | | ||
| 59 | | `instance_name` | `"Vole"` | What the instance calls itself: the home page heading, every page's document title, and the brand link's accessible name | | ||
| 60 | | `instance_repo` | `"vole-instance"` | Repository whose tree customizes the instance; empty disables it | | ||
| 61 | | `public_url` | empty | Canonical browser address; must be HTTPS to enable passkey sign-in | | ||
| 62 | | `acme_email` | empty | Contact address given to the certificate authority | | ||
| 63 | | `acme_domains` | empty | Host names to obtain certificates for; defaults to the host in `public_url` | | ||
| 64 | | `acme_cache_dir` | `<data_dir>/acme` | Where the ACME account key and certificates are stored | | ||
| 65 | | `acme_directory_url` | Let's Encrypt production | ACME directory; use the staging URL or a private CA while testing | | ||
| 66 | | `dev_login` | empty | Development only: sign loopback browser requests in as this account; requires `dev_only` | | ||
| 67 | | `dev_only` | `false` | Acknowledge that this instance is a development instance; without it `dev_login` is refused | | ||
| 68 | | `open_registration` | `false` | Let anyone create an account by registering a passkey; requires `public_url` to be HTTPS | | ||
| 69 | | `open_registration_role` | `"none"` | Instance-wide role a self-registered account gets; applies to public repositories, `admin` is refused | | ||
| 70 | | `max_blob_bytes` | `104857600` (100 MiB) | Largest single file accepted in a push | | ||
| 71 | | `receive_max_bytes` | `1073741824` (1 GiB) | Largest whole push Vole will accept | | ||
| 72 | | `lfs_object_max_bytes` | `2147483648` (2 GiB) | Largest single LFS object | | ||
| 73 | | `lfs_warn_bytes` | `5242880` (5 MiB) | Warn when a large binary is committed outside LFS; `0` turns the warning off | | ||
| 74 | | `repo_max_refs` | `0` (no limit) | Branches and tags in one repository; a push that would exceed it is refused | | ||
| 75 | | `repo_max_metadata_entries` | `0` (no limit) | Documents on the metadata branch in one repository: issues, requests, comments, approvals, and release records | | ||
| 76 | | `repo_max_metadata_bytes` | `0` (no limit) | Total size of those files | | ||
| 77 | | `repo_max_bytes` | `0` (no limit) | Git objects in one repository; a repository already over it refuses further pushes | | ||
| 78 | | `repo_max_lfs_bytes` | `0` (no limit) | LFS objects and run artifacts in one repository, checked on upload | | ||
| 79 | | `contributor_writes_per_hour` | `300` | Browser writes an untrusted (`contribute`) account may make in an hour: issues, comments, requests, labels, state changes. Maintainers and admins are trusted and are not budgeted | | ||
| 80 | | `git_http` | `true` | Serve anonymous clone, fetch and LFS downloads over smart HTTP; off leaves SSH as the only transport | | ||
| 81 | | `git_http_max_concurrent` | `16` | Simultaneous anonymous reads on that transport; past it a clone is refused with `503` and `Retry-After` | | ||
| 82 | | `git_http_max_per_client` | `8` | Simultaneous reads from one address; `0` leaves only the concurrency bound | | ||
| 83 | | `git_http_client_ip_header` | empty | Header a trusted proxy sets with the client address, e.g. `"X-Forwarded-For"`. The same header is what the sign-in rate limits key on | | ||
| 84 | | `git_http_timeout_seconds` | `600` | How long one clone may run, Git process included | | ||
| 85 | | `lease_seconds` | `60` | How long a runner may hold a job without checking in before it is given to someone else | | ||
| 86 | | `max_jobs_per_repo` | `0` | How many jobs one repository may run at once; `0` means no limit | | ||
| 87 | | `pages_domain` | empty | Domain suffix for websites, as in `<repo>.<pages_domain>`; empty disables sites. Use a different registrable domain from the forge when sites are untrusted — see [Sites](sites.md#same-site-risk) | | ||
| 88 | | `pages_ref` | `"pages"` | Branch served as a website | | ||
| 89 | | `pages_procs` | `4` | Number of Git reader processes per active site | | ||
| 90 | | `pages_cache_bytes` | `33554432` (32 MiB) | Memory used to cache site files | | ||
| 91 | |||
| 92 | The two push limits work at different levels. `max_blob_bytes` checks each file in | ||
| 93 | a push. `receive_max_bytes` caps the size of the whole push and is enforced by Git | ||
| 94 | while it receives the data, before any branch is updated. | ||
| 95 | |||
| 96 | ## Anonymous read limits | ||
| 97 | |||
| 98 | Smart HTTP is the transport an unauthenticated visitor uses: `git clone`, | ||
| 99 | fetch, and the LFS downloads that share the same URLs. Pushes never arrive there; | ||
| 100 | they are SSH only. Because the reader has no account, the transport is bounded in | ||
| 101 | every dimension that costs the instance something. | ||
| 102 | |||
| 103 | ```toml | ||
| 104 | git_http = true | ||
| 105 | git_http_max_concurrent = 16 | ||
| 106 | git_http_max_per_client = 8 | ||
| 107 | git_http_client_ip_header = "X-Forwarded-For" | ||
| 108 | git_http_timeout_seconds = 600 | ||
| 109 | ``` | ||
| 30 | Restart `vole serve` after editing the file. | ||
| 110 | 31 | ||
| 111 | `git_http_max_concurrent` bounds simultaneous reads, and a clone past it is | ||
| 112 | refused with `503` and `Retry-After` rather than queued: a waiting queue is | ||
| 113 | another thing that grows with load. `git_http_max_per_client` keeps one address | ||
| 114 | from taking every slot, and `0` turns that rule off. | ||
| 32 | ## A minimal config | ||
| 115 | 33 | ||
| 116 | Behind a proxy every connection appears to come from the proxy, so the | ||
| 117 | per-client rule needs the address the proxy saw. Name the header it sets: | ||
| 34 | A local instance needs only paths and listeners: | ||
| 118 | 35 | ||
| 119 | 36 | ```toml | |
| 120 | git_http_client_ip_header = "X-Forwarded-For" | ||
| 37 | data_dir = "./data" | ||
| 38 | http_addr = "127.0.0.1:8080" | ||
| 39 | ssh_addr = "127.0.0.1:2222" | ||
| 40 | # public_url = "https://forge.example.com" | ||
| 121 | 41 | ``` | |
| 122 | 42 | ||
| 123 | Vole takes the last entry of that header, which is the one the nearest proxy | ||
| 124 | appended. Leave it empty when nothing sits in front of Vole: the connection's own | ||
| 125 | address cannot be forged, and a header no proxy sets can. | ||
| 43 | `vole admin init --dir <directory>` writes a commented starter file. Keep the | ||
| 44 | listeners on loopback until you have chosen how to expose the service. | ||
| 126 | 45 | ||
| 127 | `git_http = false` removes the endpoints entirely, which is the setting for an | ||
| 128 | instance whose repositories are all internal and none of which are cloned | ||
| 129 | anonymously. SSH pushes are unaffected. LFS downloads share the HTTP URLs, so they | ||
| 130 | go with it; `git lfs` will report a missing object rather than fetch from SSH. | ||
| 131 | |||
| 132 | A release archive is served under the same limit: `git_http_timeout_seconds` | ||
| 133 | does not apply to the release page's tarball, which has its own concurrency bound. | ||
| 134 | |||
| 135 | ## Customizing the instance | ||
| 46 | ## Public URL | ||
| 136 | 47 | ||
| 137 | `instance_repo` names a repository whose tree customizes the instance. The idea is | ||
| 138 | GitHub's `.github` repository: fixed paths read as data, not templates. | ||
| 48 | Set `public_url` to the canonical browser origin: | ||
| 139 | 49 | ||
| 140 | 50 | ```toml | |
| 141 | instance_repo = "vole-instance" # the default; empty disables customization | ||
| 51 | public_url = "https://forge.example.com" | ||
| 142 | 52 | ``` | |
| 143 | 53 | ||
| 144 | An instance admin can scaffold it from **Admin → Configuration** (the Instance | ||
| 145 | repository panel), or create a repository with that name normally and push the | ||
| 146 | files. `vole admin init` creates it with the starter files when it is missing, | ||
| 147 | so a new instance starts with it. It is an ordinary repository: it appears in the | ||
| 148 | repository list, has the usual pages, history, issues, and change requests, and | ||
| 149 | its visibility is set in Settings. It is private by default, so only instance | ||
| 150 | admins see it until one of them publishes it. The files below are served to | ||
| 151 | visitors either way. | ||
| 54 | Vole uses this origin for passkeys, generated issue and release links, clone | ||
| 55 | URLs, LFS downloads, and Go module import prefixes. Browser sign-in is enabled | ||
| 56 | only when this is an HTTPS URL. The SSH clone host also comes from this name; | ||
| 57 | its port comes from `ssh_addr`. | ||
| 152 | 58 | ||
| 153 | | Path | What it does | | ||
| 154 | |---|---| | ||
| 155 | | `profile/README.md` | Landing page introduction; markdown, sanitized like an issue body | | ||
| 156 | | `profile/private/README.md` | Replaces it for signed-in viewers when present | | ||
| 157 | | `profile/custom.css` | Instance-wide styles, loaded last | | ||
| 158 | | `profile/themes/<id>.css` | One stylesheet per selectable theme | | ||
| 159 | | `profile/favicon.svg` | Replaces the favicon links | | ||
| 160 | | `assets/` | Served at `/-/static/custom/assets/`; CSS, images and fonts only | | ||
| 161 | |||
| 162 | Other files are ignored, and assets are limited to CSS, images and fonts: a | ||
| 163 | same-origin script is not a theme. `profile/README.md` and every other file are | ||
| 164 | edited by pushing; the home page has no separate editor. A push is live within a | ||
| 165 | couple of seconds, and a load failure keeps the previous theme. | ||
| 166 | |||
| 167 | The introduction is rendered and sanitized the same way an issue body is, and it | ||
| 168 | appears above the repository list. An empty `profile/README.md` removes the | ||
| 169 | card's body. The heading is `instance_name`, which is what the forge calls itself: | ||
| 59 | Do not add a path, query, fragment, or user information. Set `public_url` on | ||
| 60 | every non-loopback instance so generated links do not depend on a request's | ||
| 61 | untrusted `Host` header. | ||
| 170 | 62 | ||
| 171 | ```toml | ||
| 172 | instance_name = "Acme Forge" | ||
| 173 | ``` | ||
| 63 | ## Automatic HTTPS with ACME | ||
| 174 | 64 | ||
| 175 | The name is also the document title on every page (`Issues · Acme Forge`) and | ||
| 176 | the accessible name of the brand link ("Acme Forge home"), so a renamed instance | ||
| 177 | is renamed in the tab as well as in the heading. The brand mark in the top bar | ||
| 178 | stays Vole's emblem, and prose about the software itself, such as the status | ||
| 179 | page's "restart Vole", keeps the product name: the instance name describes the | ||
| 180 | organisation's forge, not the program serving it. | ||
| 181 | |||
| 182 | ### Theming | ||
| 183 | |||
| 184 | `profile/custom.css` is loaded after the built-in `vole.css`, `everforest.css`, | ||
| 185 | and `palettes.css`, and after any theme pack, so it can override every theme. | ||
| 186 | Override the design tokens rather than copying rules; the layout, contrast, and | ||
| 187 | responsive behaviour then stay intact. | ||
| 188 | |||
| 189 | Vole ships the Everforest variants, Catppuccin Mocha and Latte, Nord, Solarized | ||
| 190 | Light, Rosé Pine Moon and Dawn, Kanagawa Wave, Dracula, Tokyo Night, and Ayu | ||
| 191 | Light. The Appearance picker lists them before the instance's own theme packs. | ||
| 192 | |||
| 193 | #### Theme packs | ||
| 194 | |||
| 195 | Account → Appearance lists the built-in Everforest variants plus every CSS file | ||
| 196 | in `profile/themes/`. A theme is self-describing: the file name is the id and | ||
| 197 | the label, and the rules are scoped to that id. `acme-ocean.css` is the | ||
| 198 | “Acme Ocean” theme; `acme-paper.css` is “Acme Paper”. | ||
| 199 | |||
| 200 | ```css | ||
| 201 | /* profile/themes/acme-ocean.css */ | ||
| 202 | :root[data-theme="acme-ocean"] { | ||
| 203 | color-scheme: dark; | ||
| 204 | --bg: #0b1720; | ||
| 205 | --bg-panel: #102433; | ||
| 206 | --bg-raised: #163041; | ||
| 207 | --fg: #d7e8f0; | ||
| 208 | --fg-muted: #8fb0c0; | ||
| 209 | --fg-faint: #6f8f9f; | ||
| 210 | --accent: #38bdf8; | ||
| 211 | --accent-fg: #04121a; | ||
| 212 | --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent); | ||
| 213 | } | ||
| 214 | ``` | ||
| 65 | Vole can obtain and renew certificates without a separate proxy. Point DNS at | ||
| 66 | the server, make TCP ports 80 and 443 reachable, and set: | ||
| 215 | 67 | ||
| 216 | ```css | ||
| 217 | /* profile/themes/acme-paper.css */ | ||
| 218 | :root[data-theme="acme-paper"] { | ||
| 219 | color-scheme: light; | ||
| 220 | --bg: #fffdf7; | ||
| 221 | --bg-panel: #f8f3e8; | ||
| 222 | --bg-raised: #f1eadc; | ||
| 223 | --fg: #2b2a26; | ||
| 224 | --fg-muted: #6b675d; | ||
| 225 | --fg-faint: #8d887c; | ||
| 226 | --accent: #9a5b13; | ||
| 227 | --accent-fg: #fffdf7; | ||
| 228 | --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent); | ||
| 229 | } | ||
| 68 | ```toml | ||
| 69 | http_addr = ":80" | ||
| 70 | https_addr = ":443" | ||
| 71 | public_url = "https://forge.example.com" | ||
| 72 | acme_email = "admin@example.com" | ||
| 230 | 73 | ``` | |
| 231 | 74 | ||
| 232 | The file name must use lowercase letters, digits, and dashes (at most 41 | ||
| 233 | characters), and cannot collide with a built-in value: `system`, `nord`, | ||
| 234 | `dracula`, `tokyo-night`, or a name starting with `everforest-`, `catppuccin-`, | ||
| 235 | `solarized-`, `rose-pine-`, `kanagawa-`, or `ayu-`. A file whose name breaks that | ||
| 236 | rule fails the snapshot load with a message on the Admin page; the previous theme | ||
| 237 | stays in use. A light theme must set `color-scheme: light` | ||
| 238 | and light surface and text tokens, or form controls and inherited colours stay | ||
| 239 | dark. | ||
| 240 | |||
| 241 | Every theme file is linked on every page, so keep them small. The selection is a | ||
| 242 | browser preference, not an account setting: it lives in `localStorage`, and a | ||
| 243 | theme whose file is deleted falls back to System. | ||
| 244 | |||
| 245 | #### Tokens | ||
| 246 | |||
| 247 | Use `:root[data-theme]`, not plain `:root`. Everforest sets its tokens on | ||
| 248 | `:root[data-theme^="everforest-"]`, which is more specific than `:root`, so a | ||
| 249 | plain `:root` override can lose even though the custom file loads later. | ||
| 250 | |||
| 251 | ```css | ||
| 252 | :root[data-theme] { | ||
| 253 | --accent: #c678dd; | ||
| 254 | --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent); | ||
| 255 | --radius: 4px; | ||
| 256 | --radius-lg: 6px; | ||
| 257 | --page-max: 1200px; | ||
| 258 | } | ||
| 259 | ``` | ||
| 75 | Setting `https_addr` enables ACME. The HTTPS listener serves the forge; the HTTP | ||
| 76 | listener answers HTTP-01 challenges and redirects everything else to HTTPS. Vole | ||
| 77 | also tries TLS-ALPN-01 on port 443. Certificates are obtained on first use and | ||
| 78 | renewed in the background. | ||
| 260 | 79 | ||
| 261 | A value that has to differ between dark and light modes belongs in one of these | ||
| 262 | blocks. They match every Everforest variant: | ||
| 80 | By default, the certificate name comes from `public_url`. To serve multiple | ||
| 81 | names, list each one explicitly: | ||
| 263 | 82 | ||
| 264 | ```css | ||
| 265 | :root[data-theme^="everforest-dark"] { --bg: #101418; } | ||
| 266 | :root[data-theme^="everforest-light"] { --bg: #fffdf7; } | ||
| 83 | ```toml | ||
| 84 | acme_domains = ["forge.example.com", "git.example.com"] | ||
| 267 | 85 | ``` | |
| 268 | 86 | ||
| 269 | The tokens, grouped by what they change: | ||
| 270 | |||
| 271 | | Group | Tokens | | ||
| 272 | |---|---| | ||
| 273 | | surfaces | `--bg`, `--bg-panel`, `--bg-raised`, `--bg-hover`, `--bg-active`, `--border`, `--border-strong` | | ||
| 274 | | text | `--fg`, `--fg-muted`, `--fg-faint` | | ||
| 275 | | identity | `--accent`, `--accent-fg`, `--accent-soft` | | ||
| 276 | | status | `--good`, `--good-soft`, `--bad`, `--bad-soft`, `--warn`, `--warn-soft`, `--running`, `--merged`, `--merged-soft`, `--status-fg` | | ||
| 277 | | shape | `--radius`, `--radius-lg`, `--page-max`, `--page-gutter`, `--search-w` | | ||
| 278 | | type | `--font`, `--mono`, `--fs`, `--lh`. Leave `--font-scale` alone: it is the reader's text-size preset | | ||
| 279 | | syntax | `--syn-comment`, `--syn-punctuation`, `--syn-operator`, `--syn-number`, `--syn-string`, `--syn-keyword`, `--syn-function`, `--syn-type`, `--syn-variable`, `--syn-added`, `--syn-deleted` | | ||
| 280 | |||
| 281 | If a token cannot express the change, these page-level classes cover most | ||
| 282 | re-skins: `.panel`, `.readme`, `.md`, `.repo-card`, `.repo-grid`, `.home-grid`, | ||
| 283 | `.home-rail`, `.repohead`, `.tabs`, `.chip`, `.label`, `.status`, | ||
| 284 | `.config-table`, `.diff`, `.blob`. They are not a public API: an upgrade may move | ||
| 285 | markup, so prefer a token when one exists. | ||
| 286 | |||
| 287 | ## Public URL | ||
| 87 | Wildcard certificates are not supported. ACME state, including the account key, | ||
| 88 | lives in `data/acme/` by default. Back it up with the instance. | ||
| 288 | 89 | ||
| 289 | Set `public_url` when people reach Vole through a different address than | ||
| 290 | `http_addr`, for example through a proxy: | ||
| 90 | While testing, avoid production certificate rate limits: | ||
| 291 | 91 | ||
| 292 | 92 | ```toml | |
| 293 | public_url = "https://forge.example.com" | ||
| 93 | acme_directory_url = "https://acme-staging-v02.api.letsencrypt.org/directory" | ||
| 294 | 94 | ``` | |
| 295 | 95 | ||
| 296 | The CLI uses this to print a link to an issue, comment, or release it just | ||
| 297 | created. It is also the WebAuthn relying-party origin: browser sign-in is enabled | ||
| 298 | only when `public_url` is an `https://` URL. Vole does not change how it routes | ||
| 299 | requests based on this setting. | ||
| 300 | |||
| 301 | The host name in `public_url` is also the import prefix a Go module path uses: | ||
| 302 | `public_url = "https://forge.example.com"` publishes a public repository as | ||
| 303 | `forge.example.com/<repository>`. See [Go modules](go-modules.md). | ||
| 304 | |||
| 305 | It is also where generated clone and LFS download links point. That is a security | ||
| 306 | property, not a convenience: without it those links follow the request's `Host` | ||
| 307 | header, which is a value the browser's request carries and an attacker can choose. | ||
| 308 | Copying a clone URL out of a page and into a terminal is normal use, so the URL a | ||
| 309 | page shows should be the instance's, not the caller's. Set `public_url` on any | ||
| 310 | instance other than a loopback preview. | ||
| 311 | |||
| 312 | The same host is what the SSH clone link shows, with the port from `ssh_addr`: | ||
| 313 | an instance listening on `0.0.0.0:2222` with `public_url = | ||
| 314 | "https://forge.example.com"` offers `ssh://git@forge.example.com:2222/demo.git`. | ||
| 315 | A bind address is not something a person can connect to, so it is never used as | ||
| 316 | the clone host when a name is configured. | ||
| 317 | |||
| 318 | Forwarded headers (`X-Forwarded-Proto`, `X-Forwarded-For`) are believed only when | ||
| 319 | `git_http_client_ip_header` is set, because that is the instance's statement that | ||
| 320 | a proxy it trusts is rewriting them. Without it, a client that sets a forwarding | ||
| 321 | header is describing itself, and Vole ignores it. | ||
| 96 | Binding ports below 1024 requires `CAP_NET_BIND_SERVICE` in the packaged systemd | ||
| 97 | unit. See [Packages and upgrades](packaging.md#what-the-package-installs). | ||
| 322 | 98 | ||
| 323 | ## Automatic HTTPS with ACME | ||
| 99 | ## Running behind a proxy | ||
| 324 | 100 | ||
| 325 | Vole can obtain and renew its own TLS certificates, so a small public instance | ||
| 326 | does not need a proxy in front of it. Set `https_addr`, point the host name in | ||
| 327 | `public_url` at the server, and make both ports reachable: | ||
| 101 | When a proxy terminates TLS, leave `https_addr` empty and keep Vole on loopback: | ||
| 328 | 102 | ||
| 329 | 103 | ```toml | |
| 330 | http_addr = ":80" | ||
| 331 | https_addr = ":443" | ||
| 104 | http_addr = "127.0.0.1:8080" | ||
| 332 | 105 | public_url = "https://forge.example.com" | |
| 333 | acme_email = "admin@example.com" | ||
| 334 | ``` | ||
| 335 | |||
| 336 | `https_addr` turns it on, and `public_url` must then be an `https://` URL. Vole | ||
| 337 | serves the forge over TLS on that address. `http_addr` stops serving pages: it | ||
| 338 | answers ACME HTTP-01 challenges and redirects everything else to HTTPS. The | ||
| 339 | certificate host comes from `public_url`; to serve more than one name, list each | ||
| 340 | one in `acme_domains` (each host gets its own certificate): | ||
| 341 | |||
| 342 | ```toml | ||
| 343 | acme_domains = ["forge.example.com", "git.example.com"] | ||
| 106 | git_http_client_ip_header = "X-Forwarded-For" | ||
| 344 | 107 | ``` | |
| 345 | 108 | ||
| 346 | Certificates are obtained on first use and renewed in the background. Vole tries | ||
| 347 | tls-alpn-01 on port 443 and http-01 on port 80, so a network that blocks one can | ||
| 348 | still validate through the other. DNS must already point at the instance; ACME | ||
| 349 | cannot issue a name that does not resolve here. There is no wildcard support: | ||
| 350 | list concrete names, or keep a proxy for a wildcard certificate. | ||
| 351 | |||
| 352 | State lives in `data/acme/` by default. It contains the ACME account key, so the | ||
| 353 | directory is created private; back it up with the other instance data, though | ||
| 354 | losing it only means registering again and asking for new certificates. | ||
| 355 | |||
| 356 | While setting this up, use the staging directory so a mistake does not consume a | ||
| 357 | production rate limit: | ||
| 109 | Preserve the original `Host` header so repository and site routing work: | ||
| 358 | 110 | ||
| 359 | ```toml | ||
| 360 | acme_directory_url = "https://acme-staging-v02.api.letsencrypt.org/directory" | ||
| 111 | ```nginx | ||
| 112 | server { | ||
| 113 | listen 443 ssl; | ||
| 114 | server_name forge.example.com; | ||
| 115 | location / { | ||
| 116 | proxy_set_header Host $host; | ||
| 117 | proxy_set_header X-Forwarded-Proto $scheme; | ||
| 118 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
| 119 | proxy_pass http://127.0.0.1:8080; | ||
| 120 | } | ||
| 121 | } | ||
| 361 | 122 | ``` | |
| 362 | 123 | ||
| 363 | Ports below 1024 need `CAP_NET_BIND_SERVICE`. The packaged systemd unit can grant | ||
| 364 | it; see [Packages](packaging.md). An instance with `https_addr` empty behaves as | ||
| 365 | before and leaves TLS to a proxy. | ||
| 124 | `git_http_client_ip_header` tells Vole which trusted-proxy header carries the | ||
| 125 | client address. Vole uses the last entry, appended by the nearest proxy, for | ||
| 126 | per-client read and sign-in limits. Leave the setting empty without a trusted | ||
| 127 | proxy; otherwise clients can supply the header themselves. | ||
| 366 | 128 | ||
| 367 | When `pages_domain` is also set, Vole obtains a certificate for a site host the | ||
| 368 | first time that host is requested, provided the repository exists and is | ||
| 369 | publicly readable. Site certificates therefore work with a wildcard DNS record | ||
| 370 | pointing at the instance, but they count against the certificate authority's | ||
| 371 | per-domain rate limit. | ||
| 129 | Expose `ssh_addr` directly or through a TCP proxy. HTTP proxy configuration does | ||
| 130 | not forward Git over SSH. | ||
| 372 | 131 | ||
| 373 | 132 | ## Open registration | |
| 374 | 133 | ||
| 375 | By default only an instance admin can create an account. Set | ||
| 376 | `open_registration = true` to let anyone create one by registering a passkey: | ||
| 134 | By default, only an instance admin creates accounts. To allow visitors to | ||
| 135 | register their own passkeys: | ||
| 377 | 136 | ||
| 378 | 137 | ```toml | |
| 379 | 138 | public_url = "https://forge.example.com" | |
| @@ -381,26 +140,20 @@ open_registration = true | |||
| 381 | 140 | open_registration_role = "contribute" | |
| 382 | 141 | ``` | |
| 383 | 142 | ||
| 384 | The setting has no effect unless `public_url` is HTTPS. New accounts have no | ||
| 385 | repository-specific access, but `open_registration_role` gives them an | ||
| 386 | instance-wide role that applies to every public repository. `contribute` lets | ||
| 387 | them read, discuss, and push to their own `refs/heads/contrib/<name>/` namespace | ||
| 388 | without being added to each repository. It does not open private repositories; | ||
| 389 | `admin` is refused for self-registration. A registered account can add its own | ||
| 390 | SSH key from **Account**, so it can push. There is no email verification; | ||
| 391 | registration is a deliberate policy choice, not a safe default. | ||
| 392 | |||
| 393 | A repository can still be published for anonymous readers with: | ||
| 143 | Registration requires an HTTPS `public_url`. The instance-wide role applies only | ||
| 144 | to public repositories; `contribute` allows discussion and pushes to the | ||
| 145 | account's own contributor namespace. It does not grant access to private | ||
| 146 | repositories or shared branches. Vole refuses `admin` and `maintain` for | ||
| 147 | self-registration. | ||
| 394 | 148 | ||
| 395 | ```sh | ||
| 396 | vole admin acl set-default-role demo read | ||
| 397 | ``` | ||
| 149 | Registration has no email verification. Leave it disabled unless the instance | ||
| 150 | intends to accept public accounts. See | ||
| 151 | [Accounts and access](accounts-and-access.md#browser-sign-in). | ||
| 398 | 152 | ||
| 399 | 153 | ## Development sign-in | |
| 400 | 154 | ||
| 401 | Browsers require HTTPS for passkeys, which makes a local `http://127.0.0.1:8080` | ||
| 402 | preview awkward to use for write testing. `dev_login` is an explicit escape hatch, | ||
| 403 | and `dev_only` is what makes it explicit: | ||
| 155 | For a loopback-only development server, you can sign browser requests in without | ||
| 156 | a passkey: | ||
| 404 | 157 | ||
| 405 | 158 | ```toml | |
| 406 | 159 | http_addr = "127.0.0.1:8080" | |
| @@ -408,79 +161,81 @@ dev_only = true | |||
| 408 | 161 | dev_login = "you" | |
| 409 | 162 | ``` | |
| 410 | 163 | ||
| 411 | When set, a request from loopback is signed in as that account using a normal | ||
| 412 | server-side session. Vole refuses to start unless all of these hold: `dev_only` | ||
| 413 | is set, `http_addr` is a loopback address, there is no `https_addr`, and | ||
| 414 | `public_url` is unset or itself loopback. It logs a warning when the setting is | ||
| 415 | active. The session cookie is deliberately not named `__Host-` so a browser will | ||
| 416 | store it over plain HTTP. Never enable this on an instance other people can reach. | ||
| 164 | Vole requires `dev_only`, a loopback HTTP listener, no HTTPS listener, and an | ||
| 165 | unset or loopback `public_url`. It rejects forwarded headers for this automatic | ||
| 166 | sign-in so a proxy cannot turn a remote request into a local one. | ||
| 417 | 167 | ||
| 418 | The request check does not trust the `Host` header alone. A loopback listener | ||
| 419 | behind a proxy sees loopback as the peer address, so a development request must | ||
| 420 | also name the configured `http_addr` (same port, and either the same host or | ||
| 421 | another loopback name), and any request carrying `Forwarded`, | ||
| 422 | `X-Forwarded-For`, `X-Forwarded-Host`, `X-Forwarded-Proto` or `X-Real-IP` is | ||
| 423 | refused. A proxy that rewrites `Host` to `127.0.0.1` therefore gets no session. | ||
| 168 | Signing out opts the browser out until you visit `/-/dev/login`. Remove | ||
| 169 | `dev_login` and restart to disable it. Never enable this on a shared instance. | ||
| 424 | 170 | ||
| 425 | Signing out opts the browser out of automatic dev sign-in; visit `/-/dev/login` to | ||
| 426 | sign back in. Remove `dev_login` and restart to turn it off entirely. | ||
| 171 | For a development checkout, `DEVELOPMENT.md` provides a complete throwaway | ||
| 172 | instance procedure. | ||
| 427 | 173 | ||
| 428 | ## Refused configurations | ||
| 174 | ## Set resource limits | ||
| 429 | 175 | ||
| 430 | `vole serve` validates the configuration before it opens anything and refuses to | ||
| 431 | start on a combination that cannot be safe. It reports every problem at once, so | ||
| 432 | one restart is enough to fix the file. | ||
| 176 | The defaults target a small team. Set repository quotas explicitly on a shared | ||
| 177 | instance; their default of `0` means no limit: | ||
| 433 | 178 | ||
| 434 | | Refused when | Why | | ||
| 435 | |---|---| | ||
| 436 | | `dev_login` without `dev_only` | A credential-free session must be a decision, not a copied line | | ||
| 437 | | `dev_login` with `https_addr` | That listener is reachable from the network | | ||
| 438 | | `dev_login` with a non-loopback `public_url` | A published instance is not a development instance | | ||
| 439 | | `dev_login` with a non-loopback `http_addr` | The session is only for the machine it runs on | | ||
| 440 | | `open_registration` without an HTTPS `public_url` | WebAuthn credentials are bound to an HTTPS origin | | ||
| 441 | | `open_registration_role` = `admin` | Self-registration cannot grant instance administration | | ||
| 442 | | `public_url` with a user, path, query or fragment | It is an origin that links are appended to | | ||
| 443 | | `pages_domain` that is not a bare DNS suffix | Site routing matches a visitor's `Host` against it | | ||
| 444 | | `receive_max_bytes` below `max_blob_bytes` | No push could ever contain a permitted file | | ||
| 445 | | `https_addr` with no `acme_domains` or `public_url` | There is no name to obtain a certificate for | | ||
| 446 | | `acme_email` that is not one address | The certificate authority has nobody to contact | | ||
| 447 | | `acme_directory_url` that is not HTTPS | Renewal would fail after the typo was forgotten | | ||
| 448 | | a negative size, lease or limit | It is never what the operator meant | | ||
| 179 | ```toml | ||
| 180 | repo_max_refs = 500 | ||
| 181 | repo_max_metadata_entries = 2000 | ||
| 182 | repo_max_metadata_bytes = 33554432 | ||
| 183 | repo_max_bytes = 5368709120 | ||
| 184 | repo_max_lfs_bytes = 10737418240 | ||
| 185 | ``` | ||
| 449 | 186 | ||
| 450 | ## Running behind a proxy | ||
| 187 | Other settings bound individual files, whole pushes, anonymous reads, SSH | ||
| 188 | connections, runner leases, and site caches. The | ||
| 189 | [settings table](reference/configuration.md#settings) lists all defaults, and | ||
| 190 | [anonymous read limits](reference/configuration.md#anonymous-read-limits) | ||
| 191 | explains the HTTP transport controls. | ||
| 451 | 192 | ||
| 452 | If a proxy already terminates TLS, leave `https_addr` empty. Vole serves plain | ||
| 453 | HTTP on `http_addr`; keep the `Host` header intact, because Vole uses it to | ||
| 454 | decide which site a request belongs to. | ||
| 193 | ## Customizing the instance | ||
| 455 | 194 | ||
| 456 | ```nginx | ||
| 457 | server { | ||
| 458 | listen 443 ssl; | ||
| 459 | server_name *.forge.example.com; | ||
| 460 | location / { | ||
| 461 | proxy_set_header Host $host; | ||
| 462 | proxy_set_header X-Forwarded-Proto $scheme; | ||
| 463 | proxy_pass http://127.0.0.1:8080; | ||
| 464 | } | ||
| 465 | } | ||
| 195 | `instance_repo` names a repository whose files customize the landing page and | ||
| 196 | appearance: | ||
| 197 | |||
| 198 | ```toml | ||
| 199 | instance_name = "Acme Forge" | ||
| 200 | instance_repo = "vole-instance" | ||
| 466 | 201 | ``` | |
| 467 | 202 | ||
| 468 | SSH is separate. Expose `ssh_addr` directly, or through a TCP proxy that keeps the | ||
| 469 | connection intact. | ||
| 203 | `vole admin init` creates the default private customization repository. An | ||
| 204 | instance admin can also scaffold it from **Admin → Configuration**. Push these | ||
| 205 | paths to change it: | ||
| 206 | |||
| 207 | | Path | Purpose | | ||
| 208 | |---|---| | ||
| 209 | | `profile/README.md` | Public landing-page introduction | | ||
| 210 | | `profile/private/README.md` | Optional introduction for signed-in readers | | ||
| 211 | | `profile/custom.css` | Instance-wide style overrides | | ||
| 212 | | `profile/themes/<id>.css` | Selectable theme packs | | ||
| 213 | | `profile/favicon.svg` | Custom favicon | | ||
| 214 | | `assets/` | CSS, image, and font assets | | ||
| 215 | |||
| 216 | Set `instance_repo = ""` to disable customization. For theme syntax, design | ||
| 217 | tokens, file rules, and security boundaries, see | ||
| 218 | [Instance customization](reference/instance-customization.md). | ||
| 219 | |||
| 220 | ## Refused configurations | ||
| 221 | |||
| 222 | `vole serve` reports invalid combinations before opening listeners. These include | ||
| 223 | unsafe development sign-in, registration without HTTPS, malformed public URLs, | ||
| 224 | invalid ACME settings, negative limits, and a whole-push limit below the | ||
| 225 | single-file limit. See the | ||
| 226 | [refused-configuration table](reference/configuration.md#refused-configurations). | ||
| 470 | 227 | ||
| 471 | 228 | ## What Vole stores | |
| 472 | 229 | ||
| 473 | | Path | What it is | | ||
| 474 | |---|---| | ||
| 475 | | `data/users.db` | Accounts, names, instance roles, SSH keys, passkeys, enrollment links, browser sessions, access rules, locks, and daily page-view counters. This is the main account database. Session and enrollment-link tokens are stored only as hashes. | | ||
| 476 | | `data/repos/` | Your Git repositories. | | ||
| 477 | | `data/index.db` | A rebuildable search index. | | ||
| 478 | | `data/runs.db` | The CI queue, finished-run records and steps, artifact pointers, and contributor-branch CI approvals. It is a source of truth: back it up. Deleting it loses CI history and pending work. | | ||
| 479 | | `data/lfs/` | Stored large files and build artifacts. | | ||
| 480 | | `data/logs/` | One file per CI attempt, streamed from the runner while the job runs. | | ||
| 481 | | `data/audit.log` | A record of privileged actions: one tab-separated line per action, `timestamp`, `action`, `actor`, `subject`, `detail`. Created and kept at mode `0600`. See [Audit log](operations.md#audit-log). | | ||
| 482 | | `data/secrets.db`, `data/secrets.key` | Each repository's secrets, sealed with AES-256-GCM under the key. Losing the key loses every stored value, and restoring the database beside a newly generated key reads nothing. | | ||
| 483 | | `data/ssh_host_ed25519_key` | The SSH host key. It is the instance's long-term secret; browser credentials are public keys and session tokens are hashed. | | ||
| 484 | | `data/acme/` | The ACME account key and issued TLS certificates, when automatic HTTPS is enabled. | | ||
| 485 | |||
| 486 | See [Operations](operations.md) for backup and recovery. | ||
| 230 | `data_dir` contains repositories, account and CI databases, large files, logs, | ||
| 231 | indexes, secrets, and host keys. Some files are authoritative and others can be | ||
| 232 | rebuilt. [Where data lives](architecture.md#where-data-lives) is the storage | ||
| 233 | reference; [Back up an instance](operations.md#back-up-an-instance) turns it into | ||
| 234 | a procedure. | ||
| 235 | |||
| 236 | ## Next | ||
| 237 | |||
| 238 | - [Deploy a server](deploy/index.md) — apply a public configuration on a new | ||
| 239 | machine. | ||
| 240 | - [Accounts and access](accounts-and-access.md) — grant roles and credentials. | ||
| 241 | - [Operations](operations.md) — back up, restore, and monitor the instance. | ||