Merge pull request #1776 from thieneret/update/authentik-outposts

authentik: add outposts
This commit is contained in:
CanbiZ (MickLesk)
2026-05-02 22:32:32 +02:00
committed by GitHub
2 changed files with 97 additions and 1 deletions

View File

@@ -57,6 +57,15 @@ function update_script() {
if check_for_gh_release "authentik" "goauthentik/authentik" "${AUTHENTIK_VERSION}"; then if check_for_gh_release "authentik" "goauthentik/authentik" "${AUTHENTIK_VERSION}"; then
msg_info "Stopping Services" msg_info "Stopping Services"
systemctl stop authentik-server authentik-worker systemctl stop authentik-server authentik-worker
if [[ $(systemctl is-active authentik-ldap) == active ]]; then
systemctl stop authentik-ldap
fi
if [[ $(systemctl is-active authentik-rac) == active ]]; then
systemctl stop authentik-rac
fi
if [[ $(systemctl is-active authentik-radius) == active ]]; then
systemctl stop authentik-radius
fi
msg_ok "Stopped Services" msg_ok "Stopped Services"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "authentik" "goauthentik/authentik" "tarball" "${AUTHENTIK_VERSION}" "/opt/authentik" CLEAN_INSTALL=1 fetch_and_deploy_gh_release "authentik" "goauthentik/authentik" "tarball" "${AUTHENTIK_VERSION}" "/opt/authentik"
@@ -74,6 +83,9 @@ function update_script() {
export CGO_ENABLED="1" export CGO_ENABLED="1"
$STD go mod download $STD go mod download
$STD go build -o /opt/authentik/authentik-server ./cmd/server $STD go build -o /opt/authentik/authentik-server ./cmd/server
$STD go build -o /opt/authentik/ldap ./cmd/ldap
$STD go build -o /opt/authentik/rac ./cmd/rac
$STD go build -o /opt/authentik/radius ./cmd/radius
msg_ok "Updated go proxy" msg_ok "Updated go proxy"
msg_info "Updating python server" msg_info "Updating python server"
@@ -91,6 +103,15 @@ function update_script() {
msg_info "Starting Services" msg_info "Starting Services"
systemctl start authentik-server authentik-worker systemctl start authentik-server authentik-worker
if [[ $(systemctl is-enabled authentik-ldap) == enabled ]]; then
systemctl start authentik-ldap
fi
if [[ $(systemctl is-enabled authentik-rac) == enabled ]]; then
systemctl start authentik-rac
fi
if [[ $(systemctl is-enabled authentik-radius) == enabled ]]; then
systemctl start authentik-radius
fi
msg_ok "Started Services" msg_ok "Started Services"
msg_ok "Updated successfully!" msg_ok "Updated successfully!"
exit exit

View File

@@ -83,6 +83,9 @@ cd /opt/authentik
export CGO_ENABLED="1" export CGO_ENABLED="1"
$STD go mod download $STD go mod download
$STD go build -o /opt/authentik/authentik-server ./cmd/server $STD go build -o /opt/authentik/authentik-server ./cmd/server
$STD go build -o /opt/authentik/ldap ./cmd/ldap
$STD go build -o /opt/authentik/rac ./cmd/rac
$STD go build -o /opt/authentik/radius ./cmd/radius
msg_ok "Go proxy installed" msg_ok "Go proxy installed"
cat <<EOF >/usr/local/etc/GeoIP.conf cat <<EOF >/usr/local/etc/GeoIP.conf
@@ -133,6 +136,21 @@ PATH=/opt/authentik/lifecycle:/opt/authentik/.venv/bin:/usr/local/bin:/usr/local
DJANGO_SETTINGS_MODULE=authentik.root.settings DJANGO_SETTINGS_MODULE=authentik.root.settings
PROMETHEUS_MULTIPROC_DIR="/tmp/authentik_prometheus_tmp" PROMETHEUS_MULTIPROC_DIR="/tmp/authentik_prometheus_tmp"
EOF EOF
cat <<EOF >/etc/default/authentik_ldap
AUTHENTIK_HOST="https://127.0.0.1:9443"
AUTHENTIK_INSECURE="true"
AUTHENTIK_TOKEN="token-generated-by-authentik"
EOF
cat <<EOF >/etc/default/authentik_rac
AUTHENTIK_HOST="https://127.0.0.1:9443"
AUTHENTIK_INSECURE="true"
AUTHENTIK_TOKEN="token-generated-by-authentik"
EOF
cat <<EOF >/etc/default/authentik_radius
AUTHENTIK_HOST="https://127.0.0.1:9443"
AUTHENTIK_INSECURE="true"
AUTHENTIK_TOKEN="token-generated-by-authentik"
EOF
msg_ok "authentik config created" msg_ok "authentik config created"
msg_info "Creating services" msg_info "Creating services"
@@ -174,7 +192,64 @@ RestartSec=5
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
EOF EOF
systemctl enable -q authentik-server authentik-worker
cat <<EOF >/etc/systemd/system/authentik-ldap.service
[Unit]
Description=authentik LDAP Outpost
After=network.target
Wants=postgresql.service
[Service]
User=authentik
Group=authentik
ExecStart=/opt/authentik/ldap
WorkingDirectory=/opt/authentik/
Restart=always
RestartSec=5
EnvironmentFile=/etc/default/authentik_ldap
[Install]
WantedBy=multi-user.target
EOF
cat <<EOF >/etc/systemd/system/authentik-rac.service
[Unit]
Description=authentik RAC Outpost
After=network.target
Wants=postgresql.service
[Service]
User=authentik
Group=authentik
ExecStart=/opt/authentik/rac
WorkingDirectory=/opt/authentik/
Restart=always
RestartSec=5
EnvironmentFile=/etc/default/authentik_rac
[Install]
WantedBy=multi-user.target
EOF
cat <<EOF >/etc/systemd/system/authentik-radius.service
[Unit]
Description=authentik Radius Outpost
After=network.target
Wants=postgresql.service
[Service]
User=authentik
Group=authentik
ExecStart=/opt/authentik/radius
WorkingDirectory=/opt/authentik/
Restart=always
RestartSec=5
EnvironmentFile=/etc/default/authentik_radius
[Install]
WantedBy=multi-user.target
EOF
msg_ok "Services created" msg_ok "Services created"
motd_ssh motd_ssh