From 416f1ce86246aab7faa48caba805920f838e068d Mon Sep 17 00:00:00 2001 From: Tamas Csikel Date: Sat, 24 Oct 2026 09:32:51 +0200 Subject: [PATCH] packages: one-line base64 signing key, new key, CARGO_TARGET_DIR The multi-line PEM secret wasn't masked in the CI log, so the key was rotated: the secret is now the PEM base64-encoded on one line. Co-Authored-By: Claude Opus 5.5 --- docs/updates.md | 2 +- image/mkosi.extra/usr/share/smartfox/update.toml | 2 +- tools/pkg/packages.sh | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/updates.md b/docs/updates.md index da49c26..f3c4cc9 100644 --- a/docs/updates.md +++ b/docs/updates.md @@ -37,7 +37,7 @@ Registry: Gitea generic packages, `https://gitea.bluefox.support`, tulajdonos: ` **Aláírás:** a `.sig` 64 bájtos Ed25519 aláírás a teljes `.tar.zst` fájlon (`openssl pkeyutl -sign -rawin`). - A publikus kulcs a `/usr/share/smartfox/update.toml` fájlban van (`public_key`). -- A privát kulcs: a `SF_SIGNING_KEY` CI-secret, és egy példány a fejlesztő gépén (`%USERPROFILE%\.smartfox\signing-key.pem`). +- A privát kulcs: a `SF_SIGNING_KEY` CI-secret (a PEM fájl base64-ben, egy sorban, így a CI-napló maszkolja), és egy példány a fejlesztő gépén (`%USERPROFILE%\.smartfox\signing-key.pem`). - Aláírás nélküli vagy hibásan aláírt csomagot a TV nem telepít. Azt sem, amelyiknek a `pkg.toml`-ja más nevet vagy verziót mond. **Csak release verzió települ** (`1.2.3`), előzetes verzió (`1.2.3-rc1`) nem. A TV csak a meglévőnél (a gyári és a telepített közül a nagyobbnál) újabbat tölt le. diff --git a/image/mkosi.extra/usr/share/smartfox/update.toml b/image/mkosi.extra/usr/share/smartfox/update.toml index 548dd76..c80c0fb 100644 --- a/image/mkosi.extra/usr/share/smartfox/update.toml +++ b/image/mkosi.extra/usr/share/smartfox/update.toml @@ -6,4 +6,4 @@ owner = "bluefox" # image/secrets/update-token (not in git). token_file = "/usr/share/smartfox/update-token" # Ed25519 key that signs every package (private half: CI secret SF_SIGNING_KEY). -public_key = "8CX4spdfqE17SPGoXWMrLxJCusyAxIZndOc/0zvaal4=" +public_key = "xSZWSaxBDcMSF4T/Bdqp9iW6XhIMQj0nGjo2puaflXQ=" diff --git a/tools/pkg/packages.sh b/tools/pkg/packages.sh index dfd191f..5bdb5f3 100644 --- a/tools/pkg/packages.sh +++ b/tools/pkg/packages.sh @@ -9,7 +9,8 @@ # app: version = "version" in apps//app.toml # # Environment: -# SF_SIGNING_KEY Ed25519 private key (PEM), or SF_SIGNING_KEY_FILE +# SF_SIGNING_KEY Ed25519 private key: the PEM file base64-encoded on one +# line (so CI logs mask it), or SF_SIGNING_KEY_FILE = the PEM # SF_PACKAGE_TOKEN "user:token", or a token of SF_OWNER, with write:package (upload only) # SF_GITEA default https://gitea.bluefox.support # SF_OWNER default bluefox @@ -40,7 +41,7 @@ trap 'rm -rf "$TMP"' EXIT if [ -z "$KEY_FILE" ]; then [ -n "${SF_SIGNING_KEY:-}" ] || { echo "SF_SIGNING_KEY or SF_SIGNING_KEY_FILE is needed" >&2; exit 2; } KEY_FILE="$TMP/key.pem" - (umask 077; printf '%s\n' "$SF_SIGNING_KEY" >"$KEY_FILE") + (umask 077; printf '%s' "$SF_SIGNING_KEY" | base64 -d >"$KEY_FILE") fi auth() { @@ -92,7 +93,7 @@ do_shell() { local dir="$TMP/sf-shell" rm -rf "$dir" mkdir -p "$dir/bin" - for b in "${SHELL_BINS[@]}"; do install -m755 "$ROOT/target/release/$b" "$dir/bin/$b"; done + for b in "${SHELL_BINS[@]}"; do install -m755 "${CARGO_TARGET_DIR:-$ROOT/target}/release/$b" "$dir/bin/$b"; done install -m755 "$ROOT/tools/siri-remote/fastpair.py" "$dir/bin/sf-pair" pack sf-shell "$version" "$dir" }