Fixed comments

This commit is contained in:
lengschder97 2026-01-09 09:22:12 +01:00
parent 46e0d4f573
commit b104727293
2 changed files with 11 additions and 71 deletions

View File

@ -1,9 +1,9 @@
#!/usr/bin/env bash #!/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 # Author: Simon Friedrich
# License: MIT # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://forgejo.org/ # Source: https://forgejo.org/
APP="Forgejo Runner" APP="Forgejo Runner"
@ -14,10 +14,9 @@ var_disk="${var_disk:-8}"
var_os="${var_os:-debian}" var_os="${var_os:-debian}"
var_version="${var_version:-12}" var_version="${var_version:-12}"
# REQUIRED for Podman-in-LXC var_unprivileged="${var_unprivileged:-1}"
var_unprivileged="1" var_nesting="${var_nesting:-1}"
var_nesting="1" var_keyctl="${var_keyctl:-1}"
var_keyctl="1"
# ------------------------------------------------- # -------------------------------------------------
# Framework setup # Framework setup
@ -27,28 +26,6 @@ variables
color color
catch_errors 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() { function update_script() {
header_info header_info
check_container_storage check_container_storage
@ -84,9 +61,6 @@ function update_script() {
exit exit
} }
# -------------------------------------------------
# Install
# -------------------------------------------------
start start
build_container build_container
description description

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright (c) 2026 # Copyright (c) 2021-2026 community-scripts ORG
# Author: Simon Friedrich # Author: Simon Friedrich
# License: MIT # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://forgejo.org/ # Source: https://forgejo.org/
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
@ -12,9 +12,6 @@ setting_up_container
network_check network_check
update_os update_os
# -------------------------------------------------
# App-specific input (MUST be before variables)
# -------------------------------------------------
if [[ -z "$var_forgejo_instance" ]]; then if [[ -z "$var_forgejo_instance" ]]; then
read -rp "Forgejo Instance URL (e.g. https://code.forgejo.org): " var_forgejo_instance read -rp "Forgejo Instance URL (e.g. https://code.forgejo.org): " var_forgejo_instance
fi fi
@ -33,8 +30,8 @@ export FORGEJO_INSTANCE="$var_forgejo_instance"
export FORGEJO_RUNNER_TOKEN="$var_forgejo_runner_token" export FORGEJO_RUNNER_TOKEN="$var_forgejo_runner_token"
msg_info "Installing dependencies" msg_info "Installing dependencies"
$STD apt-get install -y \ $STD apt install -y \
curl jq gnupg git wget ca-certificates \ jq git \
podman podman-docker podman podman-docker
msg_ok "Dependencies installed" msg_ok "Dependencies installed"
@ -42,16 +39,10 @@ msg_info "Enabling Podman socket"
systemctl enable --now podman.socket systemctl enable --now podman.socket
msg_ok "Podman socket enabled" msg_ok "Podman socket enabled"
# -------------------------------------------------
# Architecture
# -------------------------------------------------
RAW_ARCH=$(uname -m) RAW_ARCH=$(uname -m)
ARCH=$(echo "$RAW_ARCH" | sed 's/x86_64/amd64/;s/aarch64/arm64/') ARCH=$(echo "$RAW_ARCH" | sed 's/x86_64/amd64/;s/aarch64/arm64/')
msg_info "Detected architecture: $ARCH" msg_info "Detected architecture: $ARCH"
# -------------------------------------------------
# Fetch latest Forgejo Runner version
# -------------------------------------------------
msg_info "Fetching latest Forgejo Runner release" msg_info "Fetching latest Forgejo Runner release"
RUNNER_VERSION=$( RUNNER_VERSION=$(
curl -fsSL https://data.forgejo.org/api/v1/repos/forgejo/runner/releases/latest | 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}" 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}" FORGEJO_URL="https://code.forgejo.org/forgejo/runner/releases/download/v${RUNNER_VERSION}/forgejo-runner-${RUNNER_VERSION}-linux-${ARCH}"
msg_info "Downloading Forgejo Runner" 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 chmod +x /usr/local/bin/forgejo-runner
msg_ok "Runner installed" 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" msg_info "Registering Forgejo Runner"
export DOCKER_HOST="unix:///run/podman/podman.sock" export DOCKER_HOST="unix:///run/podman/podman.sock"
@ -106,9 +76,6 @@ forgejo-runner register \
msg_ok "Runner registered" msg_ok "Runner registered"
# -------------------------------------------------
# systemd service
# -------------------------------------------------
msg_info "Creating systemd service" msg_info "Creating systemd service"
cat <<EOF >/etc/systemd/system/forgejo-runner.service cat <<EOF >/etc/systemd/system/forgejo-runner.service
@ -131,8 +98,7 @@ TimeoutSec=0
WantedBy=multi-user.target WantedBy=multi-user.target
EOF EOF
systemctl daemon-reload systemctl enable -q --now forgejo-runner
systemctl enable --now forgejo-runner
msg_ok "Forgejo Runner service enabled" msg_ok "Forgejo Runner service enabled"
motd_ssh motd_ssh