M6: open_webui-Rolle OIDC-vorbereitet (#5)
Co-authored-by: vibe-agent <vibe-agent@ghostnet.local>
This commit was merged in pull request #5.
This commit is contained in:
@@ -34,6 +34,19 @@ open_webui_container_port: 8080
|
||||
# Persistent app data (SQLite DB, uploads, cache).
|
||||
open_webui_data_dir: /var/lib/ghostnet-ai/production/openwebui-data
|
||||
|
||||
# OIDC phase (M6 public route via NPM + Keycloak). Disabled for the
|
||||
# internal phase; enable together with the Keycloak client
|
||||
# `gnai-openwebui` and the NPM proxy host chat.ghostnet.selfhost.eu.
|
||||
# The client secret is created as a Podman secret by the operator (the
|
||||
# Keycloak-generated value never enters git):
|
||||
# runuser -u gnai-production -- podman secret create \
|
||||
# openwebui-oidc-client-secret -
|
||||
open_webui_oidc_enabled: false
|
||||
open_webui_oidc_client_id: gnai-openwebui
|
||||
open_webui_oidc_client_secret_secret: openwebui-oidc-client-secret
|
||||
open_webui_oidc_provider_url: https://auth.ghostnet.selfhost.eu/realms/Ghost.net/.well-known/openid-configuration
|
||||
open_webui_public_url: https://chat.ghostnet.selfhost.eu
|
||||
|
||||
# Internal phase: local auth with first-user-is-admin. The public OIDC
|
||||
# phase (M6 route) switches ENABLE_OAUTH_* on and disables local signup.
|
||||
open_webui_env:
|
||||
|
||||
@@ -122,6 +122,36 @@
|
||||
when: open_webui_engine_secret_exists.rc == 1
|
||||
no_log: true
|
||||
|
||||
- name: Check whether the OIDC client secret exists (required when OIDC is enabled)
|
||||
ansible.builtin.command:
|
||||
argv:
|
||||
- /usr/sbin/runuser
|
||||
- --user
|
||||
- "{{ open_webui_user }}"
|
||||
- --
|
||||
- /usr/bin/env
|
||||
- "HOME={{ open_webui_home }}"
|
||||
- "XDG_RUNTIME_DIR=/run/user/{{ open_webui_uid }}"
|
||||
- /usr/bin/podman
|
||||
- secret
|
||||
- exists
|
||||
- "{{ open_webui_oidc_client_secret_secret }}"
|
||||
chdir: "{{ open_webui_home }}"
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
check_mode: false
|
||||
register: open_webui_oidc_secret_exists
|
||||
|
||||
- name: Require the OIDC client secret when OIDC is enabled
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
open_webui_oidc_enabled=true requires the Podman secret
|
||||
{{ open_webui_oidc_client_secret_secret }} (operator creates it from
|
||||
the Keycloak client secret, never in git).
|
||||
when:
|
||||
- open_webui_oidc_enabled | bool
|
||||
- open_webui_oidc_secret_exists.rc != 0
|
||||
|
||||
- name: Render the OpenWebUI quadlet
|
||||
ansible.builtin.template:
|
||||
src: open-webui.container.j2
|
||||
|
||||
@@ -16,6 +16,16 @@ Secret={{ open_webui_engine_api_key_secret }},type=env,target=OPENAI_API_KEY
|
||||
{% for key, value in open_webui_env.items() %}
|
||||
Environment={{ key }}={{ value }}
|
||||
{% endfor %}
|
||||
{% if open_webui_oidc_enabled %}
|
||||
Environment=WEBUI_URL={{ open_webui_public_url }}
|
||||
Environment=ENABLE_OAUTH_SIGNUP=True
|
||||
Environment=ENABLE_SIGNUP=False
|
||||
Environment=OPENID_PROVIDER_URL={{ open_webui_oidc_provider_url }}
|
||||
Environment=OAUTH_CLIENT_ID={{ open_webui_oidc_client_id }}
|
||||
Environment=OAUTH_SCOPES=openid email profile
|
||||
Environment=OAUTH_PROVIDER_NAME=Keycloak
|
||||
Secret={{ open_webui_oidc_client_secret_secret }},type=env,target=OAUTH_CLIENT_SECRET
|
||||
{% endif %}
|
||||
|
||||
[Service]
|
||||
Restart=on-failure
|
||||
|
||||
Reference in New Issue
Block a user