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.
Add a one-command install script for the stable channel
16a8be36308947758ae81c97500f9f891be18e52 · Keenan Nemetz · 13d ago · parent 1b1571bb
Add a one-command install script for the stable channel The signed package repositories still left a four- or five-command trust bootstrap on first install, because apt cannot fetch a key from a URL and pacman requires an explicit keyring signature. Ship packaging/install.sh as a release artifact served at channels/stable/install.sh: it detects the distribution, writes the key and repository, and hands the install to apt, dnf, or pacman. The script pins the release key's SHA-256 and fingerprint, and the release now publishes the committed key verbatim so the pin is exact. scripts/check-install.sh covers the three families without root or network, and the release attaches the script before SHA256SUMS so the checksum list covers it. closes: 01M7XG0ANWCC442YMFJSMW7HCC
scripts/sign-release.py +16−5
| @@ -30,8 +30,10 @@ What is signed, and why: | |||
| 30 | 30 | them with `DatabaseRequired`; | |
| 31 | 31 | - `SHA256SUMS`, so a direct download can be authenticated without the | |
| 32 | 32 | repository; | |
| 33 | - the public key is exported to `apt/vole.gpg`, `yum/RPM-GPG-KEY-vole`, and | ||
| 33 | - the public key is published as `apt/vole.gpg`, `yum/RPM-GPG-KEY-vole`, and | ||
| 34 | 34 | `vole-release-key.asc`, with its fingerprint in `vole-release-key.fingerprint`. | |
| 35 | The armored copies are `packaging/keys/vole-release.asc` verbatim, so | ||
| 36 | `packaging/install.sh` can pin that file's SHA-256 as well as the fingerprint. | ||
| 35 | 37 | ||
| 36 | 38 | Signatures carry the tag commit time (`--epoch`) rather than the build clock, so | |
| 37 | 39 | rebuilding one tag produces the same signed files. GnuPG refuses a signature | |
| @@ -222,7 +224,8 @@ def sign_packages(dist: Path, home: Path, fingerprint: str, when: int) -> None: | |||
| 222 | 224 | verify(home, signature, package) | |
| 223 | 225 | ||
| 224 | 226 | ||
| 225 | def sign_repositories(dist: Path, home: Path, fingerprint: str, when: int) -> None: | ||
| 227 | def sign_repositories(dist: Path, home: Path, fingerprint: str, when: int, | ||
| 228 | committed: bool = False) -> None: | ||
| 226 | 229 | release = dist / "apt" / "Release" | |
| 227 | 230 | repomd = dist / "yum" / "repodata" / "repomd.xml" | |
| 228 | 231 | for required in (release, repomd): | |
| @@ -270,9 +273,17 @@ def sign_repositories(dist: Path, home: Path, fingerprint: str, when: int) -> No | |||
| 270 | 273 | verify(home, signature, path) | |
| 271 | 274 | ||
| 272 | 275 | # apt wants a keyring file, not armored text, in signed-by=. dnf and the | |
| 273 | # release page are easier to read armored, so both forms are published. | ||
| 276 | # release page are easier to read armored, so both forms are published. The | ||
| 277 | # real release publishes the committed key verbatim: install.sh pins that | ||
| 278 | # file's SHA-256, so a fresh export with different armor would break the pin. | ||
| 279 | # A local --key-file is a test key and is exported from the temporary home. | ||
| 274 | 280 | binary = run_bytes([GPG, "--batch", "--no-tty", "--homedir", str(home), "--export", fingerprint]) | |
| 275 | armored = gpg(home, "--armor", "--export", fingerprint, capture=True).stdout | ||
| 281 | if committed: | ||
| 282 | armored = COMMITTED_KEY.read_text(encoding="utf-8") | ||
| 283 | if not armored.endswith("\n"): | ||
| 284 | armored += "\n" | ||
| 285 | else: | ||
| 286 | armored = gpg(home, "--armor", "--export", fingerprint, capture=True).stdout | ||
| 276 | 287 | (dist / "apt" / "vole.gpg").write_bytes(binary) | |
| 277 | 288 | (dist / "yum" / "RPM-GPG-KEY-vole").write_text(armored, encoding="utf-8") | |
| 278 | 289 | (dist / "vole-release-key.asc").write_text(armored, encoding="utf-8") | |
| @@ -335,7 +346,7 @@ def main() -> None: | |||
| 335 | 346 | if args.command == "packages": | |
| 336 | 347 | sign_packages(dist, home, fingerprint, when) | |
| 337 | 348 | elif args.command == "repositories": | |
| 338 | sign_repositories(dist, home, fingerprint, when) | ||
| 349 | sign_repositories(dist, home, fingerprint, when, committed=not args.key_file) | ||
| 339 | 350 | else: | |
| 340 | 351 | sign_sums(dist, home, fingerprint, when) | |
| 341 | 352 | finally: | |