v0.3.0-4: rootless Podman improvements
- Add btrfs storage.conf for gitea-runner user - Add gitea-runner-podman.service dependency to runner service - Auto-allocate subuid/subgid ranges via usermod (min 524288) - Add systemd-container dep for loginctl enable-linger - Use sysusers_create_package in %pre for proper user creation - Track /var/lib/gitea/runners dir in %files - Use runuser instead of sudo in setup script - Add After=systemd-logind.service to podman service - Fix SELinux volume label (:Z -> :z) in config.yaml
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
Name: gitea-act_runner
|
||||
Version: 0.3.0
|
||||
Release: 2%{?dist}
|
||||
Release: 4%{?dist}
|
||||
Summary: Gitea act runner service.
|
||||
License: MIT
|
||||
Group: System Environment/Base
|
||||
@@ -13,10 +13,11 @@ Source11: config.yaml
|
||||
Source12: gitea-act-runner-setup
|
||||
Source13: gitea-act-runner.sysusers
|
||||
Source14: gitea-runner-podman.service
|
||||
Source15: storage.conf
|
||||
|
||||
BuildRequires: systemd-rpm-macros
|
||||
Requires: shadow-utils
|
||||
Requires: podman
|
||||
Requires: systemd-container
|
||||
%{?systemd_requires}
|
||||
|
||||
ExclusiveArch: x86_64 aarch64
|
||||
@@ -48,21 +49,26 @@ install -m 755 %{SOURCE12} %{buildroot}%{_bindir}/gitea-act-runner-setup
|
||||
|
||||
install -d -m 750 %{buildroot}%{_sharedstatedir}/gitea/runners
|
||||
|
||||
# Podman storage config for gitea-runner user — uses native btrfs driver
|
||||
# instead of overlayfs for better performance on btrfs filesystems
|
||||
install -d -m 750 %{buildroot}%{_sharedstatedir}/gitea/runners/.config/containers
|
||||
install -m 644 %{SOURCE15} %{buildroot}%{_sharedstatedir}/gitea/runners/.config/containers/storage.conf
|
||||
|
||||
install -d -m 755 %{buildroot}/var/cache/act-runner/pnpm-store
|
||||
|
||||
%post
|
||||
%pre
|
||||
%sysusers_create_package gitea-act-runner %{SOURCE13}
|
||||
|
||||
%post
|
||||
if [ $1 -eq 1 ]; then
|
||||
loginctl enable-linger gitea-runner || :
|
||||
fi
|
||||
|
||||
if ! grep -q "gitea-runner" /etc/subuid; then
|
||||
LAST_ID=$(tail -n 1 /etc/subuid | cut -d: -f2)
|
||||
[ -z "$LAST_ID" ] && START_ID=100000 || START_ID=$((LAST_ID + 65536))
|
||||
|
||||
echo "gitea-runner:$START_ID:65536" >> /etc/subuid
|
||||
echo "gitea-runner:$START_ID:65536" >> /etc/subgid
|
||||
if ! grep -q "^gitea-runner:" /etc/subuid 2>/dev/null; then
|
||||
NEXT=$(awk -F: '{n=$2+$3} END{print n+0}' /etc/subuid 2>/dev/null)
|
||||
[ "$NEXT" -lt 524288 ] && NEXT=524288
|
||||
END=$((NEXT + 65535))
|
||||
usermod --add-subuids "$NEXT-$END" --add-subgids "$NEXT-$END" gitea-runner 2>/dev/null || :
|
||||
fi
|
||||
|
||||
%systemd_post gitea-act_runner@.service
|
||||
@@ -89,13 +95,24 @@ fi
|
||||
%{_sysusersdir}/gitea-act-runner.conf
|
||||
|
||||
%defattr(-,gitea-runner,gitea-runner,750)
|
||||
%dir %{_sharedstatedir}/gitea/runners
|
||||
%dir %{_sysconfdir}/gitea
|
||||
%dir %{_sysconfdir}/gitea/runners
|
||||
%config(noreplace) %{_sysconfdir}/gitea/runners/runner1.yaml
|
||||
|
||||
%dir %attr(0750,gitea-runner,gitea-runner) /var/cache/act-runner
|
||||
%dir %attr(0750,gitea-runner,gitea-runner) /var/cache/act-runner/pnpm-store
|
||||
%dir %{_sharedstatedir}/gitea/runners/.config
|
||||
%dir %{_sharedstatedir}/gitea/runners/.config/containers
|
||||
%config(noreplace) %{_sharedstatedir}/gitea/runners/.config/containers/storage.conf
|
||||
|
||||
%dir /var/cache/act-runner
|
||||
%dir /var/cache/act-runner/pnpm-store
|
||||
|
||||
%changelog
|
||||
* Mon Apr 06 2026 Zoran Pericic <zpericic@netst.org> - 0.3.0-4
|
||||
- Add Podman btrfs storage.conf for gitea-runner user
|
||||
- Add dependency on gitea-runner-podman.service
|
||||
- Use usermod --add-subuids for subuid/subgid allocation
|
||||
- Add systemd-container dependency for loginctl enable-linger
|
||||
|
||||
* Mon Mar 17 2025 Zoran Pericic <zpericic@netst.org> - 0.3.0-2
|
||||
- Add gitea-runner-podman.service for rootless Podman API socket
|
||||
|
||||
Reference in New Issue
Block a user