diff --git a/dev-util/gitea-runner/files/confd b/dev-util/gitea-runner/files/confd new file mode 100644 index 0000000..0d76d1a --- /dev/null +++ b/dev-util/gitea-runner/files/confd @@ -0,0 +1,10 @@ +GITEA_CONFIG="/var/actrunner/gitea-runner/config.yaml" + +GITEA_RUNNER_OPTS="" + +# To run an anonymous git safely, the following user should be able to only +# read your Git repositories. It should not be able to write to anywhere on +# your system, esp. not the repositories. +GITEA_RUNNER_USER="gitea-runner" +GITEA_RUNNER_GROUP="gitea-runner" + diff --git a/dev-util/gitea-runner/files/initd b/dev-util/gitea-runner/files/initd new file mode 100755 index 0000000..3f89d83 --- /dev/null +++ b/dev-util/gitea-runner/files/initd @@ -0,0 +1,20 @@ +#!/sbin/openrc-run +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +description="gitea-runner" + +# directory="/var/lib/gitea-runner" +pidfile="/run/gitea-runner.pid" +command="/usr/bin/gitea-runner" +command_args="daemon -c ${GITEA_CONFIG:-/etc/gitea-runner/config.yaml} ${GITEA_RUNNER_OPTS}" +command_user="${GITEA_RUNNER_USER:-nobody}:${GITEA_RUNNER_GROUP:-nobody}" +#start_stop_daemon_args="-e HOME= -e XDG_CONFIG_HOME=" +command_background="yes" +output_log="/var/log/gitea-runner.log" +error_log="/var/log/gitea-runner.err" + +depend() { + use docker network +} + diff --git a/dev-util/gitea-runner/gitea-runner-3.5.0.ebuild b/dev-util/gitea-runner/gitea-runner-3.5.0.ebuild index d061c62..8a281bf 100644 --- a/dev-util/gitea-runner/gitea-runner-3.5.0.ebuild +++ b/dev-util/gitea-runner/gitea-runner-3.5.0.ebuild @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=8 -inherit go-module +inherit go-module systemd DESCRIPTION="Official runner for Gitea" HOMEPAGE="https://gitea.com/gitea/runner" @@ -27,7 +27,24 @@ src_compile() { ego build } +src_prepare() { + sed -i -e 's#/usr/local/bin#/usr/bin#g' examples/systemd/${PN}.service || die "Adjusting systemd.service failed!" + eapply_user +} + src_install() { newbin runner gitea-runner dosym -r /usr/bin/gitea-runner /usr/bin/runner + newinitd ${FILESDIR}/initd ${PN} + newconfd ${FILESDIR}/confd ${PN} + systemd_dounit examples/systemd/${PN}.service + + dodoc docs/* + dodoc README.md + newdoc examples/systemd/README.md systemd.md + newdoc examples/docker/README.md docker.md + newdoc examples/docker-compose/README.md docker-compose.md + + insinto /etc/${PN} + doins internal/pkg/config/config.example.yaml }