From 4a9abcc08a1fb91843768fa61ccc84fd7bd8e72f Mon Sep 17 00:00:00 2001 From: aimee-889 Date: Thu, 26 Sep 2024 11:09:22 +0200 Subject: [PATCH] try adding the schema --- .../templates/configmap-config-script.yaml | 21 +++++++++++++++++-- .../templates/statefulset.yaml | 1 + 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/charts/dbildungs-iam-ldap/templates/configmap-config-script.yaml b/charts/dbildungs-iam-ldap/templates/configmap-config-script.yaml index 6fa8f6b..5e5d54c 100644 --- a/charts/dbildungs-iam-ldap/templates/configmap-config-script.yaml +++ b/charts/dbildungs-iam-ldap/templates/configmap-config-script.yaml @@ -21,7 +21,9 @@ data: ldapmodify -Y EXTERNAL -H ldapi:/// -f /ldap-configuration/modify/modify.ldif # no sure why this sleep is needed again - but it is sleep 10 - /bin/bash /script/02.sh + # /bin/bash /script/02.sh + ldapapply -Y EXTERNAL -H ldapi:/// -f /script/schemas.ldif + # this script is needed so that Helm Chart is stable if persistence is enabled # it applies changes if they are new, but modifies them if they already exist @@ -69,4 +71,19 @@ data: # Process the last entry in the file if [[ -n "$current_dn" ]]; then process_entry "$current_dn" "$current_entry" - fi \ No newline at end of file + fi + + + schemas.ldif: | + # add custom schema + dn: cn=ucsMail,cn=schema,cn=config + objectClass: olcSchemaConfig + cn: ucsMail + olcAttributeTypes: ( 1.3.6.1.4.1.10176.1010.1.1 NAME 'mailPrimaryAddress' DESC 'Primary mailaddresses for the user' EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) + olcAttributeTypes: ( 1.3.6.1.4.1.10176.1010.1.2 NAME 'mailAlternativeAddress' DESC 'Secondary (alias) mailaddresses for the same user' EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) + olcAttributeTypes: ( 1.3.6.1.4.1.10176.1010.1.3 NAME 'mailGlobalSpamFolder'DESC 'Move Spam to global spam folder instead of local spam folder' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) + olcAttributeTypes: ( 1.3.6.1.4.1.10176.1010.1.47 NAME 'mailForwardAddress'DESC 'External mail addresses to forward the users emails to' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) + olcAttributeTypes: ( 1.3.6.1.4.1.10176.1010.1.51 NAME 'mailForwardCopyToSelf' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{10} SINGLE-VALUE ) + olcAttributeTypes: ( 1.3.6.1.4.1.10176.1010.1.60 NAME 'univentionMailHomeServer' DESC 'home server of users mailbox' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} SINGLE-VALUE ) + olcAttributeTypes: ( 1.3.6.1.4.1.10176.1010.1.92 NAME 'univentionMailUserQuota' DESC 'Mailbox hard quota limit in MB' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) + olcObjectClasses: ( 1.3.6.1.4.1.10176.1010.2.1 NAME 'univentionMail' DESC 'Univention Mail Preferences' SUP top AUXILIARY MUST uid MAY ( univentionMailHomeServer $ mailPrimaryAddress $ mailAlternativeAddress $ mailGlobalSpamFolder $ univentionMailUserQuota $ mailForwardAddress $ mailForwardCopyToSelf ) ) \ No newline at end of file diff --git a/charts/dbildungs-iam-ldap/templates/statefulset.yaml b/charts/dbildungs-iam-ldap/templates/statefulset.yaml index 1f9a26c..3dc00bd 100644 --- a/charts/dbildungs-iam-ldap/templates/statefulset.yaml +++ b/charts/dbildungs-iam-ldap/templates/statefulset.yaml @@ -65,6 +65,7 @@ spec: fi cp /tmp-init-scripts/01.sh /script/01.sh && cp /tmp-init-scripts/02.sh /script/02.sh && + cp /tmp-init-scripts/schemas.ldif /script/schemas.ldif chmod +x /script/01.sh chmod +x /script/02.sh {{- if .Values.global.existingSecret }}