From 75cabc0046b8985b128e93d458536111a0da335e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20VIGNELLES?= Date: Sun, 10 Mar 2019 11:09:50 +0100 Subject: [PATCH] Create overrides/nginx This folder is needed for the front service to be able to start, because a bind-mount is made on that folder. (cherry picked from commit b1621d4b635992f194af09a925b630c3866a13be) # Conflicts: # setup/flavors/stack/setup.html --- setup/flavors/stack/setup.html | 65 ++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 setup/flavors/stack/setup.html diff --git a/setup/flavors/stack/setup.html b/setup/flavors/stack/setup.html new file mode 100644 index 00000000..5ae65cf7 --- /dev/null +++ b/setup/flavors/stack/setup.html @@ -0,0 +1,65 @@ +{% import "macros.html" as macros %} + +{% call macros.panel("info", "Step 1 - Download your configuration files") %} +

Docker Stack expects a project file, named docker-compose.yml +in a project directory. First create your project directory.

+ +
mkdir -p /{{ root }}/{redis,certs,data,dkim,mail,overrides/rspamd,overrides/nginx,filter,dav,webmail}
+
+ +

Then download the project file. A side configuration file makes it easier +to read and check the configuration variables generated by the wizard.

+ +
cd {{ root }}
+wget {{ url_for('.file', uid=uid, filepath='docker-compose.yml', _external=True) }}
+wget {{ url_for('.file', uid=uid, filepath='mailu.env', _external=True) }}
+
+{% endcall %} + + +{% call macros.panel("info", "Step 2 - Review the configuration") %} +

We did not insert any malicious code on purpose in the configurations we +distribute, but your download could have been intercepted, or our wizard +website could have been compromised, so make sure you check the configuration +files before going any further.

+ +

When you are done checking them, check them one last time.

+{% endcall %} + +{% call macros.panel("info", "Step 3 - Deploy docker stack") %} +

To deploy the docker stack use the following commands. For more information about setting up docker swarm nodes read the + docker documentation

+ +
cd {{ root }}
+docker swarm init
+docker stack deploy -c docker-compose.yml mailu
+
+ +In the docker stack deploy command, mailu is the app name. Feel free to change it.
+In order to display the running container you can use
+
docker ps
+or +
docker stack ps --no-trunc mailu
+Command for removing docker stack is +
docker stack rm mailu
+ +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 exec $(docker ps | grep admin | cut -d ' ' -f1) flask mailu admin {{ postmaster }} {{ domain }} PASSWORD
+
+ +

Login to the admin interface to change the password for a safe one, at +{% if admin_enabled %} +one of the hostnames +{{ hostnames.split(',')[0] }}{{ admin_path }}. +{% else %} +http://127.0.0.1:8080/ui (only directly from the host running docker). +If you run mailu on a remote server, and wish to access the admin interface via a SSH tunnel, you can create a port-forward from your local machine to your server like +

ssh -L 127.0.0.1:8080:127.0.0.1:8080 <user>@<server>
+
+And access the above URL from your local machine. +
+{% endif %} +Also, choose the "Update password" option in the left menu. +

+{% endcall %}