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 10.5 KiB
1# Customization
2
3## Customizing the instance
4
5The instance customization repository supplies the landing-page introduction,
6styles, favicon, and static assets. `vole admin init` creates the default private
7repository; an instance admin can also scaffold it from **Admin →
8Configuration**.
9
10### 1. Name the instance and repository
11
12Set these values in `vole.toml` and restart Vole:
13
14```toml
15instance_name = "Acme Forge"
16instance_repo = "vole-instance"
17```
18
19`instance_name` changes the landing-page heading and document titles. Set
20`instance_repo = ""` to disable repository-provided customization.
21
22### 2. Clone the customization repository
23
24```sh
25git clone ssh://git@forge.example.com:2222/vole-instance.git
26cd vole-instance
27```
28
29If the system sshd listens on port 22, omit `:2222`. You need instance-admin
30access to read the private customization repository.
31
32### 3. Edit the introduction and styles
33
34Write `profile/README.md` with the landing-page introduction:
35
36```markdown
37# Acme Forge
38
39Source, reviews, CI, and releases for the Acme team.
40```
41
42Create `profile/custom.css` to override design tokens:
43
44```css
45:root[data-theme] {
46 --accent: #c678dd;
47 --radius: 4px;
48}
49```
50
51Commit and push the changes:
52
53```sh
54git add profile/README.md profile/custom.css
55git commit -m "Customize the landing page"
56git push origin main
57```
58
59Vole reloads the snapshot within a few seconds and keeps the previous snapshot
60if loading fails. See [Customization paths](#customization-paths) for every
61supported file, and [Theming](#theming) and [Design tokens](#design-tokens) for
62theme syntax and security boundaries.
63
64## Customization files
65
66The repository named by `instance_repo` supplies the instance introduction,
67styles, favicon, and static assets. It is an ordinary private repository by
68default; visitors can receive its designated public files without receiving
69repository access.
70
71### Customization paths
72
73| Path | What it does |
74|---|---|
75| `profile/README.md` | Sanitized Markdown introduction above the repository list |
76| `profile/private/README.md` | Replaces the introduction for signed-in viewers |
77| `profile/custom.css` | Styles loaded after built-in and selected theme styles |
78| `profile/themes/<id>.css` | One self-describing selectable theme per file |
79| `profile/favicon.svg` | Replaces the favicon links |
80| `assets/` | Files served at `/-/static/custom/assets/` |
81
82Other files are ignored. Assets are limited to CSS, images, and fonts;
83same-origin scripts are not accepted as customization. Push changes to publish
84them. Vole reloads the snapshot within a few seconds and keeps the previous
85snapshot when loading fails. An empty `profile/README.md` removes the
86introduction body.
87
88`instance_name` controls the landing-page heading, document titles, and brand
89link's accessible name. It does not rename the Vole software or replace its
90brand mark.
91
92### Images in the introduction
93
94A relative destination in the introduction is a path in the customization
95repository. Only a destination under `assets/` becomes a link, because that is
96the namespace the instance serves as files. Point at a picture by its path
97there: `assets/logo.png`, or `../assets/light/logo.png` from
98`profile/README.md`.
99
100An `assets/` destination becomes `/-/static/custom/assets/...`; a relative link
101to anything else, and an absolute or external URL, stays as written. The public
102and private introductions resolve the same way, so one image serves both readers.
103
104### Theming
105
106`profile/custom.css` loads after `vole.css`, `everforest.css`, `palettes.css`,
107and the selected theme pack. Override design tokens instead of copying component
108rules so layout, contrast, and responsive behavior remain intact.
109
110The Appearance picker includes built-in Everforest variants, Catppuccin Mocha
111and Latte, Nord, Solarized Light, Rosé Pine Moon and Dawn, Kanagawa Wave,
112Dracula, Tokyo Night, and Ayu Light, followed by instance theme packs.
113
114### Theme packs
115
116Each file under `profile/themes/` defines one theme. Its file name supplies both
117the id and a human-readable label: `acme-ocean.css` becomes **Acme Ocean**.
118
119```css
120/* profile/themes/acme-ocean.css */
121:root[data-theme="acme-ocean"] {
122 color-scheme: dark;
123 --bg: #0b1720;
124 --bg-panel: #102433;
125 --bg-raised: #163041;
126 --fg: #d7e8f0;
127 --fg-muted: #8fb0c0;
128 --fg-faint: #6f8f9f;
129 --accent: #38bdf8;
130 --accent-fg: #04121a;
131 --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
132}
133```
134
135A light theme must set `color-scheme: light` and light surface and text tokens:
136
137```css
138/* profile/themes/acme-paper.css */
139:root[data-theme="acme-paper"] {
140 color-scheme: light;
141 --bg: #fffdf7;
142 --bg-panel: #f8f3e8;
143 --bg-raised: #f1eadc;
144 --fg: #2b2a26;
145 --fg-muted: #6b675d;
146 --fg-faint: #8d887c;
147 --accent: #9a5b13;
148 --accent-fg: #fffdf7;
149 --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
150}
151```
152
153Theme ids use lowercase letters, digits, and dashes and are at most 41
154characters. They cannot collide with `system`, `nord`, `dracula`, `tokyo-night`,
155or names beginning with `everforest-`, `catppuccin-`, `solarized-`, `rose-pine-`,
156`kanagawa-`, or `ayu-`. An invalid file fails snapshot loading and leaves the
157previous theme active.
158
159Every theme file is linked on every page, so keep theme packs small. A reader's
160selection lives in browser `localStorage`, not in the account database. Deleting
161a selected theme returns that browser to System.
162
163### Design tokens
164
165Scope overrides to `:root[data-theme]`, not plain `:root`. Built-in selectors
166such as `:root[data-theme^="everforest-"]` are more specific than `:root` and
167would otherwise win.
168
169```css
170:root[data-theme] {
171 --accent: #c678dd;
172 --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
173 --radius: 4px;
174 --radius-lg: 6px;
175 --page-max: 1200px;
176}
177```
178
179Use these selectors when a value differs between Everforest dark and light
180variants:
181
182```css
183:root[data-theme^="everforest-dark"] { --bg: #101418; }
184:root[data-theme^="everforest-light"] { --bg: #fffdf7; }
185```
186
187| Group | Tokens |
188|---|---|
189| Surfaces | `--bg`, `--bg-panel`, `--bg-raised`, `--bg-hover`, `--bg-active`, `--border`, `--border-strong` |
190| Text | `--fg`, `--fg-muted`, `--fg-faint` |
191| Identity | `--accent`, `--accent-fg`, `--accent-soft` |
192| Status | `--good`, `--good-soft`, `--bad`, `--bad-soft`, `--warn`, `--warn-soft`, `--running`, `--merged`, `--merged-soft`, `--status-fg` |
193| Shape | `--radius`, `--radius-lg`, `--page-max`, `--page-gutter`, `--search-w` |
194| Type | `--font`, `--mono`, `--fs`, `--lh`; leave `--font-scale` to the reader's text-size preference |
195| Syntax | `--syn-comment`, `--syn-punctuation`, `--syn-operator`, `--syn-number`, `--syn-string`, `--syn-keyword`, `--syn-function`, `--syn-type`, `--syn-variable`, `--syn-added`, `--syn-deleted` |
196
197When tokens are insufficient, page-level classes include `.panel`, `.readme`,
198`.md`, `.repo-card`, `.repo-grid`, `.home-grid`, `.home-rail`, `.repohead`,
199`.tabs`, `.chip`, `.label`, `.status`, `.config-table`, `.diff`, and `.blob`.
200These classes are not a stable public API; prefer tokens because upgrades can
201change markup.
202
203## Media previews
204
205Preview images and 3D models in the code browser, a commit or compare diff, and
206the Files tab of a change request. Markdown files use the same support.
207
208No configuration is required. A format with no useful source view, such as a PNG
209or binary STL, appears in place of the source table. A text format that is also a
210model or image, such as SVG, OBJ, ASCII STL, or glTF, keeps its source view and
211gains a **Preview** toggle.
212
213### Images
214
215| Extensions | Served as |
216|---|---|
217| `.png` | `image/png` |
218| `.jpg` `.jpeg` | `image/jpeg` |
219| `.gif` | `image/gif` |
220| `.webp` | `image/webp` |
221| `.avif` | `image/avif` |
222| `.bmp` | `image/bmp` |
223| `.ico` | `image/x-icon` |
224| `.svg` | `image/svg+xml` |
225
226Raw bytes are served with the image's type, so an `<img>` works. Every other
227extension stays `text/plain` and the response is `nosniff`, so an HTML file in a
228repository is never rendered on the forge's origin. An SVG opened directly is
229made inert by a Content-Security-Policy; as an image it renders normally.
230
231In a Markdown document, an image path is resolved against the document, not the
232page it is rendered on. A README beside `images/board.png` names that path. The
233instance introduction resolves `assets/...` to the customization assets; see
234[Images in the introduction](#images-in-the-introduction).
235
236An image larger than 32 MiB is a download rather than an inline preview.
237
238### 3D models
239
240| Extension | Format |
241|---|---|
242| `.stl` | STL, binary or ASCII |
243| `.obj` | Wavefront OBJ geometry |
244| `.gltf` | glTF (JSON) |
245| `.glb` | glTF (binary) |
246| `.3mf` | 3D Manufacturing Format |
247
248The viewer runs in the browser and needs only the file. Drag to turn the model
249like a turntable: sideways spins it about its own up axis, up and down tips it
250over the top, and the two mix without rolling it. Scroll, pinch, or use the + and
251− buttons to zoom; Front, Top and Right put a known side toward you; the
252remaining buttons reset the view and toggle a wireframe. On a diff the before
253and after models turn and zoom together, and Sync turns that link off for a
254reader who wants each side at its own angle and zoom. It is loaded on demand, so
255a page without a model downloads none of it. Without JavaScript or WebGL, the
256file's download link stays visible.
257
258A Markdown document names a model the same way it names a picture: a relative
259image path whose extension is on the list above. A README can therefore show an
260assembly beside the prose. The image's alt text labels the preview, and the
261file's name is what the fallback offers to download. A path in a document that
262has no place in a tree — an issue body, the instance introduction — stays an
263image, because there is no raw route behind it for the viewer to fetch.
264
265A `.gltf` may name buffers and textures beside it; they are fetched through the
266same raw path. A companion `.mtl` for an `.obj` is not loaded, so an OBJ arrives
267as geometry with a plain material.
268
269Compressed glTF assets are not supported. A model that uses Draco, KTX2, or
270meshopt reports that it could not be loaded and keeps its download link.
271
272A model larger than 64 MiB is a download rather than an inline preview in the
273code browser, which reads the file's size before rendering. A Markdown document
274is rendered from its text alone, so the path is all that decides there: a
275README's model is offered to the viewer whatever its size.
276
277## Next
278
279- [Configuration](configuration.md) — settings, listeners, and HTTPS.
280- [Workflows](workflows.md#run-artifacts) — build and publish artifacts.
281- [Releases](releases.md) — attach downloads rather than preview them.
282