feat: manage Grafana Authentik SSO
Homelab Main / validate (push) Successful in 15s Details
Homelab Main / running-update (push) Successful in 9s Details
Homelab Main / debian-ops (push) Successful in 1m13s Details

This commit is contained in:
juvenal.diaz 2026-09-29 08:26:31 -06:00
parent 76594f3f1e
commit ac594775c6
1 changed files with 7 additions and 0 deletions

View File

@ -576,14 +576,21 @@ grafana_sso() {
local action="${1:-plan}"
local stack="bootstrap/sso-grafana"
local bootstrap_token
local authentik_url="${LAB_AUTHENTIK_PUBLIC_URL:-}"
require_debian_server "sso-grafana"
if [[ "${authentik_url}" != https://* ]]; then
echo "LAB_AUTHENTIK_PUBLIC_URL must be an HTTPS URL in homelab.yml." >&2
return 1
fi
# Authentik creates this API token for akadmin on its first startup. Using
# the SOPS-encrypted bootstrap value makes the identity stack reproducible
# after an Authentik database destroy/recreate cycle.
bootstrap_token="$(authentik_bootstrap_api_token)" || return 1
export TF_VAR_authentik_token="${bootstrap_token}"
export TF_VAR_authentik_url="${authentik_url}"
case "${action}" in
plan)