You've already forked Mailu
mirror of
https://github.com/Mailu/Mailu.git
synced 2025-07-15 01:24:34 +02:00
Process code review remarks PR2023
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
from flask import Blueprint
|
||||
|
||||
sso = Blueprint('sso', __name__, static_folder='None' ,template_folder='templates')
|
||||
sso = Blueprint('sso', __name__, static_folder=None ,template_folder='templates')
|
||||
|
||||
from mailu.sso.views import *
|
||||
|
@ -1,12 +1,6 @@
|
||||
from wtforms import validators, fields, widgets
|
||||
from wtforms_components import fields as fields_
|
||||
from wtforms import validators, fields
|
||||
from flask_babel import lazy_gettext as _
|
||||
|
||||
import flask_login
|
||||
import flask_wtf
|
||||
import re
|
||||
|
||||
LOCALPART_REGEX = "^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*$"
|
||||
|
||||
class LoginForm(flask_wtf.FlaskForm):
|
||||
class Meta:
|
||||
@ -15,5 +9,3 @@ class LoginForm(flask_wtf.FlaskForm):
|
||||
pw = fields.PasswordField(_('Password'), [validators.DataRequired()])
|
||||
submitAdmin = fields.SubmitField(_('Sign in'))
|
||||
submitWebmail = fields.SubmitField(_('Sign in'))
|
||||
|
||||
|
||||
|
@ -2,14 +2,6 @@
|
||||
<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>
|
||||
{%- if config["WEBMAIL"] != "none" %}
|
||||
<li class="nav-item" role="none">
|
||||
<a href="{{ config["WEB_WEBMAIL"] }}" target="_blank" class="nav-link" role="menuitem">
|
||||
<i class="nav-icon far fa-envelope"></i>
|
||||
<p>{% trans %}Webmail{% endtrans %} <i class="fas fa-external-link-alt text-xs"></i></p>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if config['ADMIN'] %}
|
||||
<li class="nav-item">
|
||||
<a href="{{ url_for('ui.client') }}" class="nav-link">
|
||||
@ -24,8 +16,8 @@
|
||||
<p>{% trans %}Website{% endtrans %} <i class="fas fa-external-link-alt text-xs"></i></p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="https://mailu.io" target="_blank" class="nav-link">
|
||||
<li class="nav-item" role="none">
|
||||
<a href="https://mailu.io" target="_blank" class="nav-link" role="menuitem">
|
||||
<i class="nav-icon fa fa-life-ring"></i>
|
||||
<p class="text">{% trans %}Help{% endtrans %}</p>
|
||||
</a>
|
||||
@ -39,8 +31,8 @@
|
||||
{% if config['DOMAIN_REGISTRATION'] %}
|
||||
{% if not current_user.is_authenticated %}
|
||||
{% if config['ADMIN'] %}
|
||||
<li class="nav-item">
|
||||
<a href="{{ url_for('ui.domain_signup') }}" class="nav-link">
|
||||
<li class="nav-item" role="none">
|
||||
<a href="{{ url_for('ui.domain_signup') }}" class="nav-link" role="menuitem">
|
||||
<i class="nav-icon fa fa-plus-square"></i>
|
||||
<p class="text">{% trans %}Register a domain{% endtrans %}</p>
|
||||
</a>
|
||||
@ -57,8 +49,8 @@
|
||||
{% if not current_user.is_authenticated %}
|
||||
{% if signup_domains %}
|
||||
{% if config['ADMIN'] %}
|
||||
<li class="nav-item">
|
||||
<a href="{{ url_for('ui.user_signup') }}" class="nav-link">
|
||||
<li class="nav-item" role="none">
|
||||
<a href="{{ url_for('ui.user_signup') }}" class="nav-link" role="menuitem">
|
||||
<i class="nav-icon fa fa-user-plus"></i>
|
||||
<p class="text">{% trans %}Sign up{% endtrans %}</p>
|
||||
</a>
|
||||
|
@ -1,6 +1,4 @@
|
||||
from mailu.sso import sso, forms
|
||||
from mailu.ui import access
|
||||
|
||||
from mailu.sso import sso
|
||||
import flask
|
||||
|
||||
@sso.route('/language/<language>', methods=['POST'])
|
||||
|
@ -1,6 +1,6 @@
|
||||
from flask import Blueprint
|
||||
|
||||
|
||||
ui = Blueprint('ui', __name__, static_folder='None', template_folder='templates')
|
||||
ui = Blueprint('ui', __name__, static_folder=None, template_folder='templates')
|
||||
|
||||
from mailu.ui.views import *
|
||||
|
@ -92,7 +92,7 @@
|
||||
{%- endif %}
|
||||
|
||||
<li class="nav-header text-uppercase text-primary" role="none">{% trans %}Go to{% endtrans %}</li>
|
||||
{%- if config["WEBMAIL"] != "none" %}
|
||||
{%- if config["WEBMAIL"] != "none" and current_user.is_authenticated %}
|
||||
<li class="nav-item" role="none">
|
||||
<a href="{{ config["WEB_WEBMAIL"] }}" target="_blank" class="nav-link" role="menuitem">
|
||||
<i class="nav-icon far fa-envelope"></i>
|
||||
@ -136,8 +136,8 @@
|
||||
</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="nav-item">
|
||||
<a href="{{ url_for('sso.login') }}" class="nav-link">
|
||||
<li class="nav-item" role="none">
|
||||
<a href="{{ url_for('sso.login') }}" class="nav-link" role="menuitem">
|
||||
<i class="nav-icon fas fa-sign-in-alt"></i>
|
||||
<p>{% trans %}Sign in{% endtrans %}</p>
|
||||
</a>
|
||||
|
@ -178,8 +178,6 @@ http {
|
||||
location @webmail_login {
|
||||
return 302 /sso/login;
|
||||
}
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
{% if ADMIN == 'true' %}
|
||||
location {{ WEB_ADMIN }} {
|
||||
|
@ -54,27 +54,8 @@ Because the admin interface is served as ``/admin``, the Webmail as ``/webmail``
|
||||
server {
|
||||
# [...] here goes your standard configuration
|
||||
|
||||
location /webmail {
|
||||
proxy_pass https://localhost:8443/webmail;
|
||||
}
|
||||
|
||||
location /admin {
|
||||
proxy_pass https://localhost:8443/admin;
|
||||
proxy_set_header Host $http_host;
|
||||
}
|
||||
|
||||
location /sso {
|
||||
proxy_pass https://localhost:8443/sso;
|
||||
proxy_set_header Host $http_host;
|
||||
}
|
||||
|
||||
location /webdav {
|
||||
proxy_pass https://localhost:8443/webdav;
|
||||
proxy_set_header Host $http_host;
|
||||
}
|
||||
|
||||
location /static {
|
||||
proxy_pass https://localhost:8443/static;
|
||||
location ~ ^/(admin|sso|static|webdav|webmail)/ {
|
||||
proxy_pass https://localhost:8443;
|
||||
proxy_set_header Host $http_host;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user