Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

feat(linux): ship an .rpm for Fedora with every release

Bugfixer 284c328bd15cf
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index e8c6aef8f6..5ea56e2c69 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -669,7 +669,7 @@ jobs:
- name: Install package validation and native smoke tools
run: >-
sudo apt-get update && sudo apt-get install -y
- at-spi2-core dbus-x11 desktop-file-utils libxi6 libxkbcommon0 openbox squashfs-tools x11-utils xdotool xvfb
+ at-spi2-core cpio dbus-x11 desktop-file-utils libxi6 libxkbcommon0 openbox rpm squashfs-tools x11-utils xdotool xvfb
- run: pnpm install --frozen-lockfile
- name: Stage the pinned CUA runtime
run: pnpm build:cua:linux
diff --git a/.github/workflows/package-linux.yml b/.github/workflows/package-linux.yml
index e9439df17e..8e945daca5 100644
--- a/.github/workflows/package-linux.yml
+++ b/.github/workflows/package-linux.yml
@@ -20,7 +20,7 @@ permissions:
jobs:
package:
- name: DEB + AppImage (Ubuntu 24.04 x64)
+ name: DEB + RPM + AppImage (Ubuntu 24.04 x64)
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
@@ -36,7 +36,7 @@ jobs:
- name: Install package validation and native smoke tools
run: >-
sudo apt-get update && sudo apt-get install -y
- at-spi2-core dbus-x11 desktop-file-utils libxi6 libxkbcommon0 openbox squashfs-tools x11-utils xdotool xvfb
+ at-spi2-core cpio dbus-x11 desktop-file-utils libxi6 libxkbcommon0 openbox rpm squashfs-tools x11-utils xdotool xvfb
- run: pnpm install --frozen-lockfile
- name: Clean generated output
run: pnpm clean
@@ -100,18 +100,23 @@ jobs:
version="$(node -p "require('./package.json').version")"
appimage="release/OpenMausBot-${version}-x86_64.AppImage"
deb="release/OpenMausBot-${version}-amd64.deb"
+ rpm="release/OpenMausBot-${version}-x86_64.rpm"
test -f "$appimage"
test -f "$deb"
+ test -f "$rpm"
cp "$appimage" release/OpenMausBot.AppImage
cp "$deb" release/OpenMausBot-amd64.deb
+ cp "$rpm" release/OpenMausBot-x86_64.rpm
chmod 0755 release/OpenMausBot.AppImage
(
cd release
sha256sum \
"$(basename "$appimage")" \
"$(basename "$deb")" \
+ "$(basename "$rpm")" \
OpenMausBot.AppImage \
- OpenMausBot-amd64.deb > SHA256SUMS-ubuntu-x64.txt
+ OpenMausBot-amd64.deb \
+ OpenMausBot-x86_64.rpm > SHA256SUMS-ubuntu-x64.txt
)
echo "artifact-name=openmausbot-ubuntu-${version}-x64" >> "$GITHUB_OUTPUT"
echo "version: $version"
@@ -135,6 +140,8 @@ jobs:
release/OpenMausBot-*-amd64.deb
release/OpenMausBot-*-x86_64.AppImage
release/OpenMausBot-amd64.deb
+ release/OpenMausBot-*-x86_64.rpm
+ release/OpenMausBot-x86_64.rpm
release/OpenMausBot.AppImage
release/SHA256SUMS-ubuntu-x64.txt
if-no-files-found: error
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index bb15c8c3fb..1f4fc73ecc 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -442,7 +442,7 @@ jobs:
- name: Install package validation and native smoke tools
run: >-
sudo apt-get update && sudo apt-get install -y
- at-spi2-core dbus-x11 desktop-file-utils libxi6 libxkbcommon0 openbox squashfs-tools x11-utils xdotool xvfb
+ at-spi2-core cpio dbus-x11 desktop-file-utils libxi6 libxkbcommon0 openbox rpm squashfs-tools x11-utils xdotool xvfb
- run: pnpm install --frozen-lockfile
- name: Clean generated output
run: pnpm clean
@@ -500,13 +500,15 @@ jobs:
v=$(node -p "require('./package.json').version")
cp "release/OpenMausBot-$v-amd64.deb" release/OpenMausBot-amd64.deb
cp "release/OpenMausBot-$v-x86_64.AppImage" release/OpenMausBot.AppImage
- (cd release && sha256sum OpenMausBot-$v-amd64.deb OpenMausBot-$v-x86_64.AppImage > SHA256SUMS-ubuntu-x64.txt)
+ cp "release/OpenMausBot-$v-x86_64.rpm" release/OpenMausBot-x86_64.rpm
+ (cd release && sha256sum OpenMausBot-$v-amd64.deb OpenMausBot-$v-x86_64.AppImage OpenMausBot-$v-x86_64.rpm > SHA256SUMS-ubuntu-x64.txt)
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: linux-release
path: |
release/*.deb
release/*.AppImage
+ release/*.rpm
release/SHA256SUMS-ubuntu-x64.txt
release/latest-linux.yml
if-no-files-found: error
@@ -548,7 +550,8 @@ jobs:
"OpenMausBot-$VERSION-x64.zip"
"OpenMausBot-$VERSION-x64.zip.blockmap"
"OpenMausBot-$VERSION-x86_64.AppImage"
- OpenMausBot-amd64.deb OpenMausBot-intel.dmg OpenMausBot-setup.exe
+ "OpenMausBot-$VERSION-x86_64.rpm"
+ OpenMausBot-amd64.deb OpenMausBot-intel.dmg OpenMausBot-setup.exe OpenMausBot-x86_64.rpm
OpenMausBot.AppImage OpenMausBot.dmg SHA256SUMS-ubuntu-x64.txt
)
for file in "${required[@]}"; do
@@ -574,6 +577,7 @@ jobs:
["latest-linux.yml", [
"OpenMausBot-${{ needs.prepare.outputs.version }}-x86_64.AppImage",
"OpenMausBot-${{ needs.prepare.outputs.version }}-amd64.deb",
+ "OpenMausBot-${{ needs.prepare.outputs.version }}-x86_64.rpm",
]],
]);
let bad = 0;
diff --git a/.github/workflows/sync-published-release.yml b/.github/workflows/sync-published-release.yml
index 94bcf695a9..81c933c2de 100644
--- a/.github/workflows/sync-published-release.yml
+++ b/.github/workflows/sync-published-release.yml
@@ -60,7 +60,8 @@ jobs:
"OpenMausBot-$version-x64.zip"
"OpenMausBot-$version-x64.zip.blockmap"
"OpenMausBot-$version-x86_64.AppImage"
- OpenMausBot-amd64.deb OpenMausBot-intel.dmg OpenMausBot-setup.exe
+ "OpenMausBot-$version-x86_64.rpm"
+ OpenMausBot-amd64.deb OpenMausBot-intel.dmg OpenMausBot-setup.exe OpenMausBot-x86_64.rpm
OpenMausBot.AppImage OpenMausBot.dmg SHA256SUMS-ubuntu-x64.txt
)
for file in "${required[@]}"; do
@@ -89,6 +90,7 @@ jobs:
["latest-linux.yml", [
`OpenMausBot-${version}-x86_64.AppImage`,
`OpenMausBot-${version}-amd64.deb`,
+ `OpenMausBot-${version}-x86_64.rpm`,
]],
]);
let bad = 0;
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 6f5eeb0eac..84eff4b76e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -36,7 +36,7 @@ pnpm test:watch # same, in watch mode
pnpm check:electron # syntax-check the plain JS Electron entrypoints
pnpm package:mac # DMG + ZIP; requires Swift/Xcode tools
-pnpm package:linux # Ubuntu x64 .deb + AppImage; no Swift required
+pnpm package:linux # Linux x64 .deb + .rpm + AppImage; no Swift required
```
To reproduce a failing CI test job, follow [Vitest shards](docs/ci.md#vitest-shards).
@@ -59,12 +59,12 @@ app and AppImage, routes `click` and `type_text` through the overlay-free bundle
fail-closed Wayland CUA smoke,
and produces one release artifact containing:
-- the versioned `.deb` and AppImage;
-- stable `OpenMausBot-amd64.deb` and `OpenMausBot.AppImage` copies used by the latest-download links;
+- the versioned `.deb`, `.rpm` and AppImage;
+- stable `OpenMausBot-amd64.deb`, `OpenMausBot-x86_64.rpm` and `OpenMausBot.AppImage` copies used by the latest-download links;
- `SHA256SUMS-ubuntu-x64.txt` covering both versioned and stable names.
Before publishing, confirm that `package.json` has the release version and dispatch the workflow against the same
-commit used for the other platforms. Attach all five Ubuntu files to the matching release in the separate
+commit used for the other platforms. Attach all seven Linux files to the matching release in the separate
[OpenMausBot releases](https://github.com/milind-soni/OpenMausBot/releases). Then verify the checksum
file and install the `.deb` plus launch the AppImage in a clean Ubuntu 24.04 x86_64 GNOME environment. Never combine
packages built from different commits under one version.
diff --git a/README.md b/README.md
index 35fff6f617..401e1e3729 100644
--- a/README.md
+++ b/README.md
@@ -37,7 +37,7 @@ Talk to them like contacts. Watch them work. Approve what matters.
<img src="https://img.shields.io/github/v/release/milind-soni/OpenMausBot?style=for-the-badge&label=%E2%AC%87%EF%B8%8F%20%20Download%20for%20Ubuntu&labelColor=070707&color=e95420&cacheSeconds=300" alt="Download the latest OpenMausBot for Ubuntu (.deb)" height="40">
</a>
-<sub>[latest release](https://github.com/milind-soni/OpenMausBot/releases/latest) &nbsp;·&nbsp; macOS: Apple silicon & Intel · signed & notarized .dmg &nbsp;·&nbsp; Windows: x64 installer &nbsp;·&nbsp; Ubuntu 24.04 x64: .deb or AppImage beta &nbsp;·&nbsp; [all releases](https://github.com/milind-soni/OpenMausBot/releases)</sub>
+<sub>[latest release](https://github.com/milind-soni/OpenMausBot/releases/latest) &nbsp;·&nbsp; macOS: Apple silicon & Intel · signed & notarized .dmg &nbsp;·&nbsp; Windows: x64 installer &nbsp;·&nbsp; Ubuntu 24.04 x64: .deb or AppImage beta &nbsp;·&nbsp; Fedora x64: .rpm &nbsp;·&nbsp; [all releases](https://github.com/milind-soni/OpenMausBot/releases)</sub>
<br>
@@ -345,6 +345,7 @@ See [Run OpenMausBot from scripts and CI](docs/headless-cli.md).
| **macOS** (Intel) | [OpenMausBot-intel.dmg](https://github.com/milind-soni/OpenMausBot/releases/latest/download/OpenMausBot-intel.dmg) | Same app, built for Intel Macs. Signed & notarized. |
| **Windows** (x64) | [OpenMausBot-setup.exe](https://github.com/milind-soni/OpenMausBot/releases/latest/download/OpenMausBot-setup.exe) | Run it — one-click, per-user, no admin rights. The installer isn't code-signed yet, so SmartScreen shows "unknown publisher": **More info → Run anyway**. |
| **Ubuntu 24.04** (x64) | [OpenMausBot-amd64.deb](https://github.com/milind-soni/OpenMausBot/releases/latest/download/OpenMausBot-amd64.deb) · [OpenMausBot.AppImage](https://github.com/milind-soni/OpenMausBot/releases/latest/download/OpenMausBot.AppImage) | Install the `.deb` with APT (recommended), or make the AppImage executable and run it. Beta; GNOME is the supported desktop. |
+| **Fedora** (x64) | [OpenMausBot-x86_64.rpm](https://github.com/milind-soni/OpenMausBot/releases/latest/download/OpenMausBot-x86_64.rpm) | Install with `sudo dnf install ./OpenMausBot-x86_64.rpm`. Community-supported; Ubuntu is the tested Linux. |
See the [Ubuntu Desktop guide](docs/linux-desktop.md) for installation, capabilities, and troubleshooting.
Any desktop build can also open the bots of another Windows, macOS, or Ubuntu computer over Tailscale; see [open one computer's bots from another computer](docs/desktop-companion.md).
@@ -370,7 +371,7 @@ Package the desktop application:
```sh
pnpm package:mac # macOS: DMG + ZIP; requires Swift/Xcode tools
pnpm package:win # Windows: installer + ZIP
-pnpm package:linux # Ubuntu x64: .deb + AppImage + verified CUA runtime
+pnpm package:linux # Linux x64: .deb + .rpm + AppImage + verified CUA runtime
```
### Desktop capability status
@@ -421,7 +422,7 @@ pnpm test # unit, driver, API, and desktop capability tests
pnpm build # typecheck + production build
pnpm check:electron # syntax-check Electron main/preload files
pnpm package:win # Windows installer + zip → release/
-pnpm package:linux # Ubuntu x64 .deb + AppImage → release/
+pnpm package:linux # Linux x64 .deb + .rpm + AppImage → release/
```
### Triggers: schedules and webhooks
diff --git a/apps/docs/content/docs/getting-started/installation.mdx b/apps/docs/content/docs/getting-started/installation.mdx
index 88657f8d44..80565ea3d2 100644
--- a/apps/docs/content/docs/getting-started/installation.mdx
+++ b/apps/docs/content/docs/getting-started/installation.mdx
@@ -14,6 +14,7 @@ Choose your computer below. Each link always downloads the latest published buil
| macOS Intel | [Download `.dmg`](https://github.com/milind-soni/OpenMausBot/releases/latest/download/OpenMausBot-intel.dmg) | Signed and notarized. |
| Windows x64 | [Download installer](https://github.com/milind-soni/OpenMausBot/releases/latest/download/OpenMausBot-setup.exe) | Per-user installer; Windows signing is not yet available. |
| Ubuntu 24.04 x64 | [Download `.deb`](https://github.com/milind-soni/OpenMausBot/releases/latest/download/OpenMausBot-amd64.deb) · [AppImage](https://github.com/milind-soni/OpenMausBot/releases/latest/download/OpenMausBot.AppImage) | The `.deb` is recommended; the AppImage is portable. |
+| Fedora x64 | [Download `.rpm`](https://github.com/milind-soni/OpenMausBot/releases/latest/download/OpenMausBot-x86_64.rpm) | Community-supported; install with `sudo dnf install ./OpenMausBot-x86_64.rpm`. |
<Callout type="warn" title="Windows SmartScreen">
The Windows installer is not code-signed yet. Windows may show “Unknown publisher.” Verify that you downloaded it from the official OpenMausBot releases repository before choosing **More info → Run anyway**.
diff --git a/build/linux-after-remove.sh b/build/linux-after-remove.sh
index 1941db4b86..041e85b373 100644
--- a/build/linux-after-remove.sh
+++ b/build/linux-after-remove.sh
@@ -3,9 +3,12 @@ set -eu
# dpkg runs the old postrm during an upgrade too. Keep the installed profile
# until the package is actually removed or purged. pacman's post_remove runs
-# only on removal and passes the old version instead of an action word.
+# only on removal and passes the old version instead of an action word. rpm's
+# %postun passes how many copies stay installed: 0 on erase, 1 or more after
+# an upgrade, where it runs after the new package's install hook.
case "${1:-}" in
- remove|purge|[0-9]*) ;;
+ remove|purge|0) ;;
+ [0-9]*[!0-9]*) ;;
*) exit 0 ;;
esac
@@ -30,7 +33,9 @@ fi
# Preserve electron-builder's cleanup of the exact legacy launcher. Never
# remove an unrelated file that now happens to use the same command name.
-if [ "$TEST_MODE" -eq 0 ]; then
+# The rpm (erase passes 0) never shipped that launcher, and Fedora's
+# update-alternatives fails on a link group that does not exist.
+if [ "$TEST_MODE" -eq 0 ] && [ "${1:-}" != 0 ]; then
if command -v update-alternatives >/dev/null 2>&1; then
update-alternatives --remove openmausbot /opt/OpenMausBot/openmausbot
elif [ -L /usr/bin/openmausbot ] && [ "$(readlink /usr/bin/openmausbot)" = /opt/OpenMausBot/openmausbot ]; then
diff --git a/docs/linux-desktop.md b/docs/linux-desktop.md
index a4c05c2c52..86259155ad 100644
--- a/docs/linux-desktop.md
+++ b/docs/linux-desktop.md
@@ -34,6 +34,7 @@ Choose one Ubuntu 24.04 x86_64 package from the latest release:
- [Debian package (`OpenMausBot-amd64.deb`)](https://github.com/milind-soni/OpenMausBot/releases/latest/download/OpenMausBot-amd64.deb) — recommended; APT installs its desktop dependencies and configures the bundled bot browser's sandbox.
- [Portable AppImage (`OpenMausBot.AppImage`)](https://github.com/milind-soni/OpenMausBot/releases/latest/download/OpenMausBot.AppImage) — does not install system files.
+- [RPM package (`OpenMausBot-x86_64.rpm`)](https://github.com/milind-soni/OpenMausBot/releases/latest/download/OpenMausBot-x86_64.rpm) — for Fedora; see [below](#fedora-and-other-rpm-distributions).
- [SHA-256 checksums](https://github.com/milind-soni/OpenMausBot/releases/latest/download/SHA256SUMS-ubuntu-x64.txt)
Versioned packages and previous releases remain available on the
@@ -58,6 +59,7 @@ pnpm package:linux
The build creates:
- `release/OpenMausBot-<version>-amd64.deb`
+- `release/OpenMausBot-<version>-x86_64.rpm`
- `release/OpenMausBot-<version>-x86_64.AppImage`
The AppImage uses a static runtime and does not require the legacy `libfuse2` package.
@@ -85,6 +87,19 @@ chmod +x release/OpenMausBot-*-x86_64.AppImage
For a downloaded release AppImage, use `OpenMausBot.AppImage` in place of the versioned path above.
+### Fedora and other RPM distributions
+
+The `.rpm` is community-supported: every release builds and checks it, but it is not tested on Fedora the way the
+`.deb` is on Ubuntu. Install it with the package manager so its desktop dependencies are resolved:
+
+```sh
+sudo dnf install ./OpenMausBot-x86_64.rpm
+```
+
+Remove it with `sudo dnf remove openmausbot`. Updates are downloaded by the app, which then copies the `rpm` install
+command and opens a terminal for you to run it. Other RPM distributions (RHEL, openSUSE) and image-based Fedora
+editions such as Silverblue are untested; use the AppImage there.
+
### Arch Linux and EndeavourOS
Arch-based distributions are not an official target. The release AppImage runs there, or you can build a native
diff --git a/electron-builder.yml b/electron-builder.yml
index f7c93fe1a2..adb440f072 100644
--- a/electron-builder.yml
+++ b/electron-builder.yml
@@ -209,6 +209,8 @@ linux:
arch: x64
- target: deb
arch: x64
+ - target: rpm
+ arch: x64
# Keep the vector source in the freedesktop scalable icon hierarchy. A
# lone 1024px PNG is not indexed by GNOME's hicolor theme on Ubuntu 24.04.
icon: build/icon.svg
@@ -249,6 +251,15 @@ deb:
afterInstall: build/linux-after-install.sh
afterRemove: build/linux-after-remove.sh
+# Fedora (other RPM distributions are untested). The same hooks as the DEB
+# secure the package directories and the Chromium sandbox; the browser policy
+# step only acts on hosts that have AppArmor, so no apparmor dependency here.
+rpm:
+ # Own the install folder as well, so removing the package leaves no empty directories.
+ fpm: ["--directories", "/opt/OpenMausBot"]
+ afterInstall: build/linux-after-install.sh
+ afterRemove: build/linux-after-remove.sh
+
pacman:
packageCategory: utils
fpm: ["--depends", "fuse3", "--depends", "gtk3", "--depends", "nss", "--depends", "alsa-lib", "--depends", "libcups", "--depends", "mesa"]
diff --git a/scripts/linux-after-install.test.mjs b/scripts/linux-after-install.test.mjs
index 692573b3eb..193cb72564 100644
--- a/scripts/linux-after-install.test.mjs
+++ b/scripts/linux-after-install.test.mjs
@@ -320,6 +320,22 @@ describe.skipIf(process.platform !== "linux")("Linux DEB upgrade hook", () => {
expect(fs.existsSync(profile)).toBe(false);
});
+ it("keeps the profile through an rpm upgrade and removes it when rpm erases the package", () => {
+ const { appRoot, apparmorDir } = fixture();
+ expect(runHook(appRoot).status).toBe(0);
+ const profile = path.join(apparmorDir, "openmausbot-browser");
+ for (const remaining of ["1", "2", "100"]) {
+ const upgraded = runRemoveHook(appRoot, remaining);
+ expect(upgraded.status, upgraded.stderr).toBe(0);
+ expect(upgraded.stdout).not.toContain("profile operation");
+ expect(fs.existsSync(profile)).toBe(true);
+ }
+ const erased = runRemoveHook(appRoot, "0");
+ expect(erased.status, erased.stderr).toBe(0);
+ expect(erased.stdout).toContain(`profile operation: -R ${profile}`);
+ expect(fs.existsSync(profile)).toBe(false);
+ });
+
it("removes an already unloaded profile without asking the kernel again", () => {
const { appRoot, apparmorDir, systemRoot } = fixture();
expect(runHook(appRoot).status).toBe(0);
diff --git a/scripts/verify-linux-package.mjs b/scripts/verify-linux-package.mjs
index b5dfcaa004..26e181b1be 100644
--- a/scripts/verify-linux-package.mjs
+++ b/scripts/verify-linux-package.mjs
@@ -2,9 +2,12 @@ import { execFileSync } from "node:child_process";
import { createHash } from "node:crypto";
import {
accessSync,
+ closeSync,
constants,
lstatSync,
+ mkdirSync,
mkdtempSync,
+ openSync,
readdirSync,
readFileSync,
realpathSync,
@@ -397,6 +400,7 @@ function verifyCloudflaredResources(resources, label, { directoryMode = 0o755 }
const appImage = exactlyOne(".AppImage");
const deb = exactlyOne(".deb");
+const rpm = exactlyOne(".rpm");
const unpacked = path.join(releaseDir, "linux-unpacked");
const executable = path.join(unpacked, "openmausbot");
const resources = path.join(unpacked, "resources");
@@ -431,23 +435,22 @@ for (const expected of [
if (!fields.includes(expected)) fail(`DEB metadata is missing ${JSON.stringify(expected)}`);
}
-const extracted = mkdtempSync(path.join(tmpdir(), "omb-deb-verify-"));
-try {
- execFileSync("dpkg-deb", ["--extract", deb, extracted]);
- const debAppRoot = path.join(extracted, "opt", "OpenMausBot");
- requireDirectoryMode(debAppRoot, 0o755);
- const debResources = path.join(debAppRoot, "resources");
+// The DEB and RPM install the same tree under /opt; check what each extracted.
+function verifySystemPackage(extracted, label, packageType) {
+ const appRoot = path.join(extracted, "opt", "OpenMausBot");
+ requireDirectoryMode(appRoot, 0o755);
+ const packageResources = path.join(appRoot, "resources");
// Routes the in-app updater to the package-manager hand-off.
- requirePackageType(debResources, "DEB", "deb");
- requireUpdaterTarget(debResources, "DEB");
- const debHashes = verifyCuaResources(debResources, "DEB");
- const debCloudflaredHash = verifyCloudflaredResources(debResources, "DEB");
- if (debCloudflaredHash !== unpackedCloudflaredHash) {
- fail(`DEB and linux-unpacked cloudflared hashes differ`);
+ requirePackageType(packageResources, label, packageType);
+ requireUpdaterTarget(packageResources, label);
+ const packageHashes = verifyCuaResources(packageResources, label);
+ const packageCloudflaredHash = verifyCloudflaredResources(packageResources, label);
+ if (packageCloudflaredHash !== unpackedCloudflaredHash) {
+ fail(`${label} and linux-unpacked cloudflared hashes differ`);
}
for (const [unpackedFile, expected] of unpackedCuaHashes) {
- const packaged = path.join(debResources, "cua-linux-x64", path.basename(unpackedFile));
- if (debHashes.get(packaged) !== expected) fail(`DEB and linux-unpacked CUA hashes differ`);
+ const packaged = path.join(packageResources, "cua-linux-x64", path.basename(unpackedFile));
+ if (packageHashes.get(packaged) !== expected) fail(`${label} and linux-unpacked CUA hashes differ`);
}
const desktopFile = path.join(
extracted,
@@ -476,13 +479,67 @@ try {
"StartupWMClass=com.openmausbot.app",
"Categories=Utility;",
]) {
- if (!desktop.includes(expected)) fail(`desktop entry is missing ${JSON.stringify(expected)}`);
+ if (!desktop.includes(expected)) fail(`${label} desktop entry is missing ${JSON.stringify(expected)}`);
}
execFileSync("desktop-file-validate", [desktopFile], { stdio: "inherit" });
+}
+
+const extracted = mkdtempSync(path.join(tmpdir(), "omb-deb-verify-"));
+try {
+ execFileSync("dpkg-deb", ["--extract", deb, extracted]);
+ verifySystemPackage(extracted, "DEB", "deb");
} finally {
rmSync(extracted, { recursive: true, force: true });
}
+const rpmFields = execFileSync(
+ "rpm",
+ ["-qp", "--queryformat", "Name: %{NAME}\nArch: %{ARCH}\nVersion: %{VERSION}\n", rpm],
+ { encoding: "utf8" },
+);
+for (const expected of [
+ "Name: openmausbot",
+ "Arch: x86_64",
+ `Version: ${JSON.parse(readFileSync(path.join(root, "package.json"), "utf8")).version}`,
+]) {
+ if (!rpmFields.includes(expected)) fail(`RPM metadata is missing ${JSON.stringify(expected)}`);
+}
+// rpm runs these as %post and %postun; without them the Chromium sandbox
+// stays unprivileged and an upgrade would drop the browser policy.
+const rpmScripts = new Map(
+ execFileSync("rpm", ["-qp", "--scripts", rpm], { encoding: "utf8" })
+ .split(/^(?=\w+ scriptlet)/m)
+ .map((section) => [section.slice(0, section.indexOf(" ")), section]),
+);
+for (const [scriptlet, line] of [
+ ["postinstall", "repair_chromium_sandbox \"$APP_ROOT/chrome-sandbox\""],
+ ["postuninstall", "profile=$APPARMOR_DIR/openmausbot-browser"],
+]) {
+ if (!rpmScripts.get(scriptlet)?.includes(line)) {
+ fail(`RPM ${scriptlet} scriptlet does not run the Linux package hook`);
+ }
+}
+
+const rpmExtracted = mkdtempSync(path.join(tmpdir(), "omb-rpm-verify-"));
+try {
+ const archive = path.join(rpmExtracted, "payload.cpio");
+ const archiveFd = openSync(archive, "w");
+ try {
+ execFileSync("rpm2cpio", [rpm], { stdio: ["ignore", archiveFd, "inherit"] });
+ } finally {
+ closeSync(archiveFd);
+ }
+ const payload = path.join(rpmExtracted, "payload");
+ mkdirSync(payload);
+ execFileSync("cpio", ["-idm", "--quiet", "--no-absolute-filenames", "-F", archive], {
+ cwd: payload,
+ stdio: ["ignore", "ignore", "inherit"],
+ });
+ verifySystemPackage(payload, "RPM", "rpm");
+} finally {
+ rmSync(rpmExtracted, { recursive: true, force: true });
+}
+
const appImageExtracted = mkdtempSync(path.join(tmpdir(), "omb-appimage-verify-"));
try {
const offset = execFileSync(appImage, ["--appimage-offset"], {
@@ -530,4 +587,6 @@ try {
rmSync(appImageExtracted, { recursive: true, force: true });
}
-console.log(`[verify-linux-package] OK\n- ${path.basename(appImage)}\n- ${path.basename(deb)}`);
+console.log(
+ `[verify-linux-package] OK\n- ${path.basename(appImage)}\n- ${path.basename(deb)}\n- ${path.basename(rpm)}`,
+);