Commit Graph
20 Commits
Author SHA1 Message Date
Damien 3e4ede907e openbao,gitea-runner: fail loudly if lib/common.sh sourcing fails
source <(curl ...) swallows curl failures (404, network error): an empty
stream still makes `source` return 0, so the failure would otherwise only
surface later as a confusing "command not found" for one of lib/common.sh's
functions. Check that a known function landed after the source, and exit 1
with the attempted URL if not.
2026-07-30 13:34:05 +02:00
Damien fef37d2676 gitea-runner: make SCRIPT_URL overridable, matching openbao
Was a fixed value, unlike openbao's SCRIPT_URL="${SCRIPT_URL:-...}". Two
consequences: exec_in_lxc forwarded SCRIPT_URL into the container where it
was immediately overwritten by the hardcoded value, making the forward a
no-op; and the lib/common.sh sourcing fallback derives its fetch URL from
SCRIPT_URL, so it always pointed at main (where lib/common.sh doesn't exist
yet), making this branch untestable end-to-end for gitea-runner.
2026-07-30 13:33:35 +02:00
Damien 82540472ae gitea-runner: fix log_info/warn/error writing to stdout, corrupting TEMPLATE
log_info() etc. wrote to stdout, unlike openbao's identical functions
which write to stderr specifically so $(fn) capture is safe. lib/common.sh's
detect_latest_alpine_template() does `log_info "Selected..."; echo "$tmpl"` —
in gitea-runner, TEMPLATE=$(detect_latest_alpine_template) therefore captured
the log line and ANSI codes along with the template name, breaking both the
pveam list lookup and pct create's template argument.
2026-07-30 13:33:20 +02:00
Damien 294960f44d gitea-runner: detect existing LXC on re-run, refresh OS on update
Ports openbao's host-side update path to gitea-runner: main() now uses
find_existing_lxc (hostname/tag match) to switch into a new update_lxc()
instead of always recreating the container, with an explicit --update
dispatch case reaching update_runner() (previously inferred only from
/usr/local/bin/act_runner presence). require_root is ported from openbao
for the host-side pct branch.

Extracted a small exec_in_lxc() helper (option a from the two offered)
rather than duplicating the curl-pipe invocation, since main() now needs
to drive both the create and update paths through the same piping logic
with only the trailing --install/--update flag differing — matching
openbao's own exec_in_lxc for consistency.

update_runner() now calls refresh_os_packages before touching the binary,
mirroring openbao's update_inside_lxc(). Also switched create_lxc's LXC
tag from the hardcoded "cicd" to the LXC_TAG variable (added in the prior
commit but unused until now) so find_existing_lxc's tag match actually
works.

Documented the OS-refresh-on-update behavior in both READMEs.

Closes #15
2026-07-30 11:28:14 +02:00
Damien 51f2474db6 openbao,gitea-runner: source lib/common.sh, fix hardcoded Alpine template
Both install scripts now source lib/common.sh instead of duplicating
detect_latest_alpine_template(), find_existing_lxc(), and the tty1
autologin block. Since these scripts are distributed via curl one-liner
and piped into `pct exec` inside the LXC, there is no local checkout to
source from in those contexts — lib/common.sh is sourced from disk when
a local checkout is available (BASH_SOURCE resolves to a real path),
otherwise fetched over HTTP next to SCRIPT_URL. Both scripts already
require outbound network to curl themselves and to download their
respective binaries, so this adds no new failure mode.

openbao/install.sh is a behavioral no-op: same log output, same control
flow. One inline apk update/upgrade is intentionally left as-is in
update_lxc() — refresh_os_packages() is a bash function in this
process and can't run over `pct exec ... sh -c` without shipping the
function definition into the container.

gitea-runner/install.sh fixes the actual bug: TEMPLATE was hardcoded to
a specific dated Alpine release, so create_lxc() would keep trying to
provision a stale/absent template. TEMPLATE now defaults to empty and
create_lxc() calls detect_latest_alpine_template() when unset, mirroring
openbao. Also renamed HOSTNAME -> HOSTNAME_LXC and added LXC_TAG to
match openbao's naming, since a follow-up (issue #15) will wire up
find_existing_lxc()-based update detection here.

Closes #12, Closes #14
2026-07-30 11:23:03 +02:00
Damien 145c0018bf gitea-runner: paramétrer le hostname Gitea via GITEA_HOSTNAME
Remplace le hostname Tailscale hardcodé par la variable GITEA_HOSTNAME
(défaut: gitea.taila5ad8.ts.net), cohérent avec GITEA_API et VERSION_FILE.

Le heredoc étant single-quoted (<<'EOF'), la valeur est injectée à
l'écriture du service via sed, évitant tout conflit avec les variables
OpenRC runtime ($PATH, ${RC_SVCNAME}, etc.).
2026-06-20 10:53:23 +02:00
Damien 9d9ffd6449 gitea-runner: wait for Tailscale MagicDNS before starting act_runner
OpenRC's `tailscale [started]` dependency only guarantees the tailscaled
process is up, not that MagicDNS is operational. At boot this creates a
race condition where act_runner starts before gitea.taila5ad8.ts.net is
resolvable, causing the runner to fail to connect to Gitea.

Add an active DNS poll in start_pre() using getent, with a 30-second
timeout and an explicit eerror on expiry. depend() is unchanged.
2026-06-20 10:44:13 +02:00
Damien 5b8a837a11 Remove duplicate local variable declaration 2026-06-14 14:11:53 +02:00
Damien 3a7abbc1a0 chore(gitea-runner): fix tty1 autologin on Alpine LXC
Port the working autologin block from openbao/install.sh so both Proxmox
installers behave identically. The previous version assumed agetty was
already installed and relied on a sed pattern that no-ops on fresh Alpine
images; it also never told PID 1 to re-read /etc/inittab, so the change
required a reboot.

- Install agetty (with util-linux fallback) via apk.
- Drop any existing tty1 line and append the autologin line (robust
  against inittab layout drift across Alpine releases).
- SIGHUP PID 1 and kill any stale getty so init respawns the new line
  immediately — no reboot needed, no first-login "type exit once" wart.
2026-05-27 11:01:41 +02:00
Damien f9c79ded96 Update Gitea runner download URL to use gitea-runner 2026-05-12 09:02:38 +02:00
Damien defe8c7ade feat(gitea-runner): add Prometheus metrics, logrotate and LXC tags 2026-05-11 20:08:02 +02:00
Damien a6652e37eb chore: add agent prompt for gitea-runner metrics + logrotate 2026-05-11 17:50:06 +00:00
Damien bd38cb4f82 Install and configure Tailscale during runner setup
- Add Tailscale installation and service start in install.sh
- Update service dependencies to include tailscale
- Add instructions to connect via Tailscale after installation
2026-05-04 15:05:05 +02:00
Damien 2bbbb5f04d Configure LXC for Docker and Tailscale
Add unconfined AppArmor profile to allow Docker and required TUN/TAP
device access for Tailscale in LXC container.
2026-05-04 14:56:11 +02:00
Damien 526063b31b Enable console auto-login for root
This sets up automatic login on the console by modifying the agetty
options in /etc/conf.d/agetty and updating the inittab configuration
accordingly.
2026-05-04 14:51:03 +02:00
Damien b36e729e08 Enable TUN/TAP device for Tailscale in LXC container
Add necessary LXC configuration entries to allow TUN/TAP device access
2026-05-04 14:39:07 +02:00
Damien 49d6920f44 Use ip command to get container IP and suppress Docker service output
The script now uses the ip command instead of hostname -i to reliably
obtain the container's IPv4 address. Service command output is also
redirected to /dev/null to reduce noise in the logs.
2026-05-04 14:25:59 +02:00
Damien ebc5547838 Add gitea-runner installation script and update READMEs
- Added new gitea-runner/install.sh script for deploying a Gitea Act
  Runner on Alpine LXC in Proxmox
- Updated main README with new script entry and adjusted formatting
- Added multi-OS support note to requirements
- Improved formatting in code examples with proper command separation
- Translated and enhanced gitea-runner/README.md with consistent
  terminology
2026-05-04 14:14:57 +02:00
Damien b6b9278c50 docs: add gitea runner README 2026-05-04 12:00:46 +00:00
Damien 7e6ae2613b feat: add gitea act runner install/update script 2026-05-04 12:00:30 +00:00