Commit Graph
55 Commits
Author SHA1 Message Date
Damien e5d59473d2 chore: réduire le dépôt à netlab + komodo
Migration Gitea → GitHub et bascule de l'infra sur Komodo (suppression
de Proxmox) : proxy/, openbao/ et gitea-runner/ n'ont plus lieu d'être,
et lib/common.sh n'était sourcé que par ces deux derniers.

Réf: #30
2026-08-01 20:26:54 +02:00
Damien 9927e4dec1 Add shellcheck ignore for dynamic source 2026-07-30 14:31:27 +02:00
Damien d86848eb71 openbao,gitea-runner: use shared ensure_template_present, gitea-runner parity fixes
openbao: removed its now-duplicate ensure_template_present() definition,
using the one factored into lib/common.sh (call site unchanged).

gitea-runner: replaced its ad-hoc template-download check (which skipped
`pveam update`, risking a stale cached template list now that the template
is auto-detected) with a call to the shared ensure_template_present().
Also added ca-certificates to exec_in_lxc's apk add, matching openbao, and
added require_root() to the inside-LXC dispatch path in main(), which
openbao already does but gitea-runner was missing.
2026-07-30 14:05:50 +02:00
Damien 936ab2c2fb lib/common.sh: fix refresh_os_packages contract, drop set -e, add ensure_template_present
- refresh_os_packages()'s header claimed it was callable both host-side (via
  pct exec) and inside the LXC; it's a plain bash function in this process,
  it cannot cross a pct exec boundary. Corrected to match the comment
  already present at its one host-side non-call-site in openbao/install.sh.
- Removed `set -euo pipefail`: a sourced file must not impose shell options
  on the caller. Both install scripts already set these before sourcing.
- Added ensure_template_present(), ported from openbao/install.sh, so
  gitea-runner can reuse it (issue #12 follow-up) instead of duplicating a
  template-download check that skipped `pveam update` and could silently
  settle for a stale cached template list.
2026-07-30 14:05:43 +02:00
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 d0138b742d lib/common.sh: template detection + autologin + update helpers 2026-07-30 11:14:20 +02:00
Damien e545a27e9a scaffold: lib/common.sh helper skeleton (refs #12 #14 #15) 2026-07-30 11:09:51 +02:00
Damien b5ff76232e Remove ferretdb (Debian LXC, no Alpine build for DocumentDB extension)
FerretDB required Debian (DocumentDB is Debian/RHEL-only, no musl build),
making it an outlier among the Alpine-based LXC creator scripts in this
repo. Dropping it leaves openbao and gitea-runner as the only LXC creator
scripts, both Alpine, which simplifies template/OS handling (see #12).

Closes #13
2026-07-30 11:09:05 +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 c8de4bdce5 Remove KOMODO_HOST fallback from MOTD script
The script now derives KOMODO_HOST from Tailscale when compose.env
is inaccessible to non-root users
2026-06-14 15:33:22 +02:00
Damien 8d8b821ae4 Reject insecure default values in compose.env
Add helper function to detect upstream Komodo example placeholders
and regenerate secrets instead of preserving them verbatim
2026-06-14 15:30:27 +02:00
Damien e7e538d75c Remove console auto-login feature 2026-06-14 14:27:49 +02:00
Damien 5b8a837a11 Remove duplicate local variable declaration 2026-06-14 14:11:53 +02:00
Damien 7eee3b85b1 Add Komodo installation script and docs
Add Komodo (Docker + MongoDB) installation script for Alpine VM
Update README with Komodo requirements and installation command
2026-06-14 14:09:38 +02:00
Damien 1caf3737fd Remove unused timezone configuration
Use advertise-routes instead of advertise-exit-node for Tailscale
Update UFW rule to quote port variable
2026-05-30 15:57:56 +02:00
Damien 671dd91530 refactor(ferretdb): keep the install agnostic, drop LibreChat-specific wiring
The script installs and exposes the database only; it now prints a generic
MongoDB connection string (mongodb://user:pass@ip:27017/) instead of a
LibreChat MONGO_URI with a hardcoded /LibreChat database. README 'Wiring
LibreChat' section replaced with a generic 'Connecting a client' section.
Application wiring is left to that app's own config or a separate script.
2026-05-29 11:49:56 +02:00
Damien d10efadaba fix(ferretdb): create the Mongo user via DocumentDB to fix SCRAM salt length
A plain CREATE ROLE ... PASSWORD stores PostgreSQL's native 16-byte SCRAM salt.
DocumentDB has no check_password_hook, so that salt is served verbatim to Mongo
clients, which reject it at SASL step2 with 'invalid salt length of 16'.

Provision the user through documentdb_api.create_user / update_user instead:
DocumentDB builds the SCRAM-SHA-256 verifier with documentdb.scramDefaultSaltLen
(28 bytes) via its own scram_build_secret. create_user only accepts a read-only
role or the clusterAdmin + readWriteAnyDatabase pair, so use the latter for R/W.

- CREATE EXTENSION documentdb now runs before user provisioning so the API
  functions exist.
- Spec built with jq (password JSON-escaped) and passed in a $DDB$ dollar-quoted
  SQL literal; idempotent via update_user when the role already exists.
- Set password_encryption = 'scram-sha-256' explicitly in postgresql.conf.
2026-05-29 11:18:28 +02:00
Damien f13af26a62 fix(ferretdb): force C.UTF-8 locale to silence apt/perl locale warnings
A fresh Debian template has not generated the Proxmox host locale that pct exec
forwards (e.g. fr_FR.UTF-8), so apt, perl and apt-listchanges warn on every run.
Export LC_ALL=C.UTF-8 / LANG=C.UTF-8 globally and forward them through pct exec
(base tooling, the piped installer, and the host-side upgrade).
2026-05-29 11:01:07 +02:00
Damien 5caf885d83 fix(ferretdb): pin template to debian-12 and fail fast on bad SCRIPT_URL
- detect_latest_debian_template now selects the newest debian-12 template only.
  Auto-detecting the newest Debian overall picked debian-13, which would pair the
  deb12-only DocumentDB extension with a mismatched libicu. Trixie now requires
  setting TEMPLATE + DOCUMENTDB_DISTRO explicitly.
- Add preflight_script_url: verify SCRIPT_URL is reachable on the host before
  creating the LXC, so a branch/path that 404s fails immediately with guidance
  instead of dying mid-install after the container is built.
2026-05-29 10:56:51 +02:00
Damien e120d179e3 Update README with FerretDB installation script and requirements
Add FerretDB script to available scripts table
Update requirements to include FerretDB
2026-05-29 09:26:15 +02:00
Damien 805ae73f7e docs(readme): list openbao in the root README
OpenBao has a working installer and its own README, but the root README
never linked it. Add a row to Available Scripts (grouped with the other
Proxmox installer, gitea-runner) and extend the Proxmox VE Requirements
line so both LXC scripts are mentioned consistently.
2026-05-27 11:02:31 +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 1df3da81d7 Remove seedbox infrastructure 2026-05-26 18:57:07 +02:00
Damien a03af83126 Force tty1 respawn after autologin change 2026-05-26 17:52:54 +02:00
Damien bc1ad49210 Install script adds agetty for console autologin 2026-05-26 17:48:34 +02:00
Damien a6a3b421c5 Add cleanup for temporary directory
Previously the temporary directory was removed via the RETURN trap
but this could be bypassed if the script exited early. Now we
explicitly clean up the directory in all exit paths.
2026-05-26 17:42:24 +02:00
Damien c7f44aa293 Update install script for OpenBao release asset changes
OpenBao now uses raw architecture names (x86_64, aarch64) instead of
Go-style (amd64, arm64) and publishes .tar.gz archives instead of .zip
files. This commit updates the install script to match the new naming
convention and archive format.
2026-05-26 17:38:38 +02:00
Damien 34e0ce087d Update install script to use configurable GitHub releases URL 2026-05-26 17:25:25 +02:00
Damien 10f9a16782 Allow overriding SCRIPT_URL and VERSION_FILE 2026-05-26 17:20:47 +02:00
Damien c52a5b7fea Redirect logging functions to stderr 2026-05-26 17:04:35 +02:00
Damien 274e728aeb Update OpenBao README and add MOTD configuration
```
Update environment variable table formatting for readability

Fix data directory path formatting in README

Add MOTD with OpenBao status and access information
```
2026-05-26 17:02:37 +02:00
Damien 03d7b13f89 Update install script URL to main branch 2026-05-26 15:36:14 +02:00
Damien e8920b246b Enable console auto-login on Proxmox LXCs
Enable root auto-login on tty1 for faster shell access in Proxmox LXCs
by
configuring agetty with autologin and adding the necessary inittab entry
2026-05-26 15:28:07 +02:00
Damien ec77eda69e Format README table for better readability 2026-05-26 15:26:37 +02:00
Damien 636a637e81 Add key features to README 2026-05-26 15:26:02 +02:00
Damien 530e7dce2a Add Tailscale reverse proxy support to OpenBao LXC 2026-05-26 15:25:39 +02:00
Damien 7899d8fd93 Add OpenBao LXC installation and update scripts 2026-05-26 15:16:38 +02:00
Damien 9f6e583135 Update proxy server installation script
Switch to Let's Encrypt HTTP challenge
Add Tailscale exit node support
Add Fail2ban protection for Traefik
Improve idempotency and error handling
2026-05-13 16:37:15 +02:00
Damien 7c3cab2b5a Update proxy installer to use Traefik v3 with Fail2ban and Infomaniak
DNS
2026-05-13 10:39:44 +02:00
Damien f2b8d758b8 Add .DS_Store to gitignore 2026-05-12 15:17:34 +02:00
Damien 47e3275e6b Remove unused Gitea dashboard 2026-05-12 15:17:24 +02:00
Damien ac92b3a6c3 Remove deprecated seedbox deployment workflow 2026-05-12 09:24:14 +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 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