Files
firezone/scripts/tests/linux-group.sh
Thomas Eizinger 042d03af2a feat(gui-client): polish Linux bundling (#9181)
Tauri's `deb` and `rpm` bundler have support for configuring maintainer
scripts. We can therefore just use those instead of tearing apart the
`deb` file that it creates and rebuilding it ourselves.

Our `rpm` packaging is currently completely broken as well. I couldn't
get it to work on CentOS 9 at all due to missing dependencies, likely
introduced by our move to Tauri v2. It installs fine on CentOS 10
though, assuming that the user has the EPEL repository installed which
provides the WebView dependency. I extended the docs to reflect this.

Hence, with this PR, we drop support for CentOS 9 and now require CentOS
10. This allows us to remove a lot of cruft from our bundling process
and instead entirely rely on the Tauri provided bundler.

Lastly, for consistency with other platforms, the name of the
application in places like app drawers has been changed from "Firezone
Client" to just "Firezone".

---------

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
2025-05-20 15:34:16 +00:00

45 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# The integration tests call this to test security for Linux IPC.
# Only users in the `firezone` group should be able to control the privileged tunnel process.
source "./scripts/tests/lib.sh"
BINARY_NAME=firezone-client-tunnel
FZ_GROUP="firezone-client"
SERVICE_NAME=firezone-client-tunnel
SOCKET=/run/dev.firezone.client/tunnel.sock
export RUST_LOG=info
cd rust || exit 1
cargo build --bin "$BINARY_NAME"
cd ..
function debug_exit() {
systemctl status "$SERVICE_NAME"
exit 1
}
# Copy the Linux Client out of the build dir
sudo cp "rust/target/debug/$BINARY_NAME" "/usr/bin/$BINARY_NAME"
# Set up the systemd service
sudo cp "rust/gui-client/src-tauri/linux_package/$SERVICE_NAME.service" /usr/lib/systemd/system/
sudo cp "scripts/tests/systemd/env" "/etc/default/firezone-client-tunnel"
# The firezone group must exist before the daemon starts
sudo groupadd "$FZ_GROUP"
sudo systemctl start "$SERVICE_NAME" || debug_exit
# Make sure the socket has the right permissions
if [ "root $FZ_GROUP" != "$(stat -c '%U %G' $SOCKET)" ]
then
exit 1
fi
# Stop the service in case other tests run on the same VM
sudo systemctl stop "$SERVICE_NAME"
# Explicitly exiting is needed when we're intentionally having commands fail
exit 0