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.
Keep the authoritative instance in one database
1a9b383890c40885709804293cd3a75e775f06a0 · Keenan Nemetz · 3d ago · parent 12221a79
Keep the authoritative instance in one database Move the CI queue and the sealed secret rows into instance.db, leaving index.db as the one derived database. Backups now copy the single authoritative file, and the index stays disposable. Hooks and the SSH front door use the instance database for run credentials and required checks. The admin db commands and documentation now describe one authoritative database plus the derived index. This was migrated once by hand on the rodent.software instance; there is no migration command and no legacy-layout check in the shipped code.
forge/instance.go +8−7
| @@ -1,10 +1,11 @@ | |||
| 1 | 1 | // Package forge opens and owns the state of a Vole instance. | |
| 2 | 2 | // | |
| 3 | // An instance is one directory of durable state: the instance database (accounts, | ||
| 4 | // access rules, and release channels), the derived index, the CI queue, the | ||
| 5 | // object store, and the bare repositories. This package is the one place that | ||
| 6 | // knows how those fit together, so the server, the CLI's administrative commands | ||
| 7 | // and an embedding application all open the same set in the same order. | ||
| 3 | // An instance is one directory of durable state: the authoritative instance | ||
| 4 | // database (accounts, access rules, release channels, the CI queue, and sealed | ||
| 5 | // secrets), the derived index, the object store, and the bare repositories. This | ||
| 6 | // package is the one place that knows how those fit together, so the server, the | ||
| 7 | // CLI's administrative commands and an embedding application all open the same set | ||
| 8 | // in the same order. | ||
| 8 | 9 | package forge | |
| 9 | 10 | ||
| 10 | 11 | import ( | |
| @@ -106,7 +107,7 @@ func Open(cfg *config.Config, binPath string) (*Instance, error) { | |||
| 106 | 107 | ident.Close() | |
| 107 | 108 | return nil, fmt.Errorf("open index: %w", err) | |
| 108 | 109 | } | |
| 109 | rn, err := runs.Open(cfg.RunsDB()) | ||
| 110 | rn, err := runs.Open(cfg.InstanceDB()) | ||
| 110 | 111 | if err != nil { | |
| 111 | 112 | ix.Close() | |
| 112 | 113 | sessions.Close() | |
| @@ -167,7 +168,7 @@ func Open(cfg *config.Config, binPath string) (*Instance, error) { | |||
| 167 | 168 | // Secrets are opened last because nothing else depends on them, and they are | |
| 168 | 169 | // the one store whose failure an operator can act on: a key file that does not | |
| 169 | 170 | // match the database is a restore that cannot read what it restored. | |
| 170 | secrets, err := secret.Open(cfg.SecretsDB(), cfg.SecretsKeyPath()) | ||
| 171 | secrets, err := secret.Open(cfg.InstanceDB(), cfg.SecretsKeyPath()) | ||
| 171 | 172 | if err != nil { | |
| 172 | 173 | views.Close() | |
| 173 | 174 | lk.Close() | |