Update authentik 2026.8.7 (#19051)

* authentik: wait for web UI readiness after install/update restart

The new PR test battery probes the authentik web UI right after the
script ends; on slower runners gunicorn workers are still booting and
answer 503 within the probe window. Poll https://127.0.0.1:9443/ for
up to 180s (200/302 accepted) after starting services in both the
install and update paths; warn instead of fail on timeout.

* authentik: move GeoIP auto-update from cron to systemd timer

The crontab call breaks incus builds (no cron package in the runner
image, exit 127) and overwrites the whole root crontab. Replace it in
the install script with an oneshot service + calendar timer pair
(same Thu/Sat 19:39 schedule, still disabled by default like the
previous commented-out crontab entry). In update_script, migrate
existing installs: create the units when missing and strip only
geoipupdate lines from the user's crontab, keeping other entries.

* authentik: conform to AGENTS.md script rules

No /dev/null redirections: readiness probes now capture the HTTP
status line via curl -I and sed; the crontab migration guards on the
/usr/bin/crontab file test and folds stderr into the captured
variable. No systemctl daemon-reload for the new units (systemctl
enable reloads them when the user opts in). Comments trimmed to the
single allowed line.

* authentik: take over active cron job, fix errexit-unsafe grep

If the crontab geoipupdate line was not commented out, the user
opted into auto-updates, so the migration now enables the timer.
grep -v returning no lines would abort the update under the
engine's errexit; guarded with || true. Validated end-to-end in a
simulated set -Eeuo pipefail environment with stub crontab/systemctl.

* authentik: state and extend readiness wait to 300s

Both readiness blocks now print their budget upfront and wait up to
300s (60 x 5s) before warning; slow runners needed longer than 180s
in CI.

* authentik: probe readiness via the engine ct_exec helper

Follow the #18949 host-side helper style (ct_exec wraps pct exec).

* authentik: update to 2026.8.7

2026.8.7 is the current stable patch of the 2026.8 line (2026.11.25).
Build inputs are unchanged versus 2026.8.6: container Dockerfile is
byte-identical (sha256), pyproject/package.json bump the version field
only, go.mod is unchanged, and the fips Makefile still pins xmlsec
1.3.13 (the pin line moved from L26 to L28, comment updated to match).

* Remove GeoIP auto-update cron migration logic

Removed GeoIP auto-update migration from cron to systemd timer.

* Remove GeoIP update service and timer setup

Removed GeoIP update service and timer configuration from the installation script.

---------

Co-authored-by: CanbiZ (MickLesk) <47820557+MickLesk@users.noreply.github.com>
This commit is contained in:
thieneret
2026-12-04 08:10:22 +01:00
committed by GitHub
parent f6d75d7a33
commit b42e66a49d
2 changed files with 30 additions and 4 deletions

View File

@@ -47,8 +47,8 @@ function update_script() {
RUST_PROFILE="minimal" RUST_TOOLCHAIN="stable" setup_rust
setup_yq
AUTHENTIK_VERSION="version/2026.8.6"
# Source: https://github.com/goauthentik/fips/blob/main/Makefile#L26
AUTHENTIK_VERSION="version/2026.8.7"
# Source: https://github.com/goauthentik/fips/blob/main/Makefile#L28
XMLSEC_VERSION="1.3.13"
if check_for_gh_release "geoipupdate" "maxmind/geoipupdate"; then
@@ -204,6 +204,20 @@ EOF
systemctl start authentik-radius
fi
msg_ok "Started Services"
msg_info "Waiting for authentik to become ready (up to 300s)"
CODE=000
for _ in {1..60}; do
CODE=$(curl -ksI -m 3 https://127.0.0.1:9443/ | sed -n 's,^HTTP/[0-9.]* \([0-9]\{3\}\).*,\1,p' || true)
[[ "$CODE" == "200" || "$CODE" == "302" ]] && break
sleep 5
done
if [[ "$CODE" == "200" || "$CODE" == "302" ]]; then
msg_ok "authentik is responding (HTTP ${CODE})"
else
msg_warn "authentik did not start responding (HTTP ${CODE}) within 300s. It may still be booting (migrations after an upgrade can take longer); check: journalctl -eu authentik-server"
fi
fi
msg_ok "Updated successfully!"
exit
@@ -226,6 +240,19 @@ msg_info "Starting Services"
ct_exec systemctl enable -q --now authentik-server authentik-worker
msg_ok "Started Services"
msg_info "Waiting for authentik to become ready (up to 300s)"
CODE=000
for _ in {1..60}; do
CODE=$(ct_exec curl -ksI -m 3 https://127.0.0.1:9443/ | sed -n 's,^HTTP/[0-9.]* \([0-9]\{3\}\).*,\1,p' || true)
[[ "$CODE" == "200" || "$CODE" == "302" ]] && break
sleep 5
done
if [[ "$CODE" == "200" || "$CODE" == "302" ]]; then
msg_ok "authentik is responding (HTTP ${CODE})"
else
msg_warn "authentik did not start responding (HTTP ${CODE}) within 300s. It may still be booting (first boot runs migrations); check inside the container with journalctl -eu authentik-server"
fi
description
msg_ok "Completed successfully!\n"

View File

@@ -57,7 +57,7 @@ PG_VERSION="17" setup_postgresql
PG_DB_NAME="authentik" PG_DB_USER="authentik" PG_DB_GRANT_SUPERUSER="true" setup_postgresql_db
XMLSEC_VERSION="1.3.13"
AUTHENTIK_VERSION="version/2026.8.6"
AUTHENTIK_VERSION="version/2026.8.7"
fetch_and_deploy_gh_release "xmlsec" "lsh123/xmlsec" "tarball" "${XMLSEC_VERSION}" "/opt/xmlsec"
fetch_and_deploy_gh_release "authentik" "goauthentik/authentik" "tarball" "${AUTHENTIK_VERSION}" "/opt/authentik"
GO_VERSION="$(grep -m1 '^go ' /opt/authentik/go.mod | awk '{print $2}')" setup_go
@@ -108,7 +108,6 @@ DatabaseDirectory /opt/authentik-data/geoip
RetryFor 5m
Parallelism 1
EOF
echo "#39 19 * * 6,4 /usr/bin/geoipupdate -f /usr/local/etc/GeoIP.conf" | crontab -
msg_info "Building binary. It may take more than 10 minutes, please be patient."