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.

Merge release channels into the account database and rename it instance.db

3047be84e9bce79372051c09854ce9b05f12a9bf · Keenan Nemetz · 17d ago · parent 262e516e

Merge release channels into the account database and rename it instance.db

The instance keeps four SQLite files instead of five. Release channels were in a
file of their own only because they were added beside the derived index; they are
authoritative source state, like the roster, so they belong in the file an
operator restores. Nothing has to be migrated: channels.db never shipped in a
release, so only an instance tracking main can have one.

The account database is now data/instance.db. The package comments already called
it that; only the filename disagreed.

Moving an existing instance is an operator step, by decision: a rename under a
live server can lose the -wal file a hook subprocess still has open. Vole refuses
to start while data/users.db is still in place, and says what to move, rather
than creating an empty database beside it that would look like a successful
upgrade.

The list of databases now lives in Config.Databases, which TightenSecrets, the
hook plumbing, and the admin commands read, so a missed -wal file is no longer a
nine-file change. `vole admin account backup <path>` becomes `vole admin db
backup <dir>` and covers every authoritative database; `db list` and `db check`
answer what to back up and whether it is intact.

docs/cli.md +40−9

@@ -40,12 +40,14 @@ See [Configuration](configuration.md), [Deploying](deploy/index.md).
40 40
41 41 ## Server management
42 42
43 `vole admin` is the single namespace for account, repository (`repo`), and
44 access (`acl`) management. Without `--remote`, it changes the instance named
45 by the local `vole.toml`. With `--remote`, it sends the same command over SSH
46 and must be run by an instance admin. `--remote` accepts a Git remote name or
47 an instance URL such as `ssh://git@forge.example.com:2222`; `--json` prints the
48 server's JSON response instead of text.
43 `vole admin` is the single namespace for account, repository (`repo`),
44 access (`acl`), and database (`db`) management. Without `--remote`, it changes
45 the instance named by the local `vole.toml`. With `--remote`, it sends the same
46 command over SSH and must be run by an instance admin. Database commands are
47 local-only: they read and write files on the host, not over the admin channel.
48 `--remote` accepts a Git remote name or an instance URL such as
49 `ssh://git@forge.example.com:2222`; `--json` prints the server's JSON response
50 instead of text.
49 51
50 52 ```sh
51 53 vole admin [--remote <name|ssh-url>] [--config <path>] [--json] <command>...
@@ -94,7 +96,6 @@ vole admin account retire <name>
94 96 vole admin account grant-admin <name>
95 97 vole admin account show <name>
96 98 vole admin account list
97 vole admin account backup <path>
98 99 vole admin account rename <name>
99 100 ```
100 101
@@ -112,8 +113,6 @@ sets the account's instance-wide role; it applies to public repositories, while
112 113
113 114 `retire`, `rm`, `delete` — Retiring is the closest thing to deleting an account: its keys stop working within five seconds, and the name is never reissued. `rm` and `delete` are accepted for the same command.
114 115
115 `backup` — Writes the account database to <path> on the host, so it is local-only. The copy holds accounts, keys and passkeys; session and invite tokens are hashed, and VACUUM INTO keeps it consistent while the instance runs.
116
117 116 `rename`, `display` — Refused: an account name is permanent. It is the folder a contribute account's branches live under, so it is fixed at creation and never reissued.
118 117
119 118 | Option | Used by | Meaning |
@@ -232,6 +231,38 @@ repairs it rather than losing anything. Local-only: it is not available over
232 231 |---|---|---|
233 232 | `-c, --config <path>` | — | the vole.toml to read; default is ./vole.toml, then ~/.vole/vole.toml |
234 233
234 ### admin db
235
236 ```sh
237 vole admin db list
238 vole admin db check
239 vole admin db backup <dir>
240 ```
241
242 `list` — Prints every SQLite file in the data directory and what it is for. It reads
243 the configuration only: no database has to exist, and nothing is opened.
244
245 `check` — Runs SQLite's quick integrity check on each existing database and reports the
246 first problem. The sealed store is checked without its key: the file is an
247 ordinary database whose values are ciphertext.
248
249 `backup` — Writes a consistent copy of every authoritative database into <dir> with
250 VACUUM INTO, which takes a read transaction and cannot lose the rows still
251 sitting in a -wal file. The derived index is skipped: it is rebuilt from the
252 repositories with `vole admin index rebuild`.
253
254 `backup` — The copies are created at 0600. `secrets.db` is included and is still
255 ciphertext: copy the key from `secrets_key` separately, because a backup that
256 holds both is a backup of plaintext.
257
258 `backup` — Local-only: it is not available over --remote.
259
260 | Option | Used by | Meaning |
261 |---|---|---|
262 | `-c, --config <path>` | all | the vole.toml to read; default is ./vole.toml, then ~/.vole/vole.toml |
263
264 See [Operations § Back up an instance](operations.md#back-up-an-instance).
265
235 266 ### whoami
236 267
237 268 ```sh