Initialize Git Repository: 'Gitea-Action-Runner'
All checks were successful
Gitea Action Runner (Bookworm) / Gitea Action Runner [arm64] (push) Successful in 26s
Gitea Action Runner (Bookworm) / Gitea Action Runner [amd64] (push) Successful in 28s
Gitea Action Runner (Noble) / Gitea Action Runner [arm64] (push) Successful in 24s
Gitea Action Runner (Noble) / Gitea Action Runner [amd64] (push) Successful in 24s
Gitea Action Runner (Trixie) / Gitea Action Runner [arm64] (push) Successful in 25s
Gitea Action Runner (Trixie) / Gitea Action Runner [amd64] (push) Successful in 27s

This commit is contained in:
Cantibra
2026-01-26 06:10:15 +01:00
commit dd94707aea
16 changed files with 1043 additions and 0 deletions

1
root/DEBIAN/conffiles Normal file
View File

@@ -0,0 +1 @@
/etc/act_runner/act_runner.yaml

9
root/DEBIAN/control Normal file
View File

@@ -0,0 +1,9 @@
Package: act-runner
Version: 0.2.13
Architecture:
Installed-Size:
Priority: optional
Section: misc
Homepage: http://www.privlab.it
Maintainer: PrivLab <repository@privlab.it>
Description: Gitea Action Runner

33
root/DEBIAN/postinst Normal file
View File

@@ -0,0 +1,33 @@
#!/usr/bin/sh
set -e
set -u
if [ -d '/run/systemd/system' ]; then
/usr/bin/systemctl --system daemon-reload > '/dev/null' 2>&1 || \
/usr/bin/true
fi
case "${1}" in
configure)
if [ -x '/usr/bin/deb-systemd-helper' ]; then
/usr/bin/deb-systemd-helper unmask 'act_runner.service' > '/dev/null' 2>&1 || \
/usr/bin/true
fi
if /usr/bin/deb-systemd-helper --quiet was-enabled 'act_runner.service'; then
/usr/bin/deb-systemd-helper enable 'act_runner.service' > '/dev/null' 2>&1 || \
/usr/bin/true
else
/usr/bin/deb-systemd-helper update-state 'act_runner.service' > '/dev/null' 2>&1 || \
/usr/bin/true
fi
if [ -x '/etc/init.d/traefik-certs-dumper' ]; then
/usr/sbin/update-rc.d 'act_runner' defaults > '/dev/null' 2>&1 || \
/usr/bin/true
fi
/usr/bin/touch '/etc/act_runner/act_runner.env'
/usr/bin/chown --quiet --recursive 'git':'root' '/etc/act_runner'
/usr/bin/chown --quiet 'git':'git' '/var/cache/act_runner'
/usr/bin/chown --quiet 'git':'git' '/var/lib/act_runner'
;;
esac

32
root/DEBIAN/postrm Normal file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/sh
set -e
set -u
if [ -d '/run/systemd/system' ]; then
/usr/bin/systemctl --system daemon-reload > '/dev/null' || \
/usr/bin/true
fi
case "${1}" in
remove)
if [ -x '/usr/bin/deb-systemd-helper' ]; then
/usr/bin/deb-systemd-helper mask 'act_runner.service' > '/dev/null' 2>&1 || \
/usr/bin/true
fi
;;
purge)
if [ -x '/usr/bin/deb-systemd-helper' ]; then
/usr/bin/deb-systemd-helper purge 'act_runner.service' > '/dev/null' 2>&1 || \
/usr/bin/true
/usr/bin/deb-systemd-helper unmask 'act_runner.service' > '/dev/null' 2>&1 || \
/usr/bin/true
fi
if /usr/bin/getent passwd 'git' > '/dev/null'; then
/usr/sbin/deluser 'git' > '/dev/null' 2>&1
fi
if /usr/bin/getent group 'git' > '/dev/null'; then
/usr/sbin/deluser --group 'git' > '/dev/null' 2>&1
fi
;;
esac

39
root/DEBIAN/preinst Normal file
View File

@@ -0,0 +1,39 @@
#!/usr/bin/sh
set -e
set -u
case "${1}" in
install)
if ! /usr/bin/getent passwd 'git' > '/dev/null' 2>&1; then
/usr/sbin/adduser --quiet \
--system \
--home '/nonexistent' \
--shell '/usr/sbin/nologin' \
--no-create-home \
--group \
--disabled-password \
--disabled-login \
'git' > '/dev/null' 2>&1
/usr/bin/echo "########################################################################"
/usr/bin/echo "# #"
/usr/bin/echo "# ! Run this commands as User 'git' and add your Gitea-Credentials ! #"
/usr/bin/echo "# ! to activate the Gitea Action Runner ! #"
/usr/bin/echo "# #"
/usr/bin/echo "# /usr/bin/sudo --user='git' \ #"
/usr/bin/echo "# /usr/bin/act_runner register \ #"
/usr/bin/echo "# --config '/etc/act_runner/act_runner.yaml' \ #"
/usr/bin/echo "# --no-interactive \ #"
/usr/bin/echo "# --instance 'https://<URL>/' \ #"
/usr/bin/echo "# --labels '<LABEL>:<HOST>' \ #"
/usr/bin/echo "# --name '<NAME>' \ #"
/usr/bin/echo "# --token '<TOKEN>' #"
/usr/bin/echo "# #"
/usr/bin/echo "# /bin/chmod '0440' '/etc/act_runner/act_runner' #"
/usr/bin/echo "# #"
/usr/bin/echo "# /bin/chgrp 'root' '/etc/act_runner/act_runner' #"
/usr/bin/echo "# #"
/usr/bin/echo "########################################################################"
fi
;;
esac

21
root/DEBIAN/prerm Normal file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/sh
set -e
set -u
case "${1}" in
remove)
if [ -x '/usr/bin/deb-systemd-invoke' ]; then
/usr/bin/deb-systemd-invoke stop 'act_runner.service' > '/dev/null' 2>&1 || \
/usr/bin/true
/usr/bin/deb-systemd-invoke disable 'act_runner.service' > '/dev/null' 2>&1 || \
/usr/bin/true
fi
if [ -x '/etc/init.d/act_runner' ]; then
/usr/sbin/update-rc.d 'act_runner' remove > '/dev/null' 2>&1 || \
/usr/bin/true
fi
/usr/bin/rm --force --recursive '/var/cache/act_runner/'*
/usr/bin/rm --force --recursive '/var/lib/act_runner/'*
;;
esac

View File

@@ -0,0 +1,55 @@
log:
# The level of logging, can be trace, debug, info, warn, error, fatal
level: info
runner:
# Where to store the registration result.
file: "/etc/act_runner/act_runner"
# Execute how many tasks concurrently at the same time.
capacity: 1
# Extra environment variables to run jobs from a file.
# It will be ignored if it's empty or the file doesn't exist.
env_file: "/etc/act_runner/act_runner.env"
# The timeout for a job to be finished.
# Please note that the Gitea instance also has a timeout (3h by default) for the job.
# So the job could be stopped by the Gitea instance if it's timeout is shorter than this.
timeout: 3h
# The timeout for the runner to wait for running jobs to finish when shutting down.
# Any running jobs that haven't finished after this timeout will be cancelled.
shutdown_timeout: 180s
# Whether skip verifying the TLS certificate of the Gitea instance.
insecure: false
# The timeout for fetching the job from the Gitea instance.
fetch_timeout: 5s
# The interval for fetching the job from the Gitea instance.
fetch_interval: 2s
# The labels of a runner are used to determine which jobs the runner can run, and how to run them.
# Like: "macos-arm64:host" or "ubuntu-latest:docker://gitea/runner-images:ubuntu-latest"
# Find more images provided by Gitea at https://gitea.com/gitea/runner-images .
# If it's empty when registering, it will ask for inputting labels.
# If it's empty when execute `daemon`, will use labels in `.runner` file.
labels:
- "linux:host"
cache:
# Enable cache server to use actions/cache.
enabled: true
# The directory to store the cache data.
# If it's empty, the cache data will be stored in $HOME/.cache/actcache.
dir: "/var/cache/act_runner"
# The host of the cache server.
# It's not for the address to listen, but the address to connect from job containers.
# So 0.0.0.0 is a bad choice, leave it empty to detect automatically.
host: ""
# The port of the cache server.
# 0 means to use a random available port.
port: 0
# The external cache server URL. Valid only when enable is true.
# If it's specified, act_runner will use this URL as the ACTIONS_CACHE_URL rather than start a server by itself.
# The URL should generally end with "/".
external_server: ""
host:
# The parent directory of a job's working directory.
# If it's empty, $HOME/.cache/act/ will be used.
workdir_parent: "/var/lib/act_runner"

View File

@@ -0,0 +1,84 @@
#!/usr/bin/sh
### BEGIN INIT INFO
# Provides: act_runner
# Required-Start: $local_fs $network $remote_fs
# Required-Stop: $local_fs $network $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Gitea Action Runner
# Description: Traefik is an open-source reverse proxy and load balancer
# designed for microservices and containerized applications.
# It automatically discovers services and routes traffic
# based on defined rules. Traefik supports HTTP, HTTPS, and
# TCP protocols, offers automatic SSL certificate
# management, and provides a user-friendly dashboard for
# monitoring traffic and service health.
### END INIT INFO
NAME='act_runner'
DESC='Gitea Action Runner'
USER='git'
GROUP='git'
PIDFOLDER="/run/${NAME}"
PIDFILE="${PIDFOLDER}/${NAME}.pid"
DAEMON='/usr/sbin/act_runner'
DAEMON_OPTS="daemon --config '/etc/act_runner/act_runner.yaml'"
set -e
. '/lib/lsb/init-functions'
[ -x "${DAEMON}" ]
case "${1}" in
start)
/usr/bin/install --directory --group="${GROUP}" ---mode='0755' --owner="${USER}" "${PIDFOLDER}"
log_daemon_msg "Starting ${DESC}" "${NAME}"
if /usr/sbin/start-stop-daemon --quiet \
--start \
--oknodo \
--make-pidfile \
--pidfile "${PIDFILE}" \
--user "${USER}" \
--group "${GROUP}" \
--exec "${DAEMON}" -- "${DAEMON_OPTS}"; then
log_end_msg 0
else
log_end_msg 1
/usr/bin/test -f "${PIDFILE}" && \
/usr/bin/rm --force "${PIDFILE}"
fi
;;
stop)
log_daemon_msg "Stopping ${DESC}" "${NAME}"
if /usr/sbin/start-stop-daemon --quiet \
--stop \
--oknodo \
--retry 30 \
--remove-pidfile \
--pidfile "${PIDFILE}" \
--user "${USER}" \
--group "${GROUP}" \
--exec "${DAEMON}"; then
/usr/bin/test -f "${PIDFILE}" && \
/usr/bin/rm --force "${PIDFILE}"
log_end_msg 0
else
log_end_msg 1
fi
;;
restart)
"${0}" stop
"${0}" start
;;
status)
status_of_proc -p "${PIDFILE}" "${DAEMON}" "${NAME}" && \
exit 0 || \
exit "${?}"
;;
*)
echo "Usage: /etc/init.d/${NAME} {start|stop|restart|status}" >&2
exit 1
;;
esac

View File

@@ -0,0 +1,25 @@
[Unit]
Description=Gitea Action Runner
ConditionPathExists=/etc/act_runner/act_runner
ConditionPathExists=/etc/act_runner/act_runner.env
ConditionPathExists=/etc/act_runner/act_runner.yaml
StartLimitBurst=3
StartLimitIntervalSec=60
Documentation=https://gitea.com/gitea/act_runner
After=network.target network-online.target
Wants=network-online.target
[Service]
ExecStart=/usr/sbin/act_runner daemon --config /etc/act_runner/act_runner.yaml
ExecStartPost=/usr/bin/sh -c "umask '022'; /usr/bin/pgrep --newest 'act_runner' > '/run/act_runner/act_runner.pid'"
ExecStop=/usr/bin/rm --force '/run/act_runner/act_runner.pid'
Restart=on-failure
Group=git
User=git
ReadWriteDirectories=/var/cache/act_runner
RuntimeDirectory=act_runner
RuntimeDirectoryMode=755
WorkingDirectory=/var/lib/act_runner
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,2 @@
g git - -
u git - "git" /nonexistent /usr/sbin/nologin