Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions .github/CI.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,30 @@ QEMU jobs retain serial logs and result records.

Select **CI result** as the required branch check. It reports every
required job and treats a missing or failed result as a failure.
Production publishing is performed separately following the release
guide, using a complete signed RPR snapshot and the matching media.

## Production Pages and RPR

A successful CI result for a push to `main` triggers the production publisher.
To retry from Actions, run **ReliefOS CI** on `main` with **publish_pages**
enabled. The workflow builds the verified commit, serializes production
deployments, and skips commits already deployed or superseded on `main`.

Configure the `github-pages` environment for `main` deployments. Set the
`RPR_SIGNING_FINGERPRINT` Actions variable to the primary fingerprint from
`packages/arch/reliefos-keyring/production-fingerprint`. Set the
`RPR_SIGNING_KEY_B64` Actions secret to a base64-encoded OpenPGP secret-subkey
export that can sign in batch mode. Retain the primary secret key and its
revocation certificate in project-controlled backup storage.

The default repository is `https://reliefosproject.github.io/ReliefOS/rpr`.
The build uses the selected snapshot key to verify local packages. ISO and disk
images configured for the default URL trust the packaged production public key
for online installation and updates. Override `RPR_SERVER_URL` to use a
self-hosted snapshot and its own key.

Pages serves the signed pacman repository, manuals, and a checksummed ISO
download page. The ISO is an asset of a snapshot-specific GitHub Release
because it exceeds the Pages site limit. The publisher verifies the previous
signed snapshot, preserves its package URLs during the handover, and reuses
already published package bytes for unchanged fixed package versions. Bump
the PKGBUILD version or release when changing one of those packages.
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
push:
branches: [main, rewrite/new-os]
workflow_dispatch:
inputs:
publish_pages:
description: Publish the verified main commit to GitHub Pages and RPR
type: boolean
default: false

permissions:
contents: read
Expand Down Expand Up @@ -84,6 +89,7 @@ jobs:
tests/integration/arch-rpr-{testing,pacman}.sh \
tests/integration/arch-{kernel-prune,kernel-prune-container,systemd-boot,systemd-entry}.sh \
tests/integration/arch-kernel-upgrade{,-build}.sh
shellcheck scripts/ci/{restore-rpr,publish-pages}.sh
/usr/bin/python3 -m unittest discover -s tools/tests -p 'test_ci*.py' -v

documentation:
Expand Down Expand Up @@ -292,3 +298,13 @@ jobs:
env:
NEEDS_JSON: ${{ toJSON(needs) }}
run: python3 tools/ci.py summary

publish:
name: Publish production Pages and RPR
needs: ci
if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.publish_pages))
permissions:
contents: write
pages: write
id-token: write
uses: ./.github/workflows/publish-pages.yml
103 changes: 103 additions & 0 deletions .github/workflows/publish-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Publish ReliefOS Pages

on:
workflow_call:

concurrency:
group: reliefos-production-pages
cancel-in-progress: false

jobs:
production:
name: Sign RPR, publish installer and deploy Pages
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-24.04
timeout-minutes: 90
permissions:
contents: write
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
env:
ARCH_BASE_REGISTRY: docker.io
ARCH_JOBS: '2'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
submodules: recursive
persist-credentials: false
- name: Skip superseded runs
id: current
shell: bash
run: |
ref=$(git ls-remote --exit-code origin refs/heads/main)
if [[ ${ref%%$'\t'*} == "$GITHUB_SHA" ]]; then
echo 'publish=true' >> "$GITHUB_OUTPUT"
else
echo 'This CI run has been superseded by a newer main commit.'
fi
- uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
if: steps.current.outputs.publish == 'true'
id: pages
- name: Check production configuration
if: steps.current.outputs.publish == 'true'
shell: bash
env:
PAGES_BASE_URL: ${{ steps.pages.outputs.base_url }}
RPR_SIGNING_FINGERPRINT: ${{ vars.RPR_SIGNING_FINGERPRINT }}
RPR_SIGNING_KEY_B64: ${{ secrets.RPR_SIGNING_KEY_B64 }}
run: |
repository=$(<packages/arch/reliefos-keyring/production-url)
test "$repository" = "${PAGES_BASE_URL%/}/rpr"
test "$RPR_SIGNING_FINGERPRINT" = "$(<packages/arch/reliefos-keyring/production-fingerprint)"
: "${RPR_SIGNING_KEY_B64:?configure the production signing subkey in github-pages}"
echo "RPR_SERVER_URL=$repository" >> "$GITHUB_ENV"
echo "RPR_SIGNING_FINGERPRINT=$RPR_SIGNING_FINGERPRINT" >> "$GITHUB_ENV"
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
if: steps.current.outputs.publish == 'true'
with:
python-version: '3.12'
cache: pip
cache-dependency-path: Documentation/requirements.txt
- name: Install Sphinx and build release packages
if: steps.current.outputs.publish == 'true'
shell: bash
run: |
python -m pip install -r Documentation/requirements.txt 'Sphinx==9.*'
bash scripts/ci/arch-host.sh ubuntu-24.04 out/production-pages
- name: Sign the repository with the production subkey
if: steps.current.outputs.publish == 'true'
id: signed
env:
RPR_SIGNING_KEY_B64: ${{ secrets.RPR_SIGNING_KEY_B64 }}
run: bash scripts/ci/publish-pages.sh sign out/production-pages
- name: Assemble the production installer and Pages site
if: steps.signed.outputs.publish == 'true'
run: bash scripts/ci/publish-pages.sh assemble out/production-pages
- name: Check that this is still the latest main commit
if: steps.signed.outputs.publish == 'true'
id: ready
shell: bash
run: |
ref=$(git ls-remote --exit-code origin refs/heads/main)
if [[ ${ref%%$'\t'*} == "$GITHUB_SHA" ]]; then
echo 'publish=true' >> "$GITHUB_OUTPUT"
else
echo 'A newer main commit will publish its own release.'
fi
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
if: steps.ready.outputs.publish == 'true'
with:
path: out/production-pages/pages
- name: Publish the matching ISO to GitHub Releases
if: steps.ready.outputs.publish == 'true'
env:
GH_TOKEN: ${{ github.token }}
run: bash scripts/ci/publish-pages.sh upload out/production-pages
- name: Deploy the signed RPR and download links together
if: steps.ready.outputs.publish == 'true'
id: deployment
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
5 changes: 3 additions & 2 deletions Documentation/kbuild/building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ testing RPR 收录当前版本化内核包、固定名称的更新包,以及 `

客户端必须先通过独立可信渠道取得发布者的完整指纹。在 Arch 测试环境中,可用
``bash tools/build/arch-rpr-trust.sh PUBLIC_KEY FINGERPRINT PACMAN_GPGDIR`` 初始化一个
新的 pacman 信任目录。已签名的 ``reliefos-testing-keyring`` 包保存公开信任数据,
新的 pacman 信任目录。已签名的 ``reliefos-keyring`` 包保存公开信任数据,
不能替代首次指纹核验。让 ``[rpr]`` 指向所选快照,仓库使用
``SigLevel = Required TrustedOnly``;testing 环境之外使用 HTTPS。此入口不配置
系统 pacman,也不安装或切换系统组件。
Expand Down Expand Up @@ -220,7 +220,8 @@ ReliefOS 的 XDM 覆盖配置、会话选择和 IceWM 自启动规则见 :doc:`.
已校验的持久内核载荷进入归档,供离线磁盘装配和安装后的启动更新使用。
载荷发布锁文件在归档前删除。

必须用 ``RPR_SERVER_URL`` 指定目标系统使用的在线仓库地址。开发测试应指定测试服务器。目标系统的
默认在线仓库为 ``https://reliefosproject.github.io/ReliefOS/rpr``,镜像使用内置的正式 RPR 公钥。
开发测试可用 ``RPR_SERVER_URL`` 指定其他仓库,并使用所选快照的签名公钥。目标系统的
``/etc/pacman.d/reliefos-rpr.conf`` 将该地址配置为 ``[rpr]``,包和数据库均须通过
可信签名验证。首次启动时 ``reliefos-pacman-init.service`` 使用已安装的 Arch 和
ReliefOS 公钥初始化独立的 pacman 信任目录,后续密钥包升级会更新 ReliefOS 信任数据。
Expand Down
9 changes: 4 additions & 5 deletions Documentation/locale/en/LC_MESSAGES/kbuild/building.po
Original file line number Diff line number Diff line change
Expand Up @@ -399,14 +399,14 @@ msgstr ""
msgid ""
"客户端必须先通过独立可信渠道取得发布者的完整指纹。在 Arch 测试环境中,可用 ``bash tools/build/arch-rpr-"
"trust.sh PUBLIC_KEY FINGERPRINT PACMAN_GPGDIR`` 初始化一个 新的 pacman 信任目录。已签名的"
" ``reliefos-testing-keyring`` 包保存公开信任数据, 不能替代首次指纹核验。让 ``[rpr]`` "
" ``reliefos-keyring`` 包保存公开信任数据, 不能替代首次指纹核验。让 ``[rpr]`` "
"指向所选快照,仓库使用 ``SigLevel = Required TrustedOnly``;testing 环境之外使用 "
"HTTPS。此入口不配置 系统 pacman,也不安装或切换系统组件。"
msgstr ""
"Clients must first obtain the publisher’s full fingerprint through an "
"independent trusted channel. In an Arch test environment, run ``bash "
"tools/build/arch-rpr-trust.sh PUBLIC_KEY FINGERPRINT PACMAN_GPGDIR`` to "
"initialize a new pacman trust directory. The signed ``reliefos-testing-"
"initialize a new pacman trust directory. The signed ``reliefos-"
"keyring`` package carries public trust data but cannot replace the "
"initial fingerprint check. Point ``[rpr]`` at the chosen snapshot and use"
" ``SigLevel = Required TrustedOnly`` for the repository. Use HTTPS "
Expand Down Expand Up @@ -522,14 +522,13 @@ msgstr ""
" before archiving."

msgid ""
"必须用 ``RPR_SERVER_URL`` 指定目标系统使用的在线仓库地址。开发测试应指定测试服务器。目标系统的 "
"默认在线仓库为 ``https://reliefosproject.github.io/ReliefOS/rpr``,镜像使用内置的正式 RPR 公钥。 开发测试可用 ``RPR_SERVER_URL`` 指定其他仓库,并使用所选快照的签名公钥。目标系统的 "
"``/etc/pacman.d/reliefos-"
"rpr.conf`` 将该地址配置为 ``[rpr]``,包和数据库均须通过 可信签名验证。首次启动时 ``reliefos-pacman-"
"init.service`` 使用已安装的 Arch 和 ReliefOS 公钥初始化独立的 pacman 信任目录,后续密钥包升级会更新 "
"ReliefOS 信任数据。"
msgstr ""
"Set ``RPR_SERVER_URL`` to the target system's online repository URL. Use "
"the testing server for development. The target's ``/etc/pacman.d/reliefos-"
"The default online repository is ``https://reliefosproject.github.io/ReliefOS/rpr``. Images use the embedded production RPR public key. Set ``RPR_SERVER_URL`` for development to use another repository and the selected snapshot's signing key. The target's ``/etc/pacman.d/reliefos-"
"rpr.conf`` configures this URL under ``[rpr]``. Both packages and the "
"database must have trusted signatures. On first boot, ``reliefos-pacman-"
"init.service`` initializes a dedicated pacman trust directory from the "
Expand Down
9 changes: 4 additions & 5 deletions Documentation/locale/ja/LC_MESSAGES/kbuild/building.po
Original file line number Diff line number Diff line change
Expand Up @@ -333,13 +333,13 @@ msgstr ""
msgid ""
"客户端必须先通过独立可信渠道取得发布者的完整指纹。在 Arch 测试环境中,可用 ``bash tools/build/arch-rpr-"
"trust.sh PUBLIC_KEY FINGERPRINT PACMAN_GPGDIR`` 初始化一个 新的 pacman 信任目录。已签名的"
" ``reliefos-testing-keyring`` 包保存公开信任数据, 不能替代首次指纹核验。让 ``[rpr]`` "
" ``reliefos-keyring`` 包保存公开信任数据, 不能替代首次指纹核验。让 ``[rpr]`` "
"指向所选快照,仓库使用 ``SigLevel = Required TrustedOnly``;testing 环境之外使用 "
"HTTPS。此入口不配置 系统 pacman,也不安装或切换系统组件。"
msgstr ""
"クライアントは、配布元の完全なフィンガープリントを事前に独立した信頼できる経路で取得してください。 Arch のテスト環境では、``bash "
"tools/build/arch-rpr-trust.sh PUBLIC_KEY FINGERPRINT PACMAN_GPGDIR`` で新しい"
" pacman の信頼ディレクトリを初期化できます。署名済みの ``reliefos-testing-keyring`` "
" pacman の信頼ディレクトリを初期化できます。署名済みの ``reliefos-keyring`` "
"パッケージには公開の信頼情報が含まれますが、初回のフィンガープリント照合の代わりにはなりません。 ``[rpr]`` "
"の参照先を対象のスナップショットに設定し、リポジトリには ``SigLevel = Required TrustedOnly`` "
"を指定します。テスト環境以外では HTTPS を使用してください。 この手順でシステムの pacman "
Expand Down Expand Up @@ -437,14 +437,13 @@ msgstr ""
"信頼ディレクトリを含めません。検証済みの永続カーネルペイロードは、オフラインのディスク組み立てとインストール後の起動更新に使用するため含めます。ペイロード公開ロックファイルはアーカイブ前に削除します。"

msgid ""
"必须用 ``RPR_SERVER_URL`` 指定目标系统使用的在线仓库地址。开发测试应指定测试服务器。目标系统的 "
"默认在线仓库为 ``https://reliefosproject.github.io/ReliefOS/rpr``,镜像使用内置的正式 RPR 公钥。 开发测试可用 ``RPR_SERVER_URL`` 指定其他仓库,并使用所选快照的签名公钥。目标系统的 "
"``/etc/pacman.d/reliefos-"
"rpr.conf`` 将该地址配置为 ``[rpr]``,包和数据库均须通过 可信签名验证。首次启动时 ``reliefos-pacman-"
"init.service`` 使用已安装的 Arch 和 ReliefOS 公钥初始化独立的 pacman 信任目录,后续密钥包升级会更新 "
"ReliefOS 信任数据。"
msgstr ""
"``RPR_SERVER_URL`` にインストール先システムが使うオンラインリポジトリの URL を指定してください。"
"開発テストではテストサーバーを指定します。インストール先の "
"既定のオンラインリポジトリは ``https://reliefosproject.github.io/ReliefOS/rpr`` です。イメージは組み込みの正式 RPR 公開鍵を使用します。開発テストで ``RPR_SERVER_URL`` を設定すると、別のリポジトリと選択したスナップショットの署名鍵を使用できます。インストール先の "
"``/etc/pacman.d/reliefos-rpr.conf`` はこの URL を ``[rpr]`` "
"に設定し、パッケージとデータベースの両方に信頼済みの署名を要求します。初回起動時に ``reliefos-pacman-"
"init.service`` がインストール済みの Arch と ReliefOS 公開鍵から専用の pacman "
Expand Down
50 changes: 50 additions & 0 deletions packages/arch/reliefos-keyring/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# The repository publisher supplies only the selected public key and trust data.
pkgname=reliefos-keyring
pkgver=1
pkgrel=2
pkgdesc='Public OpenPGP trust data for the ReliefOS package repository'
arch=('any')
url='https://github.com/ReliefOSProject/ReliefOS'
license=('Apache-2.0')
depends=('pacman')
makedepends=('gnupg')
provides=('reliefos-testing-keyring')
conflicts=('reliefos-testing-keyring')
replaces=('reliefos-testing-keyring')
options=('!debug')
source=('reliefos-pacman-init.service' 'reliefos-pacman-keyring' 'reliefos-keyring-update.hook'
'reliefos-rpr-keyring' 'production-url' 'production-fingerprint' 'production-key.pub')
sha256sums=('30f39fdb8c2642b1a30ca49746a981ed6a6814831f9254223497207a71fc2554'
'fcd8edcd93aceea9524f5ec62159534316df79bf6f9d73a55eb19ae291601df3'
'074f6a51e422b03dcb0630b62ab8831e84ab97bb15bdc11e9c194418eedb7a77'
'8ed06f68a7286f4ba8dfedcd02de278259dfff108739c1897bee7a6a0ee5edda'
'c513a7e52e0afcd9a8831e18d3016e3aa2ef8f9b92567572206fead34563f2e5'
'02867c18145974c1f37d86c25fd0f9f7216ef365a264b7321f06ac9ded9783ba'
'663ccb5e93cb20f32542137bc9b7dc4d61ff7a1809b043a70f5fdd3cc6e3bcbe')

package() {
local keyring=${RELIEFOS_KEYRING_DIR:?build via make arch-rpr-testing}
local production_dir=$pkgdir/usr/share/pacman/keyrings
local gpg_home=$srcdir/rpr-gnupg
local -a gpg=(gpg --no-options --batch --homedir "$gpg_home")
local fingerprint found
install -dm700 -- "$gpg_home"
fingerprint=$(<"$srcdir/production-fingerprint")
found=$("${gpg[@]}" --with-colons --show-keys "$srcdir/production-key.pub" |
awk -F: '$1 == "pub" {primary = 1} $1 == "fpr" && primary {print $10; primary = 0}')
[[ $fingerprint =~ ^[0-9A-F]{40}$ && $found == "$fingerprint" ]] || return 1
install -Dm644 -t "$pkgdir/usr/share/pacman/keyrings" \
"$keyring/reliefos.gpg" "$keyring/reliefos-trusted" \
"$keyring/reliefos-revoked"
"${gpg[@]}" --dearmor --output "$production_dir/reliefos-production.gpg" "$srcdir/production-key.pub"
printf '%s:4:\n' "$fingerprint" > "$production_dir/reliefos-production-trusted"
: > "$production_dir/reliefos-production-revoked"
install -Dm644 "$srcdir/production-url" "$pkgdir/usr/share/reliefos/rpr-production-url"
install -Dm755 "$srcdir/reliefos-rpr-keyring" "$pkgdir/usr/libexec/reliefos/rpr-keyring"
install -Dm644 "$srcdir/reliefos-pacman-init.service" \
"$pkgdir/usr/lib/systemd/system/reliefos-pacman-init.service"
install -Dm755 "$srcdir/reliefos-pacman-keyring" \
"$pkgdir/usr/libexec/reliefos/pacman-keyring"
install -Dm644 "$srcdir/reliefos-keyring-update.hook" \
"$pkgdir/usr/share/libalpm/hooks/reliefos-keyring-update.hook"
}
1 change: 1 addition & 0 deletions packages/arch/reliefos-keyring/production-fingerprint
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6697F82A4B84BAD8D19A2C7867DA313B6C201C57
15 changes: 15 additions & 0 deletions packages/arch/reliefos-keyring/production-key.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----

mDMEaxF0SRYJKwYBBAHaRw8BAQdAF0MPc4BsQznQEeoZMPf6MfSpsGk87zddX01X
5N+NiQq0DFJlbGllZk9TIFJQUoiQBBMWCgA4FiEEZpf4KkuEutjRmix4Z9oxO2wg
HFcFAmsRdEkCGwEFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQZ9oxO2wgHFeD
lQD/dCKKb06VqnAhEaWO/PuRIU6bCDPvU4mDWnCD4GGZ2wMBAPSdlP75Lns43Kgq
b5P4PnyFrv+PKuNZnUZTFETqQg4BuDMEaxF0SRYJKwYBBAHaRw8BAQdAMly91ceZ
/WOfDail+OvYmjAFCjC1AwIF6nsMBsgY4+6I9QQYFgoAJhYhBGaX+CpLhLrY0Zos
eGfaMTtsIBxXBQJrEXRJAhsCBQkDwmcAAIEJEGfaMTtsIBxXdiAEGRYKAB0WIQQz
eyT8Ke/P13Ltz9eaPahVvCiaiwUCaxF0SQAKCRCaPahVvCiai/NOAQDLEC9CFKbE
cQNc9mTWbRBU02ahQApzvg808QOaiPuK8gD/Yv7mmiOhDOJDxw2fpdxmiPqepFrH
/17ZV/B3eO+ivwzwxgEAq70UJDD7F/BbwQkyObWwXTsbE4QsI7/+yuZeUaj2T2gA
/1AUDCrEm8fSuV4WlAJ6H8pEFlfn+RA7vqk1fZi6euoM
=2Sy7
-----END PGP PUBLIC KEY BLOCK-----
1 change: 1 addition & 0 deletions packages/arch/reliefos-keyring/production-url
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://reliefosproject.github.io/ReliefOS/rpr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Operation = Install
Operation = Upgrade
Type = Package
Target = reliefos-testing-keyring
Target = reliefos-keyring

[Action]
Description = Updating the ReliefOS package signing trust
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ ready=/var/lib/reliefos/pacman-keyring.ready
case ${1:-initialize} in
initialize)
[ ! -e "$ready" ] || exit 0
keyring=$(/usr/libexec/reliefos/rpr-keyring)
pacman-key --init
pacman-key --populate archlinux reliefos-testing
pacman-key --populate archlinux "$keyring"
install -Dm644 /dev/null "$ready"
;;
--if-initialized)
[ -e "$ready" ] || exit 0
pacman-key --populate reliefos-testing
keyring=$(/usr/libexec/reliefos/rpr-keyring)
pacman-key --populate "$keyring"
;;
*)
printf 'usage: %s [--if-initialized]\n' "$0" >&2
Expand Down
13 changes: 13 additions & 0 deletions packages/arch/reliefos-keyring/reliefos-rpr-keyring
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
# Select the trust root for the configured RPR, including an optional sysroot.
set -eu
root=${1:-}
production=$(cat -- "$root/usr/share/reliefos/rpr-production-url")
configuration=$root/etc/pacman.d/reliefos-rpr.conf
[ -n "$production" ]
[ -r "$configuration" ]
if grep -Fxq -- "Server = $production" "$configuration"; then
printf '%s\n' reliefos-production
else
printf '%s\n' reliefos
fi
Loading
Loading