Compare commits

...
Author SHA1 Message Date
FredApps fe44c75b16 Merge branch 'main' into fix/sec-packaging 2026-11-28 12:28:09 +01:00
FredApps edf32e785d fix: parse flatpak archive size with tar --numeric-owner
GNU tar prints owner and group names unquoted, so a name with a
space shifts the size out of awk field 3 and the 2 GiB unpack
guard can fail open. Numeric IDs stay in one field.
2026-11-28 11:18:35 +01:00
FredApps 00ba1b66b6 Merge branch 'main' into fix/sec-packaging 2026-11-28 11:07:06 +01:00
Dylan M. Taylor 9bbb7e01dd packaging: keep the signing certificate in a private folder and bound the Flatpak tarball 2026-11-03 04:35:18 +00:00
2 changed files with 11 additions and 2 deletions
+6
View File
@@ -53,6 +53,12 @@ done
echo "==> SoundCraft $VERSION Flatpak bundle for $ARCH from $(basename "$TARBALL")"
# The packaged app unpacks to tens of MB; an archive that lists far more would fill the build
# host's disk before anything here could check it.
MAX_UNPACKED_BYTES=$((2 * 1024 * 1024 * 1024))
UNPACKED="$(tar --numeric-owner -tzvf "$TARBALL" | awk '{ s += $3 } END { print s + 0 }')"
[ "$UNPACKED" -le "$MAX_UNPACKED_BYTES" ] || { echo "error: $TARBALL unpacks to $UNPACKED bytes, more than $MAX_UNPACKED_BYTES" >&2; exit 1; }
WORK="$CARGO_TARGET_DIR/flatpak-bundle"
rm -rf "$WORK"
mkdir -p "$WORK/stage"
+5 -2
View File
@@ -19,10 +19,13 @@ fi
TMP="${RUNNER_TEMP:-${TMPDIR:-/tmp}}"
KEYCHAIN="$TMP/soundcraft-signing.keychain-db"
CERT="$TMP/soundcraft-signing.p12"
# The decoded certificate goes in a folder of this run's own (mktemp creates it, owner-only):
# a name another account could plant in the shared folder must not receive or redirect it.
CERT_DIR="$(mktemp -d "$TMP/soundcraft-signing.XXXXXX")"
CERT="$CERT_DIR/soundcraft-signing.p12"
KC_PASS="${KEYCHAIN_PASSWORD:-$(openssl rand -hex 24)}"
trap 'rm -f "$CERT"' EXIT
trap 'rm -rf "$CERT_DIR"' EXIT
printf '%s' "$APPLE_CERTIFICATE" | base64 --decode >"$CERT"
security create-keychain -p "$KC_PASS" "$KEYCHAIN"
security set-keychain-settings -lut 21600 "$KEYCHAIN"