1
0
mirror of https://github.com/zokradonh/kopano-docker synced 2025-06-07 16:06:14 +00:00
kopano-docker/owncloud/99-ldap.sh
Felix Bartels d531ac4b1c
Fixes (#283)
* make readme of owncloud more clear
* clarify setup.sh
* make user23 an admin by default
* remove hard depenency on reg
* add completed message
* set more attributes on startup

Signed-off-by: Felix Bartels <felix@host-consultants.de>

* use cn instead of uid
* add config for owncloud phoenix ui and openid plugin
* add override for experimental feature endpoint
* import kweb-calendar.cfg
* experimental endpoint is yes/no
* grapi also needs the ability to run insecure
* grapi needs to resolve the domain, therefore needs to be in the web network
2019-11-12 22:23:38 +01:00

38 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
echo "Configuring LDAP for kopano-docker"
set -x
occ app:enable user_ldap
occ ldap:show-config
if [[ "$(occ ldap:show-config)" == "" ]]; then
su -c "php occ ldap:create-empty-config" www-data
fi
ldapHost=${LDAP_SERVER%:*}
ldapPort=${LDAP_SERVER##*:}
occ ldap:set-config s01 ldapHost ${ldapHost}
occ ldap:set-config s01 ldapPort ${ldapPort}
occ ldap:set-config s01 ldapAgentName ${LDAP_BIND_DN}
occ ldap:set-config s01 ldapAgentPassword ${LDAP_BIND_PW}
occ ldap:set-config s01 ldapBase ${LDAP_SEARCH_BASE}
occ ldap:set-config s01 ldapUserFilter "(|(objectclass=kopano-user))"
occ ldap:set-config s01 ldapLoginFilter "(&(|(objectclass=kopano-user))(uid=%uid))"
occ ldap:set-config s01 ldapGroupFilter "(&(|(objectclass=kopano-group)))"
occ ldap:set-config s01 ldapEmailAttribute "mail"
occ ldap:set-config s01 ldapExpertUUIDUserAttr "entryuuid"
occ ldap:set-config s01 ldapUserDisplayName "cn"
occ ldap:set-config s01 ldapUserFilter "(|(objectclass=posixAccount))"
occ ldap:set-config s01 ldapConfigurationActive 1
/usr/bin/occ user:sync -m disable "OCA\User_LDAP\User_Proxy"
cat << EOF >| /etc/cron.d/sync
*/10 * * * * root /usr/bin/occ user:sync -m disable 'OCA\User_LDAP\User_Proxy'
EOF
true