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,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