Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/git/vole.git

Write over SSH with a registered key:

git clone ssh://git@0.0.0.0:2222/vole.git

A free and open-source forge that lives in your Git repo.

Phase 7 slice 5: pages are a build directory you can publish

4c0f2aefc52a5b5f20555e1698858f0a540ad8e3 · Keenan Nemetz · 17d ago · parent 948a6d7d

Phase 7 slice 5: pages are a build directory you can publish

A site is a branch, so managing one is managing a branch; the sugar is worth it
for one reason: a build directory is a snapshot, and a plain push from a branch
leaves deleted pages served forever.

- vole pages deploy [<dir>] replaces the branch's tree with the directory, as a
  normal commit on the tip, so a protected pages branch still goes through review
  and a lost push race re-applies the snapshot instead of merging two builds
- --dry-run reports added/changed/removed; a deploy whose files already match the
  published tree pushes nothing, because a build that reruns on every commit must
  not add an empty commit each time
- vole pages status reports tip, commit, file count and bytes; unpublish deletes
  the branch, which is what makes the site 404
- dotfiles are published (.nojekyll, .well-known), .git is skipped and symlinks
  are skipped rather than followed
- issueCLI became branchCLI with a ref field: issue commands and pages commands
  now share one fetch/CAS/push-with-retry path instead of two copies of it

The first version read the local branch as the truth, and the local branch
outlives an unpublish, so deploy said "already published" for a site that was
404ing and status called a dead site live. Both now ask the server with
git ls-remote; syncSiteRef prunes a local branch the server no longer has, so a
re-publish starts fresh instead of resurrecting the old history.

Measured through the binary against a real instance with pages_domain set: three
files deployed and served at demo.pages.test inside the one-second window, a
deleted file 404ing after the next deploy, re-deploy after unpublish in 325 ms,
status reporting 3 file(s) / 19 B, and unpublish twice as a no-op.

README.md +22−1

@@ -62,7 +62,8 @@ Working today:
62 62 - A derived SQLite index that can be deleted and rebuilt from the repos
63 63 - Static sites: a repository's `pages` branch is served as a website at
64 64 `<repo>.<pages_domain>`, straight out of git — no export step, ETags from blob
65 shas, `304`s for unchanged pages
65 shas, `304`s for unchanged pages. `vole pages deploy <dir>` publishes a build
66 directory as a snapshot, `status` reports what is live, `unpublish` takes it down
66 67 - An instance ed25519 key generated at first boot (used for metadata signing in
67 68 Phase 7)
68 69
@@ -290,6 +291,26 @@ override is written to `data/audit.log`.
290 291 A repository's `pages` branch is a website at `<repo>.<pages_domain>`. Nothing is
291 292 built or exported: the push moves the branch, and the next request reads the new tree.
292 293
294 A site is usually a build directory, so the CLI publishes one as a snapshot — the
295 branch's tree becomes exactly those files, which is what makes a deleted page stop
296 being served:
297
298 ```sh
299 npm run build
300 vole pages deploy dist # publishes dist/ to the pages branch
301 vole pages deploy dist --dry-run # 12 added, 3 changed, 1 removed, nothing pushed
302 vole pages status # branch tip, commit, file count, total bytes
303 vole pages unpublish # site answers 404 within a second
304 ```
305
306 Dotfiles are published (`.nojekyll`, `.well-known/`), `.git` is skipped, and symlinks
307 are skipped rather than followed — a site is bytes, and a link out of the directory
308 would publish something the author never chose. Deploying identical bytes twice pushes
309 nothing. `--branch` names a different branch, which is what you pass if the operator
310 changed `pages_ref`.
311
312 Plain git is the same thing, for a hand-written page:
313
293 314 ```sh
294 315 git switch --orphan pages
295 316 printf '<h1>hello</h1>\n' > index.html