diff --git a/README.md b/README.md index e5392ca3..11014e49 100644 --- a/README.md +++ b/README.md @@ -187,7 +187,9 @@ stringData: ### Allow Local Resource Management -Resources such as users, teams, or organizations are recommended to be managed by the *Platform Provider*. Flag `EDA_ALLOW_LOCAL_RESOURCE_MANAGEMENT` can be toggled to instruct whether EDA can create/modify/delete these resources. The following example allows EDA to manage such resources. It is necessary when EDA is deployed alone. +Resources such as users, teams, or organizations are recommended to be managed by the *Platform Provider*. When EDA is deployed standalone (without `public_base_url`), the operator automatically sets `EDA_ALLOW_LOCAL_RESOURCE_MANAGEMENT` to `True` and clears `EDA_RESOURCE_SERVER__URL`, enabling local user/team/organization management and session-based login. + +If you need to override this behavior in a standalone deployment, use `extra_settings`: ```yaml apiVersion: eda.ansible.com/v1alpha1 @@ -197,7 +199,7 @@ metadata: spec: extra_settings: - setting: EDA_ALLOW_LOCAL_RESOURCE_MANAGEMENT - value: true + value: false ``` ### Database Fields Encryption Configuration diff --git a/dev/eda-cr/eda-k8s-ing.yml b/dev/eda-cr/eda-k8s-ing.yml index b0dd4fdf..81845bed 100644 --- a/dev/eda-cr/eda-k8s-ing.yml +++ b/dev/eda-cr/eda-k8s-ing.yml @@ -25,8 +25,6 @@ spec: # -- Example extra settings extra_settings: - - setting: EDA_ALLOW_LOCAL_RESOURCE_MANAGEMENT - value: true - setting: DEFAULT_PULL_POLICY value: "Always" diff --git a/dev/eda-cr/eda-k8s-nodeport-cr.yml b/dev/eda-cr/eda-k8s-nodeport-cr.yml index 04107cdd..8f603cd0 100644 --- a/dev/eda-cr/eda-k8s-nodeport-cr.yml +++ b/dev/eda-cr/eda-k8s-nodeport-cr.yml @@ -25,8 +25,6 @@ spec: # -- Example extra settings extra_settings: - - setting: EDA_ALLOW_LOCAL_RESOURCE_MANAGEMENT - value: true - setting: DEFAULT_PULL_POLICY value: "Always" diff --git a/dev/eda-cr/eda-openshift-cr.yml b/dev/eda-cr/eda-openshift-cr.yml index be78079b..41fb8293 100644 --- a/dev/eda-cr/eda-openshift-cr.yml +++ b/dev/eda-cr/eda-openshift-cr.yml @@ -28,8 +28,6 @@ spec: # -- Example extra settings extra_settings: - - setting: EDA_ALLOW_LOCAL_RESOURCE_MANAGEMENT - value: true - setting: DEFAULT_PULL_POLICY value: "Always" diff --git a/dev/eda-cr/eda-resource-quota-cr.yml b/dev/eda-cr/eda-resource-quota-cr.yml index cc6defef..263acd42 100644 --- a/dev/eda-cr/eda-resource-quota-cr.yml +++ b/dev/eda-cr/eda-resource-quota-cr.yml @@ -9,10 +9,6 @@ spec: ingress_type: Route no_log: false image_pull_policy: Always - extra_settings: - - setting: EDA_ALLOW_LOCAL_RESOURCE_MANAGEMENT - value: true - api: replicas: 1 resource_requirements: diff --git a/dev/eda-cr/lightweight-eda.yml b/dev/eda-cr/lightweight-eda.yml index 81cfc70d..d1f08f73 100644 --- a/dev/eda-cr/lightweight-eda.yml +++ b/dev/eda-cr/lightweight-eda.yml @@ -5,8 +5,6 @@ metadata: name: eda spec: extra_settings: - - setting: EDA_ALLOW_LOCAL_RESOURCE_MANAGEMENT - value: true - setting: GIT_SSL_NO_VERIFY value: "true" diff --git a/roles/eda/templates/eda.configmap.yaml.j2 b/roles/eda/templates/eda.configmap.yaml.j2 index 55f62f7b..ecb439ff 100644 --- a/roles/eda/templates/eda.configmap.yaml.j2 +++ b/roles/eda/templates/eda.configmap.yaml.j2 @@ -34,6 +34,17 @@ data: EDA_STATIC_URL: /api/eda/static/ + # Resource Server configuration +{% set _user_settings = (extra_settings | default([])) | map(attribute='setting') | map('upper') | list %} +{% if public_base_url | default('') | length == 0 %} +{% if 'EDA_RESOURCE_SERVER__URL' not in _user_settings %} + EDA_RESOURCE_SERVER__URL: "" +{% endif %} +{% if 'EDA_ALLOW_LOCAL_RESOURCE_MANAGEMENT' not in _user_settings %} + EDA_ALLOW_LOCAL_RESOURCE_MANAGEMENT: "True" +{% endif %} +{% endif %} + # Custom user variables {% for item in extra_settings | default([]) %} {{ item.setting | upper }}: "{{ item.value }}"