From 415e4a8a9fa347f279fb393b46295b260a8f0a2c Mon Sep 17 00:00:00 2001 From: spektr Date: Tue, 17 Nov 2026 07:33:04 +0100 Subject: [PATCH] =?UTF-8?q?keycloak=5Frealm=5Fconfig:=20KC26-Hinweis=20?= =?UTF-8?q?=E2=80=94=20realm-management-Rollen=20erst=20nach=20"Assign=20r?= =?UTF-8?q?ole"=20sichtbar=20(Service-account=20roles=20bzw.=20User=20serv?= =?UTF-8?q?ice-account-*=20->=20Role=20mapping)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- .../llm-server/ai/GNAI-023-PLAN_GPT-Researcher-IAP.md | 2 +- .../ansible/roles/keycloak_realm_config/README.md | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/platform/llm-server/ai/GNAI-023-PLAN_GPT-Researcher-IAP.md b/docs/platform/llm-server/ai/GNAI-023-PLAN_GPT-Researcher-IAP.md index f9b2bd9..9ce5388 100644 --- a/docs/platform/llm-server/ai/GNAI-023-PLAN_GPT-Researcher-IAP.md +++ b/docs/platform/llm-server/ai/GNAI-023-PLAN_GPT-Researcher-IAP.md @@ -124,7 +124,7 @@ Internet → NPM (CT 103, 443) → auth_request-Subrequest an oauth2-proxy | # | Paket | Ziel | Wo | | --- | --- | --- | --- | -| M8-T1 | Keycloak-Objekte **idempotent per Ansible** (Rolle `keycloak_realm_config` im CT-102-Projekt, Admin-REST-API via Service Account). **Einmaliger Bootstrap (Operator, Admin-UI `https://auth.ghostnet.selfhost.eu`, Realm-Dropdown = `Ghost.net`):** Clients → Create client: ID `ansible-keycloak-admin`, publicClient OFF, **Service accounts roles ON**, Standard flow OFF; Service account roles → `realm-management`: `manage-realm`, `manage-clients`, `manage-users`, `view-users`; Credentials → Secret kopieren; auf CT 102: `install -d -m 0700 /etc/keycloak-ansible && install -m 0600 /dev/null /etc/keycloak-ansible/client_secret` und Secret eintragen (nie in Git/Chat). **Danach alles per Playbook:** `cd proxmox/lxc/ct-102-keycloak/ansible && ansible-playbook -i inventories/production playbooks/site.yml` — synct Realm-Rolle `gnai-research-user`, Client `gnai-research` (confidential, Standard flow only, Redirect `https://research.ghostnet.selfhost.eu/oauth2/callback`, Web Origin `https://research.ghostnet.selfhost.eu`, post-logout `https://research.ghostnet.selfhost.eu/*`), Mapper `realm-roles-to-groups` (dedicated scope, Claim `groups`, in ID/access token + userinfo) und Role-Mapping für `ghost`; zweiter Lauf `changed=0`. Spec in `roles/keycloak_realm_config/defaults/main.yml`, Doku im Rollen-README. **Test nach M8-T3:** `curl -sI https://research.ghostnet.selfhost.eu/` → 302 zu `auth.ghostnet.selfhost.eu/...login...client_id=gnai-research`. | CT 102 (Bootstrap einmalig UI + Secret-Datei, danach site.yml) | Keycloak | +| M8-T1 | Keycloak-Objekte **idempotent per Ansible** (Rolle `keycloak_realm_config` im CT-102-Projekt, Admin-REST-API via Service Account). **Einmaliger Bootstrap (Operator, Admin-UI `https://auth.ghostnet.selfhost.eu`, Realm-Dropdown = `Ghost.net`):** Clients → Create client: ID `ansible-keycloak-admin`, publicClient OFF, **Service accounts roles ON**, Standard flow OFF; Service account roles → **Assign role** → `realm-management`: `manage-realm`, `manage-clients`, `manage-users`, `view-users` (Fallback: Users → `service-account-ansible-keycloak-admin` → Role mapping → Assign role → realm-management); Credentials → Secret kopieren; auf CT 102: `install -d -m 0700 /etc/keycloak-ansible && install -m 0600 /dev/null /etc/keycloak-ansible/client_secret` und Secret eintragen (nie in Git/Chat). **Danach alles per Playbook:** `cd proxmox/lxc/ct-102-keycloak/ansible && ansible-playbook -i inventories/production playbooks/site.yml` — synct Realm-Rolle `gnai-research-user`, Client `gnai-research` (confidential, Standard flow only, Redirect `https://research.ghostnet.selfhost.eu/oauth2/callback`, Web Origin `https://research.ghostnet.selfhost.eu`, post-logout `https://research.ghostnet.selfhost.eu/*`), Mapper `realm-roles-to-groups` (dedicated scope, Claim `groups`, in ID/access token + userinfo) und Role-Mapping für `ghost`; zweiter Lauf `changed=0`. Spec in `roles/keycloak_realm_config/defaults/main.yml`, Doku im Rollen-README. **Test nach M8-T3:** `curl -sI https://research.ghostnet.selfhost.eu/` → 302 zu `auth.ghostnet.selfhost.eu/...login...client_id=gnai-research`. | CT 102 (Bootstrap einmalig UI + Secret-Datei, danach site.yml) | Keycloak | | M8-T2 | oauth2-proxy v7.15.5 (quay.io, digest-gepinnt) als Quadlet auf CT 103 in eigenem Podman-Netz mit NPM, **kein** publish; Env: provider `oidc`, issuer, client-id/secret + cookie-secret als Podman-Secrets, `--email-domain`, `--whitelist-domain=.ghostnet.selfhost.eu`, `--allowed-group=gnai-research-user`, `--oidc-groups-claim=groups`, `--skip-auth-regex=^/ping$`, `--reverse-proxy=true`, `--set-xauthrequest` | CT 103, Rolle im CT-103-Ansible-Projekt | IAP | | M8-T3 | NPM-vHost `research.ghostnet.selfhost.eu` (LE-TLS, Force SSL) mit Advanced-Snippet `auth_request /oauth2/auth` + interne `location /oauth2/`; Split-DNS-Record auf CT 100; NPM-API via CT-103-Ansible | CT 103 + CT 100 | Ingress | | M8-T4 | GPT Researcher (digest-gepinnt) als Quadlet auf `ghostnet-ki` im Production-Netz, Port `10.0.0.90:8085` (Firewall: nur NPM); Env: `OPENAI_BASE_URL=http://llama-cpp:8080/v1`, `OPENAI_API_KEY`=Placeholder-Secret, `FAST_LLM`/`SMART_LLM`=Production-Alias, Search via SearXNG (custom retriever, `SEARXNG_URL=http://searxng:8080`) | `llm-server/llm/ansible` (neue Rolle `gpt_researcher`, Playbook `research.yml`) | Harness | diff --git a/proxmox/lxc/ct-102-keycloak/ansible/roles/keycloak_realm_config/README.md b/proxmox/lxc/ct-102-keycloak/ansible/roles/keycloak_realm_config/README.md index 9abb2b7..4c9fec3 100644 --- a/proxmox/lxc/ct-102-keycloak/ansible/roles/keycloak_realm_config/README.md +++ b/proxmox/lxc/ct-102-keycloak/ansible/roles/keycloak_realm_config/README.md @@ -10,8 +10,11 @@ Redirect-Uris/Web-Origits, `groups`-Claim-Mapper, Role-Mapping für `ghost`). 1. **Clients → Create client**: Client ID `ansible-keycloak-admin`, publicClient **OFF** (confidential), **Service accounts roles ON**, Standard flow OFF. -2. Tab **Service account roles** → Client role `realm-management` → - anhaken: `manage-realm`, `manage-clients`, `manage-users`, `view-users`. +2. Tab **Service account roles** → **Assign role** → Client-Rollen + `realm-management` anhaken: `manage-realm`, `manage-clients`, `manage-users`, + `view-users`. (Falls die Liste dort leer bleibt: Users → + `service-account-ansible-keycloak-admin` → Role mapping → Assign role → + Filter `realm-management` → dieselben vier Rollen.) 3. Tab **Credentials** → Client Secret kopieren. 4. Auf CT 102 (als root): ```