From e2a2026c3d7baac2f05fd679336521737beb9be3 Mon Sep 17 00:00:00 2001 From: George Wu Date: Wed, 18 Feb 2026 19:25:53 -0800 Subject: [PATCH 1/2] fix(admin): populate OIDC settings in admin panel from environment variables The get_oidc_settings() method was reading directly from the database only, without applying environment variable overrides. Now it uses load_effective_oidc_config() which properly applies env var overrides (OXICLOUD_OIDC_*), ensuring the admin panel accurately reflects the runtime configuration. --- .../services/admin_settings_service.rs | 32 +++++++------------ 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/src/application/services/admin_settings_service.rs b/src/application/services/admin_settings_service.rs index 92d1d321..6803b93a 100644 --- a/src/application/services/admin_settings_service.rs +++ b/src/application/services/admin_settings_service.rs @@ -149,7 +149,6 @@ impl AdminSettingsService { /// Get OIDC settings for display in admin UI (secrets masked). pub async fn get_oidc_settings(&self) -> Result { let db = self.settings_repo.get_by_category("oidc").await?; - let d = OidcConfig::default(); let has_secret = db .get("oidc.client_secret") @@ -159,28 +158,19 @@ impl AdminSettingsService { .map(|s| !s.is_empty()) .unwrap_or(false); + // Load effective config with env var overrides applied + let effective = self.load_effective_oidc_config().await?; + Ok(OidcSettingsDto { - enabled: db - .get("oidc.enabled") - .and_then(|v| v.parse().ok()) - .unwrap_or(d.enabled), - issuer_url: db.get("oidc.issuer_url").cloned().unwrap_or_default(), - client_id: db.get("oidc.client_id").cloned().unwrap_or_default(), + enabled: effective.enabled, + issuer_url: effective.issuer_url, + client_id: effective.client_id, client_secret_set: has_secret, - scopes: db.get("oidc.scopes").cloned().unwrap_or(d.scopes), - auto_provision: db - .get("oidc.auto_provision") - .and_then(|v| v.parse().ok()) - .unwrap_or(d.auto_provision), - admin_groups: db.get("oidc.admin_groups").cloned().unwrap_or_default(), - disable_password_login: db - .get("oidc.disable_password_login") - .and_then(|v| v.parse().ok()) - .unwrap_or(d.disable_password_login), - provider_name: db - .get("oidc.provider_name") - .cloned() - .unwrap_or(d.provider_name), + scopes: effective.scopes, + auto_provision: effective.auto_provision, + admin_groups: effective.admin_groups, + disable_password_login: effective.disable_password_login, + provider_name: effective.provider_name, callback_url: self.callback_url(), env_overrides: self.get_env_overrides(), }) From 5738ddbb548d79b870e7d6a266c18dcacb128de1 Mon Sep 17 00:00:00 2001 From: George Wu Date: Wed, 18 Feb 2026 19:41:43 -0800 Subject: [PATCH 2/2] fix(admin): populate OIDC settings in admin panel from environment variables - Use load_effective_oidc_config() to get OIDC settings, which applies env var overrides - Use effective.redirect_uri for callback_url instead of calculated value from server_base_url - This ensures the admin panel shows the correct OXICLOUD_OIDC_REDIRECT_URI value --- src/application/services/admin_settings_service.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/application/services/admin_settings_service.rs b/src/application/services/admin_settings_service.rs index 6803b93a..e8bb104e 100644 --- a/src/application/services/admin_settings_service.rs +++ b/src/application/services/admin_settings_service.rs @@ -171,7 +171,7 @@ impl AdminSettingsService { admin_groups: effective.admin_groups, disable_password_login: effective.disable_password_login, provider_name: effective.provider_name, - callback_url: self.callback_url(), + callback_url: effective.redirect_uri.clone(), env_overrides: self.get_env_overrides(), }) }