summaryrefslogtreecommitdiff
path: root/hosted-kolab/15-adjust-configuration.sh
diff options
context:
space:
mode:
Diffstat (limited to 'hosted-kolab/15-adjust-configuration.sh')
-rwxr-xr-xhosted-kolab/15-adjust-configuration.sh99
1 files changed, 99 insertions, 0 deletions
diff --git a/hosted-kolab/15-adjust-configuration.sh b/hosted-kolab/15-adjust-configuration.sh
new file mode 100755
index 0000000..48c3821
--- /dev/null
+++ b/hosted-kolab/15-adjust-configuration.sh
@@ -0,0 +1,99 @@
+#!/bin/bash
+
+. ./settings.sh
+
+rm -rf /etc/kolab/kolab.conf.orig
+cp /etc/kolab/kolab.conf /etc/kolab/kolab.conf.orig
+
+sed -r -i \
+ -e "s/^domain_base_dn.*$/domain_base_dn = ${domain_base_dn}/g" \
+ -e 's/^primary_mail.*/primary_mail = %(uid)s@%(domain)s/g' \
+ -e '/^secondary_mail/,+10d' \
+ -e '/^primary_mail/ a\
+daemon_rcpt_policy = False' \
+ -e '/kolab_wap/ a\
+login_filter = (uid=%U@%d)\
+devel_mode = 1\
+debug_mode = trace' \
+ -e 's/^auth_attributes.*$/auth_attributes = uid/g' \
+ -e 's/^result_attribute.*$/result_attribute = uid/g' \
+ -e 's/^domain_filter.*$/domain_filter = (\&(objectclass=domainrelatedobject)(associateddomain=*))/g' \
+ -e 's/^user_filter.*$/user_filter = (|(\&(uid=cyrus-admin)(!(objectclass=kolabinetorgperson)))(objectclass=kolabinetorgperson))/g' \
+ /etc/kolab/kolab.conf
+
+if [ -z "$(grep ^auth_mechanism /etc/kolab/kolab.conf)" ]; then
+ echo "WARNING: No more auth_mechanism setting?"
+ sed -i -e '/\[kolab\]/ a\
+auth_mechanism = ldap' \
+ /etc/kolab/kolab.conf
+fi
+
+sed -r -i \
+ -e 's/^ldap_filter:.*$/ldap_filter: (|(\&(uid=cyrus-admin)(uid=%u)(objectclass=inetorgperson)(!(objectclass=kolabinetorgperson)))(\&(uid=%u)(objectclass=kolabinetorgperson)))/g' \
+ -e 's/^ldap_base:.*$/ldap_base: dc=example,dc=org/g' \
+ -e 's/^ldap_user_attribute:.*$/ldap_user_attribute: uid/g' \
+ -e 's/^ldap_group_base:.*%$/ldap_group_base: dc=example,dc=org/g' \
+ -e 's/^ldap_group_filter:.*$/ldap_group_filter: (\&(objectclass=kolabgroupofuniquenames)(mail=%u))/g' \
+ -e 's/^ldap_member_base:.*$/ldap_member_base: dc=mykolab,dc=com/g' \
+ -e 's/^ldap_member_method:.*$/ldap_member_method: filter/g' \
+ -e 's/^ldap_member_filter:.*$/ldap_member_filter: (uniquemember=%D)/g' \
+ -e 's/^ldap_member_attribute:.*$/ldap_member_attribute: mail/g' \
+ -e '/^ldap_domain_base_dn/d' \
+ -e '/^debug:/d' \
+ -e '/^auditlog:/d' \
+ -e '/^chatty:/d' \
+ -e '/^ldap_member_attribute:.*$/ a\
+ldap_domain_base_dn: ou=Domains,dc=example,dc=org' \
+ /etc/imapd.conf
+
+echo "debug: 1" >> /etc/imapd.conf
+echo "auditlog: 1" >> /etc/imapd.conf
+echo "chatty: 1" >> /etc/imapd.conf
+
+service cyrus-imapd restart
+
+service kolabd restart
+service kolab-saslauthd restart
+
+if [ ! -d "/usr/share/kolab-hkccp/" ]; then
+ git clone ssh://git@git.kolab.org/diffusion/H/hkccp.git /usr/share/kolab-hkccp/
+ mkdir -p /usr/share/kolab-hkccp/temp/session
+ chown apache:apache /usr/share/kolab-hkccp/temp/session
+fi
+
+rm -rf /usr/share/kolab-hkccp/config/config.ini
+cp /usr/share/kolab-hkccp/config/config.ini.kolab /usr/share/kolab-hkccp/config/config.ini
+
+pushd /usr/share/kolab-hkccp/
+uri=$(grep ^cache_uri /etc/kolab/kolab.conf | awk '{print $3}')
+service_auth_pw=$(grep ^service_bind_pw /etc/kolab/kolab.conf | awk '{print $3}')
+
+sed -r -i \
+ -e "s|^dsn =.*$|dsn = $uri|g" \
+ -e "s|^dsnr =.*$|dsnr = $uri|g" \
+ -e "s|^service_auth_pw =.*$|service_auth_pw = $service_auth_pw|g" \
+ -e '/^root_dn = / a\
+mgmt_root_dn = "dc=example,dc=org"\
+hosted_root_dn = "dc=mykolab,dc=com"' \
+ config/config.ini
+
+password=$(grep ^cache_uri /etc/kolab/kolab.conf | awk '{print $3}' | cut -d':' -f3 | cut -d'@' -f1)
+mysql -u kolab --password="${password}" kolab < SQL/mysql.sql
+popd
+
+pushd /usr/share/kolab-webadmin/
+php sample-insert-hosted-user_types.php
+popd
+
+pushd /usr/share/kolab-hkccp
+
+mkdir -p temp/session/
+chown apache temp/session/
+
+#php bin/backend.php adduser doe@example.org --tenant 1 --verbose
+#php bin/backend.php adduser kanarip@kanarip.com --tenant 1 --verbose
+#php bin/backend.php adduser doe@kolabnow.com --tenant 1 --verbose
+#php bin/backend.php adduser sixpack@kolabnow.com --tenant 1 --verbose
+#php bin/backend.php adduser doe@mykolab.com --tenant 1 --verbose
+popd
+