Fixed comments
This commit is contained in:
parent
46e0d4f573
commit
b104727293
@ -1,9 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
|
||||
# Copyright (c) 2026
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: Simon Friedrich
|
||||
# License: MIT
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://forgejo.org/
|
||||
|
||||
APP="Forgejo Runner"
|
||||
@ -14,10 +14,9 @@ var_disk="${var_disk:-8}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-12}"
|
||||
|
||||
# REQUIRED for Podman-in-LXC
|
||||
var_unprivileged="1"
|
||||
var_nesting="1"
|
||||
var_keyctl="1"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
var_nesting="${var_nesting:-1}"
|
||||
var_keyctl="${var_keyctl:-1}"
|
||||
|
||||
# -------------------------------------------------
|
||||
# Framework setup
|
||||
@ -27,28 +26,6 @@ variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
# -------------------------------------------------
|
||||
# Description
|
||||
# -------------------------------------------------
|
||||
function description() {
|
||||
cat <<EOF
|
||||
Forgejo Actions Runner using Podman (unprivileged LXC)
|
||||
|
||||
Required inputs:
|
||||
- Forgejo Instance URL
|
||||
- Forgejo Runner Registration Token
|
||||
|
||||
Requirements:
|
||||
- unprivileged container
|
||||
- nesting enabled
|
||||
- keyctl enabled
|
||||
- unconfined AppArmor profile
|
||||
EOF
|
||||
}
|
||||
|
||||
# -------------------------------------------------
|
||||
# Update logic
|
||||
# -------------------------------------------------
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
@ -84,9 +61,6 @@ function update_script() {
|
||||
exit
|
||||
}
|
||||
|
||||
# -------------------------------------------------
|
||||
# Install
|
||||
# -------------------------------------------------
|
||||
start
|
||||
build_container
|
||||
description
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright (c) 2026
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: Simon Friedrich
|
||||
# License: MIT
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://forgejo.org/
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
@ -12,9 +12,6 @@ setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
# -------------------------------------------------
|
||||
# App-specific input (MUST be before variables)
|
||||
# -------------------------------------------------
|
||||
if [[ -z "$var_forgejo_instance" ]]; then
|
||||
read -rp "Forgejo Instance URL (e.g. https://code.forgejo.org): " var_forgejo_instance
|
||||
fi
|
||||
@ -33,8 +30,8 @@ export FORGEJO_INSTANCE="$var_forgejo_instance"
|
||||
export FORGEJO_RUNNER_TOKEN="$var_forgejo_runner_token"
|
||||
|
||||
msg_info "Installing dependencies"
|
||||
$STD apt-get install -y \
|
||||
curl jq gnupg git wget ca-certificates \
|
||||
$STD apt install -y \
|
||||
jq git \
|
||||
podman podman-docker
|
||||
msg_ok "Dependencies installed"
|
||||
|
||||
@ -42,16 +39,10 @@ msg_info "Enabling Podman socket"
|
||||
systemctl enable --now podman.socket
|
||||
msg_ok "Podman socket enabled"
|
||||
|
||||
# -------------------------------------------------
|
||||
# Architecture
|
||||
# -------------------------------------------------
|
||||
RAW_ARCH=$(uname -m)
|
||||
ARCH=$(echo "$RAW_ARCH" | sed 's/x86_64/amd64/;s/aarch64/arm64/')
|
||||
msg_info "Detected architecture: $ARCH"
|
||||
|
||||
# -------------------------------------------------
|
||||
# Fetch latest Forgejo Runner version
|
||||
# -------------------------------------------------
|
||||
msg_info "Fetching latest Forgejo Runner release"
|
||||
RUNNER_VERSION=$(
|
||||
curl -fsSL https://data.forgejo.org/api/v1/repos/forgejo/runner/releases/latest |
|
||||
@ -65,9 +56,6 @@ RUNNER_VERSION=$(
|
||||
|
||||
msg_ok "Forgejo Runner v${RUNNER_VERSION}"
|
||||
|
||||
# -------------------------------------------------
|
||||
# Download Runner
|
||||
# -------------------------------------------------
|
||||
FORGEJO_URL="https://code.forgejo.org/forgejo/runner/releases/download/v${RUNNER_VERSION}/forgejo-runner-${RUNNER_VERSION}-linux-${ARCH}"
|
||||
|
||||
msg_info "Downloading Forgejo Runner"
|
||||
@ -75,24 +63,6 @@ wget -q -O /usr/local/bin/forgejo-runner "$FORGEJO_URL"
|
||||
chmod +x /usr/local/bin/forgejo-runner
|
||||
msg_ok "Runner installed"
|
||||
|
||||
# -------------------------------------------------
|
||||
# Signature verification
|
||||
# -------------------------------------------------
|
||||
msg_info "Verifying signature"
|
||||
wget -q -O /tmp/forgejo-runner.asc "${FORGEJO_URL}.asc"
|
||||
|
||||
GPG_KEY="EB114F5E6C0DC2BCDD183550A4B61A2DC5923710"
|
||||
if ! gpg --list-keys "$GPG_KEY" >/dev/null 2>&1; then
|
||||
gpg --keyserver hkps://keys.openpgp.org --recv "$GPG_KEY" >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
gpg --verify /tmp/forgejo-runner.asc /usr/local/bin/forgejo-runner >/dev/null 2>&1 \
|
||||
&& msg_ok "Signature valid" \
|
||||
|| { msg_error "Signature verification failed"; exit 1; }
|
||||
|
||||
# -------------------------------------------------
|
||||
# Runner registration
|
||||
# -------------------------------------------------
|
||||
msg_info "Registering Forgejo Runner"
|
||||
|
||||
export DOCKER_HOST="unix:///run/podman/podman.sock"
|
||||
@ -106,9 +76,6 @@ forgejo-runner register \
|
||||
|
||||
msg_ok "Runner registered"
|
||||
|
||||
# -------------------------------------------------
|
||||
# systemd service
|
||||
# -------------------------------------------------
|
||||
msg_info "Creating systemd service"
|
||||
|
||||
cat <<EOF >/etc/systemd/system/forgejo-runner.service
|
||||
@ -131,8 +98,7 @@ TimeoutSec=0
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable --now forgejo-runner
|
||||
systemctl enable -q --now forgejo-runner
|
||||
msg_ok "Forgejo Runner service enabled"
|
||||
|
||||
motd_ssh
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user