You've already forked Mailu
mirror of
https://github.com/Mailu/Mailu.git
synced 2025-06-29 00:41:33 +02:00
Remove WEB_ variables from setup.
Setup is meant for the standard use case where you don't change WEB_*. WEB_* can still be changed via mailu.env
This commit is contained in:
@ -40,7 +40,11 @@ AUTH_RATELIMIT_USER={{ auth_ratelimit_user }}/day
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
# Opt-out of statistics, replace with "True" to opt out
|
# Opt-out of statistics, replace with "True" to opt out
|
||||||
DISABLE_STATISTICS={{ disable_statistics or 'False' }}
|
{% if statistics_enabled %}
|
||||||
|
DISABLE_STATISTICS=False
|
||||||
|
{% else %}
|
||||||
|
DISABLE_STATISTICS=True
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
###################################
|
###################################
|
||||||
# Optional features
|
# Optional features
|
||||||
@ -120,24 +124,22 @@ FULL_TEXT_SEARCH=en
|
|||||||
###################################
|
###################################
|
||||||
|
|
||||||
# Path to redirect / to
|
# Path to redirect / to
|
||||||
{% if webmail_type != 'none' and webmail_path == '' %}
|
{% if webmail_type != 'none' %}
|
||||||
WEBROOT_REDIRECT=/
|
WEBROOT_REDIRECT=/webmail
|
||||||
|
{% elif admin_enabled %}
|
||||||
|
WEBROOT_REDIRECT=/admin
|
||||||
{% else %}
|
{% else %}
|
||||||
WEBROOT_REDIRECT={{ webmail_path }}
|
WEBROOT_REDIRECT=
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
# Path to the admin interface if enabled
|
# Path to the admin interface if enabled
|
||||||
WEB_ADMIN={{ admin_path }}
|
WEB_ADMIN=/admin
|
||||||
|
|
||||||
# Path to the webmail if enabled
|
# Path to the webmail if enabled
|
||||||
{% if webmail_type != 'none' and webmail_path == '' %}
|
WEB_WEBMAIL=/webmail
|
||||||
WEB_WEBMAIL=/
|
|
||||||
{% else %}
|
|
||||||
WEB_WEBMAIL={{ webmail_path }}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
# Path to the API interface if enabled
|
# Path to the API interface if enabled
|
||||||
WEB_API={{ api_path }}
|
WEB_API=/api
|
||||||
|
|
||||||
# Website name
|
# Website name
|
||||||
SITENAME={{ site_name }}
|
SITENAME={{ site_name }}
|
||||||
|
@ -120,28 +120,10 @@ def build_app(path):
|
|||||||
except ValueError as err:
|
except ValueError as err:
|
||||||
flask.flash('Invalid configuration: ' + str(err))
|
flask.flash('Invalid configuration: ' + str(err))
|
||||||
valid = False
|
valid = False
|
||||||
if data['webmail_type'] != 'none':
|
|
||||||
if data['webmail_path'] == '':
|
|
||||||
flask.flash('Webmail path cannot be empty when webmail is enabled', 'error')
|
|
||||||
valid = False
|
|
||||||
if data['webmail_path'][0] != '/':
|
|
||||||
flask.flash('Webmail path must start with a leading slash "/"', 'error')
|
|
||||||
valid = False
|
|
||||||
if 'admin_enabled' in data:
|
|
||||||
if data['admin_enabled'] == 'true':
|
|
||||||
if data['admin_path'] == '':
|
|
||||||
flask.flash('Admin path cannot be empty when admin is enabled', 'error')
|
|
||||||
valid = False
|
|
||||||
if data['admin_path'][0] != '/':
|
|
||||||
flask.flash('Admin path must start with a leading slash "/"', 'error')
|
|
||||||
valid = False
|
|
||||||
if 'api_enabled' in data:
|
if 'api_enabled' in data:
|
||||||
if (data['api_enabled'] == 'true'):
|
if (data['api_enabled'] == 'true'):
|
||||||
if data['api_path'] == '' or data['api_token'] == '':
|
if data['api_token'] == '':
|
||||||
flask.flash('API path and API token cannot be empty when API is enabled', 'error')
|
flask.flash('API token cannot be empty when API is enabled', 'error')
|
||||||
valid = False
|
|
||||||
if data['api_path'][0] != '/':
|
|
||||||
flask.flash('API path must start with a leading slash "/"', 'error')
|
|
||||||
valid = False
|
valid = False
|
||||||
if valid:
|
if valid:
|
||||||
db.set(data['uid'], json.dumps(data))
|
db.set(data['uid'], json.dumps(data))
|
||||||
|
@ -6,61 +6,13 @@ $(document).ready(function() {
|
|||||||
$("#container").show();
|
$("#container").show();
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).ready(function() {
|
|
||||||
if ($("#webmail").val() == 'none') {
|
|
||||||
$("#webmail_path").hide();
|
|
||||||
$("#webmail_path").val("");
|
|
||||||
$("#webmail_path").prop('required',false);
|
|
||||||
} else {
|
|
||||||
$("#webmail_path").show();
|
|
||||||
$("#webmail_path").val("/webmail");
|
|
||||||
$("#webmail_path").prop('required',true);
|
|
||||||
}
|
|
||||||
$("#webmail").click(function() {
|
|
||||||
if (this.value == 'none') {
|
|
||||||
$("#webmail_path").hide();
|
|
||||||
$("#webmail_path").val("");
|
|
||||||
$("#webmail_path").prop('required',false);
|
|
||||||
} else {
|
|
||||||
$("#webmail_path").show();
|
|
||||||
$("#webmail_path").val("/webmail");
|
|
||||||
$("#webmail_path").prop('required',true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
$(document).ready(function() {
|
|
||||||
if ($('#admin').prop('checked')) {
|
|
||||||
$("#admin_path").show();
|
|
||||||
$("#admin_path").val("/admin");
|
|
||||||
$("#admin_path").prop('required',true);
|
|
||||||
}
|
|
||||||
$("#admin").change(function() {
|
|
||||||
if ($(this).is(":checked")) {
|
|
||||||
$("#admin_path").show();
|
|
||||||
$("#admin_path").val("/admin");
|
|
||||||
$("#admin_path").prop('required',true);
|
|
||||||
} else {
|
|
||||||
$("#admin_path").hide();
|
|
||||||
$("#admin_path").val("");
|
|
||||||
$("#admin_path").prop('required',false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
if ($('#api_enabled').prop('checked')) {
|
if ($('#api_enabled').prop('checked')) {
|
||||||
$("#api_path").show();
|
|
||||||
$("#api_path").prop('required',true);
|
|
||||||
$("#api_path").val("/api")
|
|
||||||
$("#api_token").show();
|
$("#api_token").show();
|
||||||
$("#api_token").prop('required',true);
|
$("#api_token").prop('required',true);
|
||||||
$("#api_token").val(token);
|
$("#api_token").val(token);
|
||||||
$("#api_token_label").show();
|
$("#api_token_label").show();
|
||||||
} else {
|
} else {
|
||||||
$("#api_path").hide();
|
|
||||||
$("#api_path").prop('required',false);
|
|
||||||
$("#api_path").val("")
|
|
||||||
$("#api_token").hide();
|
$("#api_token").hide();
|
||||||
$("#api_token").prop('required',false);
|
$("#api_token").prop('required',false);
|
||||||
$("#api_token").val("");
|
$("#api_token").val("");
|
||||||
@ -68,17 +20,11 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
$("#api_enabled").change(function() {
|
$("#api_enabled").change(function() {
|
||||||
if ($(this).is(":checked")) {
|
if ($(this).is(":checked")) {
|
||||||
$("#api_path").show();
|
|
||||||
$("#api_path").prop('required',true);
|
|
||||||
$("#api_path").val("/api");
|
|
||||||
$("#api_token").show();
|
$("#api_token").show();
|
||||||
$("#api_token").prop('required',true);
|
$("#api_token").prop('required',true);
|
||||||
$("#api_token").val(token)
|
$("#api_token").val(token)
|
||||||
$("#api_token_label").show();
|
$("#api_token_label").show();
|
||||||
} else {
|
} else {
|
||||||
$("#api_path").hide();
|
|
||||||
$("#api_path").prop('required',false);
|
|
||||||
$("#api_path").val("")
|
|
||||||
$("#api_token").hide();
|
$("#api_token").hide();
|
||||||
$("#api_token").prop('required',false);
|
$("#api_token").prop('required',false);
|
||||||
$("#api_token").val("");
|
$("#api_token").val("");
|
||||||
|
@ -60,8 +60,8 @@ Or in plain English: if receivers start to classify your mail as spam, this post
|
|||||||
|
|
||||||
<div class="form-check form-check-inline">
|
<div class="form-check form-check-inline">
|
||||||
<label class="form-check-label">
|
<label class="form-check-label">
|
||||||
<input class="form-check-input" type="checkbox" name="disable_statistics" value="True">
|
<input class="form-check-input" type="checkbox" name="statistics_enabled" value="True">
|
||||||
Opt-out of statistics
|
Opt-in for anonymized statistics
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -82,8 +82,7 @@ manage your email domains, users, etc.</p>
|
|||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="checkbox" name="admin_enabled" value="true" id="admin" checked>
|
<input type="checkbox" name="admin_enabled" value="true" id="admin" checked>
|
||||||
<label>Enable the admin UI (and path to the admin UI)</label>
|
<label>Enable the admin UI</label>
|
||||||
<input class="form-control" type="text" name="admin_path" id="admin_path" style="display: none">
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>The API interface is a RESTful API for changing the Mailu configuration.
|
<p>The API interface is a RESTful API for changing the Mailu configuration.
|
||||||
@ -93,8 +92,8 @@ manage your email domains, users, etc.</p>
|
|||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="checkbox" name="api_enabled" value="true" id="api_enabled" >
|
<input type="checkbox" name="api_enabled" value="true" id="api_enabled" >
|
||||||
<label>Enable the API (and path to the API)</label>
|
<label>Enable the API</label>
|
||||||
<input class="form-control" type="text" name="api_path" id="api_path" style="display: none">
|
<br>
|
||||||
<label name="api_token_label" id="api_token_label">API token</label>
|
<label name="api_token_label" id="api_token_label">API token</label>
|
||||||
<input class="form-control" type="text" name="api_token" id="api_token" style="display: none" value="{{ secret(32) }}">
|
<input class="form-control" type="text" name="api_token" id="api_token" style="display: none" value="{{ secret(32) }}">
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user