deployment for athentik

This commit is contained in:
Ubuntu
2026-01-12 16:24:49 +00:00
parent 8d3c77664f
commit 4dee56fb54
5 changed files with 215 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
# Vault Secrets für Authentik anlegen
Authentik benötigt Secrets für die Datenbank, Redis und seinen eigenen Encryption Key.
```bash
# Umgebungsvariablen für Vault
export VAULT_ADDR='https://10.100.30.11:8200'
export VAULT_TOKEN='DeinRootToken' # Ersetzen!
export VAULT_CACERT='./vault-ca.crt'
# 1. Passwörter generieren
PG_PASS=$(openssl rand -hex 16)
REDIS_PASS=$(openssl rand -hex 16)
SECRET_KEY=$(openssl rand -hex 32)
BOOTSTRAP_TOKEN=$(openssl rand -hex 16) # Token für ersten Admin-Login (ak-admin)
# 2. Email Passwort (Optional, sonst leer lassen)
EMAIL_PASS="supersecret"
# 3. In Vault schreiben
vault kv put secret/apps/authentik \
postgres_password="$PG_PASS" \
redis_password="$REDIS_PASS" \
secret_key="$SECRET_KEY" \
bootstrap_token="$BOOTSTRAP_TOKEN" \
email_password="$EMAIL_PASS"
echo "Dein Bootstrap Token für den ersten Login: $BOOTSTRAP_TOKEN"
```
### Erster Login
1. Öffne `https://auth.apps.k3s.stabify.de/if/flow/initial-setup/`
2. Logge dich mit User `ak-admin` und dem `BOOTSTRAP_TOKEN` ein (oder setze dort das Passwort).
### Outline Integration
Nachdem Authentik läuft:
1. Erstelle im Authentik Admin Interface einen **Provider** (OAuth2/OpenID) für Outline.
* Redirect URI: `https://kb.apps.k3s.stabify.de/auth/oidc.callback`
2. Erstelle eine **Application** "Outline" und verknüpfe den Provider.
3. Kopiere **Client ID** und **Client Secret** aus Authentik.
4. Update die Outline Secrets in Vault:
```bash
vault kv patch secret/apps/outline \
oidc_client_id="<Client-ID-aus-Authentik>" \
oidc_client_secret="<Client-Secret-aus-Authentik>" \
oidc_auth_uri="https://auth.apps.k3s.stabify.de/application/o/authorize/" \
oidc_token_uri="https://auth.apps.k3s.stabify.de/application/o/token/" \
oidc_userinfo_uri="https://auth.apps.k3s.stabify.de/application/o/userinfo/"
```
5. Restart Outline Pods.