[SOGo] use bash script for ldap plist template
This commit is contained in:
parent
b3e26e14ef
commit
132e37bfec
1
.gitignore
vendored
1
.gitignore
vendored
@ -44,6 +44,7 @@ data/conf/rspamd/local.d/*
|
|||||||
data/conf/rspamd/override.d/*
|
data/conf/rspamd/override.d/*
|
||||||
data/conf/sogo/custom-theme.js
|
data/conf/sogo/custom-theme.js
|
||||||
data/conf/sogo/plist_ldap
|
data/conf/sogo/plist_ldap
|
||||||
|
data/conf/sogo/plist_ldap.sh
|
||||||
data/conf/sogo/sieve.creds
|
data/conf/sogo/sieve.creds
|
||||||
data/conf/sogo/sogo-full.svg
|
data/conf/sogo/sogo-full.svg
|
||||||
data/gitea/
|
data/gitea/
|
||||||
|
|||||||
@ -107,7 +107,7 @@ while read -r line gal
|
|||||||
</dict>" >> /var/lib/sogo/GNUstep/Defaults/sogod.plist
|
</dict>" >> /var/lib/sogo/GNUstep/Defaults/sogod.plist
|
||||||
# Generate alternative LDAP authentication dict, when SQL authentication fails
|
# Generate alternative LDAP authentication dict, when SQL authentication fails
|
||||||
# This will nevertheless read attributes from LDAP
|
# This will nevertheless read attributes from LDAP
|
||||||
line=${line} envsubst < /etc/sogo/plist_ldap >> /var/lib/sogo/GNUstep/Defaults/sogod.plist
|
/etc/sogo/plist_ldap.sh ${line} ${gal} >> /var/lib/sogo/GNUstep/Defaults/sogod.plist
|
||||||
echo " </array>
|
echo " </array>
|
||||||
</dict>" >> /var/lib/sogo/GNUstep/Defaults/sogod.plist
|
</dict>" >> /var/lib/sogo/GNUstep/Defaults/sogod.plist
|
||||||
done < <(mysql --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS} ${DBNAME} -e "SELECT domain, CASE gal WHEN '1' THEN 'YES' ELSE 'NO' END AS gal FROM domain;" -B -N)
|
done < <(mysql --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS} ${DBNAME} -e "SELECT domain, CASE gal WHEN '1' THEN 'YES' ELSE 'NO' END AS gal FROM domain;" -B -N)
|
||||||
|
|||||||
62
data/conf/sogo/plist_ldap → data/conf/sogo/plist_ldap.sh
Normal file → Executable file
62
data/conf/sogo/plist_ldap → data/conf/sogo/plist_ldap.sh
Normal file → Executable file
@ -1,28 +1,34 @@
|
|||||||
<!--
|
#!/bin/bash
|
||||||
<example>
|
|
||||||
<key>canAuthenticate</key>
|
domain="$1"
|
||||||
<string>YES</string>
|
gal_status="$2"
|
||||||
<key>id</key>
|
|
||||||
<string>${line}_ldap</string>
|
echo '
|
||||||
<key>isAddressBook</key>
|
<!--
|
||||||
<string>NO</string>
|
<example>
|
||||||
<key>IDFieldName</key>
|
<key>canAuthenticate</key>
|
||||||
<string>mail</string>
|
<string>YES</string>
|
||||||
<key>UIDFieldName</key>
|
<key>id</key>
|
||||||
<string>uid</string>
|
<string>'"${domain}_ldap"'</string>
|
||||||
<key>bindFields</key>
|
<key>isAddressBook</key>
|
||||||
<array>
|
<string>'"${gal_status}"'</string>
|
||||||
<string>mail</string>
|
<key>IDFieldName</key>
|
||||||
</array>
|
<string>mail</string>
|
||||||
<key>type</key>
|
<key>UIDFieldName</key>
|
||||||
<string>ldap</string>
|
<string>uid</string>
|
||||||
<key>bindDN</key>
|
<key>bindFields</key>
|
||||||
<string>cn=admin,dc=example,dc=local</string>
|
<array>
|
||||||
<key>bindPassword</key>
|
<string>mail</string>
|
||||||
<string>password</string>
|
</array>
|
||||||
<key>baseDN</key>
|
<key>type</key>
|
||||||
<string>ou=People,dc=example,dc=local</string>
|
<string>ldap</string>
|
||||||
<key>hostname</key>
|
<key>bindDN</key>
|
||||||
<string>ldap://1.2.3.4:389</string>
|
<string>cn=admin,dc=example,dc=local</string>
|
||||||
</example>
|
<key>bindPassword</key>
|
||||||
-->
|
<string>password</string>
|
||||||
|
<key>baseDN</key>
|
||||||
|
<string>ou=People,dc=example,dc=local</string>
|
||||||
|
<key>hostname</key>
|
||||||
|
<string>ldap://1.2.3.4:389</string>
|
||||||
|
</example>
|
||||||
|
-->'
|
||||||
@ -190,7 +190,7 @@ services:
|
|||||||
- phpfpm
|
- phpfpm
|
||||||
|
|
||||||
sogo-mailcow:
|
sogo-mailcow:
|
||||||
image: mailcow/sogo:nightly-20240208
|
image: mailcow/sogo:nightly-20240220
|
||||||
environment:
|
environment:
|
||||||
- DBNAME=${DBNAME}
|
- DBNAME=${DBNAME}
|
||||||
- DBUSER=${DBUSER}
|
- DBUSER=${DBUSER}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user