From bb5d0078824c70870aa3b4da9120c6911284ff29 Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Wed, 15 Feb 2023 10:00:03 +0100 Subject: [PATCH 01/11] s/docker\-compose\([^\.]\)/docker compose\1/g --- CHANGELOG.md | 6 ++--- ISSUE_TEMPLATE.md | 4 ++-- RELEASE_TEMPLATE.md | 2 +- design/mailu-directory-structure.md | 6 ++--- docs/antispam.rst | 14 +++++------ docs/cli.rst | 30 ++++++++++++------------ docs/compose/.env | 2 +- docs/compose/requirements.rst | 6 ++--- docs/compose/setup.rst | 4 ++-- docs/contributors/environment.rst | 12 +++++----- docs/database.rst | 24 +++++++++---------- docs/faq.rst | 14 +++++------ docs/maintain.rst | 8 +++---- docs/releases.rst | 10 ++++---- docs/setup.rst | 2 +- setup/flavors/compose/mailu.env | 2 +- setup/flavors/compose/setup.html | 4 ++-- tests/compose/core/00_create_users.sh | 10 ++++---- tests/compose/core/02_forward_test.sh | 4 ++-- tests/compose/core/03_alias_test.sh | 4 ++-- tests/compose/core/04_reply_test.sh | 4 ++-- tests/compose/core/mailu.env | 2 +- tests/compose/fetchmail/mailu.env | 2 +- tests/compose/filters/00_create_users.sh | 4 ++-- tests/compose/filters/mailu.env | 2 +- tests/compose/test.py | 4 ++-- tests/compose/webdav/mailu.env | 2 +- tests/compose/webmail/mailu.env | 2 +- 28 files changed, 95 insertions(+), 95 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e793564..e413e7d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ These settings tell Mailu that the HTTP header with the remote client IP address For more information see the [configuration reference](https://mailu.io/1.9/configuration.html#advanced-settings). One major change for the docker compose file is that the antispam container needs a fixed hostname [#1837](https://github.com/Mailu/Mailu/issues/1837). -This is handled when you regenerate the docker-compose file. A fixed hostname is required to retain rspamd history. +This is handled when you regenerate the docker compose file. A fixed hostname is required to retain rspamd history. After changing mailu.env, it is required to recreate all containers for the changes to be propagated. @@ -314,8 +314,8 @@ v1.6.0 - 2019-01-18 - Enhancement: Reverse proxy - Real ip header and mail-letsencrypt ([#358](https://github.com/Mailu/Mailu/issues/358)) - Enhancement: Parametrize hosts ([#373](https://github.com/Mailu/Mailu/issues/373)) - Enhancement: Expose ports in dockerfiles ([#392](https://github.com/Mailu/Mailu/issues/392)) -- Enhancement: Added webmail-imap dependency in docker-compose ([#403](https://github.com/Mailu/Mailu/issues/403)) -- Enhancement: Add environment variables to allow running outside of docker-compose ([#429](https://github.com/Mailu/Mailu/issues/429)) +- Enhancement: Added webmail-imap dependency in docker compose ([#403](https://github.com/Mailu/Mailu/issues/403)) +- Enhancement: Add environment variables to allow running outside of docker compose ([#429](https://github.com/Mailu/Mailu/issues/429)) - Enhancement: Add original Delivered-To header to received messages ([#433](https://github.com/Mailu/Mailu/issues/433)) - Enhancement: Use HOST_ADMIN in "Forwarding authentication server" ([#436](https://github.com/Mailu/Mailu/issues/436), [#437](https://github.com/Mailu/Mailu/issues/437)) - Enhancement: Use POD_ADDRESS_RANGE for Dovecot ([#448](https://github.com/Mailu/Mailu/issues/448)) diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md index 7c05deae..fbc83ffb 100644 --- a/ISSUE_TEMPLATE.md +++ b/ISSUE_TEMPLATE.md @@ -19,7 +19,7 @@ Please put your text outside of the comment blocks to be visible. You can use th ### Environment -- [ ] docker-compose +- [ ] docker compose - [ ] kubernetes - [ ] docker swarm @@ -61,7 +61,7 @@ Just saying "it doesn’t work as expected" is not useful. It's also helpful to Often it is very useful to include log fragments of the involved component. You can get the logs via `docker logs --tail 1000`. For example for the admin container: `docker logs mailu_admin_1 --tail 1000` -or using docker-compose `docker-compose -f /mailu/docker-compose.yml logs --tail 1000 admin` +or using docker compose `docker compose -f /mailu/docker-compose.yml logs --tail 1000 admin` If you can find the relevant section, please share only the parts that seem relevant. If you have any logs, please enclose them in code tags, like so: diff --git a/RELEASE_TEMPLATE.md b/RELEASE_TEMPLATE.md index 45641c2f..1455b883 100644 --- a/RELEASE_TEMPLATE.md +++ b/RELEASE_TEMPLATE.md @@ -1,5 +1,5 @@ This is a new automatic release of Mailu. The new version can be seen in the tag name. -The main version X.Y (e.g. 1.9) will always reflect the latest version of the branch. To update your Mailu installation simply pull the latest images `docker-compose pull && docker-compose up -d`. +The main version X.Y (e.g. 1.9) will always reflect the latest version of the branch. To update your Mailu installation simply pull the latest images `docker compose pull && docker compose up -d`. The pinned version X.Y.Z (e.g. 1.9.1) is not updated. It is pinned to the commit that was used for creating this release. You can use a pinned version to make sure your Mailu installation is not suddenly updated when recreating containers. The pinned version allows the user to manually update. It also allows to go back to a previous pinned version. To check what was changed: diff --git a/design/mailu-directory-structure.md b/design/mailu-directory-structure.md index 5d62c85d..69c666d7 100644 --- a/design/mailu-directory-structure.md +++ b/design/mailu-directory-structure.md @@ -88,7 +88,7 @@ If RFC issue #1222 is accepted, Dovecot will need read-only access to the certif - Path: `/mailu/data/` -Database files, like SQLite or PostgreSQL files. Databases don't perform well on network filesystems as they depend heavily on file locking and full controll on the database files. Making it unfit for concurrent access from multiple hosts. This directory should always live on a local filesystem. This makes it only usable in `docker-compose` deployments. Usage of this directory should be avoided in Kubernetes and Docker Swarm deployments. Some services will need to be improved to allow for this. +Database files, like SQLite or PostgreSQL files. Databases don't perform well on network filesystems as they depend heavily on file locking and full controll on the database files. Making it unfit for concurrent access from multiple hosts. This directory should always live on a local filesystem. This makes it only usable in `docker compose` deployments. Usage of this directory should be avoided in Kubernetes and Docker Swarm deployments. Some services will need to be improved to allow for this. #### admin data @@ -138,7 +138,7 @@ In the old situation, Maildir indexes are stored on the same volume. However, th - Path: `/mailu/local` (new) -Persistent storage not suitable for replication. In `docker-compose` deployments it lives inside `/mailu` and in replicated deployments it should live somewhere on the local host machine. +Persistent storage not suitable for replication. In `docker compose` deployments it lives inside `/mailu` and in replicated deployments it should live somewhere on the local host machine. #### Mailqueue @@ -185,7 +185,7 @@ The final layout of the Mailu filesystem will look like: Where in replicated environments: - `/mailu/config/`: should be a small, low performant and shared filesystem. -- `/mailu/data`: should be avoided. More work will need to be done to configure external DB servers for relevant services. Ideally, this directory should only exist on docker-compose deployments. +- `/mailu/data`: should be avoided. More work will need to be done to configure external DB servers for relevant services. Ideally, this directory should only exist on docker compose deployments. - `/mailu/local/`: Should exist only on local file systems of worker nodes. - `/mailu/mail`: A distributed filesystem with sufficient performance and storage requirements to hold and process all user mailboxes. Ideally only Maildir without indexes. diff --git a/docs/antispam.rst b/docs/antispam.rst index fb97e66a..7b0c7373 100644 --- a/docs/antispam.rst +++ b/docs/antispam.rst @@ -125,12 +125,12 @@ The following steps have to be taken to configure an additional symbol (rule) th #This file is LIVE reloaded by rspamd. Any changes are EFFECTIVE IMMEDIATELY. dummy.com -3. Reload Rspamd by stopping the Rspamd container and starting the Rspamd container again. Example for docker-compose setup: +3. Reload Rspamd by stopping the Rspamd container and starting the Rspamd container again. Example for docker compose setup: .. code-block:: bash - docker-compose scale antispam=0 - docker-compose scale antispam=1 + docker compose scale antispam=0 + docker compose scale antispam=1 4. (Optional) Check if the custom symbol is loaded. To access the Rspamd webgui, log in the Mailu administration web interface with a user that is an administrator and go to Antispam. In Rspamd webgui go to tab Symbols. Change the group drop-down box to local_bl. The following additional rule will be listed. @@ -163,8 +163,8 @@ Mailu rejects emails with file attachements it deems to be "executable" or other .. code-block:: bash - docker-compose exec antispam cat /etc/rspamd/local.d/forbidden_file_extension.map > overrides/rspamd/forbidden_file_extension.map - docker-compose restart antispam + docker compose exec antispam cat /etc/rspamd/local.d/forbidden_file_extension.map > overrides/rspamd/forbidden_file_extension.map + docker compose restart antispam Now the file `overrides/rspamd/forbidden_file_extension.map` can be edited, to make changes to the forbidden file extensions list. For the changes to take effect, rspamd must be restarted. @@ -176,8 +176,8 @@ If configured to do so, Mailu uses a lightweight tool called `mraptor from oleto .. code-block:: bash - docker-compose exec antispam cat /etc/rspamd/local.d/composites.conf > overrides/rspamd/composites.conf - docker-compose restart antispam + docker compose exec antispam cat /etc/rspamd/local.d/composites.conf > overrides/rspamd/composites.conf + docker compose restart antispam Now the file `overrides/rspamd/composites.conf` can be edited, to override the mraptor configuration in rspamd. For the changes to take effect, rspamd must be restarted. diff --git a/docs/cli.rst b/docs/cli.rst index 5513e41f..2c325110 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -19,7 +19,7 @@ alias .. code-block:: bash - docker-compose exec admin flask mailu alias foo example.net "mail1@example.com,mail2@example.com" + docker compose exec admin flask mailu alias foo example.net "mail1@example.com,mail2@example.com" alias-delete @@ -27,7 +27,7 @@ alias-delete .. code-block:: bash - docker-compose exec admin flask mailu alias-delete foo@example.net + docker compose exec admin flask mailu alias-delete foo@example.net domain @@ -35,7 +35,7 @@ domain .. code-block:: bash - docker-compose exec admin flask mailu domain example.net + docker compose exec admin flask mailu domain example.net password @@ -43,7 +43,7 @@ password .. code-block:: bash - docker-compose exec admin flask mailu password myuser example.net 'password123' + docker compose exec admin flask mailu password myuser example.net 'password123' user @@ -51,7 +51,7 @@ user .. code-block:: bash - docker-compose exec admin flask mailu user myuser example.net 'password123' + docker compose exec admin flask mailu user myuser example.net 'password123' user-import @@ -61,14 +61,14 @@ primary difference with simple `user` command is that password is being imported .. code-block:: bash - docker-compose run --rm admin flask mailu user-import myuser example.net '$6$51ebe0cb9f1dab48effa2a0ad8660cb489b445936b9ffd812a0b8f46bca66dd549fea530ce' 'SHA512-CRYPT' + docker compose run --rm admin flask mailu user-import myuser example.net '$6$51ebe0cb9f1dab48effa2a0ad8660cb489b445936b9ffd812a0b8f46bca66dd549fea530ce' 'SHA512-CRYPT' user-delete ----------- .. code-block:: bash - docker-compose exec admin flask mailu user-delete foo@example.net + docker compose exec admin flask mailu user-delete foo@example.net config-update ------------- @@ -77,7 +77,7 @@ The sole purpose of this command is for importing users/aliases in bulk and sync .. code-block:: bash - cat mail-config.yml | docker-compose exec -T admin flask mailu config-update --delete-objects + cat mail-config.yml | docker compose exec -T admin flask mailu config-update --delete-objects where mail-config.yml looks like: @@ -131,7 +131,7 @@ The purpose of this command is to export the complete configuration in YAML or J .. code-block:: bash - $ docker-compose exec admin flask mailu config-export --help + $ docker compose exec admin flask mailu config-export --help Usage: flask mailu config-export [OPTIONS] [FILTER]... @@ -156,11 +156,11 @@ Attributes explicitly specified in filters are automatically exported: there is .. code-block:: bash - $ docker-compose exec admin flask mailu config-export --output mail-config.yml + $ docker compose exec admin flask mailu config-export --output mail-config.yml - $ docker-compose exec admin flask mailu config-export domain.dns_mx domain.dns_spf + $ docker compose exec admin flask mailu config-export domain.dns_mx domain.dns_spf - $ docker-compose exec admin flask mailu config-export user.spam_threshold + $ docker compose exec admin flask mailu config-export user.spam_threshold config-import ------------- @@ -169,7 +169,7 @@ This command imports configuration data from an external YAML or JSON source. .. code-block:: bash - $ docker-compose exec admin flask mailu config-import --help + $ docker compose exec admin flask mailu config-import --help Usage: flask mailu config-import [OPTIONS] [FILENAME|-] @@ -184,11 +184,11 @@ This command imports configuration data from an external YAML or JSON source. -n, --dry-run Perform a trial run with no changes made. -?, -h, --help Show this message and exit. -The current version of docker-compose exec does not pass stdin correctly, so you have to user docker exec instead: +The current version of docker compose exec does not pass stdin correctly, so you have to user docker exec instead: .. code-block:: bash - docker exec -i $(docker-compose ps -q admin) flask mailu config-import -nv < mail-config.yml + docker exec -i $(docker compose ps -q admin) flask mailu config-import -nv < mail-config.yml mail-config.yml contains the configuration and looks like this: diff --git a/docs/compose/.env b/docs/compose/.env index 265b4bad..e5e1edbf 100644 --- a/docs/compose/.env +++ b/docs/compose/.env @@ -138,7 +138,7 @@ WEBSITE=https://mailu.io # 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!) +# 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. diff --git a/docs/compose/requirements.rst b/docs/compose/requirements.rst index a9ec6eab..60a721e7 100644 --- a/docs/compose/requirements.rst +++ b/docs/compose/requirements.rst @@ -91,7 +91,7 @@ The Docker website is full of `detailed instructions`_ about setting up a proper Docker install. Default configuration should be suited for Mailu. -Additionally, you must install ``docker-compose`` by following the instructions +Additionally, you must install ``docker compose`` by following the instructions from the `Docker website`_ if you plan on using the Compose flavor. Compose is a management tool for Docker, especially suited for multiple containers systems like Mailu. @@ -121,8 +121,8 @@ Once everything is setup, you should be able to run the following commands Built: Mon May 2 00:06:51 2016 OS/Arch: linux/amd64 - $ docker-compose version - docker-compose version 1.7.1, build 6c29830 + $ docker compose version + docker compose version 1.7.1, build 6c29830 docker-py version: 1.8.1 CPython version: 3.5.1 OpenSSL version: OpenSSL 1.0.2h 3 May 2016 diff --git a/docs/compose/setup.rst b/docs/compose/setup.rst index 57c9b761..f4c9c574 100644 --- a/docs/compose/setup.rst +++ b/docs/compose/setup.rst @@ -95,7 +95,7 @@ You may now start Mailu. Move the to the Mailu directory and run: .. code-block:: bash - docker-compose up -d + docker compose up -d Finally, you need an admin user account. @@ -106,7 +106,7 @@ Else, if you don't go with the automatic way, you need to manually create the ad .. code-block:: bash - docker-compose exec admin flask mailu admin me example.net 'password' + docker compose exec admin flask mailu admin me example.net 'password' This will create a user named ``me@example.net`` with password ``password`` and administration privileges. Connect to the Web admin interface and change the password to a strong one. diff --git a/docs/contributors/environment.rst b/docs/contributors/environment.rst index 25f6fbc0..d1b26787 100644 --- a/docs/contributors/environment.rst +++ b/docs/contributors/environment.rst @@ -153,25 +153,25 @@ After that you can run: .. code-block:: bash - docker-compose up -d + docker compose up -d If you wish to run commands inside a container, simply run (example): .. code-block:: bash - docker-compose exec admin ls -lah / + docker compose exec admin ls -lah / Or if you wish to start a shell for debugging: .. code-block:: bash - docker-compose exec admin sh + docker compose exec admin sh Finally, if you need to install packages inside the containers for debugging: .. code-block:: bash - docker-compose exec admin apk add --no-cache package-name + docker compose exec admin apk add --no-cache package-name Reviewing --------- @@ -215,8 +215,8 @@ For example, to test PR #500 against master, reviewers can use: export DOCKER_ORG="mailuci" export MAILU_VERSION="pr-500" - docker-compose pull - docker-compose up -d + docker compose pull + docker compose up -d You can now test the PR. Play around. See if (external) mails work. Check for whatever functionality the PR is trying to fix. When happy, you can approve the PR. When running into failures, mark the review as diff --git a/docs/database.rst b/docs/database.rst index fa6a199e..31abc191 100644 --- a/docs/database.rst +++ b/docs/database.rst @@ -15,11 +15,11 @@ This means it is not possible to switch the database back-end used by roundcube To switch to a different database back-end: -1. Run config-export to export the configuration. E.g. `docker-compose exec admin flask mailu config-export --secrets --output mail-config.yml` +1. Run config-export to export the configuration. E.g. `docker compose exec admin flask mailu config-export --secrets --output mail-config.yml` 2. Set up your new database server. Refer to the subsequent sections for tips for creating the database. 3. Modify the database settings (DB_*) in mailu.env. Refer to the :ref:`configuration guide (link) ` for the exact settings. 4. Start your Mailu deployment. -5. Run config-import to import the configuration. E.g. `docker exec -i $(docker-compose ps -q admin) flask mailu config-import -v < mail-config.yml` +5. Run config-import to import the configuration. E.g. `docker exec -i $(docker compose ps -q admin) flask mailu config-import -v < mail-config.yml` Mailu has now been switched to the new database back-end. The Mailu configuration has also been migrated. @@ -114,22 +114,22 @@ Prepare the environment. Mailu must not be in use. Only the database container. 1. Open a terminal. 2. `cd /mailu` -3. `docker-compose -p mailu down` -4. `docker-compose -p mailu up -d database` +3. `docker compose -p mailu down` +4. `docker compose -p mailu up -d database` Create the dump SQL file for recreating the database. -1. `docker-compose -p mailu exec database /bin/bash` +1. `docker compose -p mailu exec database /bin/bash` 2. `pg_dump -h database -p 5432 -U mailu > /backup/backup_db.sql` 3. Enter the password. See the value of DB_PW in mailu.env. 4. `exit` 5. The dump is saved to /mailu/data/psql_backup/backup_db.sql. -6. `docker-compose -p mailu down` +6. `docker compose -p mailu down` Prepare the new PostgreSQL deployment. 1. `mkdir -p /mailu/data/external_psql/pgdata` -2. Create the file docker-compose-postgresql.yml with the following contents: +2. Create the file docker compose-postgresql.yml with the following contents: .. code-block:: docker @@ -147,12 +147,12 @@ Prepare the new PostgreSQL deployment. - "/mailu/data/psql_backup:/dump" -3. `docker-compose -f docker-compose-postgresql.yml up -d` -4. `docker-compose -f docker-compose-postgresql.yml exec database /bin/bash` +3. `docker compose -f docker compose-postgresql.yml up -d` +4. `docker compose -f docker compose-postgresql.yml exec database /bin/bash` 5. `cat /dump/backup_db.sql | psql -h localhost -p 5432 -U mailu` 6. `exit` -7. `docker-compose -f docker-compose-postgresql.yml down` -8. Remove the file docker-compose-postgresql.yml. +7. `docker compose -f docker compose-postgresql.yml down` +8. Remove the file docker compose-postgresql.yml. The new PostgreSQL deployment has the dump loaded now. Now it is time to modify Mailu to use the official PostgreSQL docker image. @@ -199,7 +199,7 @@ to Mailu is now configured to use the official PostgreSQL docker image. Bring your new deployment online -1. `docker-compose -p mailu up -d` +1. `docker compose -p mailu up -d` Optionally you can remove left-over files which were used by the old database: diff --git a/docs/faq.rst b/docs/faq.rst index c73304b0..93bc384e 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -401,8 +401,8 @@ down and up again. A container restart is not sufficient. .. code-block:: bash - docker-compose down && \ - docker-compose up -d + docker compose down && \ + docker compose up -d *Issue reference:* `615`_. @@ -479,8 +479,8 @@ to check the logs. .. code-block:: bash - docker-compose logs front | less -R - docker-compose exec front less /var/log/letsencrypt/letsencrypt.log + docker compose logs front | less -R + docker compose exec front less /var/log/letsencrypt/letsencrypt.log Common problems: @@ -551,7 +551,7 @@ See the :ref:`[configuration reference ` for more informa Assuming you have a working Fail2Ban installation on the host running your Docker containers, follow these steps: -1. In the mailu docker-compose set the logging driver of the front container to journald; and set the tag to mailu-front +1. In the mailu docker compose set the logging driver of the front container to journald; and set the tag to mailu-front .. code-block:: bash @@ -585,7 +585,7 @@ follow these steps: The above will block flagged IPs for a week, you can of course change it to your needs. -4. In the mailu docker-compose set the logging driver of the Admin container to journald; and set the tag to mailu-admin +4. In the mailu docker compose set the logging driver of the Admin container to journald; and set the tag to mailu-admin .. code-block:: bash @@ -790,7 +790,7 @@ In many cases, Docker Compose will complain about the yaml syntax because it is Unless your distribution has proper up-to-date packages for Compose, we strongly advise that you install it either: - from the Docker-CE repositories along with Docker CE itself, - - from PyPI using `pip install docker-compose` or + - from PyPI using `pip install docker compose` or - from Github by downloading it directly. Detailed instructions can be found at https://docs.docker.com/compose/install/ diff --git a/docs/maintain.rst b/docs/maintain.rst index ec004006..eff8f5c4 100644 --- a/docs/maintain.rst +++ b/docs/maintain.rst @@ -14,9 +14,9 @@ simply pull the latest images and recreate the containers : .. code-block:: bash - docker-compose pull - docker-compose down - docker-compose up -d + docker compose pull + docker compose down + docker compose up -d Monitoring the mail server -------------------------- @@ -25,7 +25,7 @@ Logs are managed by Docker directly. You can easily read your logs using: .. code-block:: bash - docker-compose logs + docker compose logs Docker is able to forward logs to multiple log engines. Read the following documentation for details: https://docs.docker.com/engine/admin/logging/overview/. diff --git a/docs/releases.rst b/docs/releases.rst index 51d904ed..4a8e8731 100644 --- a/docs/releases.rst +++ b/docs/releases.rst @@ -382,9 +382,9 @@ For this upgrade it is necessary to bring the project down and up, due to networ .. code-block:: bash - docker-compose pull - docker-compose down --remove-orphans - docker-compose up -d + docker compose pull + docker compose down --remove-orphans + docker compose up -d After everything runs successfully, ``/mailu/certs/dhparam.pem`` is no longer needed and can be deleted. It's included in the Mailu distribution by default now. Also the old ``.env`` can be deleted. @@ -441,8 +441,8 @@ were removed (e.g. rmilter): .. code-block:: bash - docker-compose pull - docker-compose up -d --remove-orphans + docker compose pull + docker compose up -d --remove-orphans If you experience problems when upgrading, feel free to post issues and contact us on our chat channel for emergency support. diff --git a/docs/setup.rst b/docs/setup.rst index 64ba2bec..e7ede399 100644 --- a/docs/setup.rst +++ b/docs/setup.rst @@ -67,7 +67,7 @@ Make sure that you test properly before going live! - Try to send an email to an external service - On the external service, verify that DKIM and SPF are listed as passing - Try to receive an email from an external service -- Check the logs (``docker-compose logs -f servicenamehere``) to look for +- Check the logs (``docker compose logs -f servicenamehere``) to look for warnings or errors - Use an open relay checker like `mxtoolbox`_ to ensure you're not contributing to the spam problem on the internet. diff --git a/setup/flavors/compose/mailu.env b/setup/flavors/compose/mailu.env index 8fac8ad9..e6b40a61 100644 --- a/setup/flavors/compose/mailu.env +++ b/setup/flavors/compose/mailu.env @@ -161,7 +161,7 @@ DOMAIN_REGISTRATION=true # 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!) +# syslog (Non systemd platforms, Fail2Ban integration. Disables `docker compose log` for front!) # LOG_DRIVER={{ log_driver or 'json-file' }} # Docker-compose project name, this will prepended to containers names. diff --git a/setup/flavors/compose/setup.html b/setup/flavors/compose/setup.html index 3aa88809..85744192 100644 --- a/setup/flavors/compose/setup.html +++ b/setup/flavors/compose/setup.html @@ -31,12 +31,12 @@ files before going any further.

command using -p mailu flag for project name.

cd {{ root }}
-docker-compose -p mailu 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: -
docker-compose -p mailu exec admin flask mailu admin {{ postmaster }} {{ domain }} PASSWORD
+
docker compose -p mailu exec admin flask mailu admin {{ postmaster }} {{ domain }} PASSWORD
 

Login to the admin interface to change the password for a safe one, at diff --git a/tests/compose/core/00_create_users.sh b/tests/compose/core/00_create_users.sh index 2e36189f..26461966 100755 --- a/tests/compose/core/00_create_users.sh +++ b/tests/compose/core/00_create_users.sh @@ -1,11 +1,11 @@ echo "Users tests ..." # Should fail, admin is already auto-created -docker-compose -f tests/compose/core/docker-compose.yml exec -T admin flask mailu admin admin mailu.io 'FooBar' && exit 1 +docker compose -f tests/compose/core/docker-compose.yml exec -T admin flask mailu admin admin mailu.io 'FooBar' && exit 1 echo "The above error was intended!" # Should not fail, but does nothing; ifmissing mode -docker-compose -f tests/compose/core/docker-compose.yml exec -T admin flask mailu admin admin mailu.io 'FooBar' --mode=ifmissing || exit 1 +docker compose -f tests/compose/core/docker-compose.yml exec -T admin flask mailu admin admin mailu.io 'FooBar' --mode=ifmissing || exit 1 # Should not fail and update the password; update mode -docker-compose -f tests/compose/core/docker-compose.yml exec -T admin flask mailu admin admin mailu.io 'password' --mode=update || exit 1 -docker-compose -f tests/compose/core/docker-compose.yml exec -T admin flask mailu user user mailu.io 'password' || exit 1 -docker-compose -f tests/compose/core/docker-compose.yml exec -T admin flask mailu user 'user/with/slash' mailu.io 'password' || exit 1 +docker compose -f tests/compose/core/docker-compose.yml exec -T admin flask mailu admin admin mailu.io 'password' --mode=update || exit 1 +docker compose -f tests/compose/core/docker-compose.yml exec -T admin flask mailu user user mailu.io 'password' || exit 1 +docker compose -f tests/compose/core/docker-compose.yml exec -T admin flask mailu user 'user/with/slash' mailu.io 'password' || exit 1 echo "User testing successful!" diff --git a/tests/compose/core/02_forward_test.sh b/tests/compose/core/02_forward_test.sh index a53fa459..43eb8f99 100755 --- a/tests/compose/core/02_forward_test.sh +++ b/tests/compose/core/02_forward_test.sh @@ -1,4 +1,4 @@ -cat << EOF | docker-compose -f tests/compose/core/docker-compose.yml exec -T admin flask mailu config-update -v 1 +cat << EOF | docker compose -f tests/compose/core/docker-compose.yml exec -T admin flask mailu config-update -v 1 users: - localpart: forwardinguser password_hash: "\$1\$F2OStvi1\$Q8hBIHkdJpJkJn/TrMIZ9/" @@ -9,7 +9,7 @@ EOF python3 tests/forward_test.py -cat << EOF | docker-compose -f tests/compose/core/docker-compose.yml exec -T admin flask mailu config-update -v 1 +cat << EOF | docker compose -f tests/compose/core/docker-compose.yml exec -T admin flask mailu config-update -v 1 users: - localpart: forwardinguser password_hash: "\$1\$F2OStvi1\$Q8hBIHkdJpJkJn/TrMIZ9/" diff --git a/tests/compose/core/03_alias_test.sh b/tests/compose/core/03_alias_test.sh index dce1918a..6de31580 100755 --- a/tests/compose/core/03_alias_test.sh +++ b/tests/compose/core/03_alias_test.sh @@ -1,4 +1,4 @@ -cat << EOF | docker-compose -f tests/compose/core/docker-compose.yml exec -T admin flask mailu config-update -v 1 +cat << EOF | docker compose -f tests/compose/core/docker-compose.yml exec -T admin flask mailu config-update -v 1 aliases: - localpart: alltheusers domain: mailu.io @@ -7,6 +7,6 @@ EOF python3 tests/alias_test.py -cat << EOF | docker-compose -f tests/compose/core/docker-compose.yml exec -T admin flask mailu config-update -v 1 +cat << EOF | docker compose -f tests/compose/core/docker-compose.yml exec -T admin flask mailu config-update -v 1 aliases: [] EOF diff --git a/tests/compose/core/04_reply_test.sh b/tests/compose/core/04_reply_test.sh index e1479cf0..b2402878 100755 --- a/tests/compose/core/04_reply_test.sh +++ b/tests/compose/core/04_reply_test.sh @@ -1,4 +1,4 @@ -cat << EOF | docker-compose -f tests/compose/core/docker-compose.yml exec -T admin flask mailu config-update -v 1 +cat << EOF | docker compose -f tests/compose/core/docker-compose.yml exec -T admin flask mailu config-update -v 1 users: - localpart: replyuser password_hash: "\$1\$F2OStvi1\$Q8hBIHkdJpJkJn/TrMIZ9/" @@ -10,7 +10,7 @@ EOF python3 tests/reply_test.py -cat << EOF | docker-compose -f tests/compose/core/docker-compose.yml exec -T admin flask mailu config-update -v 1 +cat << EOF | docker compose -f tests/compose/core/docker-compose.yml exec -T admin flask mailu config-update -v 1 users: - localpart: replyuser password_hash: "\$1\$F2OStvi1\$Q8hBIHkdJpJkJn/TrMIZ9/" diff --git a/tests/compose/core/mailu.env b/tests/compose/core/mailu.env index 134b8e84..405d736f 100644 --- a/tests/compose/core/mailu.env +++ b/tests/compose/core/mailu.env @@ -128,7 +128,7 @@ WEBSITE=https://mailu.io # 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!) +# 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. diff --git a/tests/compose/fetchmail/mailu.env b/tests/compose/fetchmail/mailu.env index 0cc263e2..dfc35a7a 100644 --- a/tests/compose/fetchmail/mailu.env +++ b/tests/compose/fetchmail/mailu.env @@ -128,7 +128,7 @@ WEBSITE=https://mailu.io # 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!) +# 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. diff --git a/tests/compose/filters/00_create_users.sh b/tests/compose/filters/00_create_users.sh index 3c581685..137c1947 100755 --- a/tests/compose/filters/00_create_users.sh +++ b/tests/compose/filters/00_create_users.sh @@ -1,5 +1,5 @@ echo "Creating user required for next test ..." # Should not fail and update the password; update mode -docker-compose -f tests/compose/filters/docker-compose.yml exec -T admin flask mailu admin admin mailu.io 'password' --mode=update || exit 1 -docker-compose -f tests/compose/filters/docker-compose.yml exec -T admin flask mailu user user mailu.io 'password' || exit 1 +docker compose -f tests/compose/filters/docker-compose.yml exec -T admin flask mailu admin admin mailu.io 'password' --mode=update || exit 1 +docker compose -f tests/compose/filters/docker-compose.yml exec -T admin flask mailu user user mailu.io 'password' || exit 1 echo "User created successfully" diff --git a/tests/compose/filters/mailu.env b/tests/compose/filters/mailu.env index 2df09f61..ebf92b5a 100644 --- a/tests/compose/filters/mailu.env +++ b/tests/compose/filters/mailu.env @@ -128,7 +128,7 @@ WEBSITE=https://mailu.io # 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!) +# 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. diff --git a/tests/compose/test.py b/tests/compose/test.py index 02575535..caff6b6c 100755 --- a/tests/compose/test.py +++ b/tests/compose/test.py @@ -22,7 +22,7 @@ containers = [] def stop(exit_code): print_logs() sys.stdout.flush() - print(subprocess.check_output("docker-compose -f " + compose_file + " down", shell=True).decode()) + print(subprocess.check_output("docker compose -f " + compose_file + " down", shell=True).decode()) sys.exit(exit_code) def health_checks(deadline): @@ -88,7 +88,7 @@ def hooks(): sys.stdout.flush() deadline=datetime.datetime.now()+datetime.timedelta(minutes=timeout) deadline=calendar.timegm(deadline.timetuple()) -print(subprocess.check_output("docker-compose -f " + compose_file + " up -d", shell=True).decode()) +print(subprocess.check_output("docker compose -f " + compose_file + " up -d", shell=True).decode()) print() print(Fore.LIGHTMAGENTA_EX + "Sleeping for 10s" + Style.RESET_ALL) time.sleep(10) diff --git a/tests/compose/webdav/mailu.env b/tests/compose/webdav/mailu.env index f0842dd4..9d70c58d 100644 --- a/tests/compose/webdav/mailu.env +++ b/tests/compose/webdav/mailu.env @@ -128,7 +128,7 @@ WEBSITE=https://mailu.io # 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!) +# 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. diff --git a/tests/compose/webmail/mailu.env b/tests/compose/webmail/mailu.env index c1e0dff0..26fa5cdb 100644 --- a/tests/compose/webmail/mailu.env +++ b/tests/compose/webmail/mailu.env @@ -128,7 +128,7 @@ WEBSITE=https://mailu.io # 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!) +# 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. From b983c64b4b5ed42d2aaede8aa5fba8433f57597b Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Wed, 15 Feb 2023 10:28:48 +0100 Subject: [PATCH 02/11] Clarify we expect v2 --- docs/compose/requirements.rst | 50 +++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/docs/compose/requirements.rst b/docs/compose/requirements.rst index 60a721e7..3eacc017 100644 --- a/docs/compose/requirements.rst +++ b/docs/compose/requirements.rst @@ -91,7 +91,7 @@ The Docker website is full of `detailed instructions`_ about setting up a proper Docker install. Default configuration should be suited for Mailu. -Additionally, you must install ``docker compose`` by following the instructions +Additionally, you must install ``docker compose`` v2 by following the instructions from the `Docker website`_ if you plan on using the Compose flavor. Compose is a management tool for Docker, especially suited for multiple containers systems like Mailu. @@ -105,24 +105,34 @@ Once everything is setup, you should be able to run the following commands .. code-block:: bash $ docker version - Client: - Version: 1.11.2 - API version: 1.23 - Go version: go1.6.2 - Git commit: b9f10c9 - Built: Sun Jun 5 23:17:55 2016 - OS/Arch: linux/amd64 - - Server: - Version: 1.11.1 - API version: 1.23 - Go version: go1.6.2 - Git commit: 5604cbe - Built: Mon May 2 00:06:51 2016 - OS/Arch: linux/amd64 + Client: Docker Engine - Community + Version: 20.10.22 + API version: 1.41 + Go version: go1.18.9 + Git commit: 3a2c30b + Built: Thu Dec 15 22:27:03 2022 + OS/Arch: linux/arm64 + Context: default + Experimental: true + + Server: Docker Engine - Community + Engine: + Version: 20.10.22 + API version: 1.41 (minimum version 1.12) + Go version: go1.18.9 + Git commit: 42c8b31 + Built: Thu Dec 15 22:25:25 2022 + OS/Arch: linux/arm64 + Experimental: false + containerd: + Version: 1.6.14 + GitCommit: 9ba4b250366a5ddde94bb7c9d1def331423aa323 + runc: + Version: 1.1.4 + GitCommit: v1.1.4-0-g5fd4c4d + docker-init: + Version: 0.19.0 + GitCommit: de40ad0 $ docker compose version - docker compose version 1.7.1, build 6c29830 - docker-py version: 1.8.1 - CPython version: 3.5.1 - OpenSSL version: OpenSSL 1.0.2h 3 May 2016 + Docker Compose version v2.14.1 From 23ae60e3df563e16c084da8143a1d30e6f25dced Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Mon, 20 Feb 2023 11:52:21 +0100 Subject: [PATCH 03/11] Update docs/cli.rst Co-authored-by: Alexander Graf --- docs/cli.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/cli.rst b/docs/cli.rst index 2c325110..28a62b7e 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -169,7 +169,7 @@ This command imports configuration data from an external YAML or JSON source. .. code-block:: bash - $ docker compose exec admin flask mailu config-import --help + $ docker compose exec -T admin flask mailu config-import --help Usage: flask mailu config-import [OPTIONS] [FILENAME|-] From 07da831533614f6463b7e0810d8f9bb6cbbc6b2a Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Mon, 20 Feb 2023 11:52:56 +0100 Subject: [PATCH 04/11] Update docs/cli.rst Co-authored-by: Alexander Graf --- docs/cli.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/cli.rst b/docs/cli.rst index 28a62b7e..e60b986c 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -131,7 +131,7 @@ The purpose of this command is to export the complete configuration in YAML or J .. code-block:: bash - $ docker compose exec admin flask mailu config-export --help + $ docker compose exec -T admin flask mailu config-export --help Usage: flask mailu config-export [OPTIONS] [FILTER]... From dd21d4bf0c25ad25fed2e27899fae440fe29591f Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Mon, 20 Feb 2023 11:53:07 +0100 Subject: [PATCH 05/11] Update docs/cli.rst Co-authored-by: Alexander Graf --- docs/cli.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/cli.rst b/docs/cli.rst index e60b986c..c3983936 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -158,7 +158,7 @@ Attributes explicitly specified in filters are automatically exported: there is $ docker compose exec admin flask mailu config-export --output mail-config.yml - $ docker compose exec admin flask mailu config-export domain.dns_mx domain.dns_spf + $ docker compose exec -T admin flask mailu config-export domain.dns_mx domain.dns_spf $ docker compose exec admin flask mailu config-export user.spam_threshold From 8d8f7537965289c45816fac2d14163d56b4483e2 Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Mon, 20 Feb 2023 11:53:29 +0100 Subject: [PATCH 06/11] Update tests/compose/test.py Co-authored-by: Alexander Graf --- tests/compose/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/compose/test.py b/tests/compose/test.py index caff6b6c..39b6d33c 100755 --- a/tests/compose/test.py +++ b/tests/compose/test.py @@ -22,7 +22,7 @@ containers = [] def stop(exit_code): print_logs() sys.stdout.flush() - print(subprocess.check_output("docker compose -f " + compose_file + " down", shell=True).decode()) + print(subprocess.check_output(f"docker compose -f {compose_file} down", shell=True).decode()) sys.exit(exit_code) def health_checks(deadline): From 511cdcf1ba9960a65994f3a2f02f88b7f69a3cfe Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Mon, 20 Feb 2023 11:53:41 +0100 Subject: [PATCH 07/11] Update docs/cli.rst Co-authored-by: Alexander Graf --- docs/cli.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/cli.rst b/docs/cli.rst index c3983936..6ed7c0f8 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -188,7 +188,7 @@ The current version of docker compose exec does not pass stdin correctly, so you .. code-block:: bash - docker exec -i $(docker compose ps -q admin) flask mailu config-import -nv < mail-config.yml + docker compose exec -T admin flask mailu config-import -nv < mail-config.yml mail-config.yml contains the configuration and looks like this: From 8b502b73ee8981acbbe591aa273a0da87574de6e Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Mon, 20 Feb 2023 11:53:52 +0100 Subject: [PATCH 08/11] Update tests/compose/test.py Co-authored-by: Alexander Graf --- tests/compose/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/compose/test.py b/tests/compose/test.py index 39b6d33c..a9ec9bce 100755 --- a/tests/compose/test.py +++ b/tests/compose/test.py @@ -88,7 +88,7 @@ def hooks(): sys.stdout.flush() deadline=datetime.datetime.now()+datetime.timedelta(minutes=timeout) deadline=calendar.timegm(deadline.timetuple()) -print(subprocess.check_output("docker compose -f " + compose_file + " up -d", shell=True).decode()) +print(subprocess.check_output(f"docker compose -f {compose_file} up -d", shell=True).decode()) print() print(Fore.LIGHTMAGENTA_EX + "Sleeping for 10s" + Style.RESET_ALL) time.sleep(10) From 2cf4e61fd2179e5f872886a963d3925bef1534b8 Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Mon, 20 Feb 2023 11:54:11 +0100 Subject: [PATCH 09/11] Update docs/cli.rst Co-authored-by: Alexander Graf --- docs/cli.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/cli.rst b/docs/cli.rst index 6ed7c0f8..36f1d5e5 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -184,7 +184,7 @@ This command imports configuration data from an external YAML or JSON source. -n, --dry-run Perform a trial run with no changes made. -?, -h, --help Show this message and exit. -The current version of docker compose exec does not pass stdin correctly, so you have to user docker exec instead: +To pass stdin correctly you have to use the `-T` option: .. code-block:: bash From b205f406de72760dccb0da17e0cc103ef430c494 Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Mon, 20 Feb 2023 11:54:52 +0100 Subject: [PATCH 10/11] Update docs/cli.rst Co-authored-by: Alexander Graf --- docs/cli.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/cli.rst b/docs/cli.rst index 36f1d5e5..5f7bc690 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -160,7 +160,7 @@ Attributes explicitly specified in filters are automatically exported: there is $ docker compose exec -T admin flask mailu config-export domain.dns_mx domain.dns_spf - $ docker compose exec admin flask mailu config-export user.spam_threshold + $ docker compose exec -T admin flask mailu config-export user.email user.spam_threshold config-import ------------- From cef97f78f12aa5c1aae36407dcaea786c05dfa34 Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Sat, 11 Mar 2023 11:58:51 +0100 Subject: [PATCH 11/11] Maybe fix the tests --- tests/compose/webmail/01_ensure_admin_unreachable.sh | 2 +- tests/compose/webmail/docker-compose.yml | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/compose/webmail/01_ensure_admin_unreachable.sh b/tests/compose/webmail/01_ensure_admin_unreachable.sh index 4fd78a1b..1d8a467e 100755 --- a/tests/compose/webmail/01_ensure_admin_unreachable.sh +++ b/tests/compose/webmail/01_ensure_admin_unreachable.sh @@ -1,6 +1,6 @@ #!/bin/bash -IP="$(docker inspect webmail_webmail_1|jq -r '.[0].NetworkSettings.Networks.webmail_default.IPAddress')" +IP="$(docker inspect webmail-webmail-1|jq -r '.[0].NetworkSettings.Networks.webmail_webmail.IPAddress')" MAIN_RETURN_CODE=$(curl -I -so /dev/null -w "%{http_code}" http://$IP/) [[ $MAIN_RETURN_CODE -ne 200 && $MAIN_RETURN_CODE -ne 302 ]] && echo "The default page of snappymail hasn't returned 200 but $MAIN_RETURN_CODE!" >>/dev/stderr && exit 1 diff --git a/tests/compose/webmail/docker-compose.yml b/tests/compose/webmail/docker-compose.yml index 5e106105..d61621d3 100644 --- a/tests/compose/webmail/docker-compose.yml +++ b/tests/compose/webmail/docker-compose.yml @@ -32,6 +32,9 @@ services: - "127.0.0.1:993:993" volumes: - "/mailu/certs:/certs" + networks: + - default + - webmail admin: image: ${DOCKER_ORG:-mailu}/${DOCKER_PREFIX:-}admin:${MAILU_VERSION:-local} @@ -105,6 +108,8 @@ services: - "/mailu/webmail:/data" depends_on: - imap + networks: + - webmail networks: @@ -114,6 +119,8 @@ networks: driver: default config: - subnet: 192.168.203.0/24 + webmail: + driver: bridge noinet: driver: bridge internal: true