fix: use signed-by keyring instead of removed apt-key - #15
Merged
Conversation
Ubuntu 26.04 (resolute) drops the apt-key binary, so registering the stns apt repo via apt-key add always fails. Switch to storing the GPG key in /etc/apt/keyrings and referencing it via signed-by.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
Ubuntu 26.04 (resolute) では
apt-keyバイナリが削除されており、apt-repo.shによるリポジトリ登録が失敗します。ubuntu:resolute コンテナでの実測:
#14 で
resoluteのパッケージ配信を追加しても、ユーザーは公式手順でリポジトリを登録できない状態になります。変更内容
apt-key addを廃止し、signed-by+/etc/apt/keyrings/方式へ移行します。graph LR A["GPG-KEY-stns (ASCII armored)"] -->|"gpg --dearmor"| B["/etc/apt/keyrings/stns.gpg"] B -->|"signed-by="| C["/etc/apt/sources.list.d/stns.list"] C --> D["apt-get update"]apt-key add -を廃止し、gpg --dearmorで/etc/apt/keyrings/stns.gpgへ配置signed-by=/etc/apt/keyrings/stns.gpgを付与apt-get updateが走らないように)curlを install 対象に追加(従来インストールしていなかった)互換性
signed-byは apt 1.1 以降でサポートされており、dearmor 済みバイナリ鍵を使うため対象ディストリ全て(focal / jammy / noble / resolute / buster / bullseye / bookworm)で動作します。GPG鍵
ED9008B7は RSA 4096bit (2023年作成) で、apt 3.x の鍵強度要件も満たしています。検証
ubuntu:resolute 上で
gpg --dearmorによるキーリング生成と配置が成功することを確認済みです。実リポジトリ (repo.stns.jp) へのapt-get updateまでのエンドツーエンド検証は未実施です。CI について
このPRの
testジョブは失敗しますが、本PRの変更とは無関係の既存の問題です。make yumrepoがbuilds/*x86_64*.rpmを見つけられずに落ちています。libnss のリリース成果物が v2.6.9 以降 tar.gz のみになっており、deb / rpm が1つも生成されていないためです。
本PRは
assets/scripts/apt-repo.shのみの変更で、make yumrepo/make debrepoの処理には一切触れていません。Refs: STNS/STNS#394