aboutsummaryrefslogtreecommitdiff
path: root/tests/instrumentation/docker
diff options
context:
space:
mode:
authorQuentin <quentin@dufour.io>2024-01-02 22:44:29 +0000
committerQuentin <quentin@dufour.io>2024-01-02 22:44:29 +0000
commitb9a0c1e6eced036eb71e8221a4f236f72832fec2 (patch)
treec498a7a2a5833f2c6f27d4ba97894747f9d454c0 /tests/instrumentation/docker
parent6ff3c6f71efd802da422a371e6168ae528fb2ddc (diff)
parentc9a33c080d39d4a2b269e3c8f166a708b6606da5 (diff)
downloadaerogramme-b9a0c1e6eced036eb71e8221a4f236f72832fec2.tar.gz
aerogramme-b9a0c1e6eced036eb71e8221a4f236f72832fec2.zip
Merge pull request 'Implement imap-flow' (#34) from refactor/imap-flow into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/aerogramme/pulls/34
Diffstat (limited to 'tests/instrumentation/docker')
-rw-r--r--tests/instrumentation/docker/cyrus/Dockerfile15
-rwxr-xr-xtests/instrumentation/docker/cyrus/entrypoint.sh15
-rw-r--r--tests/instrumentation/docker/maddy/Dockerfile16
-rwxr-xr-xtests/instrumentation/docker/maddy/entrypoint.sh9
4 files changed, 55 insertions, 0 deletions
diff --git a/tests/instrumentation/docker/cyrus/Dockerfile b/tests/instrumentation/docker/cyrus/Dockerfile
new file mode 100644
index 0000000..67b4e11
--- /dev/null
+++ b/tests/instrumentation/docker/cyrus/Dockerfile
@@ -0,0 +1,15 @@
+FROM debian:buster
+
+ARG DEBIAN_FRONTEND=noninteractive
+RUN apt update && \
+ apt install -y cyrus-imapd cyrus-pop3d cyrus-nntpd cyrus-caldav cyrus-admin sasl2-bin && \
+ echo "admins: cyrus" >> /etc/imapd.conf && \
+ touch /var/lib/cyrus/tls_sessions.db && \
+ chown cyrus:mail /var/lib/cyrus/tls_sessions.db && \
+ mkdir /run/cyrus && \
+ chown -R cyrus:mail /run/cyrus
+
+COPY entrypoint.sh /usr/local/bin/entrypoint.sh
+
+CMD [ "/usr/local/bin/entrypoint.sh" ]
+
diff --git a/tests/instrumentation/docker/cyrus/entrypoint.sh b/tests/instrumentation/docker/cyrus/entrypoint.sh
new file mode 100755
index 0000000..c410e9d
--- /dev/null
+++ b/tests/instrumentation/docker/cyrus/entrypoint.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+cyrmaster -D -l 32 -C /etc/imapd.conf -M /etc/cyrus.conf &
+sleep 2
+
+echo cyrus | saslpasswd2 -p cyrus
+echo pass | saslpasswd2 -p test
+
+cyradm -u cyrus -w cyrus 127.0.0.1 <<EOF
+cm user.test
+setaclmailbox user.test test kxtelrswip
+exit
+EOF
+
+wait
diff --git a/tests/instrumentation/docker/maddy/Dockerfile b/tests/instrumentation/docker/maddy/Dockerfile
new file mode 100644
index 0000000..341e398
--- /dev/null
+++ b/tests/instrumentation/docker/maddy/Dockerfile
@@ -0,0 +1,16 @@
+FROM debian:buster as builder
+
+WORKDIR /root
+RUN apt-get update && apt-get install -y openssl && \
+ openssl req -nodes -new -x509 -subj "/C=DW/ST=Sto/L=Ankh-Morpork /O=Unseen University/OU=Library/CN=Ook/emailAddress=ook@ook.ook" -keyout privkey.pem -out fullchain.pem
+
+FROM foxcpp/maddy:0.6.2
+
+COPY --from=builder /root/privkey.pem /data/tls/privkey.pem
+COPY --from=builder /root/fullchain.pem /data/tls/fullchain.pem
+
+ENV MADDY_DOMAIN=example.com MADDY_HOSTNAME=mx.example.com
+
+COPY entrypoint.sh /entrypoint.sh
+
+ENTRYPOINT [ "/entrypoint.sh" ]
diff --git a/tests/instrumentation/docker/maddy/entrypoint.sh b/tests/instrumentation/docker/maddy/entrypoint.sh
new file mode 100755
index 0000000..f875624
--- /dev/null
+++ b/tests/instrumentation/docker/maddy/entrypoint.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+maddy -config /data/maddy.conf run &
+
+sleep 2
+maddyctl creds create --password pass test@example.com
+maddyctl imap-acct create test@example.com
+
+wait