Publish a signed APT repository for Linux releases

The site deploy builds https://breeze.waozi.xyz/apt from the published release's .deb files, signed with the APT_SIGNING_KEY secret and checked against the committed keyring. install-apt.html explains setup and the Linux card links to it.
This commit is contained in:
waozi committed 2026-10-31 03:07:30 -03:00
1 parent 29594aa1ef
commit 8408d63f84
10 files changed
+233

No files matched your search

+11
View File
@@ -132,6 +132,17 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
# apt users follow the published release at https://breeze.waozi.xyz/apt.
- name: Build APT Repository
if: github.event_name != 'pull_request'
env:
GH_TOKEN: ${{ github.token }}
APT_SIGNING_KEY: ${{ secrets.APT_SIGNING_KEY }}
run: |
set -euo pipefail
command -v apt-ftparchive >/dev/null || sudo apt-get install -y --no-install-recommends apt-utils
sh scripts/build-apt-repo.sh build/site/apt "$SITE_RELEASE_VERSION"
- name: Upload Web diagnostics after a failed build
if: ${{ failure() && env.USE_RELEASED_WEB != 'true' }}
uses: actions/upload-artifact@v4
+1
View File
@@ -2,6 +2,7 @@
## [Unreleased]
- Linux: install from the signed APT repository and get updates with apt.
- Filter Android account-key imports to key files and related backup types.
- Practice results show smooth, labeled mood faces with a clear selection.
- Apps keeps each grid card's ⋮ control unchanged while editing.
+1
View File
@@ -125,6 +125,7 @@ test: modal-rules-test
test: elist-screen-test
test: theme-catalog-bundle-check
test: site-assets-test
test: apt-repo-test
test: android-smoke-script-test
test: sync-recovery-test
test: sync-connection-test
+4
View File
@@ -22,6 +22,10 @@ web-window-zi-test: $(ZI2C_BIN)
site-assets-test:
node tests/site_assets_test.mjs
.PHONY: apt-repo-test
apt-repo-test:
sh tests/apt_repo_test.sh
web-canvas-smoke-test: $(WEB_SMOKE_TEST)
WEB_SMOKE_RENDERER=canvas WEB_SMOKE_BROWSER="$(WEB_SMOKE_BROWSER)" node $(WEB_SMOKE_TEST) $(WEB_DIST_DIR)
Binary file not shown.
+92
View File
@@ -0,0 +1,92 @@
#!/bin/sh
# Build the signed APT repository for a published release under the site:
# build-apt-repo.sh OUT_DIR VERSION
# APT_SIGNING_KEY holds the armored private key; its public half is
# packaging/linux/apt/breeze-archive-keyring.gpg. APT_DEB_DIR, when set,
# supplies the .deb files instead of downloading them from the release.
set -eu
script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
root_dir=$(dirname -- "$script_dir")
keyring=${APT_KEYRING:-"$root_dir/packaging/linux/apt/breeze-archive-keyring.gpg"}
archs="amd64 arm64"
if [ "$#" -ne 2 ]; then
printf 'Usage: %s OUT_DIR VERSION\n' "$0" >&2
exit 2
fi
out_dir=$1
version=$2
if [ -z "${APT_SIGNING_KEY:-}" ]; then
printf 'Error: APT_SIGNING_KEY is not set\n' >&2
exit 1
fi
for tool in apt-ftparchive gpg gpgv; do
if ! command -v "$tool" >/dev/null 2>&1; then
printf 'Error: %s is required\n' "$tool" >&2
exit 1
fi
done
GNUPGHOME=$(mktemp -d)
export GNUPGHOME
trap 'rm -rf "$GNUPGHOME"' EXIT INT TERM
rm -rf "$out_dir"
pool="$out_dir/pool/main/i/inbe"
mkdir -p "$pool"
for arch in $archs; do
deb="inbe_${version}_${arch}.deb"
if [ -n "${APT_DEB_DIR:-}" ]; then
cp "$APT_DEB_DIR/$deb" "$pool/$deb"
else
gh release download "v$version" --repo waozixyz/breeze --pattern "$deb" --dir "$pool"
fi
# A deb whose control fields disagree with its name would publish a wrong upgrade.
fields=$(dpkg-deb -f "$pool/$deb" Package Version Architecture | tr '\n' ' ')
if [ "$fields" != "Package: inbe Version: $version Architecture: $arch " ]; then
printf 'Error: %s has control fields %s\n' "$deb" "$fields" >&2
exit 1
fi
done
dist="$out_dir/dists/stable"
for arch in $archs; do
mkdir -p "$dist/main/binary-$arch"
# Uncompressed only: the CDN may re-encode .gz responses.
(cd "$out_dir" && apt-ftparchive --arch "$arch" packages pool) > "$dist/main/binary-$arch/Packages"
done
apt-ftparchive \
-o APT::FTPArchive::Release::Origin="Waozi" \
-o APT::FTPArchive::Release::Label="Inner Breeze" \
-o APT::FTPArchive::Release::Suite="stable" \
-o APT::FTPArchive::Release::Codename="stable" \
-o APT::FTPArchive::Release::Architectures="$archs" \
-o APT::FTPArchive::Release::Components="main" \
-o APT::FTPArchive::Release::Description="Inner Breeze releases" \
release "$dist" > "$GNUPGHOME/Release"
mv "$GNUPGHOME/Release" "$dist/Release"
printf '%s\n' "$APT_SIGNING_KEY" | gpg --batch --quiet --import
gpg --batch --yes --digest-algo SHA512 --clearsign --output "$dist/InRelease" "$dist/Release"
gpg --batch --yes --digest-algo SHA512 --armor --detach-sign --output "$dist/Release.gpg" "$dist/Release"
# Users trust only the committed keyring, so the signature must verify against it.
gpgv --keyring "$keyring" "$dist/InRelease" 2>/dev/null || {
printf 'Error: APT_SIGNING_KEY does not match %s\n' "$keyring" >&2
exit 1
}
gpgv --keyring "$keyring" "$dist/Release.gpg" "$dist/Release" 2>/dev/null
cp "$keyring" "$out_dir/breeze-archive-keyring.gpg"
cat > "$out_dir/inbe.sources" <<'EOF'
Types: deb
URIs: https://breeze.waozi.xyz/apt
Suites: stable
Components: main
Signed-By: /usr/share/keyrings/breeze-archive-keyring.gpg
EOF
printf 'APT repository for inbe %s written to %s\n' "$version" "$out_dir"
+1
View File
@@ -243,6 +243,7 @@ python3 "$root_dir/scripts/prepare-site-assets.py" "$out_dir"
for path in \
index.html \
privacy.html \
install-apt.html \
delete-account.html \
delete-account/index.html \
legacy-converter.html \
+1
View File
@@ -103,6 +103,7 @@
<div class="link-row">
<a href="https://github.com/waozixyz/breeze/releases/download/v${version}/inbe-linux-x86_64.AppImage" target="_blank" rel="noopener">AppImage</a>
<a href="https://github.com/waozixyz/breeze/releases/download/v${version}/inbe_${version}_amd64.deb" target="_blank" rel="noopener">DEB</a>
<a href="/install-apt.html">APT</a>
<a href="https://github.com/waozixyz/breeze/releases/download/v${version}/inbe-${version}-1.x86_64.rpm" target="_blank" rel="noopener">RPM</a>
<a href="https://github.com/waozixyz/breeze/releases/download/v${version}/inbe-linux-aarch64.AppImage" target="_blank" rel="noopener">ARM64</a>
</div>
+46
View File
@@ -0,0 +1,46 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Install with APT - Inner Breeze</title>
<link href="/css/landing.css?v=${asset_version}" rel="stylesheet" />
<meta name="description" content="Install Inner Breeze on Debian and Ubuntu from its APT repository and get every release through apt upgrade.">
<meta name="theme-color" content="#f7f3eb">
<style>
.document-main pre {
overflow-x: auto;
padding: 1rem;
border: 1px solid var(--line);
background: var(--surface);
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 0.9rem;
}
</style>
</head>
<body>
<header class="topbar"><a class="brand" href="/"><img src="/assets/editorial/lotus.svg" width="36" height="30" alt="">Inner Breeze</a><nav aria-label="APT page navigation"><a href="/">Overview</a><a href="/privacy.html">Privacy</a></nav></header>
<div class="document-main">
<section>
<h1>Install with APT</h1>
<p>Debian, Ubuntu and their derivatives can install Inner Breeze from its signed APT repository. New releases then arrive with your other system updates. The repository has packages for amd64 and arm64.</p>
</section>
<section>
<h2>Add the repository</h2>
<pre><code>sudo curl -fsSLo /usr/share/keyrings/breeze-archive-keyring.gpg https://breeze.waozi.xyz/apt/breeze-archive-keyring.gpg
sudo curl -fsSLo /etc/apt/sources.list.d/inbe.sources https://breeze.waozi.xyz/apt/inbe.sources
sudo apt update
sudo apt install inbe</code></pre>
<p>Start it from your app menu or with <code>breeze</code>. The signing key fingerprint is <code>70C3 0C13 CB00 6C50 9B19 1480 BC01 11C7 1342 0287</code>.</p>
</section>
<section>
<h2>Remove it</h2>
<pre><code>sudo apt remove inbe
sudo rm /etc/apt/sources.list.d/inbe.sources /usr/share/keyrings/breeze-archive-keyring.gpg</code></pre>
<p>Your practices and habits stay in <code>~/.local/share/inbe</code>.</p>
</section>
</div>
</body>
</html>
+76
View File
@@ -0,0 +1,76 @@
#!/bin/sh
# scripts/build-apt-repo.sh signs a repository apt accepts, and refuses a key
# that differs from the published keyring or a deb that differs from its name.
set -eu
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
work=$(mktemp -d)
trap 'rm -rf "$work"' EXIT INT TERM
version=9.8.7
fail() {
printf 'apt repo test: %s\n' "$1" >&2
exit 1
}
make_deb() {
pkg=$work/pkg-$1
mkdir -p -m 755 "$pkg/DEBIAN" "$pkg/usr/bin"
printf '#!/bin/sh\n' > "$pkg/usr/bin/breeze"
chmod 755 "$pkg/DEBIAN" "$pkg/usr/bin/breeze"
printf 'Package: inbe\nVersion: %s\nArchitecture: %s\nMaintainer: Test <[email protected]>\nDescription: test\n' \
"$2" "$1" > "$pkg/DEBIAN/control"
dpkg-deb --root-owner-group --build "$pkg" "$work/debs/inbe_${version}_$1.deb" >/dev/null
}
new_key() {
GNUPGHOME=$work/gpg-$1 && export GNUPGHOME
mkdir -m 700 "$GNUPGHOME"
gpg --batch --quiet --passphrase '' --quick-gen-key "test $1 <[email protected]>" rsa2048 sign never 2>/dev/null
gpg --export > "$work/$1.gpg"
gpg --armor --export-secret-keys
unset GNUPGHOME
}
mkdir -p "$work/debs"
make_deb amd64 "$version"
make_deb arm64 "$version"
key=$(new_key good)
other=$(new_key other)
APT_DEB_DIR=$work/debs APT_KEYRING=$work/good.gpg APT_SIGNING_KEY=$key \
sh "$root/scripts/build-apt-repo.sh" "$work/repo" "$version" >/dev/null
for path in dists/stable/InRelease dists/stable/Release.gpg breeze-archive-keyring.gpg inbe.sources \
dists/stable/main/binary-amd64/Packages dists/stable/main/binary-arm64/Packages \
pool/main/i/inbe/inbe_${version}_amd64.deb pool/main/i/inbe/inbe_${version}_arm64.deb; do
[ -s "$work/repo/$path" ] || fail "missing $path"
done
if APT_DEB_DIR=$work/debs APT_KEYRING=$work/good.gpg APT_SIGNING_KEY=$other \
sh "$root/scripts/build-apt-repo.sh" "$work/bad-key" "$version" 2>/dev/null; then
fail "accepted a key that differs from the keyring"
fi
make_deb arm64 9.8.6
if APT_DEB_DIR=$work/debs APT_KEYRING=$work/good.gpg APT_SIGNING_KEY=$key \
sh "$root/scripts/build-apt-repo.sh" "$work/bad-deb" "$version" 2>/dev/null; then
fail "accepted a deb whose version differs from its name"
fi
# apt itself verifies the signature and finds the package, without root.
apt_dir=$work/apt
mkdir -p "$apt_dir/etc/sources.list.d" "$apt_dir/etc/preferences.d" "$apt_dir/state/lists/partial" \
"$apt_dir/cache/archives/partial"
: > "$apt_dir/state/status"
sed -e "s#https://breeze.waozi.xyz/apt#file://$work/repo#" \
-e "s#/usr/share/keyrings/breeze-archive-keyring.gpg#$work/good.gpg#" \
"$work/repo/inbe.sources" > "$apt_dir/etc/sources.list.d/inbe.sources"
apt_opts="-o Dir::Etc=$apt_dir/etc -o Dir::Etc::sourcelist=/dev/null -o Dir::State=$apt_dir/state
-o Dir::State::status=$apt_dir/state/status -o Dir::Cache=$apt_dir/cache -o Debug::NoLocking=1
-o APT::Architecture=amd64"
# shellcheck disable=SC2086
apt-get $apt_opts update >"$work/apt-update.log" 2>&1 || { cat "$work/apt-update.log" >&2; fail "apt update failed"; }
grep -q -E '^(W|E):' "$work/apt-update.log" && { cat "$work/apt-update.log" >&2; fail "apt update warned"; }
# shellcheck disable=SC2086
candidate=$(apt-cache $apt_opts policy inbe | awk '/Candidate:/ { print $2 }')
[ "$candidate" = "$version" ] || fail "apt candidate is '$candidate', expected $version"
echo "apt repo test passed"