diff --git a/config/flavors/compose/docker-compose.yml b/config/flavors/compose/docker-compose.yml new file mode 100644 index 00000000..e69de29b diff --git a/config/flavors/compose/mailu.env b/config/flavors/compose/mailu.env new file mode 100644 index 00000000..e69de29b diff --git a/config/flavors/compose/setup.html b/config/flavors/compose/setup.html new file mode 100644 index 00000000..b136250e --- /dev/null +++ b/config/flavors/compose/setup.html @@ -0,0 +1,36 @@ +{% import "macros.html" as macros %} + +{% call macros.panel("info", "Step 1 - Download your configuration files") %} +
Docker Compose expects a project file, named docker-compose.yml
+in a project directory. First create your project directory.
mkdir /path/to/project
+
+
+Then download the project file. A side configuration file makes it easier +to read and check the configuration variables generated by the wizard.
+ +cd /path/to/project
+wget https://...
+wget https://...
+
+{% 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 - Start the Compose project") %} +To start your compose project, simply run the Docker Compose up
+command.
cd /path/to/project
+docker-compose up -d
+
+{% endcall %}
diff --git a/config/requirements.txt b/config/requirements.txt
new file mode 100644
index 00000000..88ea3d75
--- /dev/null
+++ b/config/requirements.txt
@@ -0,0 +1,3 @@
+flask
+flask-bootstrap
+redis
diff --git a/config/server.py b/config/server.py
new file mode 100644
index 00000000..a0e3564f
--- /dev/null
+++ b/config/server.py
@@ -0,0 +1,35 @@
+import flask
+import flask_bootstrap
+import redis
+import os
+import jinja2
+
+app = flask.Flask(__name__)
+flask_bootstrap.Bootstrap(app)
+db = redis.StrictRedis(host='localhost', port=6379, db=0)
+
+app.jinja_loader = jinja2.ChoiceLoader([
+ app.jinja_loader,
+ jinja2.FileSystemLoader("flavors"),
+])
+
+
+def render_flavor(flavor, template, **context):
+ path = os.path.join(flavor, template)
+ return flask.render_template(path, **context)
+
+
+@app.route("/")
+def index():
+ return flask.render_template('index.html')
+
+
+@app.route("/setup", methods=["POST"])
+def setup():
+ flavor = flask.request.form.get("flavor", "compose")
+ rendered = render_flavor(flavor, "setup.html")
+ return flask.render_template("setup.html", contents=rendered)
+
+
+if __name__ == "__main__":
+ app.run(debug=True)
diff --git a/config/templates/base.html b/config/templates/base.html
new file mode 100644
index 00000000..bc52b3b6
--- /dev/null
+++ b/config/templates/base.html
@@ -0,0 +1,4 @@
+{% extends "bootstrap/base.html" %}
+{% import "macros.html" as macros %}
+
+{% block title %}Mailu configuration{% endblock %}
diff --git a/config/templates/index.html b/config/templates/index.html
new file mode 100644
index 00000000..ff3a8800
--- /dev/null
+++ b/config/templates/index.html
@@ -0,0 +1,22 @@
+{% extends "base.html" %}
+
+{% block content %}
+The following steps will guide you towards downloading and using your + configuration files. Keep in mind that you should review every downloaded + file before running anything based on it.
+If you encounter issues while setting Mailu up, please review the + documentation first, then check if an issue is open for that specific + problem. If not, you may either use Github to open an issue and detail what + your problem or bug looks like, or join us on Matrix and discuss it + with contributors.
+ {% endcall %} + + {% autoescape false %} + {{ contents }} + {% endautoescape %} + +A mail server must be exposed to the world to receive emails, send emails, +and let users access their mailboxes. Mailu has some flexibility in the way +you expose it to the world.
+ +Among Mailu services, the front server is the one accepting connections, +be it directly from the outside world, through a reverse proxy or in any +complex configuration that you might want to setup. It needs to listen on some +IP addresses in order to expose its public services. You must at least setup +an IPv4 or an IPv6 address if you wish to access Mailu.
+ +Warning You must use specific addresses, please +avoid generic all-interfaces addresses like 0.0.0.0 or ::.
+ +Mailu comes in multiple "flavors". It was originally +designed to run on top of Docker Compose but now offers multiple options +including Docker Stack, Rancher, Kubernetes.
+Please note that "official" support, that is provided by the most active +developpers, will mostly cover Compose and Stack, while other flavors are +maintained by specific contributors.
+ +