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.
Move release channels to an authoritative channels.db
262e516e838cfc4b16b5d00fd98d5e4ef135aa85 · Keenan Nemetz · 19d ago · parent 24019cb3
Move release channels to an authoritative channels.db Channels are consumed from the public URL and are server-side publication state, so they no longer live on the vole branch or in the derived index. - forge/channel: authoritative SQLite store with schema, validation, and CRUD - config: data/channels.db, opened and closed with the instance - CLI: release channel set|list|clear over a new vole-channel SSH verb - server: maintain for set/clear, read for list, annotated-tag validation, audit channel.set/channel.clear, JSON list - web: channel page and tree read the store; release badges query it - remove the metadata-branch channel parser/validator, the index-derived channel table, and the hook path rules - backup, instance-data, and architecture docs include channels.db Refs: 01M7BPHANWMSW5HK2GT0PY74QZ
forge/instance.go +21
| @@ -18,6 +18,7 @@ import ( | |||
| 18 | 18 | "rodent.software/vole/ci/runs" | |
| 19 | 19 | "rodent.software/vole/core/lfs" | |
| 20 | 20 | "rodent.software/vole/forge/access" | |
| 21 | "rodent.software/vole/forge/channel" | ||
| 21 | 22 | "rodent.software/vole/forge/config" | |
| 22 | 23 | "rodent.software/vole/forge/identity" | |
| 23 | 24 | "rodent.software/vole/forge/index" | |
| @@ -51,6 +52,10 @@ type Instance struct { | |||
| 51 | 52 | // from the roster because it is the one whose contents are encrypted, and it is | |
| 52 | 53 | // opened last because nothing else depends on it. | |
| 53 | 54 | Secrets *secret.Store | |
| 55 | // Channels is the authoritative release-channel store. It is server-side | ||
| 56 | // source state, not a derived index: a channel is consumed from the public | ||
| 57 | // URL, not cloned. | ||
| 58 | Channels *channel.Store | ||
| 54 | 59 | ||
| 55 | 60 | // ImportedACLs is how many legacy refs/vole/acl rule sets were imported by | |
| 56 | 61 | // Open, so a caller that logs startup can say so. | |
| @@ -174,6 +179,19 @@ func Open(cfg *config.Config, binPath string) (*Instance, error) { | |||
| 174 | 179 | // repository from leaving values behind for a name that is created again. | |
| 175 | 180 | rs.Secrets = secrets | |
| 176 | 181 | ||
| 182 | channels, err := channel.Open(cfg.ChannelsDB()) | ||
| 183 | if err != nil { | ||
| 184 | secrets.Close() | ||
| 185 | views.Close() | ||
| 186 | lk.Close() | ||
| 187 | acls.Close() | ||
| 188 | rn.Close() | ||
| 189 | ix.Close() | ||
| 190 | sessions.Close() | ||
| 191 | ident.Close() | ||
| 192 | return nil, fmt.Errorf("open channels: %w", err) | ||
| 193 | } | ||
| 194 | |||
| 177 | 195 | return &Instance{ | |
| 178 | 196 | Cfg: cfg, | |
| 179 | 197 | Repos: rs, | |
| @@ -188,6 +206,7 @@ func Open(cfg *config.Config, binPath string) (*Instance, error) { | |||
| 188 | 206 | PageViews: views, | |
| 189 | 207 | InstanceRepo: instancerepo.New(rs, cfg.InstanceRepo), | |
| 190 | 208 | Secrets: secrets, | |
| 209 | Channels: channels, | ||
| 191 | 210 | ImportedACLs: imported, | |
| 192 | 211 | }, nil | |
| 193 | 212 | } | |
| @@ -213,6 +232,7 @@ func TightenSecrets(cfg *config.Config) ([]string, error) { | |||
| 213 | 232 | cfg.IndexDB(), cfg.IndexDB() + "-wal", cfg.IndexDB() + "-shm", | |
| 214 | 233 | cfg.RunsDB(), cfg.RunsDB() + "-wal", cfg.RunsDB() + "-shm", | |
| 215 | 234 | cfg.SecretsDB(), cfg.SecretsDB() + "-wal", cfg.SecretsDB() + "-shm", | |
| 235 | cfg.ChannelsDB(), cfg.ChannelsDB() + "-wal", cfg.ChannelsDB() + "-shm", | ||
| 216 | 236 | cfg.SecretsKeyPath(), | |
| 217 | 237 | cfg.AuditLog(), | |
| 218 | 238 | cfg.SSHHostKey(), | |
| @@ -249,6 +269,7 @@ func (i *Instance) Close() error { | |||
| 249 | 269 | } | |
| 250 | 270 | var err error | |
| 251 | 271 | for _, closeFn := range []func() error{ | |
| 272 | i.Channels.Close, | ||
| 252 | 273 | i.Secrets.Close, | |
| 253 | 274 | i.PageViews.Close, | |
| 254 | 275 | i.Locks.Close, | |