From 6862ff4a632e028fbfbbc18795ba205929177bdc Mon Sep 17 00:00:00 2001 From: Max Erenberg <> Date: Thu, 9 Sep 2021 23:21:22 -0400 Subject: [PATCH] add principal for mail --- .drone/auth1-setup.sh | 4 ++++ .drone/common.sh | 18 ++++++++++++++++++ .drone/data.ldif | 2 +- .drone/mail-setup.sh | 22 ++++++++++++++++++++++ .drone/phosphoric-acid-setup.sh | 17 +++-------------- .drone/uwldap_data.ldif | 12 ++++++------ docker.sh | 9 ++++----- tests/MockSMTPServer.py | 2 ++ tests/ceod_dev.ini | 2 +- 9 files changed, 61 insertions(+), 27 deletions(-) diff --git a/.drone/auth1-setup.sh b/.drone/auth1-setup.sh index 4ef21d1..c8486e8 100755 --- a/.drone/auth1-setup.sh +++ b/.drone/auth1-setup.sh @@ -87,5 +87,9 @@ killall slapd && sleep 0.5 && service slapd start # sync with phosphoric-acid apt install -y netcat-openbsd nc -l 0.0.0.0 9000 +if [ -z "$CI" ]; then + # sync with mail + nc -l 0.0.0.0 9001 +fi sleep infinity diff --git a/.drone/common.sh b/.drone/common.sh index ed91d08..740fc93 100644 --- a/.drone/common.sh +++ b/.drone/common.sh @@ -15,3 +15,21 @@ add_fqdn_to_hosts() { rm /tmp/hosts echo "$ip_addr $hostname.csclub.internal $hostname" >> /etc/hosts } + +sync_with() { + host=$1 + port=9000 + if [ $# -eq 2 ]; then + port=$2 + fi + synced=false + # give it 5 minutes + for i in {1..60}; do + if nc -vz $host $port ; then + synced=true + break + fi + sleep 5 + done + test $synced = true +} diff --git a/.drone/data.ldif b/.drone/data.ldif index 6a50745..48873b1 100644 --- a/.drone/data.ldif +++ b/.drone/data.ldif @@ -151,6 +151,6 @@ dn: cn=exec,ou=Group,dc=csclub,dc=internal objectClass: top objectClass: group objectClass: posixGroup -cn: syscom +cn: exec gidNumber: 10013 uniqueMember: uid=exec1,ou=People,dc=csclub,dc=internal diff --git a/.drone/mail-setup.sh b/.drone/mail-setup.sh index 527698a..42745b2 100755 --- a/.drone/mail-setup.sh +++ b/.drone/mail-setup.sh @@ -6,9 +6,31 @@ set -ex # set FQDN in /etc/hosts add_fqdn_to_hosts $(get_ip_addr $(hostname)) mail +add_fqdn_to_hosts $(get_ip_addr auth1) auth1 . venv/bin/activate python tests/MockMailmanServer.py & python tests/MockSMTPServer.py & +# KERBEROS +export DEBIAN_FRONTEND=noninteractive +apt update +apt install -y krb5-user netcat-openbsd +cp .drone/krb5.conf /etc/krb5.conf + +# sync with auth1 +sync_with auth1 9001 + +rm -f /etc/krb5.keytab +cat <