removed some whitespace

master
Alexander Graf 3 years ago
parent 6b16756d92
commit 3141ffe791

@ -70,3 +70,4 @@ def create_app():
"""
config = configuration.ConfigManager()
return create_app_from_config(config)

@ -8,4 +8,4 @@
{{ macros.form_fields( fields, label=False, class="btn btn-default", spacing=False) }}
</form>
{%- endcall %}
{%- endblock %}
{%- endblock %}

@ -1,7 +1,7 @@
<div class="sidebar text-sm">
<nav class="mt-2">
<nav class="mt-2">
<ul class="nav nav-pills nav-sidebar flex-column" role="menu">
<li class="nav-header text-uppercase text-primary" role="none">{% trans %}Go to{% endtrans %}</li>
<li class="nav-header text-uppercase text-primary" role="none">{% trans %}Go to{% endtrans %}</li>
{% if config['ADMIN'] %}
<li class="nav-item">
<a href="{{ url_for('ui.client') }}" class="nav-link">
@ -21,12 +21,12 @@
<i class="nav-icon fa fa-life-ring"></i>
<p class="text">{% trans %}Help{% endtrans %}</p>
</a>
</li>
</li>
{#
Domain self-registration is only available when
- Admin is available
- Domain Self-registration is enabled
- The current user is not logged on
- The current user is not logged on
#}
{% if config['DOMAIN_REGISTRATION'] %}
{% if not current_user.is_authenticated %}
@ -44,7 +44,7 @@
User self-registration is only available when
- Admin is available
- Self-registration is enabled
- The current user is not logged on
- The current user is not logged on
#}
{% if not current_user.is_authenticated %}
{% if signup_domains %}
@ -57,7 +57,7 @@
</li>
{% endif %}
{% endif %}
{% endif %}
{% endif %}
</ul>
</nav>
</div>

@ -13,7 +13,7 @@ def login():
form = forms.LoginForm()
form.submitAdmin.label.text = form.submitAdmin.label.text + ' Admin'
form.submitWebmail.label.text = form.submitWebmail.label.text + ' Webmail'
fields = []
if str(app.config["ADMIN"]).upper() != "FALSE":
fields.append(form.submitAdmin)
@ -36,7 +36,7 @@ def login():
user = models.User.login(username, form.pw.data)
if user:
flask.session.regenerate()
flask_login.login_user(user)
flask_login.login_user(user)
response = flask.redirect(destination)
response.set_cookie('rate_limit', utils.limiter.device_cookie(username), max_age=31536000, path=flask.url_for('sso.login'))
flask.current_app.logger.info(f'Login succeeded for {username} from {client_ip}.')
@ -46,10 +46,11 @@ def login():
flask.current_app.logger.warn(f'Login failed for {username} from {client_ip}.')
flask.flash('Wrong e-mail or password', 'error')
return flask.render_template('login.html', form=form, fields=fields)
@sso.route('/logout', methods=['GET'])
@access.authenticated
def logout():
flask_login.logout_user()
flask.session.destroy()
return flask.redirect(flask.url_for('.login'))

@ -103,7 +103,7 @@ class PrefixMiddleware(object):
self.app = None
def __call__(self, environ, start_response):
return self.app(environ, start_response)
return self.app(environ, start_response)
def init_app(self, app):
self.app = fixers.ProxyFix(app.wsgi_app, x_for=1, x_proto=1)

@ -1,4 +1,4 @@
# Basic configuration
# Basic configuration
user nginx;
worker_processes auto;
error_log /dev/stderr info;
@ -6,7 +6,7 @@ pid /var/run/nginx.pid;
load_module "modules/ngx_mail_module.so";
events {
worker_connections 1024;
worker_connections 1024;
}
http {
@ -15,7 +15,7 @@ http {
default_type application/octet-stream;
access_log /dev/stdout;
sendfile on;
keepalive_timeout 65;
keepalive_timeout 65;
server_tokens off;
absolute_redirect off;
resolver {{ RESOLVER }} ipv6=off valid=30s;
@ -47,12 +47,12 @@ http {
{% if KUBERNETES_INGRESS != 'true' and TLS_FLAVOR in [ 'letsencrypt', 'cert' ] %}
# Enable the proxy for certbot if the flavor is letsencrypt and not on kubernetes
#
#
server {
# Listen over HTTP
listen 80;
listen [::]:80;
{% if TLS_FLAVOR == 'letsencrypt' %}
{% if TLS_FLAVOR == 'letsencrypt' %}
location ^~ /.well-known/acme-challenge/ {
proxy_pass http://127.0.0.1:8008;
}
@ -80,7 +80,7 @@ http {
{% endif %}
# Listen on HTTP only in kubernetes or behind reverse proxy
{% if KUBERNETES_INGRESS == 'true' or TLS_FLAVOR in [ 'mail-letsencrypt', 'notls', 'mail' ] %}
{% if KUBERNETES_INGRESS == 'true' or TLS_FLAVOR in [ 'mail-letsencrypt', 'notls', 'mail' ] %}
listen 80;
listen [::]:80;
{% endif %}
@ -153,8 +153,8 @@ http {
rewrite ^{{ WEB_WEBMAIL }}/(.*) /$1 break;
{% endif %}
include /etc/nginx/proxy.conf;
client_max_body_size {{ MESSAGE_SIZE_LIMIT|int + 8388608 }};
auth_request /internal/auth/user;
client_max_body_size {{ MESSAGE_SIZE_LIMIT|int + 8388608 }};
auth_request /internal/auth/user;
error_page 403 @webmail_login;
proxy_pass http://$webmail;
}
@ -177,7 +177,7 @@ http {
location @webmail_login {
return 302 /sso/login;
}
}
{% endif %}
{% if ADMIN == 'true' %}
location {{ WEB_ADMIN }} {
@ -186,7 +186,7 @@ http {
expires $expires;
}
location {{ WEB_ADMIN }}/antispam {
location {{ WEB_ADMIN }}/antispam {
rewrite ^{{ WEB_ADMIN }}/antispam/(.*) /$1 break;
auth_request /internal/auth/admin;
proxy_set_header X-Real-IP "";

Loading…
Cancel
Save