diff --git a/lib/jeannie/pipeline.sh b/lib/jeannie/pipeline.sh index 6b9eebc..7a12dce 100644 --- a/lib/jeannie/pipeline.sh +++ b/lib/jeannie/pipeline.sh @@ -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)