From b3c7c45140f4c8d1e019ecff9db5c5f623b6f8ff Mon Sep 17 00:00:00 2001 From: Ionut Filip Date: Wed, 17 Oct 2018 15:11:55 +0300 Subject: [PATCH] Added input form constraints --- setup/flavors/compose/docker-compose.yml | 4 ++-- setup/flavors/compose/mailu.env | 6 ++--- .../config.html} | 22 +++++++++++++------ .../templates/steps/{ => compose}/expose.html | 12 +++++++--- .../templates/steps/{ => compose}/flavor.html | 0 .../steps/{ => compose}/optional.html | 0 .../steps/{ => compose}/services.html | 21 ++++++++++++------ setup/templates/wizard.html | 10 ++++----- 8 files changed, 48 insertions(+), 27 deletions(-) rename setup/templates/steps/{initial-config.html => compose/config.html} (71%) rename setup/templates/steps/{ => compose}/expose.html (67%) rename setup/templates/steps/{ => compose}/flavor.html (100%) rename setup/templates/steps/{ => compose}/optional.html (100%) rename setup/templates/steps/{ => compose}/services.html (77%) diff --git a/setup/flavors/compose/docker-compose.yml b/setup/flavors/compose/docker-compose.yml index 83a46169..8316e681 100644 --- a/setup/flavors/compose/docker-compose.yml +++ b/setup/flavors/compose/docker-compose.yml @@ -20,7 +20,7 @@ services: env_file: {{ env }} env: - TLS_FLAVOR={{ tls_flavor }} - - ADMIN={{ admin_enabled or 'no' }} + - ADMIN={{ admin_enabled or 'false' }} ports: {% for port in (80, 443, 25, 465, 587, 110, 995, 143, 993) %} {% if bind4 %} @@ -112,7 +112,7 @@ services: {% endif %} # Webmail - {% if webmail_enabled %} + {% if webmail_type != 'none' %} webmail: image: mailu/{{ webmail_type }}:{{ version }} restart: always diff --git a/setup/flavors/compose/mailu.env b/setup/flavors/compose/mailu.env index b1cded1c..77da5670 100644 --- a/setup/flavors/compose/mailu.env +++ b/setup/flavors/compose/mailu.env @@ -33,8 +33,9 @@ POSTMASTER={{ postmaster or 'admin'}} HOSTNAMES={{ hostnames }} # Authentication rate limit (per source IP address) -AUTH_RATELIMIT={% if auth_ratelimit_pm %}{{ auth_ratelimit_pm }}/minute;{% endif %} -{% if auth_ratelimit_ph %}{{ auth_ratelimit_ph }}/hour{% endif %} +{% if auth_ratelimit_pm > '0' and auth_ratelimit_ph > '0' %} +AUTH_RATELIMIT={{ auth_ratelimit_pm }}/minute;{{ auth_ratelimit_ph }}/hour +{% endif %} # Opt-out of statistics, replace with "True" to opt out DISABLE_STATISTICS={{ disable_statistics or 'False' }} @@ -47,7 +48,6 @@ DISABLE_STATISTICS={{ disable_statistics or 'False' }} #ADMIN={{ admin_enabled or 'false' }} #Chose which webmail to run if any -#WEBMAIL_ENABLED={{ webmail_enabled or 'false' }} #WEBMAIL={{ webmail_type or 'none' }} #Antivirus solution diff --git a/setup/templates/steps/initial-config.html b/setup/templates/steps/compose/config.html similarity index 71% rename from setup/templates/steps/initial-config.html rename to setup/templates/steps/compose/config.html index c16d4c13..f5a39a5a 100644 --- a/setup/templates/steps/initial-config.html +++ b/setup/templates/steps/compose/config.html @@ -3,12 +3,15 @@
- + +
- + +
@@ -20,7 +23,7 @@
- +
@@ -35,8 +38,11 @@
-

/minute; - /hour

+ +

/minute; + /hour

@@ -48,12 +54,14 @@
- +
- + +
{% endcall %} diff --git a/setup/templates/steps/expose.html b/setup/templates/steps/compose/expose.html similarity index 67% rename from setup/templates/steps/expose.html rename to setup/templates/steps/compose/expose.html index 372ebddc..e0aa8fee 100644 --- a/setup/templates/steps/expose.html +++ b/setup/templates/steps/compose/expose.html @@ -14,12 +14,16 @@ avoid generic all-interfaces addresses like 0.0.0.0 or :: - + +
- + +

You server will be available under a main hostname but may expose multiple public @@ -28,6 +32,8 @@ hostnames in its MX record. Hostnames must be coma-separated.

- + +
{% endcall %} diff --git a/setup/templates/steps/flavor.html b/setup/templates/steps/compose/flavor.html similarity index 100% rename from setup/templates/steps/flavor.html rename to setup/templates/steps/compose/flavor.html diff --git a/setup/templates/steps/optional.html b/setup/templates/steps/compose/optional.html similarity index 100% rename from setup/templates/steps/optional.html rename to setup/templates/steps/compose/optional.html diff --git a/setup/templates/steps/services.html b/setup/templates/steps/compose/services.html similarity index 77% rename from setup/templates/steps/services.html rename to setup/templates/steps/compose/services.html index ed529c83..d8ec8106 100644 --- a/setup/templates/steps/services.html +++ b/setup/templates/steps/compose/services.html @@ -18,16 +18,23 @@ manage your email domains, users, etc.

email client. These do add some complexity but provide an easier way of accessing messages for beginner users.

+
-
-
- -
+ + + + +
+

-
- {{ macros.radio("webmail_type", "roundcube", "RoundCube", "popular Webmail running on top of PHP") }} - {{ macros.radio("webmail_type", "rainloop", "Rainloop", "lightweight Webmail based on PHP, no database") }} +
+ +
diff --git a/setup/templates/wizard.html b/setup/templates/wizard.html index 5a15af6f..1c85a0ad 100644 --- a/setup/templates/wizard.html +++ b/setup/templates/wizard.html @@ -9,11 +9,11 @@ {% endcall %}
- {% include "steps/initial-config.html" %} - {% include "steps/flavor.html" %} - {% include "steps/expose.html" %} - {% include "steps/services.html" %} - + {% include "steps/compose/flavor.html" %} + {% include "steps/compose/config.html" %} + {% include "steps/compose/services.html" %} + {% include "steps/compose/expose.html" %} +