You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mailu/setup
bors[bot] 2d4c837761 Merge #1015
1015: Merge DNS hints, and hostname/domain ordering hints. r=Nebukadneza a=toxik-io

## Enhancement - Hints in setup, references in setup & DNS docs

Unrelated: This PR makes changes to the Flask setup utilities to suggest ordering the `HOSTNAMES` 
entry so that the first entry is the admin panel's domain (at least in my experience that's what fixed my
issues)

It also makes changes to the documentation, referencing that more than the usual DNS
entries need to be set (and the admin panel used) if they've enabled DMARC/SPF/DKIM.

### Related issue(s)
- My original issue #1002

## Prerequistes

- [x] In case of feature or enhancement: documentation updated accordingly
- [ ] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/guide.html#changelog) entry file.

## Assistance
I'm unsure if the hints for HOSTNAME ordering are simply because of how the config is gulped in
by the current tooling, or if it's a bug that the frontend only accepts connections from the first host...

I also don't know what commands in the CLI would replicate the steps taken on the admin dashboard.

Further, I don't know what you'd put in the changelog.

Co-authored-by: toxik-io <thetoxicarcade@gmail.com>
5 years ago
..
flavors Merge #939 6 years ago
static Added IPv6 as optional 6 years ago
templates update in stack, as well. 6 years ago
.env Revert accidental setup commits and fix code/pre tags 6 years ago
Dockerfile Disable healthcheck, doen't work in versioned env 6 years ago
README.md Create/generate file template 6 years ago
docker-compose.yml Revert accidental setup commits and fix code/pre tags 6 years ago
main.py Rename the config dir to setup 7 years ago
requirements.txt Prepare setup for multi-ver deployment on docs server 6 years ago
server.py Handle setup subnet error 6 years ago

README.md

Adding more flavors/steps

(Everything will go under setup/ directory - using Kubernetes flavor as example)

Until this point, the app is working as it follows:

  • when accesing the setup page it will display the flavors selection step (templates/steps/flavor.html)
  • after you choose your desired flavor it will iterare over the files in the flavor directory and building the page (templates/steps/config.html is general for all flavors)
  • when you complete all required fields and press "Setup Mailu" button it will redirect you to the setup page (flavors/choosen-flavor/setup.html)

To add a new flavor you need to create a directory under templates/steps/ in which you are adding actual steps. Eg: Adding a WIP step we'll create templates/steps/kubernetes/wip.html

Note that wizard.html is iterating over files in this directory and building the page. Files are prefixed with a number for sorting purposes.

wip.html will start with

{% call macros.panel("info", "Step X - Work in progress") %}

and end with

{% endcall %}

You store variable from front-page using the name attribute inside tag. In the example below the string entered in the input field is stored in the variable named var_test

<input type="text" name="var_test">

In order to user the variable furter you use it like {{ var_test }}

In the setup page (flavors/kubernetes/setup.html) you cand add steps by importing macros

{% import "macros.html" as macros %}

and start and end every step with

{% call macros.panel("info", "Step X - Title") %}
-------------------
{% endcall %}

Generating a file

Create the file template in flavors/kubernetes/ (eg. file.txt) in which you save your variables

ROOT = {{ root }}
MY_VAR = {{ var_test }}

When you submit to Setup Mailu the file will be generated. In order to get the file add the following command to setup.html

<p>curl {{ url_for('.file', uid=uid, filepath='file.txt', _external=True) }} > file.txt</p>