Commit 45b6bc59 authored by zauberstuhl's avatar zauberstuhl
Browse files

Replace nanolist with microlist

parent c0ef59d6
Pipeline #3412 failed with stages
in 4 minutes and 16 seconds
FROM golang
RUN go get git.feneas.org/feneas/infrastructure/microlist
WORKDIR $GOPATH/src/git.feneas.org/feneas/infrastructure/microlist
RUN go build -o microlist
RUN mv microlist /tmp/microlist
FROM tvial/docker-mailserver:release-v6.1.0
RUN apt-get update
......@@ -14,13 +21,12 @@ ADD sa-learn-ham.sh /usr/lib/dovecot/sieve-pipe/sa-learn-ham.sh
ADD sa-learn-spam.sh /usr/lib/dovecot/sieve-pipe/sa-learn-spam.sh
RUN chmod +x /usr/lib/dovecot/sieve-pipe/sa-learn-*.sh
# add nanolist (mailing list support)
RUN curl -o /usr/local/bin/nanolist \
https://git.feneas.org/feneas/infrastructure/nanolist/raw/master/dist/nanolist
ADD nanolist.ini /etc/nanolist.ini
RUN touch /var/log/nanolist.log
RUN chmod +x /usr/local/bin/nanolist
RUN chmod 777 /var/log/nanolist.log
# add microlist (mailing list support)
COPY --from=0 /tmp/microlist /usr/local/bin/microlist
ADD microlist.ini /etc/microlist.ini
RUN touch /var/log/microlist.log
RUN chmod +x /usr/local/bin/microlist
RUN chmod 777 /var/log/microlist.log
# add expand docker secret script
ADD env_secrets_expand.sh /env_secrets_expand.sh
......
log = /var/log/nanolist.log
log_file = /var/log/microlist.log
# Address nanolist should receive user commands on
# Address microlist should receive user commands on
postmaster_address = "admins@feneas.org"
command_address = "lists@feneas.org"
prefix_address = "%s@feneas.org"
# SMTP details for sending mail
......@@ -11,7 +10,7 @@ smtp_port = RELAY_PORT
smtp_username = "RELAY_USER"
smtp_password = "RELAY_PASSWORD"
ldap_host = "ldaps://LDAP_SERVER_HOST:636"
ldap_host = "ldap://LDAP_SERVER_HOST:389"
ldap_base = "ou=lists,LDAP_SEARCH_BASE"
ldap_bind_dn = "LDAP_BIND_DN"
ldap_bind_pw = "LDAP_BIND_PW"
......@@ -25,20 +25,20 @@
configomat.sh "LDAP_" "${f}"
done
+ notify 'inf' "Patching /etc/postfix/ldap-groups.cf for nanolist"
+ notify 'inf' "Patching /etc/postfix/ldap-groups.cf for microlist"
+ LDAP_RESULT_ATTRIBUTE=sn \
+ LDAP_QUERY_FILTER=$LDAP_QUERY_FILTER_GROUP \
+ configomat.sh "LDAP_" "/etc/postfix/ldap-groups.cf"
+
+ notify 'inf' "Configuring nanolist LDAP"
+ sed -i 's/RELAY_HOST/'$RELAY_HOST'/' /etc/nanolist.ini
+ sed -i 's/RELAY_PORT/'$RELAY_PORT'/' /etc/nanolist.ini
+ sed -i 's/RELAY_USER/'$RELAY_USER'/' /etc/nanolist.ini
+ sed -i 's#RELAY_PASSWORD#'$RELAY_PASSWORD'#' /etc/nanolist.ini
+ sed -i 's/LDAP_SERVER_HOST/'$LDAP_SERVER_HOST'/' /etc/nanolist.ini
+ sed -i 's/LDAP_SEARCH_BASE/'$LDAP_SEARCH_BASE'/' /etc/nanolist.ini
+ sed -i 's/LDAP_BIND_DN/'$LDAP_BIND_DN'/' /etc/nanolist.ini
+ sed -i 's/LDAP_BIND_PW/'$LDAP_BIND_PW'/' /etc/nanolist.ini
+ notify 'inf' "Configuring microlist LDAP"
+ sed -i 's/RELAY_HOST/'$RELAY_HOST'/' /etc/microlist.ini
+ sed -i 's/RELAY_PORT/'$RELAY_PORT'/' /etc/microlist.ini
+ sed -i 's/RELAY_USER/'$RELAY_USER'/' /etc/microlist.ini
+ sed -i 's#RELAY_PASSWORD#'$RELAY_PASSWORD'#' /etc/microlist.ini
+ sed -i 's/LDAP_SERVER_HOST/'$LDAP_SERVER_HOST'/' /etc/microlist.ini
+ sed -i 's/LDAP_SEARCH_BASE/'$LDAP_SEARCH_BASE'/' /etc/microlist.ini
+ sed -i 's/LDAP_BIND_DN/'$LDAP_BIND_DN'/' /etc/microlist.ini
+ sed -i 's/LDAP_BIND_PW/'$LDAP_BIND_PW'/' /etc/microlist.ini
+
notify 'inf' "Configuring dovecot LDAP"
......@@ -58,7 +58,7 @@
notify 'inf' "Configuring root alias"
- echo "root: ${POSTMASTER_ADDRESS}" > /etc/aliases
+ echo "root: ${POSTMASTER_ADDRESS}
+nanolist: \"| /usr/local/bin/nanolist message\"" > /etc/aliases
+nanolist: \"| /usr/local/bin/microlist -config /etc/microlist.ini message\"" > /etc/aliases
postalias /etc/aliases
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment