From 5c2ec3a54922764164d14b6a5c33e651614d54e3 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Mon, 23 Mar 2026 15:29:25 +0100 Subject: [PATCH] Format authentik update script and trim blank line Reformat ct/authentik.sh for consistent indentation and add an explicit exit at the end of the update_script function to ensure the updater stops after completing. Also remove an extra blank line in install/github-runner-install.sh. No functional logic changes beyond the added exit and whitespace cleanup. --- ct/authentik.sh | 168 +++++++++++++++---------------- install/github-runner-install.sh | 1 - 2 files changed, 84 insertions(+), 85 deletions(-) diff --git a/ct/authentik.sh b/ct/authentik.sh index ece42fde..fc195c21 100644 --- a/ct/authentik.sh +++ b/ct/authentik.sh @@ -20,93 +20,93 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources + header_info + check_container_storage + check_container_resources - AUTHENTIK_VERSION="version/2026.2.0" - NODE_VERSION="24" + AUTHENTIK_VERSION="version/2026.2.0" + NODE_VERSION="24" - if [[ ! -d /opt/authentik ]]; then - msg_error "No authentik Installation Found!" - exit - fi - - if [[ "$AUTHENTIK_VERSION" == "$(cat $HOME/.authentik)" ]]; then - msg_ok "Authentik up-to-date" - exit - fi - - if check_for_gh_release "geoipupdate" "maxmind/geoipupdate"; then - fetch_and_deploy_gh_release "geoipupdate" "maxmind/geoipupdate" "binary" - fi - - msg_info "Stopping Services" - systemctl stop authentik-server.service - systemctl stop authentik-worker.service - msg_ok "Stopped Services" - - if check_for_gh_release "xmlsec" "lsh123/xmlsec"; then - - CLEAN_INSTALL=1 fetch_and_deploy_gh_release "xmlsec" "lsh123/xmlsec" "tarball" "latest" "/opt/xmlsec" - - msg_info "Update xmlsec" - cd /opt/xmlsec - $STD ./autogen.sh - $STD make -j $(nproc) - $STD make check - $STD make install - ldconfig - msg_ok "xmlsec updated" - fi - - setup_nodejs - setup_go - - if check_for_gh_release "authentik" "goauthentik/authentik" "${AUTHENTIK_VERSION}"; then - - CLEAN_INSTALL=1 fetch_and_deploy_gh_release "authentik" "goauthentik/authentik" "tarball" "${AUTHENTIK_VERSION}" "/opt/authentik" - - msg_info "Update web" - cd /opt/authentik/web - NODE_ENV="production" - $STD npm install - $STD npm run build - $STD npm run build:sfe - msg_ok "Web updated" - - msg_info "Update go proxy" - cd /opt/authentik - CGO_ENABLED="1" - $STD go mod download - $STD go build -o /opt/authentik/authentik-server ./cmd/server - msg_ok "Go proxy updated" - - setup_uv - - setup_rust - - msg_info "Update python server" - $STD uv python install 3.14.3 -i /usr/local/bin - UV_NO_BINARY_PACKAGE="cryptography lxml python-kadmin-rs xmlsec" - UV_COMPILE_BYTECODE="1" - UV_LINK_MODE="copy" - UV_NATIVE_TLS="1" - RUSTUP_PERMIT_COPY_RENAME="true" - cd /opt/authentik - export UV_PYTHON_INSTALL_DIR="/usr/local/bin" - $STD uv sync --frozen --no-install-project --no-dev - msg_ok "Python server updated" - - chown -R authentik:authentik /opt/authentik - - fi - - msg_info "Restarting services" - systemctl restart authentik-server.service authentik-worker.service - msg_ok "Started Service" - msg_ok "Updated successfully!" + if [[ ! -d /opt/authentik ]]; then + msg_error "No authentik Installation Found!" exit + fi + + if [[ "$AUTHENTIK_VERSION" == "$(cat $HOME/.authentik)" ]]; then + msg_ok "Authentik up-to-date" + exit + fi + + if check_for_gh_release "geoipupdate" "maxmind/geoipupdate"; then + fetch_and_deploy_gh_release "geoipupdate" "maxmind/geoipupdate" "binary" + fi + + msg_info "Stopping Services" + systemctl stop authentik-server.service + systemctl stop authentik-worker.service + msg_ok "Stopped Services" + + if check_for_gh_release "xmlsec" "lsh123/xmlsec"; then + + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "xmlsec" "lsh123/xmlsec" "tarball" "latest" "/opt/xmlsec" + + msg_info "Update xmlsec" + cd /opt/xmlsec + $STD ./autogen.sh + $STD make -j $(nproc) + $STD make check + $STD make install + ldconfig + msg_ok "xmlsec updated" + fi + + setup_nodejs + setup_go + + if check_for_gh_release "authentik" "goauthentik/authentik" "${AUTHENTIK_VERSION}"; then + + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "authentik" "goauthentik/authentik" "tarball" "${AUTHENTIK_VERSION}" "/opt/authentik" + + msg_info "Update web" + cd /opt/authentik/web + NODE_ENV="production" + $STD npm install + $STD npm run build + $STD npm run build:sfe + msg_ok "Web updated" + + msg_info "Update go proxy" + cd /opt/authentik + CGO_ENABLED="1" + $STD go mod download + $STD go build -o /opt/authentik/authentik-server ./cmd/server + msg_ok "Go proxy updated" + + setup_uv + + setup_rust + + msg_info "Update python server" + $STD uv python install 3.14.3 -i /usr/local/bin + UV_NO_BINARY_PACKAGE="cryptography lxml python-kadmin-rs xmlsec" + UV_COMPILE_BYTECODE="1" + UV_LINK_MODE="copy" + UV_NATIVE_TLS="1" + RUSTUP_PERMIT_COPY_RENAME="true" + cd /opt/authentik + export UV_PYTHON_INSTALL_DIR="/usr/local/bin" + $STD uv sync --frozen --no-install-project --no-dev + msg_ok "Python server updated" + + chown -R authentik:authentik /opt/authentik + + fi + + msg_info "Restarting services" + systemctl restart authentik-server.service authentik-worker.service + msg_ok "Started Service" + msg_ok "Updated successfully!" + exit } start diff --git a/install/github-runner-install.sh b/install/github-runner-install.sh index a350029b..027be130 100644 --- a/install/github-runner-install.sh +++ b/install/github-runner-install.sh @@ -11,7 +11,6 @@ setting_up_container network_check update_os - msg_info "Installing Dependencies" $STD apt install -y \ git \