You server will be available under a main hostname but may expose multiple public
diff --git a/setup/templates/steps/stack/04_replicas.html b/setup/templates/steps/stack/04_replicas.html
new file mode 100644
index 00000000..785125cc
--- /dev/null
+++ b/setup/templates/steps/stack/04_replicas.html
@@ -0,0 +1,28 @@
+{% call macros.panel("info", "Step 5 - Number of replicas for containers") %}
+
Select number of replicas for containers
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{% endcall %}
\ No newline at end of file
From aed80a74faa241a0b37dea79e81c8cbd3f2420e4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tim=20M=C3=B6hlmann?=
Date: Tue, 23 Oct 2018 11:52:15 +0300
Subject: [PATCH 10/62] Rectify decleration of domain_name
---
core/admin/mailu/internal/views/postfix.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core/admin/mailu/internal/views/postfix.py b/core/admin/mailu/internal/views/postfix.py
index f0fbaa5d..894532a3 100644
--- a/core/admin/mailu/internal/views/postfix.py
+++ b/core/admin/mailu/internal/views/postfix.py
@@ -27,7 +27,7 @@ def postfix_alias_map(alias):
@internal.route("/postfix/transport/")
def postfix_transport(email):
- localpart, domain = models.Email.resolve_domain(email)
+ localpart, domain_name = models.Email.resolve_domain(email)
relay = models.Relay.query.get(domain_name) or flask.abort(404)
return flask.jsonify("smtp:[{}]".format(relay.smtp))
From ed81c076f2c635c342e21f08289aa203f00f0b4b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tim=20M=C3=B6hlmann?=
Date: Tue, 23 Oct 2018 11:53:52 +0300
Subject: [PATCH 11/62] Take out "models" path, as we are already in it
---
core/admin/mailu/models.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/core/admin/mailu/models.py b/core/admin/mailu/models.py
index 2845334e..ffe1ad08 100644
--- a/core/admin/mailu/models.py
+++ b/core/admin/mailu/models.py
@@ -224,17 +224,17 @@ class Email(object):
@classmethod
def resolve_domain(cls, email):
localpart, domain_name = email.split('@', 1) if '@' in email else (None, email)
- alternative = models.Alternative.query.get(domain_name)
+ alternative = Alternative.query.get(domain_name)
if alternative:
domain_name = alternative.domain_name
return (localpart, domain_name)
@classmethod
def resolve_destination(cls, localpart, domain_name, ignore_forward_keep=False):
- alias = models.Alias.resolve(localpart, domain_name)
+ alias = Alias.resolve(localpart, domain_name)
if alias:
return alias.destination
- user = models.User.query.get('{}@{}'.format(localpart, domain_name))
+ user = User.query.get('{}@{}'.format(localpart, domain_name))
if user:
if user.forward_enabled:
destination = user.forward_destination
From ae8f928fc0705adf1bde24c6c812ec45d964e6b9 Mon Sep 17 00:00:00 2001
From: Ionut Filip
Date: Tue, 23 Oct 2018 17:07:05 +0300
Subject: [PATCH 12/62] Added project name on docker commands
---
setup/flavors/compose/setup.html | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/setup/flavors/compose/setup.html b/setup/flavors/compose/setup.html
index 0379ba82..3d87a263 100644
--- a/setup/flavors/compose/setup.html
+++ b/setup/flavors/compose/setup.html
@@ -28,15 +28,15 @@ files before going any further.
{% call macros.panel("info", "Step 3 - Start the Compose project") %}
To start your compose project, simply run the Docker Compose up
-command.
+command using -p mailu flag for project name.
cd {{ root }}
-docker-compose up -d
+docker-compose -p mailu up -d
Before you can use Mailu, you must create the primary administrator user account. This should be {{ postmaster }}@{{ domain }}. Use the following command, changing PASSWORD to your liking:
-
Login to the admin interface to change the password for a safe one, at
From e5268de0c750125b5d9621fed47f643e3b97237b Mon Sep 17 00:00:00 2001
From: Ionut Filip
Date: Tue, 23 Oct 2018 17:55:44 +0300
Subject: [PATCH 13/62] Revert default value for subnet
---
setup/templates/steps/stack/03_expose.html | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/setup/templates/steps/stack/03_expose.html b/setup/templates/steps/stack/03_expose.html
index bb61a35c..a9cffc1c 100644
--- a/setup/templates/steps/stack/03_expose.html
+++ b/setup/templates/steps/stack/03_expose.html
@@ -5,8 +5,7 @@ you expose it to the world.
-
+
You server will be available under a main hostname but may expose multiple public
From 238d4e7f208b13b245b1bb98e8e8b56ce50e229f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tim=20M=C3=B6hlmann?=
Date: Wed, 24 Oct 2018 12:02:28 +0300
Subject: [PATCH 14/62] Provide test cases created with the new setup utility
---
tests/compose/core.yml | 74 ++++++++++++++++
tests/compose/fetchmail.yml | 77 +++++++++++++++++
tests/compose/filters+dns.yml | 119 ++++++++++++++++++++++++++
tests/compose/{core.env => mailu.env} | 54 ++++++------
tests/compose/rainloop.yml | 84 ++++++++++++++++++
tests/compose/roundcube.yml | 84 ++++++++++++++++++
tests/compose/run.yml | 101 ----------------------
tests/compose/webdav.yml | 79 +++++++++++++++++
8 files changed, 545 insertions(+), 127 deletions(-)
create mode 100644 tests/compose/core.yml
create mode 100644 tests/compose/fetchmail.yml
create mode 100644 tests/compose/filters+dns.yml
rename tests/compose/{core.env => mailu.env} (72%)
create mode 100644 tests/compose/rainloop.yml
create mode 100644 tests/compose/roundcube.yml
delete mode 100644 tests/compose/run.yml
create mode 100644 tests/compose/webdav.yml
diff --git a/tests/compose/core.yml b/tests/compose/core.yml
new file mode 100644
index 00000000..460a6908
--- /dev/null
+++ b/tests/compose/core.yml
@@ -0,0 +1,74 @@
+# This file is auto-generated by the Mailu configuration wizard.
+# Please read the documentation before attempting any change.
+# Generated for compose flavor
+
+version: '3.6'
+
+services:
+
+ # External dependencies
+ redis:
+ image: redis:alpine
+ volumes:
+ - "/mailu/redis:/data"
+
+ # Core services
+ front:
+ image: mailu/nginx:master
+ env_file: mailu.env
+ ports:
+ - "127.0.0.1:80:80"
+ - "::1:80:80"
+ - "127.0.0.1:443:443"
+ - "::1:443:443"
+ - "127.0.0.1:25:25"
+ - "::1:25:25"
+ - "127.0.0.1:465:465"
+ - "::1:465:465"
+ - "127.0.0.1:587:587"
+ - "::1:587:587"
+ - "127.0.0.1:110:110"
+ - "::1:110:110"
+ - "127.0.0.1:995:995"
+ - "::1:995:995"
+ - "127.0.0.1:143:143"
+ - "::1:143:143"
+ - "127.0.0.1:993:993"
+ - "::1:993:993"
+ volumes:
+ - "/mailu/certs:/certs"
+
+
+ admin:
+ image: mailu/admin:master
+ env_file: mailu.env
+ volumes:
+ - "/mailu/data:/data"
+ - "/mailu/dkim:/dkim"
+ depends_on:
+ - redis
+
+ imap:
+ image: mailu/dovecot:master
+ env_file: mailu.env
+ volumes:
+ - "/mailu/mail:/mail"
+ - "/mailu/overrides:/overrides"
+ depends_on:
+ - front
+
+ smtp:
+ image: mailu/postfix:master
+ env_file: mailu.env
+ volumes:
+ - "/mailu/overrides:/overrides"
+ depends_on:
+ - front
+
+ # Optional services
+
+
+
+
+ # Webmail
+
diff --git a/tests/compose/fetchmail.yml b/tests/compose/fetchmail.yml
new file mode 100644
index 00000000..8f40ba19
--- /dev/null
+++ b/tests/compose/fetchmail.yml
@@ -0,0 +1,77 @@
+# This file is auto-generated by the Mailu configuration wizard.
+# Please read the documentation before attempting any change.
+# Generated for compose flavor
+
+version: '3.6'
+
+services:
+
+ # External dependencies
+ redis:
+ image: redis:alpine
+ volumes:
+ - "/mailu/redis:/data"
+
+ # Core services
+ front:
+ image: mailu/nginx:master
+ env_file: mailu.env
+ ports:
+ - "127.0.0.1:80:80"
+ - "::1:80:80"
+ - "127.0.0.1:443:443"
+ - "::1:443:443"
+ - "127.0.0.1:25:25"
+ - "::1:25:25"
+ - "127.0.0.1:465:465"
+ - "::1:465:465"
+ - "127.0.0.1:587:587"
+ - "::1:587:587"
+ - "127.0.0.1:110:110"
+ - "::1:110:110"
+ - "127.0.0.1:995:995"
+ - "::1:995:995"
+ - "127.0.0.1:143:143"
+ - "::1:143:143"
+ - "127.0.0.1:993:993"
+ - "::1:993:993"
+ volumes:
+ - "/mailu/certs:/certs"
+
+
+ admin:
+ image: mailu/admin:master
+ env_file: mailu.env
+ volumes:
+ - "/mailu/data:/data"
+ - "/mailu/dkim:/dkim"
+ depends_on:
+ - redis
+
+ imap:
+ image: mailu/dovecot:master
+ env_file: mailu.env
+ volumes:
+ - "/mailu/mail:/mail"
+ - "/mailu/overrides:/overrides"
+ depends_on:
+ - front
+
+ smtp:
+ image: mailu/postfix:master
+ env_file: mailu.env
+ volumes:
+ - "/mailu/overrides:/overrides"
+ depends_on:
+ - front
+
+ # Optional services
+
+
+
+ fetchmail:
+ image: mailu/fetchmail:master
+ env_file: mailu.env
+
+ # Webmail
+
diff --git a/tests/compose/filters+dns.yml b/tests/compose/filters+dns.yml
new file mode 100644
index 00000000..993ed786
--- /dev/null
+++ b/tests/compose/filters+dns.yml
@@ -0,0 +1,119 @@
+# This file is auto-generated by the Mailu configuration wizard.
+# Please read the documentation before attempting any change.
+# Generated for compose flavor
+
+version: '3.6'
+
+services:
+
+ # External dependencies
+ redis:
+ image: redis:alpine
+ volumes:
+ - "/mailu/redis:/data"
+
+ # Core services
+ front:
+ image: mailu/nginx:master
+ env_file: mailu.env
+ ports:
+ - "127.0.0.1:80:80"
+ - "::1:80:80"
+ - "127.0.0.1:443:443"
+ - "::1:443:443"
+ - "127.0.0.1:25:25"
+ - "::1:25:25"
+ - "127.0.0.1:465:465"
+ - "::1:465:465"
+ - "127.0.0.1:587:587"
+ - "::1:587:587"
+ - "127.0.0.1:110:110"
+ - "::1:110:110"
+ - "127.0.0.1:995:995"
+ - "::1:995:995"
+ - "127.0.0.1:143:143"
+ - "::1:143:143"
+ - "127.0.0.1:993:993"
+ - "::1:993:993"
+ volumes:
+ - "/mailu/certs:/certs"
+
+ resolver:
+ image: mailu/unbound:master
+ env_file: mailu.env
+ restart: always
+ networks:
+ default:
+ ipv4_address: 192.168.0.254
+
+ admin:
+ image: mailu/admin:master
+ env_file: mailu.env
+ volumes:
+ - "/mailu/data:/data"
+ - "/mailu/dkim:/dkim"
+ depends_on:
+ - redis
+
+ imap:
+ image: mailu/dovecot:master
+ env_file: mailu.env
+ volumes:
+ - "/mailu/mail:/mail"
+ - "/mailu/overrides:/overrides"
+ depends_on:
+ - front
+
+ smtp:
+ image: mailu/postfix:master
+ env_file: mailu.env
+ volumes:
+ - "/mailu/overrides:/overrides"
+ depends_on:
+ - front
+ - resolver
+ dns:
+ - 192.168.0.254
+
+ # Optional services
+ antispam:
+ image: mailu/rspamd:master
+ env_file: mailu.env
+ volumes:
+ - "/mailu/filter:/var/lib/rspamd"
+ - "/mailu/dkim:/dkim"
+ - "/mailu/overrides/rspamd:/etc/rspamd/override.d"
+ depends_on:
+ - front
+ - resolver
+ dns:
+ - 192.168.0.254
+
+ antivirus:
+ image: mailu/clamav:master
+ env_file: mailu.env
+ volumes:
+ - "/mailu/filter:/data"
+ depends_on:
+ - resolver
+ dns:
+ - 192.168.0.254
+
+
+
+ # Webmail
+ webmail:
+ image: mailu/rainloop:master
+ env_file: mailu.env
+ volumes:
+ - "/mailu/webmail:/data"
+ depends_on:
+ - imap
+
+networks:
+ default:
+ driver: bridge
+ ipam:
+ driver: default
+ config:
+ - subnet: 192.168.0.0/24
diff --git a/tests/compose/core.env b/tests/compose/mailu.env
similarity index 72%
rename from tests/compose/core.env
rename to tests/compose/mailu.env
index 78c307c0..74c87118 100644
--- a/tests/compose/core.env
+++ b/tests/compose/mailu.env
@@ -1,31 +1,38 @@
# Mailu main configuration file
#
-# Most configuration variables can be modified through the Web interface,
-# these few settings must however be configured before starting the mail
-# server and require a restart upon change.
+# Generated for compose flavor
+#
+# This file is autogenerated by the configuration management wizard.
+# For a detailed list of configuration variables, see the documentation at
+# https://mailu.io
###################################
# Common configuration variables
###################################
# Set this to the path where Mailu data and configuration is stored
-ROOT=/mailu
+# This variable is now set directly in `docker-compose.yml by the setup utility
+# ROOT=/mailu
# Mailu version to run (1.0, 1.1, etc. or master)
#VERSION=master
# Set to a randomly generated 16 bytes string
-SECRET_KEY=ChangeMeChangeMe
+SECRET_KEY=1DS36JPBRGPM5JUC
# Address where listening ports should bind
-BIND_ADDRESS4=127.0.0.1
-#BIND_ADDRESS6=::1
+# This variables are now set directly in `docker-compose.yml by the setup utility
+# PUBLIC_IPV4= 127.0.0.1 (default: 127.0.0.1)
+# PUBLIC_IPV6= ::1 (default: ::1)
+
+# Subnet
+SUBNET=192.168.0.0/24
# Main mail domain
DOMAIN=mailu.io
# Hostnames for this server, separated with comas
-HOSTNAMES=mail.mailu.io,alternative.mailu.io,yetanother.mailu.io
+HOSTNAMES=mail.mailu.io
# Postmaster local part (will append the main mail domain)
POSTMASTER=admin
@@ -34,7 +41,7 @@ POSTMASTER=admin
TLS_FLAVOR=cert
# Authentication rate limit (per source IP address)
-AUTH_RATELIMIT=10/minute;1000/hour
+AUTH_RATELIMIT=10/minute;1000/hour
# Opt-out of statistics, replace with "True" to opt out
DISABLE_STATISTICS=False
@@ -44,7 +51,7 @@ DISABLE_STATISTICS=False
###################################
# Expose the admin interface (value: true, false)
-ADMIN=false
+ADMIN=true
# Choose which webmail to run if any (values: roundcube, rainloop, none)
WEBMAIL=none
@@ -53,7 +60,10 @@ WEBMAIL=none
WEBDAV=none
# Antivirus solution (value: clamav, none)
-ANTIVIRUS=none
+#ANTIVIRUS=none
+
+#Antispam solution
+ANTISPAM=none
###################################
# Mail settings
@@ -65,7 +75,7 @@ MESSAGE_SIZE_LIMIT=50000000
# Networks granted relay permissions, make sure that you include your Docker
# internal network (default to 172.17.0.0/16)
-RELAYNETS=172.16.0.0/12
+RELAYNETS=172.17.0.0/16
# Will relay all outgoing mails if configured
RELAYHOST=
@@ -74,18 +84,12 @@ RELAYHOST=
FETCHMAIL_DELAY=600
# Recipient delimiter, character used to delimiter localpart from custom address part
-# e.g. localpart+custom@domain;tld
RECIPIENT_DELIMITER=+
# DMARC rua and ruf email
DMARC_RUA=admin
DMARC_RUF=admin
-# Welcome email, enable and set a topic and body if you wish to send welcome
-# emails to all users.
-WELCOME=false
-WELCOME_SUBJECT=Welcome to your new email account
-WELCOME_BODY=Welcome to your new email account, if you can read this, then it is configured properly!
# Maildir Compression
# choose compression-method, default: none (value: bz2, gz)
@@ -109,12 +113,7 @@ SITENAME=Mailu
# Linked Website URL
WEBSITE=https://mailu.io
-# Registration reCaptcha settings (warning, this has some privacy impact)
-# RECAPTCHA_PUBLIC_KEY=
-# RECAPTCHA_PRIVATE_KEY=
-# Domain registration, uncomment to enable
-# DOMAIN_REGISTRATION=true
###################################
# Advanced settings
@@ -127,14 +126,17 @@ WEBSITE=https://mailu.io
LOG_DRIVER=json-file
# Docker-compose project name, this will prepended to containers names.
-#COMPOSE_PROJECT_NAME=mailu
+COMPOSE_PROJECT_NAME=mailu
# Default password scheme used for newly created accounts and changed passwords
-# (value: SHA512-CRYPT, SHA256-CRYPT, MD5-CRYPT, CRYPT)
-PASSWORD_SCHEME=SHA512-CRYPT
+# (value: BLF-CRYPT, SHA512-CRYPT, SHA256-CRYPT, MD5-CRYPT, CRYPT)
+PASSWORD_SCHEME=BLF-CRYPT
# Header to take the real ip from
REAL_IP_HEADER=
# IPs for nginx set_real_ip_from (CIDR list separated by commas)
REAL_IP_FROM=
+
+# choose wether mailu bounces (no) or rejects (yes) mail when recipient is unknown (value: yes, no)
+REJECT_UNLISTED_RECIPIENT=
\ No newline at end of file
diff --git a/tests/compose/rainloop.yml b/tests/compose/rainloop.yml
new file mode 100644
index 00000000..29011eeb
--- /dev/null
+++ b/tests/compose/rainloop.yml
@@ -0,0 +1,84 @@
+# This file is auto-generated by the Mailu configuration wizard.
+# Please read the documentation before attempting any change.
+# Generated for compose flavor
+
+version: '3.6'
+
+services:
+
+ # External dependencies
+ redis:
+ image: redis:alpine
+ volumes:
+ - "/mailu/redis:/data"
+
+ # Core services
+ front:
+ image: mailu/nginx:master
+ env_file: mailu.env
+ ports:
+ - "127.0.0.1:80:80"
+ - "::1:80:80"
+ - "127.0.0.1:443:443"
+ - "::1:443:443"
+ - "127.0.0.1:25:25"
+ - "::1:25:25"
+ - "127.0.0.1:465:465"
+ - "::1:465:465"
+ - "127.0.0.1:587:587"
+ - "::1:587:587"
+ - "127.0.0.1:110:110"
+ - "::1:110:110"
+ - "127.0.0.1:995:995"
+ - "::1:995:995"
+ - "127.0.0.1:143:143"
+ - "::1:143:143"
+ - "127.0.0.1:993:993"
+ - "::1:993:993"
+ volumes:
+ - "/mailu/certs:/certs"
+
+
+ admin:
+ image: mailu/admin:master
+ env_file: mailu.env
+ volumes:
+ - "/mailu/data:/data"
+ - "/mailu/dkim:/dkim"
+ depends_on:
+ - redis
+
+ imap:
+ image: mailu/dovecot:master
+ env_file: mailu.env
+ volumes:
+ - "/mailu/mail:/mail"
+ - "/mailu/overrides:/overrides"
+ depends_on:
+ - front
+
+ smtp:
+ image: mailu/postfix:master
+ env_file: mailu.env
+ volumes:
+ - "/mailu/overrides:/overrides"
+ depends_on:
+ - front
+
+ # Optional services
+
+
+
+
+ # Webmail
+ webmail:
+ image: mailu/rainloop:master
+ env_file: mailu.env
+ volumes:
+ - "/mailu/webmail:/data"
+ depends_on:
+ - imap
+ - resolver
+ dns:
+ - 192.168.0.254
+
diff --git a/tests/compose/roundcube.yml b/tests/compose/roundcube.yml
new file mode 100644
index 00000000..c6e46ed9
--- /dev/null
+++ b/tests/compose/roundcube.yml
@@ -0,0 +1,84 @@
+# This file is auto-generated by the Mailu configuration wizard.
+# Please read the documentation before attempting any change.
+# Generated for compose flavor
+
+version: '3.6'
+
+services:
+
+ # External dependencies
+ redis:
+ image: redis:alpine
+ volumes:
+ - "/mailu/redis:/data"
+
+ # Core services
+ front:
+ image: mailu/nginx:master
+ env_file: mailu.env
+ ports:
+ - "127.0.0.1:80:80"
+ - "::1:80:80"
+ - "127.0.0.1:443:443"
+ - "::1:443:443"
+ - "127.0.0.1:25:25"
+ - "::1:25:25"
+ - "127.0.0.1:465:465"
+ - "::1:465:465"
+ - "127.0.0.1:587:587"
+ - "::1:587:587"
+ - "127.0.0.1:110:110"
+ - "::1:110:110"
+ - "127.0.0.1:995:995"
+ - "::1:995:995"
+ - "127.0.0.1:143:143"
+ - "::1:143:143"
+ - "127.0.0.1:993:993"
+ - "::1:993:993"
+ volumes:
+ - "/mailu/certs:/certs"
+
+
+ admin:
+ image: mailu/admin:master
+ env_file: mailu.env
+ volumes:
+ - "/mailu/data:/data"
+ - "/mailu/dkim:/dkim"
+ depends_on:
+ - redis
+
+ imap:
+ image: mailu/dovecot:master
+ env_file: mailu.env
+ volumes:
+ - "/mailu/mail:/mail"
+ - "/mailu/overrides:/overrides"
+ depends_on:
+ - front
+
+ smtp:
+ image: mailu/postfix:master
+ env_file: mailu.env
+ volumes:
+ - "/mailu/overrides:/overrides"
+ depends_on:
+ - front
+
+ # Optional services
+
+
+
+
+ # Webmail
+ webmail:
+ image: mailu/roundcube:master
+ env_file: mailu.env
+ volumes:
+ - "/mailu/webmail:/data"
+ depends_on:
+ - imap
+ - resolver
+ dns:
+ - 192.168.0.254
+
diff --git a/tests/compose/run.yml b/tests/compose/run.yml
deleted file mode 100644
index eac35b76..00000000
--- a/tests/compose/run.yml
+++ /dev/null
@@ -1,101 +0,0 @@
-version: '2'
-
-services:
-
- front:
- image: $DOCKER_ORG/nginx:$VERSION
- restart: 'no'
- env_file: $PWD/.env
- logging:
- driver: $LOG_DRIVER
- ports:
- - "$BIND_ADDRESS4:80:80"
- - "$BIND_ADDRESS4:443:443"
- - "$BIND_ADDRESS4:110:110"
- - "$BIND_ADDRESS4:143:143"
- - "$BIND_ADDRESS4:993:993"
- - "$BIND_ADDRESS4:995:995"
- - "$BIND_ADDRESS4:25:25"
- - "$BIND_ADDRESS4:465:465"
- - "$BIND_ADDRESS4:587:587"
- volumes:
- - "$ROOT/certs:/certs"
-
- redis:
- image: redis:alpine
- restart: 'no'
- volumes:
- - "$ROOT/redis:/data"
-
- imap:
- image: $DOCKER_ORG/dovecot:$VERSION
- restart: 'no'
- env_file: $PWD/.env
- volumes:
- - "$ROOT/data:/data"
- - "$ROOT/mail:/mail"
- - "$ROOT/overrides:/overrides"
- depends_on:
- - front
-
- smtp:
- image: $DOCKER_ORG/postfix:$VERSION
- restart: 'no'
- env_file: $PWD/.env
- volumes:
- - "$ROOT/data:/data"
- - "$ROOT/overrides:/overrides"
- depends_on:
- - front
-
- antispam:
- image: $DOCKER_ORG/rspamd:$VERSION
- restart: 'no'
- env_file: $PWD/.env
- volumes:
- - "$ROOT/filter:/var/lib/rspamd"
- - "$ROOT/dkim:/dkim"
- - "$ROOT/overrides/rspamd:/etc/rspamd/override.d"
- depends_on:
- - front
-
- antivirus:
- image: $DOCKER_ORG/$ANTIVIRUS:$VERSION
- restart: 'no'
- env_file: $PWD/.env
- volumes:
- - "$ROOT/filter:/data"
-
- webdav:
- image: $DOCKER_ORG/$WEBDAV:$VERSION
- restart: 'no'
- env_file: $PWD/.env
- volumes:
- - "$ROOT/dav:/data"
-
- admin:
- image: $DOCKER_ORG/admin:$VERSION
- restart: 'no'
- env_file: $PWD/.env
- volumes:
- - "$ROOT/data:/data"
- - "$ROOT/dkim:/dkim"
- - /var/run/docker.sock:/var/run/docker.sock:ro
- depends_on:
- - redis
-
- webmail:
- image: "$DOCKER_ORG/$WEBMAIL:$VERSION"
- restart: 'no'
- env_file: $PWD/.env
- volumes:
- - "$ROOT/webmail:/data"
- depends_on:
- - imap
-
- fetchmail:
- image: $DOCKER_ORG/fetchmail:$VERSION
- restart: 'no'
- env_file: $PWD/.env
- volumes:
- - "$ROOT/data:/data"
diff --git a/tests/compose/webdav.yml b/tests/compose/webdav.yml
new file mode 100644
index 00000000..b4d222ef
--- /dev/null
+++ b/tests/compose/webdav.yml
@@ -0,0 +1,79 @@
+# This file is auto-generated by the Mailu configuration wizard.
+# Please read the documentation before attempting any change.
+# Generated for compose flavor
+
+version: '3.6'
+
+services:
+
+ # External dependencies
+ redis:
+ image: redis:alpine
+ volumes:
+ - "/mailu/redis:/data"
+
+ # Core services
+ front:
+ image: mailu/nginx:master
+ env_file: mailu.env
+ ports:
+ - "127.0.0.1:80:80"
+ - "::1:80:80"
+ - "127.0.0.1:443:443"
+ - "::1:443:443"
+ - "127.0.0.1:25:25"
+ - "::1:25:25"
+ - "127.0.0.1:465:465"
+ - "::1:465:465"
+ - "127.0.0.1:587:587"
+ - "::1:587:587"
+ - "127.0.0.1:110:110"
+ - "::1:110:110"
+ - "127.0.0.1:995:995"
+ - "::1:995:995"
+ - "127.0.0.1:143:143"
+ - "::1:143:143"
+ - "127.0.0.1:993:993"
+ - "::1:993:993"
+ volumes:
+ - "/mailu/certs:/certs"
+
+
+ admin:
+ image: mailu/admin:master
+ env_file: mailu.env
+ volumes:
+ - "/mailu/data:/data"
+ - "/mailu/dkim:/dkim"
+ depends_on:
+ - redis
+
+ imap:
+ image: mailu/dovecot:master
+ env_file: mailu.env
+ volumes:
+ - "/mailu/mail:/mail"
+ - "/mailu/overrides:/overrides"
+ depends_on:
+ - front
+
+ smtp:
+ image: mailu/postfix:master
+ env_file: mailu.env
+ volumes:
+ - "/mailu/overrides:/overrides"
+ depends_on:
+ - front
+
+ # Optional services
+
+
+ webdav:
+ image: mailu/radicale:master
+ env_file: mailu.env
+ volumes:
+ - "/mailu/dav:/data"
+
+
+ # Webmail
+
From 3b1fdc6166a3505e7c516d0f99b210dc5ab066f9 Mon Sep 17 00:00:00 2001
From: Ionut Filip
Date: Thu, 25 Oct 2018 15:27:09 +0300
Subject: [PATCH 15/62] Migrate test script from shell to python
- test.py needs to be called with 2 arguments : test_name and timeout
- it will cd to test_name dir and use the test_name.yml from there
- it will sleep for an amount of time equals to timeout in minutes
- it will perform health checks for containers. If healtcheck isn't enabled will check for running state
- it will run hooks inside the test_name dir ( .py and .sh) if there are any
- printing logs in any case
---
.travis.yml | 7 +-
tests/compose/{ => core}/core.yml | 10 +-
tests/compose/{ => fetchmail}/fetchmail.yml | 0
.../compose/{ => filters+dns}/filters+dns.yml | 0
tests/compose/{ => rainloop}/rainloop.yml | 0
tests/compose/{ => roundcube}/roundcube.yml | 0
tests/compose/test.py | 92 +++++++++++++++++++
tests/compose/{ => webdav}/webdav.yml | 0
tests/requirements.txt | 2 +
9 files changed, 109 insertions(+), 2 deletions(-)
rename tests/compose/{ => core}/core.yml (85%)
rename tests/compose/{ => fetchmail}/fetchmail.yml (100%)
rename tests/compose/{ => filters+dns}/filters+dns.yml (100%)
rename tests/compose/{ => rainloop}/rainloop.yml (100%)
rename tests/compose/{ => roundcube}/roundcube.yml (100%)
create mode 100755 tests/compose/test.py
rename tests/compose/{ => webdav}/webdav.yml (100%)
create mode 100644 tests/requirements.txt
diff --git a/.travis.yml b/.travis.yml
index c3a19529..107696aa 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,12 +6,17 @@ addons:
- docker-ce
env:
- VERSION=$TRAVIS_BRANCH
+language: python
+python:
+ - "3.6"
+install:
+ - pip install -r tests/requirements.txt
script:
# Default to mailu for DOCKER_ORG
- if [ -z "$DOCKER_ORG" ]; then export DOCKER_ORG="mailu"; fi
- docker-compose -f tests/build.yml build
- - tests/compose/test-script.sh
+ - python tests/compose/test.py
deploy:
provider: script
diff --git a/tests/compose/core.yml b/tests/compose/core/core.yml
similarity index 85%
rename from tests/compose/core.yml
rename to tests/compose/core/core.yml
index 460a6908..d85388a4 100644
--- a/tests/compose/core.yml
+++ b/tests/compose/core/core.yml
@@ -66,7 +66,15 @@ services:
- front
# Optional services
-
+ antispam:
+ image: mailu/rspamd:master
+ env_file: mailu.env
+ volumes:
+ - "/mailu/filter:/var/lib/rspamd"
+ - "/mailu/dkim:/dkim"
+ - "/mailu/overrides/rspamd:/etc/rspamd/override.d"
+ depends_on:
+ - front
diff --git a/tests/compose/fetchmail.yml b/tests/compose/fetchmail/fetchmail.yml
similarity index 100%
rename from tests/compose/fetchmail.yml
rename to tests/compose/fetchmail/fetchmail.yml
diff --git a/tests/compose/filters+dns.yml b/tests/compose/filters+dns/filters+dns.yml
similarity index 100%
rename from tests/compose/filters+dns.yml
rename to tests/compose/filters+dns/filters+dns.yml
diff --git a/tests/compose/rainloop.yml b/tests/compose/rainloop/rainloop.yml
similarity index 100%
rename from tests/compose/rainloop.yml
rename to tests/compose/rainloop/rainloop.yml
diff --git a/tests/compose/roundcube.yml b/tests/compose/roundcube/roundcube.yml
similarity index 100%
rename from tests/compose/roundcube.yml
rename to tests/compose/roundcube/roundcube.yml
diff --git a/tests/compose/test.py b/tests/compose/test.py
new file mode 100755
index 00000000..95670e30
--- /dev/null
+++ b/tests/compose/test.py
@@ -0,0 +1,92 @@
+import sys
+import os
+import time
+import docker
+from colorama import Fore, Style
+
+# Declare variables for service name and sleep time
+test_name=sys.argv[1]
+timeout=int(sys.argv[2])
+
+client = docker.APIClient(base_url='unix://var/run/docker.sock')
+
+containers = []
+
+# Start up containers
+def start():
+ os.system("cp mailu.env " + test_name + "/")
+ os.system("docker-compose -f " + test_name + "/" + test_name + ".yml -p $DOCKER_ORG up -d ")
+
+# Stop containers
+def stop(exit_code):
+ print_logs()
+ os.system("docker-compose -f " + test_name + "/" + test_name + ".yml -p $DOCKER_ORG down")
+ os.system("rm " + test_name +"/mailu.env")
+ sys.exit(exit_code)
+
+# Sleep for a defined amount of time
+def sleep():
+ print(Fore.LIGHTMAGENTA_EX + "Sleeping for " + str(timeout) + "m" + Style.RESET_ALL)
+ time.sleep(timeout*60)
+
+def health_checks():
+ exit_code = 0
+ #Iterating trough all containers dictionary
+ for container in client.containers(all=True):
+ #Perform "docker container inspect" on container based on container ID and save output to a dictionary
+ container_inspect = client.inspect_container(container['Id']) #Dict
+
+ if "Health" in container_inspect['State'].keys():
+ if container_inspect['State']['Health']['Status'] == "healthy":
+ print(Fore.GREEN + "Health status for " + container_inspect['Name'].replace("/", "") + " : " + Fore.CYAN + container_inspect['State']['Health']['Status'] + Style.RESET_ALL)
+ if container_inspect['State']['Health']['Status'] != "healthy":
+ print(Fore.RED + "Container " + container_inspect['Name'].replace("/", "") + " is " + Fore.YELLOW + container_inspect['State']['Health']['Status']
+ + Fore.RED + ", FailingStreak: " + Fore.YELLOW + str(container_inspect['State']['Health']['FailingStreak'])
+ + Fore.RED + ", Log: " + Fore.YELLOW + str(container_inspect['State']['Health']['Log']) + Style.RESET_ALL)
+ exit_code = 1
+ else:
+ if container_inspect['State']['Status'] == "running":
+ print(Fore.GREEN + "Running status for " + container_inspect['Name'].replace("/", "") + " : " + Fore.BLUE + container_inspect['State']['Status'] + Style.RESET_ALL)
+ if container_inspect['State']['Status'] != "running":
+ print(Fore.RED + "Container " + container_inspect['Name'].replace("/", "") + " state is: " + Fore.YELLOW + container_inspect['State']['Status'] + Style.RESET_ALL)
+ exit_code = 1
+
+ #Saving Id, Name and state to a new dictionary
+ containers_dict = {}
+ containers_dict['Name'] = container_inspect['Name'].replace("/", "")
+ containers_dict['Id'] = container_inspect['Id']
+ containers_dict['State'] = container_inspect['State']
+
+ #Adding the generated dictionary to a list
+ containers.append(containers_dict)
+
+ if exit_code != 0:
+ stop(exit_code)
+
+def print_logs():
+ print("Printing logs ...")
+ #Iterating through docker container inspect list and print logs
+ for container in containers:
+ print(Fore.LIGHTMAGENTA_EX + "Printing logs for: " + Fore.GREEN + container['Name'] + Style.RESET_ALL)
+ os.system('docker container logs ' + container['Name'])
+
+#Iterating over hooks in test folder and running them
+def hooks():
+ print("Running hooks")
+ for test_file in sorted(os.listdir(test_name + "/")):
+ if test_file.endswith(".py"):
+ os.system("python3 " + test_name + "/" + test_file)
+ elif test_file.endswith(".sh"):
+ os.system("./" + test_name + "/" + test_file)
+
+start()
+print()
+sleep()
+print()
+os.system("docker ps -a")
+print()
+health_checks()
+print()
+hooks()
+print()
+stop(0)
diff --git a/tests/compose/webdav.yml b/tests/compose/webdav/webdav.yml
similarity index 100%
rename from tests/compose/webdav.yml
rename to tests/compose/webdav/webdav.yml
diff --git a/tests/requirements.txt b/tests/requirements.txt
new file mode 100644
index 00000000..36006cfc
--- /dev/null
+++ b/tests/requirements.txt
@@ -0,0 +1,2 @@
+docker
+colorama
From 72e931f4b470b74f2546ffa0483a88208987b7d1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tim=20M=C3=B6hlmann?=
Date: Thu, 25 Oct 2018 16:35:08 +0300
Subject: [PATCH 16/62] Modify setup templates to allow for DOCKER_ORG and
VERSION override. (Needed for Travis)
---
.travis.yml | 7 +++----
setup/flavors/compose/docker-compose.yml | 18 ++++++++--------
setup/flavors/stack/docker-compose.yml | 18 ++++++++--------
tests/build.yml | 26 ++++++++++++------------
4 files changed, 34 insertions(+), 35 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 107696aa..bae6d04f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,7 +5,7 @@ addons:
packages:
- docker-ce
env:
- - VERSION=$TRAVIS_BRANCH
+ - MAILU_VERSION=$TRAVIS_BRANCH
language: python
python:
- "3.6"
@@ -13,10 +13,9 @@ install:
- pip install -r tests/requirements.txt
script:
- # Default to mailu for DOCKER_ORG
- - if [ -z "$DOCKER_ORG" ]; then export DOCKER_ORG="mailu"; fi
- docker-compose -f tests/build.yml build
- - python tests/compose/test.py
+# test.py, test name and timeout between start and tests.
+ - python tests/compose/test.py core 1
deploy:
provider: script
diff --git a/setup/flavors/compose/docker-compose.yml b/setup/flavors/compose/docker-compose.yml
index daea844e..14eeba3c 100644
--- a/setup/flavors/compose/docker-compose.yml
+++ b/setup/flavors/compose/docker-compose.yml
@@ -16,7 +16,7 @@ services:
# Core services
front:
- image: mailu/nginx:{{ version }}
+ image: ${DOCKER_ORG:-mailu}/nginx:${MAILU_VERSION:-{{ version }}}
restart: always
env_file: {{ env }}
logging:
@@ -34,7 +34,7 @@ services:
- "{{ root }}/certs:/certs"
admin:
- image: mailu/admin:{{ version }}
+ image: ${DOCKER_ORG:-mailu}/admin:${MAILU_VERSION:-{{ version }}}
restart: always
env_file: {{ env }}
{% if not admin_enabled %}
@@ -48,7 +48,7 @@ services:
- redis
imap:
- image: mailu/dovecot:{{ version }}
+ image: ${DOCKER_ORG:-mailu}/dovecot:${MAILU_VERSION:-{{ version }}}
restart: always
env_file: {{ env }}
volumes:
@@ -58,7 +58,7 @@ services:
- front
smtp:
- image: mailu/postfix:{{ version }}
+ image: ${DOCKER_ORG:-mailu}/postfix:${MAILU_VERSION:-{{ version }}}
restart: always
env_file: {{ env }}
volumes:
@@ -69,7 +69,7 @@ services:
# Optional services
{% if antispam_enabled %}
antispam:
- image: mailu/rspamd:{{ version }}
+ image: ${DOCKER_ORG:-mailu}/rspamd:${MAILU_VERSION:-{{ version }}}
restart: always
env_file: {{ env }}
volumes:
@@ -82,7 +82,7 @@ services:
{% if antivirus_enabled %}
antivirus:
- image: mailu/clamav:{{ version }}
+ image: ${DOCKER_ORG:-mailu}/clamav:${MAILU_VERSION:-{{ version }}}
restart: always
env_file: {{ env }}
volumes:
@@ -91,7 +91,7 @@ services:
{% if webdav_enabled %}
webdav:
- image: mailu/radicale:{{ version }}
+ image: ${DOCKER_ORG:-mailu}/radicale:${MAILU_VERSION:-{{ version }}}
restart: always
env_file: {{ env }}
volumes:
@@ -100,7 +100,7 @@ services:
{% if fetchmail_enabled %}
fetchmail:
- image: mailu/fetchmail:{{ version }}
+ image: ${DOCKER_ORG:-mailu}/fetchmail:${MAILU_VERSION:-{{ version }}}
restart: always
env_file: {{ env }}
{% endif %}
@@ -108,7 +108,7 @@ services:
# Webmail
{% if webmail_type != 'none' %}
webmail:
- image: mailu/{{ webmail_type }}:{{ version }}
+ image: ${DOCKER_ORG:-mailu}/{{ webmail_type }}:${MAILU_VERSION:-{{ version }}}
restart: always
env_file: {{ env }}
volumes:
diff --git a/setup/flavors/stack/docker-compose.yml b/setup/flavors/stack/docker-compose.yml
index 728135d5..92a156c7 100644
--- a/setup/flavors/stack/docker-compose.yml
+++ b/setup/flavors/stack/docker-compose.yml
@@ -15,7 +15,7 @@ services:
# Core services
front:
- image: mailu/nginx:{{ version }}
+ image: ${DOCKER_ORG:-mailu}/nginx:${MAILU_VERSION:-{{ version }}}
env_file: {{ env }}
logging:
driver: {{ log_driver or 'json-file' }}
@@ -31,7 +31,7 @@ services:
replicas: {{ front_replicas }}
admin:
- image: mailu/admin:{{ version }}
+ image: ${DOCKER_ORG:-mailu}/admin:${MAILU_VERSION:-{{ version }}}
env_file: {{ env }}
{% if not admin_enabled %}
ports:
@@ -44,7 +44,7 @@ services:
replicas: {{ admin_replicas }}
imap:
- image: mailu/dovecot:{{ version }}
+ image: ${DOCKER_ORG:-mailu}/dovecot:${MAILU_VERSION:-{{ version }}}
env_file: {{ env }}
environment:
# Default to 10.0.1.0/24
@@ -56,7 +56,7 @@ services:
replicas: {{ imap_replicas }}
smtp:
- image: mailu/postfix:{{ version }}
+ image: ${DOCKER_ORG:-mailu}/postfix:${MAILU_VERSION:-{{ version }}}
env_file: {{ env }}
environment:
- POD_ADDRESS_RANGE={{ subnet }}
@@ -68,7 +68,7 @@ services:
# Optional services
{% if antispam_enabled %}
antispam:
- image: mailu/rspamd:{{ version }}
+ image: ${DOCKER_ORG:-mailu}/rspamd:${MAILU_VERSION:-{{ version }}}
env_file: {{ env }}
environment:
- POD_ADDRESS_RANGE={{ subnet }}
@@ -82,7 +82,7 @@ services:
{% if antivirus_enabled %}
antivirus:
- image: mailu/clamav:{{ version }}
+ image: ${DOCKER_ORG:-mailu}/clamav:${MAILU_VERSION:-{{ version }}}
env_file: {{ env }}
volumes:
- "{{ root }}/filter:/data"
@@ -92,7 +92,7 @@ services:
{% if webdav_enabled %}
webdav:
- image: mailu/none:{{ version }}
+ image: ${DOCKER_ORG:-mailu}/none:${MAILU_VERSION:-{{ version }}}
env_file: {{ env }}
volumes:
- "{{ root }}/dav:/data"
@@ -102,7 +102,7 @@ services:
{% if fetchmail_enabled %}
fetchmail:
- image: mailu/fetchmail:{{ version }}
+ image: ${DOCKER_ORG:-mailu}/fetchmail:${MAILU_VERSION:-{{ version }}}
env_file: {{ env }}
volumes:
- "{{ root }}/data:/data"
@@ -112,7 +112,7 @@ services:
{% if webmail_type != 'none' %}
webmail:
- image: mailu/roundcube:{{ version }}
+ image: ${DOCKER_ORG:-mailu}/roundcube:${MAILU_VERSION:-{{ version }}}
env_file: {{ env }}
volumes:
- "{{ root }}/webmail:/data"
diff --git a/tests/build.yml b/tests/build.yml
index 5f360ece..dc259608 100644
--- a/tests/build.yml
+++ b/tests/build.yml
@@ -3,54 +3,54 @@ version: '3'
services:
front:
- image: ${DOCKER_ORG:-mailu}/nginx:${VERSION:-local}
+ image: ${DOCKER_ORG:-mailu}/nginx:${MAILU_VERSION:-local}
build: ../core/nginx
imap:
- image: ${DOCKER_ORG:-mailu}/dovecot:${VERSION:-local}
+ image: ${DOCKER_ORG:-mailu}/dovecot:${MAILU_VERSION:-local}
build: ../core/dovecot
smtp:
- image: ${DOCKER_ORG:-mailu}/postfix:${VERSION:-local}
+ image: ${DOCKER_ORG:-mailu}/postfix:${MAILU_VERSION:-local}
build: ../core/postfix
antispam:
- image: ${DOCKER_ORG:-mailu}/rspamd:${VERSION:-local}
+ image: ${DOCKER_ORG:-mailu}/rspamd:${MAILU_VERSION:-local}
build: ../services/rspamd
antivirus:
- image: ${DOCKER_ORG:-mailu}/clamav:${VERSION:-local}
+ image: ${DOCKER_ORG:-mailu}/clamav:${MAILU_VERSION:-local}
build: ../optional/clamav
webdav:
- image: ${DOCKER_ORG:-mailu}/radicale:${VERSION:-local}
+ image: ${DOCKER_ORG:-mailu}/radicale:${MAILU_VERSION:-local}
build: ../optional/radicale
admin:
- image: ${DOCKER_ORG:-mailu}/admin:${VERSION:-local}
+ image: ${DOCKER_ORG:-mailu}/admin:${MAILU_VERSION:-local}
build: ../core/admin
roundcube:
- image: ${DOCKER_ORG:-mailu}/roundcube:${VERSION:-local}
+ image: ${DOCKER_ORG:-mailu}/roundcube:${MAILU_VERSION:-local}
build: ../webmails/roundcube
rainloop:
- image: ${DOCKER_ORG:-mailu}/rainloop:${VERSION:-local}
+ image: ${DOCKER_ORG:-mailu}/rainloop:${MAILU_VERSION:-local}
build: ../webmails/rainloop
fetchmail:
- image: ${DOCKER_ORG:-mailu}/fetchmail:${VERSION:-local}
+ image: ${DOCKER_ORG:-mailu}/fetchmail:${MAILU_VERSION:-local}
build: ../services/fetchmail
none:
- image: ${DOCKER_ORG:-mailu}/none:${VERSION:-local}
+ image: ${DOCKER_ORG:-mailu}/none:${MAILU_VERSION:-local}
build: ../core/none
docs:
- image: ${DOCKER_ORG:-mailu}/docs:${VERSION:-local}
+ image: ${DOCKER_ORG:-mailu}/docs:${MAILU_VERSION:-local}
build: ../docs
setup:
- image: ${DOCKER_ORG:-mailu}/setup:${VERSION:-local}
+ image: ${DOCKER_ORG:-mailu}/setup:${MAILU_VERSION:-local}
build: ../setup
From dde7ccca97a72c20143f0cfb76a54077aab675f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tim=20M=C3=B6hlmann?=
Date: Thu, 25 Oct 2018 17:35:53 +0300
Subject: [PATCH 17/62] Created test cases from latest setup revision
---
.travis.yml | 9 +-
.../core/{core.yml => docker-compose.yml} | 23 ++-
tests/compose/{ => core}/mailu.env | 9 +-
.../docker-compose.yml} | 43 +++---
tests/compose/fetchmail/fetchmail.yml | 77 ----------
tests/compose/fetchmail/mailu.env | 139 ++++++++++++++++++
tests/compose/filters/docker-compose.yml | 95 ++++++++++++
tests/compose/filters/mailu.env | 139 ++++++++++++++++++
.../docker-compose.yml} | 54 ++-----
tests/compose/rainloop/mailu.env | 139 ++++++++++++++++++
.../{roundcube.yml => docker-compose.yml} | 35 +++--
tests/compose/roundcube/mailu.env | 139 ++++++++++++++++++
tests/compose/test-script.sh | 57 -------
tests/compose/test.py | 12 +-
.../webdav/{webdav.yml => docker-compose.yml} | 32 +++-
tests/compose/webdav/mailu.env | 139 ++++++++++++++++++
16 files changed, 910 insertions(+), 231 deletions(-)
rename tests/compose/core/{core.yml => docker-compose.yml} (75%)
rename tests/compose/{ => core}/mailu.env (96%)
rename tests/compose/{rainloop/rainloop.yml => fetchmail/docker-compose.yml} (63%)
delete mode 100644 tests/compose/fetchmail/fetchmail.yml
create mode 100644 tests/compose/fetchmail/mailu.env
create mode 100644 tests/compose/filters/docker-compose.yml
create mode 100644 tests/compose/filters/mailu.env
rename tests/compose/{filters+dns/filters+dns.yml => rainloop/docker-compose.yml} (68%)
create mode 100644 tests/compose/rainloop/mailu.env
rename tests/compose/roundcube/{roundcube.yml => docker-compose.yml} (64%)
create mode 100644 tests/compose/roundcube/mailu.env
delete mode 100755 tests/compose/test-script.sh
rename tests/compose/webdav/{webdav.yml => docker-compose.yml} (63%)
create mode 100644 tests/compose/webdav/mailu.env
diff --git a/.travis.yml b/.travis.yml
index bae6d04f..b1eb2d10 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -12,10 +12,17 @@ python:
install:
- pip install -r tests/requirements.txt
-script:
+before_script:
- docker-compose -f tests/build.yml build
+
+script:
# test.py, test name and timeout between start and tests.
- python tests/compose/test.py core 1
+ - python tests/compose/test.py fetchmail 1
+ - travis_wait python tests/compose/test.py filters 10
+ - python tests/compose/test.py rainloop 1
+ - python tests/compose/test.py roundcube 1
+ - python tests/compose/test.py webdav 1
deploy:
provider: script
diff --git a/tests/compose/core/core.yml b/tests/compose/core/docker-compose.yml
similarity index 75%
rename from tests/compose/core/core.yml
rename to tests/compose/core/docker-compose.yml
index d85388a4..47c5f179 100644
--- a/tests/compose/core/core.yml
+++ b/tests/compose/core/docker-compose.yml
@@ -9,13 +9,17 @@ services:
# External dependencies
redis:
image: redis:alpine
+ restart: always
volumes:
- "/mailu/redis:/data"
# Core services
front:
- image: mailu/nginx:master
+ image: ${DOCKER_ORG:-mailu}/nginx:${MAILU_VERSION:-master}
+ restart: always
env_file: mailu.env
+ logging:
+ driver: json-file
ports:
- "127.0.0.1:80:80"
- "::1:80:80"
@@ -37,10 +41,10 @@ services:
- "::1:993:993"
volumes:
- "/mailu/certs:/certs"
-
admin:
- image: mailu/admin:master
+ image: ${DOCKER_ORG:-mailu}/admin:${MAILU_VERSION:-master}
+ restart: always
env_file: mailu.env
volumes:
- "/mailu/data:/data"
@@ -49,7 +53,8 @@ services:
- redis
imap:
- image: mailu/dovecot:master
+ image: ${DOCKER_ORG:-mailu}/dovecot:${MAILU_VERSION:-master}
+ restart: always
env_file: mailu.env
volumes:
- "/mailu/mail:/mail"
@@ -58,16 +63,17 @@ services:
- front
smtp:
- image: mailu/postfix:master
+ image: ${DOCKER_ORG:-mailu}/postfix:${MAILU_VERSION:-master}
+ restart: always
env_file: mailu.env
volumes:
- "/mailu/overrides:/overrides"
depends_on:
- front
- # Optional services
antispam:
- image: mailu/rspamd:master
+ image: ${DOCKER_ORG:-mailu}/rspamd:${MAILU_VERSION:-master}
+ restart: always
env_file: mailu.env
volumes:
- "/mailu/filter:/var/lib/rspamd"
@@ -76,7 +82,8 @@ services:
depends_on:
- front
+ # Optional services
+
# Webmail
-
diff --git a/tests/compose/mailu.env b/tests/compose/core/mailu.env
similarity index 96%
rename from tests/compose/mailu.env
rename to tests/compose/core/mailu.env
index 74c87118..b243adcc 100644
--- a/tests/compose/mailu.env
+++ b/tests/compose/core/mailu.env
@@ -18,16 +18,13 @@
#VERSION=master
# Set to a randomly generated 16 bytes string
-SECRET_KEY=1DS36JPBRGPM5JUC
+SECRET_KEY=DY8PPWQXCFV84N4K
# Address where listening ports should bind
# This variables are now set directly in `docker-compose.yml by the setup utility
# PUBLIC_IPV4= 127.0.0.1 (default: 127.0.0.1)
# PUBLIC_IPV6= ::1 (default: ::1)
-# Subnet
-SUBNET=192.168.0.0/24
-
# Main mail domain
DOMAIN=mailu.io
@@ -38,7 +35,7 @@ HOSTNAMES=mail.mailu.io
POSTMASTER=admin
# Choose how secure connections will behave (value: letsencrypt, cert, notls, mail, mail-letsencrypt)
-TLS_FLAVOR=cert
+TLS_FLAVOR=letsencrypt
# Authentication rate limit (per source IP address)
AUTH_RATELIMIT=10/minute;1000/hour
@@ -123,7 +120,7 @@ WEBSITE=https://mailu.io
# json-file (default)
# journald (On systemd platforms, useful for Fail2Ban integration)
# syslog (Non systemd platforms, Fail2Ban integration. Disables `docker-compose log` for front!)
-LOG_DRIVER=json-file
+# LOG_DRIVER=json-file
# Docker-compose project name, this will prepended to containers names.
COMPOSE_PROJECT_NAME=mailu
diff --git a/tests/compose/rainloop/rainloop.yml b/tests/compose/fetchmail/docker-compose.yml
similarity index 63%
rename from tests/compose/rainloop/rainloop.yml
rename to tests/compose/fetchmail/docker-compose.yml
index 29011eeb..6612dc25 100644
--- a/tests/compose/rainloop/rainloop.yml
+++ b/tests/compose/fetchmail/docker-compose.yml
@@ -9,13 +9,17 @@ services:
# External dependencies
redis:
image: redis:alpine
+ restart: always
volumes:
- "/mailu/redis:/data"
# Core services
front:
- image: mailu/nginx:master
+ image: ${DOCKER_ORG:-mailu}/nginx:${MAILU_VERSION:-master}
+ restart: always
env_file: mailu.env
+ logging:
+ driver: json-file
ports:
- "127.0.0.1:80:80"
- "::1:80:80"
@@ -37,10 +41,10 @@ services:
- "::1:993:993"
volumes:
- "/mailu/certs:/certs"
-
admin:
- image: mailu/admin:master
+ image: ${DOCKER_ORG:-mailu}/admin:${MAILU_VERSION:-master}
+ restart: always
env_file: mailu.env
volumes:
- "/mailu/data:/data"
@@ -49,7 +53,8 @@ services:
- redis
imap:
- image: mailu/dovecot:master
+ image: ${DOCKER_ORG:-mailu}/dovecot:${MAILU_VERSION:-master}
+ restart: always
env_file: mailu.env
volumes:
- "/mailu/mail:/mail"
@@ -58,27 +63,31 @@ services:
- front
smtp:
- image: mailu/postfix:master
+ image: ${DOCKER_ORG:-mailu}/postfix:${MAILU_VERSION:-master}
+ restart: always
env_file: mailu.env
volumes:
- "/mailu/overrides:/overrides"
depends_on:
- front
+ antispam:
+ image: ${DOCKER_ORG:-mailu}/rspamd:${MAILU_VERSION:-master}
+ restart: always
+ env_file: mailu.env
+ volumes:
+ - "/mailu/filter:/var/lib/rspamd"
+ - "/mailu/dkim:/dkim"
+ - "/mailu/overrides/rspamd:/etc/rspamd/override.d"
+ depends_on:
+ - front
+
# Optional services
-
+ fetchmail:
+ image: ${DOCKER_ORG:-mailu}/fetchmail:${MAILU_VERSION:-master}
+ restart: always
+ env_file: mailu.env
# Webmail
- webmail:
- image: mailu/rainloop:master
- env_file: mailu.env
- volumes:
- - "/mailu/webmail:/data"
- depends_on:
- - imap
- - resolver
- dns:
- - 192.168.0.254
-
diff --git a/tests/compose/fetchmail/fetchmail.yml b/tests/compose/fetchmail/fetchmail.yml
deleted file mode 100644
index 8f40ba19..00000000
--- a/tests/compose/fetchmail/fetchmail.yml
+++ /dev/null
@@ -1,77 +0,0 @@
-# This file is auto-generated by the Mailu configuration wizard.
-# Please read the documentation before attempting any change.
-# Generated for compose flavor
-
-version: '3.6'
-
-services:
-
- # External dependencies
- redis:
- image: redis:alpine
- volumes:
- - "/mailu/redis:/data"
-
- # Core services
- front:
- image: mailu/nginx:master
- env_file: mailu.env
- ports:
- - "127.0.0.1:80:80"
- - "::1:80:80"
- - "127.0.0.1:443:443"
- - "::1:443:443"
- - "127.0.0.1:25:25"
- - "::1:25:25"
- - "127.0.0.1:465:465"
- - "::1:465:465"
- - "127.0.0.1:587:587"
- - "::1:587:587"
- - "127.0.0.1:110:110"
- - "::1:110:110"
- - "127.0.0.1:995:995"
- - "::1:995:995"
- - "127.0.0.1:143:143"
- - "::1:143:143"
- - "127.0.0.1:993:993"
- - "::1:993:993"
- volumes:
- - "/mailu/certs:/certs"
-
-
- admin:
- image: mailu/admin:master
- env_file: mailu.env
- volumes:
- - "/mailu/data:/data"
- - "/mailu/dkim:/dkim"
- depends_on:
- - redis
-
- imap:
- image: mailu/dovecot:master
- env_file: mailu.env
- volumes:
- - "/mailu/mail:/mail"
- - "/mailu/overrides:/overrides"
- depends_on:
- - front
-
- smtp:
- image: mailu/postfix:master
- env_file: mailu.env
- volumes:
- - "/mailu/overrides:/overrides"
- depends_on:
- - front
-
- # Optional services
-
-
-
- fetchmail:
- image: mailu/fetchmail:master
- env_file: mailu.env
-
- # Webmail
-
diff --git a/tests/compose/fetchmail/mailu.env b/tests/compose/fetchmail/mailu.env
new file mode 100644
index 00000000..4cea36f7
--- /dev/null
+++ b/tests/compose/fetchmail/mailu.env
@@ -0,0 +1,139 @@
+# Mailu main configuration file
+#
+# Generated for compose flavor
+#
+# This file is autogenerated by the configuration management wizard.
+# For a detailed list of configuration variables, see the documentation at
+# https://mailu.io
+
+###################################
+# Common configuration variables
+###################################
+
+# Set this to the path where Mailu data and configuration is stored
+# This variable is now set directly in `docker-compose.yml by the setup utility
+# ROOT=/mailu
+
+# Mailu version to run (1.0, 1.1, etc. or master)
+#VERSION=master
+
+# Set to a randomly generated 16 bytes string
+SECRET_KEY=PDK7N9UC7FDQ2UWE
+
+# Address where listening ports should bind
+# This variables are now set directly in `docker-compose.yml by the setup utility
+# PUBLIC_IPV4= 127.0.0.1 (default: 127.0.0.1)
+# PUBLIC_IPV6= ::1 (default: ::1)
+
+# Main mail domain
+DOMAIN=mailu.io
+
+# Hostnames for this server, separated with comas
+HOSTNAMES=mail.mailu.io
+
+# Postmaster local part (will append the main mail domain)
+POSTMASTER=admin
+
+# Choose how secure connections will behave (value: letsencrypt, cert, notls, mail, mail-letsencrypt)
+TLS_FLAVOR=letsencrypt
+
+# Authentication rate limit (per source IP address)
+AUTH_RATELIMIT=10/minute;1000/hour
+
+# Opt-out of statistics, replace with "True" to opt out
+DISABLE_STATISTICS=False
+
+###################################
+# Optional features
+###################################
+
+# Expose the admin interface (value: true, false)
+ADMIN=true
+
+# Choose which webmail to run if any (values: roundcube, rainloop, none)
+WEBMAIL=none
+
+# Dav server implementation (value: radicale, none)
+WEBDAV=none
+
+# Antivirus solution (value: clamav, none)
+#ANTIVIRUS=none
+
+#Antispam solution
+ANTISPAM=none
+
+###################################
+# Mail settings
+###################################
+
+# Message size limit in bytes
+# Default: accept messages up to 50MB
+MESSAGE_SIZE_LIMIT=50000000
+
+# Networks granted relay permissions, make sure that you include your Docker
+# internal network (default to 172.17.0.0/16)
+RELAYNETS=172.17.0.0/16
+
+# Will relay all outgoing mails if configured
+RELAYHOST=
+
+# Fetchmail delay
+FETCHMAIL_DELAY=600
+
+# Recipient delimiter, character used to delimiter localpart from custom address part
+RECIPIENT_DELIMITER=+
+
+# DMARC rua and ruf email
+DMARC_RUA=admin
+DMARC_RUF=admin
+
+
+# Maildir Compression
+# choose compression-method, default: none (value: bz2, gz)
+COMPRESSION=
+# change compression-level, default: 6 (value: 1-9)
+COMPRESSION_LEVEL=
+
+###################################
+# Web settings
+###################################
+
+# Path to the admin interface if enabled
+WEB_ADMIN=/admin
+
+# Path to the webmail if enabled
+WEB_WEBMAIL=/webmail
+
+# Website name
+SITENAME=Mailu
+
+# Linked Website URL
+WEBSITE=https://mailu.io
+
+
+
+###################################
+# Advanced settings
+###################################
+
+# Log driver for front service. Possible values:
+# json-file (default)
+# journald (On systemd platforms, useful for Fail2Ban integration)
+# syslog (Non systemd platforms, Fail2Ban integration. Disables `docker-compose log` for front!)
+# LOG_DRIVER=json-file
+
+# Docker-compose project name, this will prepended to containers names.
+COMPOSE_PROJECT_NAME=mailu
+
+# Default password scheme used for newly created accounts and changed passwords
+# (value: BLF-CRYPT, SHA512-CRYPT, SHA256-CRYPT, MD5-CRYPT, CRYPT)
+PASSWORD_SCHEME=BLF-CRYPT
+
+# Header to take the real ip from
+REAL_IP_HEADER=
+
+# IPs for nginx set_real_ip_from (CIDR list separated by commas)
+REAL_IP_FROM=
+
+# choose wether mailu bounces (no) or rejects (yes) mail when recipient is unknown (value: yes, no)
+REJECT_UNLISTED_RECIPIENT=
\ No newline at end of file
diff --git a/tests/compose/filters/docker-compose.yml b/tests/compose/filters/docker-compose.yml
new file mode 100644
index 00000000..31e62e72
--- /dev/null
+++ b/tests/compose/filters/docker-compose.yml
@@ -0,0 +1,95 @@
+# This file is auto-generated by the Mailu configuration wizard.
+# Please read the documentation before attempting any change.
+# Generated for compose flavor
+
+version: '3.6'
+
+services:
+
+ # External dependencies
+ redis:
+ image: redis:alpine
+ restart: always
+ volumes:
+ - "/mailu/redis:/data"
+
+ # Core services
+ front:
+ image: ${DOCKER_ORG:-mailu}/nginx:${MAILU_VERSION:-master}
+ restart: always
+ env_file: mailu.env
+ logging:
+ driver: json-file
+ ports:
+ - "127.0.0.1:80:80"
+ - "::1:80:80"
+ - "127.0.0.1:443:443"
+ - "::1:443:443"
+ - "127.0.0.1:25:25"
+ - "::1:25:25"
+ - "127.0.0.1:465:465"
+ - "::1:465:465"
+ - "127.0.0.1:587:587"
+ - "::1:587:587"
+ - "127.0.0.1:110:110"
+ - "::1:110:110"
+ - "127.0.0.1:995:995"
+ - "::1:995:995"
+ - "127.0.0.1:143:143"
+ - "::1:143:143"
+ - "127.0.0.1:993:993"
+ - "::1:993:993"
+ volumes:
+ - "/mailu/certs:/certs"
+
+ admin:
+ image: ${DOCKER_ORG:-mailu}/admin:${MAILU_VERSION:-master}
+ restart: always
+ env_file: mailu.env
+ volumes:
+ - "/mailu/data:/data"
+ - "/mailu/dkim:/dkim"
+ depends_on:
+ - redis
+
+ imap:
+ image: ${DOCKER_ORG:-mailu}/dovecot:${MAILU_VERSION:-master}
+ restart: always
+ env_file: mailu.env
+ volumes:
+ - "/mailu/mail:/mail"
+ - "/mailu/overrides:/overrides"
+ depends_on:
+ - front
+
+ smtp:
+ image: ${DOCKER_ORG:-mailu}/postfix:${MAILU_VERSION:-master}
+ restart: always
+ env_file: mailu.env
+ volumes:
+ - "/mailu/overrides:/overrides"
+ depends_on:
+ - front
+
+ antispam:
+ image: ${DOCKER_ORG:-mailu}/rspamd:${MAILU_VERSION:-master}
+ restart: always
+ env_file: mailu.env
+ volumes:
+ - "/mailu/filter:/var/lib/rspamd"
+ - "/mailu/dkim:/dkim"
+ - "/mailu/overrides/rspamd:/etc/rspamd/override.d"
+ depends_on:
+ - front
+
+ # Optional services
+ antivirus:
+ image: ${DOCKER_ORG:-mailu}/clamav:${MAILU_VERSION:-master}
+ restart: always
+ env_file: mailu.env
+ volumes:
+ - "/mailu/filter:/data"
+
+
+
+ # Webmail
diff --git a/tests/compose/filters/mailu.env b/tests/compose/filters/mailu.env
new file mode 100644
index 00000000..15fae1fc
--- /dev/null
+++ b/tests/compose/filters/mailu.env
@@ -0,0 +1,139 @@
+# Mailu main configuration file
+#
+# Generated for compose flavor
+#
+# This file is autogenerated by the configuration management wizard.
+# For a detailed list of configuration variables, see the documentation at
+# https://mailu.io
+
+###################################
+# Common configuration variables
+###################################
+
+# Set this to the path where Mailu data and configuration is stored
+# This variable is now set directly in `docker-compose.yml by the setup utility
+# ROOT=/mailu
+
+# Mailu version to run (1.0, 1.1, etc. or master)
+#VERSION=master
+
+# Set to a randomly generated 16 bytes string
+SECRET_KEY=IUFE7Z57URZH1ZM1
+
+# Address where listening ports should bind
+# This variables are now set directly in `docker-compose.yml by the setup utility
+# PUBLIC_IPV4= 127.0.0.1 (default: 127.0.0.1)
+# PUBLIC_IPV6= ::1 (default: ::1)
+
+# Main mail domain
+DOMAIN=mailu.io
+
+# Hostnames for this server, separated with comas
+HOSTNAMES=mail.mailu.io
+
+# Postmaster local part (will append the main mail domain)
+POSTMASTER=admin
+
+# Choose how secure connections will behave (value: letsencrypt, cert, notls, mail, mail-letsencrypt)
+TLS_FLAVOR=letsencrypt
+
+# Authentication rate limit (per source IP address)
+AUTH_RATELIMIT=10/minute;1000/hour
+
+# Opt-out of statistics, replace with "True" to opt out
+DISABLE_STATISTICS=False
+
+###################################
+# Optional features
+###################################
+
+# Expose the admin interface (value: true, false)
+ADMIN=true
+
+# Choose which webmail to run if any (values: roundcube, rainloop, none)
+WEBMAIL=none
+
+# Dav server implementation (value: radicale, none)
+WEBDAV=none
+
+# Antivirus solution (value: clamav, none)
+#ANTIVIRUS=clamav
+
+#Antispam solution
+ANTISPAM=none
+
+###################################
+# Mail settings
+###################################
+
+# Message size limit in bytes
+# Default: accept messages up to 50MB
+MESSAGE_SIZE_LIMIT=50000000
+
+# Networks granted relay permissions, make sure that you include your Docker
+# internal network (default to 172.17.0.0/16)
+RELAYNETS=172.17.0.0/16
+
+# Will relay all outgoing mails if configured
+RELAYHOST=
+
+# Fetchmail delay
+FETCHMAIL_DELAY=600
+
+# Recipient delimiter, character used to delimiter localpart from custom address part
+RECIPIENT_DELIMITER=+
+
+# DMARC rua and ruf email
+DMARC_RUA=admin
+DMARC_RUF=admin
+
+
+# Maildir Compression
+# choose compression-method, default: none (value: bz2, gz)
+COMPRESSION=
+# change compression-level, default: 6 (value: 1-9)
+COMPRESSION_LEVEL=
+
+###################################
+# Web settings
+###################################
+
+# Path to the admin interface if enabled
+WEB_ADMIN=/admin
+
+# Path to the webmail if enabled
+WEB_WEBMAIL=/webmail
+
+# Website name
+SITENAME=Mailu
+
+# Linked Website URL
+WEBSITE=https://mailu.io
+
+
+
+###################################
+# Advanced settings
+###################################
+
+# Log driver for front service. Possible values:
+# json-file (default)
+# journald (On systemd platforms, useful for Fail2Ban integration)
+# syslog (Non systemd platforms, Fail2Ban integration. Disables `docker-compose log` for front!)
+# LOG_DRIVER=json-file
+
+# Docker-compose project name, this will prepended to containers names.
+COMPOSE_PROJECT_NAME=mailu
+
+# Default password scheme used for newly created accounts and changed passwords
+# (value: BLF-CRYPT, SHA512-CRYPT, SHA256-CRYPT, MD5-CRYPT, CRYPT)
+PASSWORD_SCHEME=BLF-CRYPT
+
+# Header to take the real ip from
+REAL_IP_HEADER=
+
+# IPs for nginx set_real_ip_from (CIDR list separated by commas)
+REAL_IP_FROM=
+
+# choose wether mailu bounces (no) or rejects (yes) mail when recipient is unknown (value: yes, no)
+REJECT_UNLISTED_RECIPIENT=
\ No newline at end of file
diff --git a/tests/compose/filters+dns/filters+dns.yml b/tests/compose/rainloop/docker-compose.yml
similarity index 68%
rename from tests/compose/filters+dns/filters+dns.yml
rename to tests/compose/rainloop/docker-compose.yml
index 993ed786..730e33d8 100644
--- a/tests/compose/filters+dns/filters+dns.yml
+++ b/tests/compose/rainloop/docker-compose.yml
@@ -9,13 +9,17 @@ services:
# External dependencies
redis:
image: redis:alpine
+ restart: always
volumes:
- "/mailu/redis:/data"
# Core services
front:
- image: mailu/nginx:master
+ image: ${DOCKER_ORG:-mailu}/nginx:${MAILU_VERSION:-master}
+ restart: always
env_file: mailu.env
+ logging:
+ driver: json-file
ports:
- "127.0.0.1:80:80"
- "::1:80:80"
@@ -37,17 +41,10 @@ services:
- "::1:993:993"
volumes:
- "/mailu/certs:/certs"
-
- resolver:
- image: mailu/unbound:master
- env_file: mailu.env
- restart: always
- networks:
- default:
- ipv4_address: 192.168.0.254
admin:
- image: mailu/admin:master
+ image: ${DOCKER_ORG:-mailu}/admin:${MAILU_VERSION:-master}
+ restart: always
env_file: mailu.env
volumes:
- "/mailu/data:/data"
@@ -56,7 +53,8 @@ services:
- redis
imap:
- image: mailu/dovecot:master
+ image: ${DOCKER_ORG:-mailu}/dovecot:${MAILU_VERSION:-master}
+ restart: always
env_file: mailu.env
volumes:
- "/mailu/mail:/mail"
@@ -65,19 +63,17 @@ services:
- front
smtp:
- image: mailu/postfix:master
+ image: ${DOCKER_ORG:-mailu}/postfix:${MAILU_VERSION:-master}
+ restart: always
env_file: mailu.env
volumes:
- "/mailu/overrides:/overrides"
depends_on:
- front
- - resolver
- dns:
- - 192.168.0.254
- # Optional services
antispam:
- image: mailu/rspamd:master
+ image: ${DOCKER_ORG:-mailu}/rspamd:${MAILU_VERSION:-master}
+ restart: always
env_file: mailu.env
volumes:
- "/mailu/filter:/var/lib/rspamd"
@@ -85,35 +81,17 @@ services:
- "/mailu/overrides/rspamd:/etc/rspamd/override.d"
depends_on:
- front
- - resolver
- dns:
- - 192.168.0.254
- antivirus:
- image: mailu/clamav:master
- env_file: mailu.env
- volumes:
- - "/mailu/filter:/data"
- depends_on:
- - resolver
- dns:
- - 192.168.0.254
+ # Optional services
# Webmail
webmail:
- image: mailu/rainloop:master
+ image: ${DOCKER_ORG:-mailu}/rainloop:${MAILU_VERSION:-master}
+ restart: always
env_file: mailu.env
volumes:
- "/mailu/webmail:/data"
depends_on:
- imap
-
-networks:
- default:
- driver: bridge
- ipam:
- driver: default
- config:
- - subnet: 192.168.0.0/24
diff --git a/tests/compose/rainloop/mailu.env b/tests/compose/rainloop/mailu.env
new file mode 100644
index 00000000..7ac75438
--- /dev/null
+++ b/tests/compose/rainloop/mailu.env
@@ -0,0 +1,139 @@
+# Mailu main configuration file
+#
+# Generated for compose flavor
+#
+# This file is autogenerated by the configuration management wizard.
+# For a detailed list of configuration variables, see the documentation at
+# https://mailu.io
+
+###################################
+# Common configuration variables
+###################################
+
+# Set this to the path where Mailu data and configuration is stored
+# This variable is now set directly in `docker-compose.yml by the setup utility
+# ROOT=/mailu
+
+# Mailu version to run (1.0, 1.1, etc. or master)
+#VERSION=master
+
+# Set to a randomly generated 16 bytes string
+SECRET_KEY=QWE7CJZOET9BN4BU
+
+# Address where listening ports should bind
+# This variables are now set directly in `docker-compose.yml by the setup utility
+# PUBLIC_IPV4= 127.0.0.1 (default: 127.0.0.1)
+# PUBLIC_IPV6= ::1 (default: ::1)
+
+# Main mail domain
+DOMAIN=mailu.io
+
+# Hostnames for this server, separated with comas
+HOSTNAMES=mail.mailu.io
+
+# Postmaster local part (will append the main mail domain)
+POSTMASTER=admin
+
+# Choose how secure connections will behave (value: letsencrypt, cert, notls, mail, mail-letsencrypt)
+TLS_FLAVOR=letsencrypt
+
+# Authentication rate limit (per source IP address)
+AUTH_RATELIMIT=10/minute;1000/hour
+
+# Opt-out of statistics, replace with "True" to opt out
+DISABLE_STATISTICS=False
+
+###################################
+# Optional features
+###################################
+
+# Expose the admin interface (value: true, false)
+ADMIN=true
+
+# Choose which webmail to run if any (values: roundcube, rainloop, none)
+WEBMAIL=rainloop
+
+# Dav server implementation (value: radicale, none)
+WEBDAV=none
+
+# Antivirus solution (value: clamav, none)
+#ANTIVIRUS=none
+
+#Antispam solution
+ANTISPAM=none
+
+###################################
+# Mail settings
+###################################
+
+# Message size limit in bytes
+# Default: accept messages up to 50MB
+MESSAGE_SIZE_LIMIT=50000000
+
+# Networks granted relay permissions, make sure that you include your Docker
+# internal network (default to 172.17.0.0/16)
+RELAYNETS=172.17.0.0/16
+
+# Will relay all outgoing mails if configured
+RELAYHOST=
+
+# Fetchmail delay
+FETCHMAIL_DELAY=600
+
+# Recipient delimiter, character used to delimiter localpart from custom address part
+RECIPIENT_DELIMITER=+
+
+# DMARC rua and ruf email
+DMARC_RUA=admin
+DMARC_RUF=admin
+
+
+# Maildir Compression
+# choose compression-method, default: none (value: bz2, gz)
+COMPRESSION=
+# change compression-level, default: 6 (value: 1-9)
+COMPRESSION_LEVEL=
+
+###################################
+# Web settings
+###################################
+
+# Path to the admin interface if enabled
+WEB_ADMIN=/admin
+
+# Path to the webmail if enabled
+WEB_WEBMAIL=/webmail
+
+# Website name
+SITENAME=Mailu
+
+# Linked Website URL
+WEBSITE=https://mailu.io
+
+
+
+###################################
+# Advanced settings
+###################################
+
+# Log driver for front service. Possible values:
+# json-file (default)
+# journald (On systemd platforms, useful for Fail2Ban integration)
+# syslog (Non systemd platforms, Fail2Ban integration. Disables `docker-compose log` for front!)
+# LOG_DRIVER=json-file
+
+# Docker-compose project name, this will prepended to containers names.
+COMPOSE_PROJECT_NAME=mailu
+
+# Default password scheme used for newly created accounts and changed passwords
+# (value: BLF-CRYPT, SHA512-CRYPT, SHA256-CRYPT, MD5-CRYPT, CRYPT)
+PASSWORD_SCHEME=BLF-CRYPT
+
+# Header to take the real ip from
+REAL_IP_HEADER=
+
+# IPs for nginx set_real_ip_from (CIDR list separated by commas)
+REAL_IP_FROM=
+
+# choose wether mailu bounces (no) or rejects (yes) mail when recipient is unknown (value: yes, no)
+REJECT_UNLISTED_RECIPIENT=
\ No newline at end of file
diff --git a/tests/compose/roundcube/roundcube.yml b/tests/compose/roundcube/docker-compose.yml
similarity index 64%
rename from tests/compose/roundcube/roundcube.yml
rename to tests/compose/roundcube/docker-compose.yml
index c6e46ed9..989f6a67 100644
--- a/tests/compose/roundcube/roundcube.yml
+++ b/tests/compose/roundcube/docker-compose.yml
@@ -9,13 +9,17 @@ services:
# External dependencies
redis:
image: redis:alpine
+ restart: always
volumes:
- "/mailu/redis:/data"
# Core services
front:
- image: mailu/nginx:master
+ image: ${DOCKER_ORG:-mailu}/nginx:${MAILU_VERSION:-master}
+ restart: always
env_file: mailu.env
+ logging:
+ driver: json-file
ports:
- "127.0.0.1:80:80"
- "::1:80:80"
@@ -37,10 +41,10 @@ services:
- "::1:993:993"
volumes:
- "/mailu/certs:/certs"
-
admin:
- image: mailu/admin:master
+ image: ${DOCKER_ORG:-mailu}/admin:${MAILU_VERSION:-master}
+ restart: always
env_file: mailu.env
volumes:
- "/mailu/data:/data"
@@ -49,7 +53,8 @@ services:
- redis
imap:
- image: mailu/dovecot:master
+ image: ${DOCKER_ORG:-mailu}/dovecot:${MAILU_VERSION:-master}
+ restart: always
env_file: mailu.env
volumes:
- "/mailu/mail:/mail"
@@ -58,27 +63,35 @@ services:
- front
smtp:
- image: mailu/postfix:master
+ image: ${DOCKER_ORG:-mailu}/postfix:${MAILU_VERSION:-master}
+ restart: always
env_file: mailu.env
volumes:
- "/mailu/overrides:/overrides"
depends_on:
- front
+ antispam:
+ image: ${DOCKER_ORG:-mailu}/rspamd:${MAILU_VERSION:-master}
+ restart: always
+ env_file: mailu.env
+ volumes:
+ - "/mailu/filter:/var/lib/rspamd"
+ - "/mailu/dkim:/dkim"
+ - "/mailu/overrides/rspamd:/etc/rspamd/override.d"
+ depends_on:
+ - front
+
# Optional services
-
# Webmail
webmail:
- image: mailu/roundcube:master
+ image: ${DOCKER_ORG:-mailu}/roundcube:${MAILU_VERSION:-master}
+ restart: always
env_file: mailu.env
volumes:
- "/mailu/webmail:/data"
depends_on:
- imap
- - resolver
- dns:
- - 192.168.0.254
-
diff --git a/tests/compose/roundcube/mailu.env b/tests/compose/roundcube/mailu.env
new file mode 100644
index 00000000..3c092f15
--- /dev/null
+++ b/tests/compose/roundcube/mailu.env
@@ -0,0 +1,139 @@
+# Mailu main configuration file
+#
+# Generated for compose flavor
+#
+# This file is autogenerated by the configuration management wizard.
+# For a detailed list of configuration variables, see the documentation at
+# https://mailu.io
+
+###################################
+# Common configuration variables
+###################################
+
+# Set this to the path where Mailu data and configuration is stored
+# This variable is now set directly in `docker-compose.yml by the setup utility
+# ROOT=/mailu
+
+# Mailu version to run (1.0, 1.1, etc. or master)
+#VERSION=master
+
+# Set to a randomly generated 16 bytes string
+SECRET_KEY=KXGYDHIHWTS7VRUP
+
+# Address where listening ports should bind
+# This variables are now set directly in `docker-compose.yml by the setup utility
+# PUBLIC_IPV4= 127.0.0.1 (default: 127.0.0.1)
+# PUBLIC_IPV6= ::1 (default: ::1)
+
+# Main mail domain
+DOMAIN=mailu.io
+
+# Hostnames for this server, separated with comas
+HOSTNAMES=mail.mailu.io
+
+# Postmaster local part (will append the main mail domain)
+POSTMASTER=admin
+
+# Choose how secure connections will behave (value: letsencrypt, cert, notls, mail, mail-letsencrypt)
+TLS_FLAVOR=letsencrypt
+
+# Authentication rate limit (per source IP address)
+AUTH_RATELIMIT=10/minute;1000/hour
+
+# Opt-out of statistics, replace with "True" to opt out
+DISABLE_STATISTICS=False
+
+###################################
+# Optional features
+###################################
+
+# Expose the admin interface (value: true, false)
+ADMIN=true
+
+# Choose which webmail to run if any (values: roundcube, rainloop, none)
+WEBMAIL=roundcube
+
+# Dav server implementation (value: radicale, none)
+WEBDAV=none
+
+# Antivirus solution (value: clamav, none)
+#ANTIVIRUS=none
+
+#Antispam solution
+ANTISPAM=none
+
+###################################
+# Mail settings
+###################################
+
+# Message size limit in bytes
+# Default: accept messages up to 50MB
+MESSAGE_SIZE_LIMIT=50000000
+
+# Networks granted relay permissions, make sure that you include your Docker
+# internal network (default to 172.17.0.0/16)
+RELAYNETS=172.17.0.0/16
+
+# Will relay all outgoing mails if configured
+RELAYHOST=
+
+# Fetchmail delay
+FETCHMAIL_DELAY=600
+
+# Recipient delimiter, character used to delimiter localpart from custom address part
+RECIPIENT_DELIMITER=+
+
+# DMARC rua and ruf email
+DMARC_RUA=admin
+DMARC_RUF=admin
+
+
+# Maildir Compression
+# choose compression-method, default: none (value: bz2, gz)
+COMPRESSION=
+# change compression-level, default: 6 (value: 1-9)
+COMPRESSION_LEVEL=
+
+###################################
+# Web settings
+###################################
+
+# Path to the admin interface if enabled
+WEB_ADMIN=/admin
+
+# Path to the webmail if enabled
+WEB_WEBMAIL=/webmail
+
+# Website name
+SITENAME=Mailu
+
+# Linked Website URL
+WEBSITE=https://mailu.io
+
+
+
+###################################
+# Advanced settings
+###################################
+
+# Log driver for front service. Possible values:
+# json-file (default)
+# journald (On systemd platforms, useful for Fail2Ban integration)
+# syslog (Non systemd platforms, Fail2Ban integration. Disables `docker-compose log` for front!)
+# LOG_DRIVER=json-file
+
+# Docker-compose project name, this will prepended to containers names.
+COMPOSE_PROJECT_NAME=mailu
+
+# Default password scheme used for newly created accounts and changed passwords
+# (value: BLF-CRYPT, SHA512-CRYPT, SHA256-CRYPT, MD5-CRYPT, CRYPT)
+PASSWORD_SCHEME=BLF-CRYPT
+
+# Header to take the real ip from
+REAL_IP_HEADER=
+
+# IPs for nginx set_real_ip_from (CIDR list separated by commas)
+REAL_IP_FROM=
+
+# choose wether mailu bounces (no) or rejects (yes) mail when recipient is unknown (value: yes, no)
+REJECT_UNLISTED_RECIPIENT=
\ No newline at end of file
diff --git a/tests/compose/test-script.sh b/tests/compose/test-script.sh
deleted file mode 100755
index 0a3c2237..00000000
--- a/tests/compose/test-script.sh
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/bin/bash
-containers=(
- webmail
- imap
- smtp
- antispam
- admin
- redis
- antivirus
- webdav
-# fetchmail
- front
-)
-
-# Time to sleep in minutes after starting the containers
-WAIT=1
-
-containers_check() {
- status=0
- for container in "${containers[@]}"; do
- name="${DOCKER_ORG}_${container}_1"
- echo "Checking $name"
- docker inspect "$name" | grep '"Status": "running"' || status=1
- done
- docker ps -a
- return $status
-}
-
-container_logs() {
- for container in "${containers[@]}"; do
- name="${DOCKER_ORG}_${container}_1"
- echo "Showing logs for $name"
- docker container logs "$name"
- done
-}
-
-clean() {
- docker-compose -f tests/compose/run.yml -p $DOCKER_ORG down || exit 1
- rm -fv .env
-}
-
-# Cleanup before callig exit
-die() {
- clean
- exit $1
-}
-
-for file in tests/compose/*.env ; do
- cp $file .env
- docker-compose -f tests/compose/run.yml -p $DOCKER_ORG up -d
- echo -e "\nSleeping for ${WAIT} minutes" # Clean terminal distortion from docker-compose in travis
- travis_wait sleep ${WAIT}m || sleep ${WAIT}m #Fallback sleep for local run
- container_logs
- containers_check || die 1
- clean
-done
-
diff --git a/tests/compose/test.py b/tests/compose/test.py
index 95670e30..dfe07ea8 100755
--- a/tests/compose/test.py
+++ b/tests/compose/test.py
@@ -7,21 +7,16 @@ from colorama import Fore, Style
# Declare variables for service name and sleep time
test_name=sys.argv[1]
timeout=int(sys.argv[2])
+compose_file="tests/compose/" + test_name + "/docker-compose.yml"
client = docker.APIClient(base_url='unix://var/run/docker.sock')
containers = []
-# Start up containers
-def start():
- os.system("cp mailu.env " + test_name + "/")
- os.system("docker-compose -f " + test_name + "/" + test_name + ".yml -p $DOCKER_ORG up -d ")
-
# Stop containers
def stop(exit_code):
print_logs()
- os.system("docker-compose -f " + test_name + "/" + test_name + ".yml -p $DOCKER_ORG down")
- os.system("rm " + test_name +"/mailu.env")
+ os.system("docker-compose -f " + compose_file + " -p ${DOCKER_ORG:-mailu} down")
sys.exit(exit_code)
# Sleep for a defined amount of time
@@ -79,7 +74,8 @@ def hooks():
elif test_file.endswith(".sh"):
os.system("./" + test_name + "/" + test_file)
-start()
+# Start up containers
+os.system("docker-compose -f " + compose_file + " -p ${DOCKER_ORG:-mailu} up -d ")
print()
sleep()
print()
diff --git a/tests/compose/webdav/webdav.yml b/tests/compose/webdav/docker-compose.yml
similarity index 63%
rename from tests/compose/webdav/webdav.yml
rename to tests/compose/webdav/docker-compose.yml
index b4d222ef..7e28c4cc 100644
--- a/tests/compose/webdav/webdav.yml
+++ b/tests/compose/webdav/docker-compose.yml
@@ -9,13 +9,17 @@ services:
# External dependencies
redis:
image: redis:alpine
+ restart: always
volumes:
- "/mailu/redis:/data"
# Core services
front:
- image: mailu/nginx:master
+ image: ${DOCKER_ORG:-mailu}/nginx:${MAILU_VERSION:-master}
+ restart: always
env_file: mailu.env
+ logging:
+ driver: json-file
ports:
- "127.0.0.1:80:80"
- "::1:80:80"
@@ -37,10 +41,10 @@ services:
- "::1:993:993"
volumes:
- "/mailu/certs:/certs"
-
admin:
- image: mailu/admin:master
+ image: ${DOCKER_ORG:-mailu}/admin:${MAILU_VERSION:-master}
+ restart: always
env_file: mailu.env
volumes:
- "/mailu/data:/data"
@@ -49,7 +53,8 @@ services:
- redis
imap:
- image: mailu/dovecot:master
+ image: ${DOCKER_ORG:-mailu}/dovecot:${MAILU_VERSION:-master}
+ restart: always
env_file: mailu.env
volumes:
- "/mailu/mail:/mail"
@@ -58,22 +63,33 @@ services:
- front
smtp:
- image: mailu/postfix:master
+ image: ${DOCKER_ORG:-mailu}/postfix:${MAILU_VERSION:-master}
+ restart: always
env_file: mailu.env
volumes:
- "/mailu/overrides:/overrides"
depends_on:
- front
+ antispam:
+ image: ${DOCKER_ORG:-mailu}/rspamd:${MAILU_VERSION:-master}
+ restart: always
+ env_file: mailu.env
+ volumes:
+ - "/mailu/filter:/var/lib/rspamd"
+ - "/mailu/dkim:/dkim"
+ - "/mailu/overrides/rspamd:/etc/rspamd/override.d"
+ depends_on:
+ - front
+
# Optional services
-
webdav:
- image: mailu/radicale:master
+ image: ${DOCKER_ORG:-mailu}/radicale:${MAILU_VERSION:-master}
+ restart: always
env_file: mailu.env
volumes:
- "/mailu/dav:/data"
# Webmail
-
diff --git a/tests/compose/webdav/mailu.env b/tests/compose/webdav/mailu.env
new file mode 100644
index 00000000..acb48abb
--- /dev/null
+++ b/tests/compose/webdav/mailu.env
@@ -0,0 +1,139 @@
+# Mailu main configuration file
+#
+# Generated for compose flavor
+#
+# This file is autogenerated by the configuration management wizard.
+# For a detailed list of configuration variables, see the documentation at
+# https://mailu.io
+
+###################################
+# Common configuration variables
+###################################
+
+# Set this to the path where Mailu data and configuration is stored
+# This variable is now set directly in `docker-compose.yml by the setup utility
+# ROOT=/mailu
+
+# Mailu version to run (1.0, 1.1, etc. or master)
+#VERSION=master
+
+# Set to a randomly generated 16 bytes string
+SECRET_KEY=QDHY5C0EME3YBI2W
+
+# Address where listening ports should bind
+# This variables are now set directly in `docker-compose.yml by the setup utility
+# PUBLIC_IPV4= 127.0.0.1 (default: 127.0.0.1)
+# PUBLIC_IPV6= ::1 (default: ::1)
+
+# Main mail domain
+DOMAIN=mailu.io
+
+# Hostnames for this server, separated with comas
+HOSTNAMES=mail.mailu.io
+
+# Postmaster local part (will append the main mail domain)
+POSTMASTER=admin
+
+# Choose how secure connections will behave (value: letsencrypt, cert, notls, mail, mail-letsencrypt)
+TLS_FLAVOR=letsencrypt
+
+# Authentication rate limit (per source IP address)
+AUTH_RATELIMIT=10/minute;1000/hour
+
+# Opt-out of statistics, replace with "True" to opt out
+DISABLE_STATISTICS=False
+
+###################################
+# Optional features
+###################################
+
+# Expose the admin interface (value: true, false)
+ADMIN=true
+
+# Choose which webmail to run if any (values: roundcube, rainloop, none)
+WEBMAIL=none
+
+# Dav server implementation (value: radicale, none)
+WEBDAV=radicale
+
+# Antivirus solution (value: clamav, none)
+#ANTIVIRUS=none
+
+#Antispam solution
+ANTISPAM=none
+
+###################################
+# Mail settings
+###################################
+
+# Message size limit in bytes
+# Default: accept messages up to 50MB
+MESSAGE_SIZE_LIMIT=50000000
+
+# Networks granted relay permissions, make sure that you include your Docker
+# internal network (default to 172.17.0.0/16)
+RELAYNETS=172.17.0.0/16
+
+# Will relay all outgoing mails if configured
+RELAYHOST=
+
+# Fetchmail delay
+FETCHMAIL_DELAY=600
+
+# Recipient delimiter, character used to delimiter localpart from custom address part
+RECIPIENT_DELIMITER=+
+
+# DMARC rua and ruf email
+DMARC_RUA=admin
+DMARC_RUF=admin
+
+
+# Maildir Compression
+# choose compression-method, default: none (value: bz2, gz)
+COMPRESSION=
+# change compression-level, default: 6 (value: 1-9)
+COMPRESSION_LEVEL=
+
+###################################
+# Web settings
+###################################
+
+# Path to the admin interface if enabled
+WEB_ADMIN=/admin
+
+# Path to the webmail if enabled
+WEB_WEBMAIL=/webmail
+
+# Website name
+SITENAME=Mailu
+
+# Linked Website URL
+WEBSITE=https://mailu.io
+
+
+
+###################################
+# Advanced settings
+###################################
+
+# Log driver for front service. Possible values:
+# json-file (default)
+# journald (On systemd platforms, useful for Fail2Ban integration)
+# syslog (Non systemd platforms, Fail2Ban integration. Disables `docker-compose log` for front!)
+# LOG_DRIVER=json-file
+
+# Docker-compose project name, this will prepended to containers names.
+COMPOSE_PROJECT_NAME=mailu
+
+# Default password scheme used for newly created accounts and changed passwords
+# (value: BLF-CRYPT, SHA512-CRYPT, SHA256-CRYPT, MD5-CRYPT, CRYPT)
+PASSWORD_SCHEME=BLF-CRYPT
+
+# Header to take the real ip from
+REAL_IP_HEADER=
+
+# IPs for nginx set_real_ip_from (CIDR list separated by commas)
+REAL_IP_FROM=
+
+# choose wether mailu bounces (no) or rejects (yes) mail when recipient is unknown (value: yes, no)
+REJECT_UNLISTED_RECIPIENT=
\ No newline at end of file
From 1e3392e4175ff41d0dfc61c8fba40914e7d179ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tim=20M=C3=B6hlmann?=
Date: Thu, 25 Oct 2018 17:37:22 +0300
Subject: [PATCH 18/62] Antispam not an optional service, postfix fails without
it
---
setup/flavors/compose/docker-compose.yml | 4 +---
setup/flavors/stack/docker-compose.yml | 4 +---
setup/templates/steps/compose/02_services.html | 6 ------
setup/templates/steps/stack/02_services.html | 6 ------
4 files changed, 2 insertions(+), 18 deletions(-)
diff --git a/setup/flavors/compose/docker-compose.yml b/setup/flavors/compose/docker-compose.yml
index 14eeba3c..f2cbad23 100644
--- a/setup/flavors/compose/docker-compose.yml
+++ b/setup/flavors/compose/docker-compose.yml
@@ -66,8 +66,6 @@ services:
depends_on:
- front
- # Optional services
- {% if antispam_enabled %}
antispam:
image: ${DOCKER_ORG:-mailu}/rspamd:${MAILU_VERSION:-{{ version }}}
restart: always
@@ -78,8 +76,8 @@ services:
- "{{ root }}/overrides/rspamd:/etc/rspamd/override.d"
depends_on:
- front
- {% endif %}
+ # Optional services
{% if antivirus_enabled %}
antivirus:
image: ${DOCKER_ORG:-mailu}/clamav:${MAILU_VERSION:-{{ version }}}
diff --git a/setup/flavors/stack/docker-compose.yml b/setup/flavors/stack/docker-compose.yml
index 92a156c7..dd9ed7dc 100644
--- a/setup/flavors/stack/docker-compose.yml
+++ b/setup/flavors/stack/docker-compose.yml
@@ -65,8 +65,6 @@ services:
deploy:
replicas: {{ smtp_replicas }}
- # Optional services
- {% if antispam_enabled %}
antispam:
image: ${DOCKER_ORG:-mailu}/rspamd:${MAILU_VERSION:-{{ version }}}
env_file: {{ env }}
@@ -78,8 +76,8 @@ services:
- "{{ root }}/overrides/rspamd:/etc/rspamd/override.d"
deploy:
replicas: 1
- {% endif %}
+ # Optional services
{% if antivirus_enabled %}
antivirus:
image: ${DOCKER_ORG:-mailu}/clamav:${MAILU_VERSION:-{{ version }}}
diff --git a/setup/templates/steps/compose/02_services.html b/setup/templates/steps/compose/02_services.html
index 7117c490..424b22dc 100644
--- a/setup/templates/steps/compose/02_services.html
+++ b/setup/templates/steps/compose/02_services.html
@@ -32,12 +32,6 @@ will prevent Mailu from doing spam filtering, virus filtering, and from applying
white and blacklists that you may configure in the admin interface. You may
also disable the antivirus if required (it does use aroung 1GB of ram).
-
-
-
+
+
+
+
{% endcall %}
diff --git a/setup/templates/steps/config.html b/setup/templates/steps/config.html
index 88c17597..a3352b7e 100644
--- a/setup/templates/steps/config.html
+++ b/setup/templates/steps/config.html
@@ -68,11 +68,29 @@ Or in plain english: if receivers start to classify your mail as spam, this post
manage your email domains, users, etc.
- Enable the admin UI (and path to the admin UI)
-
-
-
-
+
+ Enable the admin UI (and path to the admin UI)
+