-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
update authentik to 2026.5.2 #14846
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
update authentik to 2026.5.2 #14846
Changes from all commits
6fdf825
0accd6e
2ac56e4
7b776e9
8b925c1
2713e68
96a3b98
7337c95
6e6eeb0
f33dacf
3ab1a0f
7b63f05
bc8848f
2bd183f
928c54f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV | |
| APP="authentik" | ||
| var_tags="${var_tags:-auth}" | ||
| var_cpu="${var_cpu:-4}" | ||
| var_ram="${var_ram:-4096}" | ||
| var_ram="${var_ram:-8192}" | ||
| var_disk="${var_disk:-16}" | ||
| var_os="${var_os:-debian}" | ||
| var_version="${var_version:-13}" | ||
|
|
@@ -30,12 +30,21 @@ function update_script() { | |
| exit | ||
| fi | ||
|
|
||
| CUR_VERSION="$(<"$HOME/.authentik")" | ||
| IFS='.' read -ra PARTS <<< "${CUR_VERSION#version/}" | ||
| MAJOR=${PARTS[0]} | ||
| MINOR=${PARTS[1]} | ||
|
|
||
| msg_info "Update dependencies" | ||
| ensure_dependencies crossbuild-essential-amd64 gcc-x86-64-linux-gnu cmake clang libunwind-18-dev | ||
| msg_ok "Update dependencies" | ||
|
|
||
| NODE_VERSION="24" setup_nodejs | ||
| setup_go | ||
| UV_PYTHON_INSTALL_DIR="/usr/local/bin" PYTHON_VERSION="3.14.3" setup_uv | ||
| setup_rust | ||
| RUST_PROFILE="minimal" RUST_TOOLCHAIN="stable" setup_rust | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe we add here setup_yq too if something broke in bashrc during update?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you add it? |
||
| AUTHENTIK_VERSION="version/2026.2.3" | ||
| AUTHENTIK_VERSION="version/2026.5.2" | ||
| XMLSEC_VERSION="1.3.11" | ||
|
|
||
| if check_for_gh_release "geoipupdate" "maxmind/geoipupdate"; then | ||
|
|
@@ -71,7 +80,13 @@ function update_script() { | |
|
|
||
| CLEAN_INSTALL=1 fetch_and_deploy_gh_release "authentik" "goauthentik/authentik" "tarball" "${AUTHENTIK_VERSION}" "/opt/authentik" | ||
|
|
||
| msg_info "Updating web" | ||
| msg_info "Configuring rust" | ||
| cd /opt/authentik | ||
| $STD rustup install | ||
| $STD rustup default "$(sed -n 's/channel = "\(.*\)"/\1/p' rust-toolchain.toml)" | ||
| msg_ok "Configured rust" | ||
|
|
||
| msg_info "Updating web" | ||
| cd /opt/authentik/web | ||
| export NODE_ENV="production" | ||
| $STD npm install | ||
|
|
@@ -89,6 +104,14 @@ function update_script() { | |
| $STD go build -o /opt/authentik/radius ./cmd/radius | ||
| msg_ok "Updated go proxy" | ||
|
|
||
| msg_info "Building worker" | ||
| export AWS_LC_FIPS_SYS_CC="clang" | ||
| cd /opt/authentik | ||
| $STD cargo build --package authentik --no-default-features --features core --locked --release --jobs 1 | ||
|
MickLesk marked this conversation as resolved.
|
||
| cp ./target/release/authentik /opt/authentik/authentik-worker | ||
| rm -r ./target | ||
| msg_ok "Built worker" | ||
|
|
||
| msg_info "Updating python server" | ||
| export UV_NO_BINARY_PACKAGE="cryptography lxml python-kadmin-rs xmlsec" | ||
| export UV_COMPILE_BYTECODE="1" | ||
|
|
@@ -100,6 +123,103 @@ function update_script() { | |
| $STD uv sync --frozen --no-install-project --no-dev | ||
| chown -R authentik:authentik /opt/authentik | ||
| msg_ok "Updated python server" | ||
|
|
||
| if [[ $MAJOR == 2026 && $MINOR -lt 5 ]]; then | ||
| msg_info "Updating Worker and Server config" | ||
| cp /etc/authentik/config.yml /etc/authentik/config.bak | ||
| yq -i ".postgresql.conn_max_age = 0" /etc/authentik/config.yml | ||
| yq -i ".postgresql.conn_health_checks = false" /etc/authentik/config.yml | ||
| yq -i ".listen.debug_tokio = \"[::]:6669\"" /etc/authentik/config.yml | ||
| yq -i ".log.rust_log.console_subscriber = \"info\"" /etc/authentik/config.yml | ||
| yq -i ".log.rust_log.h2 = \"info\"" /etc/authentik/config.yml | ||
| yq -i ".log.rust_log.hyper_util = \"warn\"" /etc/authentik/config.yml | ||
| yq -i ".log.rust_log.mio = \"info\"" /etc/authentik/config.yml | ||
| yq -i ".log.rust_log.notify = \"info\"" /etc/authentik/config.yml | ||
| yq -i ".log.rust_log.reqwest = \"info\"" /etc/authentik/config.yml | ||
| yq -i ".log.rust_log.runtime = \"info\"" /etc/authentik/config.yml | ||
| yq -i ".log.rust_log.rustls = \"info\"" /etc/authentik/config.yml | ||
| yq -i ".log.rust_log.sqlx = \"info\"" /etc/authentik/config.yml | ||
| yq -i ".log.rust_log.sqlx_postgres = \"info\"" /etc/authentik/config.yml | ||
| yq -i ".log.rust_log.tokio = \"info\"" /etc/authentik/config.yml | ||
| yq -i ".log.rust_log.tungstenite = \"info\"" /etc/authentik/config.yml | ||
| yq -i ".web.workers = 2" /etc/authentik/config.yml | ||
| mv /etc/default/authentik /etc/default/authentik.bak | ||
| cat <<EOF >/etc/default/authentik-server | ||
| TMPDIR=/dev/shm/ | ||
| UV_LINK_MODE=copy | ||
| UV_PYTHON_DOWNLOADS=0 | ||
| UV_NATIVE_TLS=1 | ||
| VENV_PATH=/opt/authentik/.venv | ||
| PYTHONDONTWRITEBYTECODE=1 | ||
| PYTHONUNBUFFERED=1 | ||
| PATH=/opt/authentik/lifecycle:/opt/authentik/.venv/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin | ||
| DJANGO_SETTINGS_MODULE=authentik.root.settings | ||
| PROMETHEUS_MULTIPROC_DIR="/tmp/authentik_prometheus_tmp" | ||
| AUTHENTIK_LISTEN__HTTP="[::]:9000" | ||
| AUTHENTIK_LISTEN__HTTPS="[::]:9443" | ||
| AUTHENTIK_LISTEN__METRICS="[::]:9300" | ||
| EOF | ||
| cat <<EOF >/etc/default/authentik-worker | ||
| TMPDIR=/dev/shm/ | ||
| UV_LINK_MODE=copy | ||
| UV_PYTHON_DOWNLOADS=0 | ||
| UV_NATIVE_TLS=1 | ||
| VENV_PATH=/opt/authentik/.venv | ||
| PYTHONDONTWRITEBYTECODE=1 | ||
| PYTHONUNBUFFERED=1 | ||
| PATH=/opt/authentik/lifecycle:/opt/authentik/.venv/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin | ||
| DJANGO_SETTINGS_MODULE=authentik.root.settings | ||
| PROMETHEUS_MULTIPROC_DIR="/tmp/authentik_prometheus_tmp" | ||
| AUTHENTIK_LISTEN__HTTP="[::]:8000" | ||
| AUTHENTIK_LISTEN__HTTPS="[::]:8443" | ||
| AUTHENTIK_LISTEN__METRICS="[::]:8300" | ||
| EOF | ||
| msg_ok "Updated Worker and Server config!" | ||
| msg_warn "Please check /etc/default/authentik-worker and /etc/default/authentik-server config files for port configurations!" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why does one need to review the port after an update?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Previously, the port configuration was read from the /etc/authentik/config.yml file. The http, https, and metrics ports are valid for both the worker and the server. This is not a problem in a docker environment, since they run in two separate containers, but in our case they cause a conflict. During testing, I found that this conflict prevents the services from starting in some cases, so I created separate environment files for both the worker and the server, where the ports are overridden. If the user has modified the default ports, they must be transferred to the new environment file.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okay I see. So essentially the ports stay the same unless the user customized them? Also then there was an error in the script as port was noted to be 9000?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The default http port is 9000, through which the service can be accessed. The default https port is 9443, through which the service can be accessed securely. However, as I wrote in the pull request description, starting with version 2026.5.2, the initial settings can only be made via https 9443, so at the end of the script I changed the port to 9443 and I would recommend changing this on the website as well. After the initial settings, the service can also be accessed via http 9000.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you add this into PR Description? Its marked as "breaking change" so the users can look about it and see the recent big changes and why ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's in the description, although not as detailed as here. |
||
|
|
||
| msg_info "Updating services" | ||
| cat <<EOF >/etc/systemd/system/authentik-server.service | ||
| [Unit] | ||
| Description=authentik Go Server (API Gateway) | ||
| After=network.target | ||
| Wants=postgresql.service | ||
| [Service] | ||
| User=authentik | ||
| Group=authentik | ||
| ExecStartPre=/usr/bin/mkdir -p "\${PROMETHEUS_MULTIPROC_DIR}" | ||
|
MickLesk marked this conversation as resolved.
|
||
| ExecStart=/opt/authentik/authentik-server | ||
| WorkingDirectory=/opt/authentik/ | ||
| Restart=always | ||
| RestartSec=5 | ||
| EnvironmentFile=/etc/default/authentik-server | ||
| [Install] | ||
| WantedBy=multi-user.target | ||
| EOF | ||
|
|
||
| cat <<EOF >/etc/systemd/system/authentik-worker.service | ||
| [Unit] | ||
| Description=authentik Worker | ||
| After=network.target postgresql.service | ||
| [Service] | ||
| User=authentik | ||
| Group=authentik | ||
| Type=simple | ||
| EnvironmentFile=/etc/default/authentik-worker | ||
| ExecStartPre=/usr/bin/mkdir -p "\${PROMETHEUS_MULTIPROC_DIR}" | ||
|
MickLesk marked this conversation as resolved.
|
||
| ExecStart=/opt/authentik/authentik-worker worker | ||
| WorkingDirectory=/opt/authentik | ||
| Restart=always | ||
| RestartSec=5 | ||
| [Install] | ||
| WantedBy=multi-user.target | ||
| EOF | ||
| systemctl daemon-reload | ||
| msg_ok "Updated services" | ||
|
MickLesk marked this conversation as resolved.
|
||
| fi | ||
| fi | ||
|
|
||
| msg_info "Starting Services" | ||
|
|
@@ -150,7 +270,5 @@ description | |
|
|
||
| msg_ok "Completed successfully!\n" | ||
| echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" | ||
| echo -e "${INFO}${YW} Initial setup URL:${CL}" | ||
| echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:9000/if/flow/initial-setup/${CL}" | ||
| echo -e "${INFO}${YW} Access it using the following URL:${CL}" | ||
| echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:9000${CL}" | ||
| echo -e "${TAB}${GATEWAY}${BGN}https://${IP}:9443${CL}" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not tested, but possibly cleaner.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not working:
-bash: ${$(< "$HOME/.authentik")#version/}: bad substitutionThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
read -r MAJOR MINOR PATCH <<< "$(sed 's/^version\///; s/\./ /g' "$HOME/.authentik")"?