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.

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/sites.md +85−72

@@ -1,96 +1,109 @@
1 1 # Sites
2 2
3 A website can be a branch. That keeps publishing simple and keeps the files with
4 the repository. Vole serves a repository's `pages` branch at `<repo>.<pages_domain>`.
5 There is no build step on the server: change the branch and the next request sees
6 the new files.
3 Vole serves static files from a repository branch at
4 `<repo>.<pages_domain>`. Publish a build directory as a snapshot or push the
5 branch directly; Vole does not run a build when a visitor requests the site.
6
7 ## Enable sites
8
9 An instance admin sets the site domain and branch in `vole.toml`:
10
11 ```toml
12 pages_domain = "pages.example.com"
13 pages_ref = "pages"
14 pages_procs = 4
15 pages_cache_bytes = 33554432
16 ```
17
18 `pages_domain` is empty by default, which disables sites. Point a wildcard DNS
19 record such as `*.pages.example.com` at the instance.
20
21 With [automatic HTTPS](configuration.md#automatic-https-with-acme), Vole obtains
22 a certificate for each public site host on its first request. It does not obtain
23 wildcard certificates. With a TLS proxy, preserve the `Host` header so Vole can
24 select the requested site; see
25 [Running behind a proxy](configuration.md#running-behind-a-proxy).
26
27 Use a separate registrable domain for untrusted sites—for example,
28 `pages.example.net` when the forge is `forge.example.com`. A subdomain such as
29 `pages.example.com` is same-site with the forge and shares browser security
30 assumptions. See [Same-site risk](#same-site-risk).
7 31
8 32 ## Publish a build directory
9 33
10 Most websites are generated into a directory such as `dist/`. Vole can publish
11 that directory as a snapshot, so the branch contains exactly those files. If you
12 delete a page from the build, it stops being served.
34 From a repository clone, build the site and deploy the output directory:
13 35
14 36 ```sh
15 37 npm run build
16 vole pages deploy dist # publish dist/ to the pages branch
17 vole pages deploy dist --dry-run # show changes without pushing
18 vole pages status # show the current branch and files
19 vole pages unpublish # take the site down
38 vole pages deploy dist
39 vole pages status
20 40 ```
21 41
22 Publishing the same files twice does nothing. Use `--branch` if the instance
23 serves a different branch than `pages`.
42 `deploy` replaces the configured site branch with the files in `dist/`. A file
43 removed from the build disappears from the site. Publishing identical files does
44 not create another change.
24 45
25 Dotfiles such as `.nojekyll` and `.well-known/` are published. Vole skips `.git`
26 and symbolic links. A site is just files, and a link pointing outside the build
27 directory would publish something you did not choose.
46 Preview or remove a deployment:
28 47
29 ## Publish by hand
48 ```sh
49 vole pages deploy dist --dry-run
50 vole pages unpublish
51 ```
30 52
31 Plain Git is enough:
53 If the instance uses a branch other than `pages`, pass
54 `--branch <branch>` to each command.
55
56 Dotfiles including `.nojekyll` and `.well-known/` are published. Vole skips
57 `.git` and symbolic links so deployment cannot include files outside the chosen
58 build directory.
59
60 ## Publish with Git
61
62 You can push the branch without the Vole CLI:
32 63
33 64 ```sh
34 65 git switch --orphan pages
35 printf '<h1>hello</h1>\n' > index.html
66 printf '<h1>Hello</h1>\n' > index.html
36 67 git add index.html
37 git commit -m "site"
38 git push origin pages # live at https://demo.pages.example.com/
68 git commit -m "Publish the site"
69 git push origin pages
39 70 ```
40 71
41 ## Turn sites on
72 For a repository named `demo`, the site is then
73 `https://demo.pages.example.com/` when sites and TLS are configured.
42 74
43 ```toml
44 pages_domain = "pages.example.com" # <repo>.pages.example.com
45 pages_ref = "pages" # branch to serve
46 pages_procs = 4 # Git reader processes per active site
47 pages_cache_bytes = 33554432 # 32 MiB of cached files
48 ```
75 A workflow can deploy its build output instead. See
76 [Publish a website](workflows.md#publish-a-website); Vole rejects an older run
77 that would roll back a newer branch.
49 78
50 Set `pages_domain` to enable websites. If you change `pages_ref`, pass the same
51 branch name to `vole pages deploy --branch`.
52
53 ## How sites are served
54
55 - A directory serves its `index.html`. A directory URL without a trailing slash
56 redirects to the version with one.
57 - Vole uses the file's Git hash as its `ETag` and the commit time as
58 `Last-Modified`, so unchanged pages return `304`.
59 - Vole checks the branch and repository visibility once a second, so changes take
60 effect within that window. The repository header links to the site only once
61 the pages branch exists and the repository is public; until then there is no
62 Site button, because the link would lead to a 404.
63 - A private repository has no public website. There is no logged-in reader, so the
64 site returns `404`, just like its clone URL.
65
66 With automatic HTTPS enabled (`https_addr`), Vole obtains a certificate for each
67 site host the first time it is requested, as long as the repository exists and is
68 publicly readable. A wildcard DNS record pointing at the instance is enough;
69 wildcard certificates are not supported, so each host is issued separately. Without `https_addr`, terminate
70 TLS in a proxy in front of `http_addr` and keep the `Host` header: it is how Vole
71 knows which site was requested. See
72 [Configuration § Automatic HTTPS with ACME](configuration.md#automatic-https-with-acme)
73 and [Configuration § Running behind a proxy](configuration.md#running-behind-a-proxy).
74
75 A workflow can publish the site as its last step. See
76 [Workflows § Publish a website](workflows.md#publish-a-website).
79 ## Serving behavior
80
81 - A directory serves its `index.html`; a directory URL without a trailing slash
82 redirects to the slash form.
83 - The file's Git hash supplies its `ETag`, and the commit time supplies
84 `Last-Modified`, allowing `304` responses for unchanged files.
85 - Vole checks branch and visibility changes once per second.
86 - Only public repositories have public sites. A private repository's site returns
87 `404`; there is no browser sign-in on a site host.
88 - The repository header links to the site only after the configured branch exists
89 and the repository is public.
77 90
78 91 ## Same-site risk
79 92
80 A site is content somebody else wrote, served from a hostname you control. If
81 `pages_domain` shares a registrable domain with the forge — `forge.example.com`
82 and `*.pages.example.com`, say — then every site is *same-site* with the forge,
83 and a malicious site can:
84
85 - make the browser send the forge's `SameSite=Lax` cookies on a top-level
86 navigation (Vole's writes still need a CSRF token, so this does not authorize
87 anything on its own, but it is the assumption a weaker application would rely on);
88 - open the forge in a window or frame and interact with it as a same-site
89 document, which is why `Cross-Origin-Opener-Policy` and the CSP frame rules are
90 set on every page;
91 - share a cookie domain if you ever set one wider than a host.
92
93 Use a separate registrable domain for sites when the repositories publishing them
94 are not all trusted: `pages.example.net` for a forge at `forge.example.com`. The
95 two then cannot be same-site. If the sites are as trusted as the forge itself, a
96 subdomain is fine and keeps certificate management to one domain.
93 Hosted sites contain author-controlled content on host names you control. When
94 the forge and sites share a registrable domain, a malicious site is same-site
95 with the forge. It can participate in top-level navigations that carry
96 `SameSite=Lax` cookies, attempt window or frame interactions, and benefit from
97 any future domain-wide cookie.
98
99 Vole's CSRF tokens, `Cross-Origin-Opener-Policy`, and frame rules provide
100 additional boundaries, but a separate registrable domain removes the underlying
101 same-site relationship. Use one whenever site publishers are not as trusted as
102 the forge itself.
103
104 ## Next
105
106 - [Workflows](workflows.md#publish-a-website) — deploy from CI.
107 - [Releases](releases.md) — distribute versioned files rather than a live site.
108 - [Configuration](configuration.md) — configure the instance's public origin and
109 TLS.