mirror of
https://github.com/optim-enterprises-bv/Mailu.git
synced 2025-11-01 10:37:49 +00:00
Update dependencies and re-enable flask toolbar
This commit is contained in:
@@ -1,11 +1,10 @@
|
|||||||
#Note: Currently flask_debugtoolbar is not compatible with flask.
|
import flask_debugtoolbar
|
||||||
#import flask_debugtoolbar
|
|
||||||
|
|
||||||
from werkzeug.middleware.profiler import ProfilerMiddleware
|
from werkzeug.middleware.profiler import ProfilerMiddleware
|
||||||
|
|
||||||
|
|
||||||
# Debugging toolbar
|
# Debugging toolbar
|
||||||
#toolbar = flask_debugtoolbar.DebugToolbarExtension()
|
toolbar = flask_debugtoolbar.DebugToolbarExtension()
|
||||||
|
|
||||||
|
|
||||||
# Profiler
|
# Profiler
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import passlib.context
|
|||||||
import passlib.hash
|
import passlib.hash
|
||||||
import passlib.registry
|
import passlib.registry
|
||||||
import time
|
import time
|
||||||
|
import logging
|
||||||
import os
|
import os
|
||||||
import smtplib
|
import smtplib
|
||||||
import idna
|
import idna
|
||||||
@@ -30,6 +31,10 @@ from werkzeug.utils import cached_property
|
|||||||
from mailu import dkim, utils
|
from mailu import dkim, utils
|
||||||
|
|
||||||
|
|
||||||
|
# silence AttributeError: module 'bcrypt' has no attribute '__about__'
|
||||||
|
logging.getLogger('passlib').setLevel(logging.ERROR)
|
||||||
|
|
||||||
|
|
||||||
db = flask_sqlalchemy.SQLAlchemy()
|
db = flask_sqlalchemy.SQLAlchemy()
|
||||||
|
|
||||||
|
|
||||||
@@ -159,13 +164,6 @@ class Base(db.Model):
|
|||||||
flag_modified(self, 'updated_at')
|
flag_modified(self, 'updated_at')
|
||||||
|
|
||||||
|
|
||||||
# Many-to-many association table for domain managers
|
|
||||||
managers = db.Table('manager', Base.metadata,
|
|
||||||
db.Column('domain_name', IdnaDomain, db.ForeignKey('domain.name')),
|
|
||||||
db.Column('user_email', IdnaEmail, db.ForeignKey('user.email'))
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class Config(Base):
|
class Config(Base):
|
||||||
""" In-database configuration values
|
""" In-database configuration values
|
||||||
"""
|
"""
|
||||||
@@ -180,6 +178,10 @@ def _save_dkim_keys(session):
|
|||||||
if isinstance(obj, Domain):
|
if isinstance(obj, Domain):
|
||||||
obj.save_dkim_key()
|
obj.save_dkim_key()
|
||||||
|
|
||||||
|
def _get_managers():
|
||||||
|
return managers
|
||||||
|
|
||||||
|
|
||||||
class Domain(Base):
|
class Domain(Base):
|
||||||
""" A DNS domain that has mail addresses associated to it.
|
""" A DNS domain that has mail addresses associated to it.
|
||||||
"""
|
"""
|
||||||
@@ -187,7 +189,7 @@ class Domain(Base):
|
|||||||
__tablename__ = 'domain'
|
__tablename__ = 'domain'
|
||||||
|
|
||||||
name = db.Column(IdnaDomain, primary_key=True, nullable=False)
|
name = db.Column(IdnaDomain, primary_key=True, nullable=False)
|
||||||
managers = db.relationship('User', secondary=managers,
|
managers = db.relationship('User', secondary=_get_managers,
|
||||||
backref=db.backref('manager_of'), lazy='dynamic')
|
backref=db.backref('manager_of'), lazy='dynamic')
|
||||||
max_users = db.Column(db.Integer, nullable=False, default=-1)
|
max_users = db.Column(db.Integer, nullable=False, default=-1)
|
||||||
max_aliases = db.Column(db.Integer, nullable=False, default=-1)
|
max_aliases = db.Column(db.Integer, nullable=False, default=-1)
|
||||||
@@ -790,6 +792,13 @@ class Fetch(Base):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# Many-to-many association table for domain managers
|
||||||
|
managers = db.Table('manager', Base.metadata,
|
||||||
|
db.Column('domain_name', IdnaDomain, db.ForeignKey(Domain.name)),
|
||||||
|
db.Column('user_email', IdnaEmail, db.ForeignKey(User.email))
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class MailuConfig:
|
class MailuConfig:
|
||||||
""" Class which joins whole Mailu config for dumping
|
""" Class which joins whole Mailu config for dumping
|
||||||
and loading
|
and loading
|
||||||
|
|||||||
@@ -9,8 +9,7 @@ import flask
|
|||||||
import flask_login
|
import flask_login
|
||||||
import secrets
|
import secrets
|
||||||
import ipaddress
|
import ipaddress
|
||||||
from urllib.parse import urlparse, urljoin
|
from urllib.parse import urlparse, urljoin, unquote
|
||||||
from werkzeug.urls import url_unquote
|
|
||||||
|
|
||||||
@sso.route('/login', methods=['GET', 'POST'])
|
@sso.route('/login', methods=['GET', 'POST'])
|
||||||
def login():
|
def login():
|
||||||
@@ -120,8 +119,7 @@ def _has_usable_redirect(is_proxied=False):
|
|||||||
if 'homepage' in flask.request.url and not is_proxied:
|
if 'homepage' in flask.request.url and not is_proxied:
|
||||||
return None
|
return None
|
||||||
if url := flask.request.args.get('url'):
|
if url := flask.request.args.get('url'):
|
||||||
url = url_unquote(url)
|
target = urlparse(urljoin(flask.request.url, unquote(url)))
|
||||||
target = urlparse(urljoin(flask.request.url, url))
|
|
||||||
if target.netloc == urlparse(flask.request.url).netloc:
|
if target.netloc == urlparse(flask.request.url).netloc:
|
||||||
return target.geturl()
|
return target.geturl()
|
||||||
return None
|
return None
|
||||||
|
|||||||
@@ -412,8 +412,8 @@ class MailuSessionInterface(SessionInterface):
|
|||||||
# save session and update cookie if necessary
|
# save session and update cookie if necessary
|
||||||
if session.save():
|
if session.save():
|
||||||
response.set_cookie(
|
response.set_cookie(
|
||||||
app.config['SESSION_COOKIE_NAME'],
|
app.config['SESSION_COOKIE_NAME'],
|
||||||
session.sid,
|
session.sid.decode('ascii'),
|
||||||
expires=datetime.now()+timedelta(seconds=app.config['PERMANENT_SESSION_LIFETIME']),
|
expires=datetime.now()+timedelta(seconds=app.config['PERMANENT_SESSION_LIFETIME']),
|
||||||
httponly=self.get_cookie_httponly(app),
|
httponly=self.get_cookie_httponly(app),
|
||||||
domain=self.get_cookie_domain(app),
|
domain=self.get_cookie_domain(app),
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ Flask-Login
|
|||||||
flask-marshmallow
|
flask-marshmallow
|
||||||
Flask-Migrate
|
Flask-Migrate
|
||||||
Flask-RESTX
|
Flask-RESTX
|
||||||
Flask-SQLAlchemy<3
|
Flask-SQLAlchemy
|
||||||
Flask-WTF
|
Flask-WTF
|
||||||
gunicorn
|
gunicorn
|
||||||
idna
|
idna
|
||||||
|
|||||||
@@ -1,68 +1,64 @@
|
|||||||
aiodns==3.1.1
|
aiodns==3.1.1
|
||||||
aiohttp==3.8.6
|
aiohttp==3.9.1
|
||||||
aiosignal==1.3.1
|
aiosignal==1.3.1
|
||||||
alembic==1.12.1
|
alembic==1.13.1
|
||||||
aniso8601==9.0.1
|
aniso8601==9.0.1
|
||||||
async-timeout==4.0.3
|
attrs==23.2.0
|
||||||
attrs==23.1.0
|
Babel==2.14.0
|
||||||
Babel==2.13.1
|
bcrypt==4.1.2
|
||||||
bcrypt==4.0.1
|
blinker==1.7.0
|
||||||
blinker==1.6.3
|
certifi==2023.11.17
|
||||||
certifi==2023.7.22
|
|
||||||
cffi==1.16.0
|
cffi==1.16.0
|
||||||
charset-normalizer==3.3.1
|
charset-normalizer==3.3.2
|
||||||
click==8.1.7
|
click==8.1.7
|
||||||
colorclass==2.2.2
|
colorclass==2.2.2
|
||||||
cryptography==41.0.5
|
cryptography==41.0.7
|
||||||
defusedxml==0.7.1
|
defusedxml==0.7.1
|
||||||
Deprecated==1.2.14
|
Deprecated==1.2.14
|
||||||
dnspython==2.4.2
|
dnspython==2.5.0
|
||||||
dominate==2.8.0
|
dominate==2.9.1
|
||||||
easygui==0.98.3
|
easygui==0.98.3
|
||||||
email-validator==2.1.0.post1
|
email-validator==2.1.0.post1
|
||||||
Flask==2.3.3
|
Flask==3.0.1
|
||||||
flask-babel==4.0.0
|
flask-babel==4.0.0
|
||||||
Flask-Bootstrap==3.3.7.1
|
Flask-Bootstrap==3.3.7.1
|
||||||
#Flask-DebugToolbar is not compatible with Flask 2.3.3+
|
Flask-DebugToolbar==0.14.1
|
||||||
#Flask-DebugToolbar==0.13.1
|
|
||||||
Flask-Login==0.6.3
|
Flask-Login==0.6.3
|
||||||
flask-marshmallow==0.15.0
|
flask-marshmallow==1.1.0
|
||||||
Flask-Migrate==4.0.5
|
Flask-Migrate==4.0.5
|
||||||
flask-restx==1.1.0
|
flask-restx==1.3.0
|
||||||
Flask-SQLAlchemy==2.5.1
|
Flask-SQLAlchemy==3.1.1
|
||||||
# >2.5.1 bug with parsing models.py. Could otherwise be 3.0.5
|
|
||||||
Flask-WTF==1.2.1
|
Flask-WTF==1.2.1
|
||||||
frozenlist==1.4.0
|
frozenlist==1.4.1
|
||||||
greenlet==3.0.1
|
greenlet==3.0.3
|
||||||
gunicorn==21.2.0
|
gunicorn==21.2.0
|
||||||
idna==3.4
|
idna==3.6
|
||||||
importlib-resources==6.1.0
|
importlib-resources==6.1.1
|
||||||
infinity==1.5
|
infinity==1.5
|
||||||
intervals==0.9.2
|
intervals==0.9.2
|
||||||
itsdangerous==2.1.2
|
itsdangerous==2.1.2
|
||||||
Jinja2==3.1.2
|
Jinja2==3.1.3
|
||||||
jsonschema==4.19.2
|
jsonschema==4.21.1
|
||||||
jsonschema-specifications==2023.7.1
|
jsonschema-specifications==2023.12.1
|
||||||
limits==3.6.0
|
limits==3.7.0
|
||||||
Mako==1.2.4
|
Mako==1.3.0
|
||||||
MarkupSafe==2.1.3
|
MarkupSafe==2.1.4
|
||||||
marshmallow==3.20.1
|
marshmallow==3.20.2
|
||||||
marshmallow-sqlalchemy==0.29
|
marshmallow-sqlalchemy==0.30.0
|
||||||
msoffcrypto-tool==5.1.1
|
msoffcrypto-tool==5.3.1
|
||||||
multidict==6.0.4
|
multidict==6.0.4
|
||||||
mysql-connector-python==8.2.0
|
mysql-connector-python==8.3.0
|
||||||
olefile==0.46
|
olefile==0.47
|
||||||
oletools==0.60.1
|
oletools==0.60.1
|
||||||
packaging==23.2
|
packaging==23.2
|
||||||
passlib==1.7.4
|
passlib==1.7.4
|
||||||
pcodedmp==1.2.6
|
pcodedmp==1.2.6
|
||||||
podop @ file:///app/libs/podop
|
podop @ file:///app/libs/podop
|
||||||
postfix-mta-sts-resolver==1.4.0
|
postfix-mta-sts-resolver==1.4.0
|
||||||
protobuf==4.21.12
|
|
||||||
psycopg2-binary==2.9.9
|
psycopg2-binary==2.9.9
|
||||||
pycares==4.4.0
|
pycares==4.4.0
|
||||||
pycparser==2.21
|
pycparser==2.21
|
||||||
Pygments==2.16.1
|
Pygments==2.17.2
|
||||||
pyparsing==2.4.7
|
pyparsing==2.4.7
|
||||||
python-dateutil==2.8.2
|
python-dateutil==2.8.2
|
||||||
python-magic==0.4.27
|
python-magic==0.4.27
|
||||||
@@ -70,24 +66,24 @@ pytz==2023.3.post1
|
|||||||
PyYAML==6.0.1
|
PyYAML==6.0.1
|
||||||
Radicale==3.1.8
|
Radicale==3.1.8
|
||||||
redis==5.0.1
|
redis==5.0.1
|
||||||
referencing==0.30.2
|
referencing==0.32.1
|
||||||
requests==2.31.0
|
requests==2.31.0
|
||||||
rpds-py==0.10.6
|
rpds-py==0.17.1
|
||||||
six==1.16.0
|
six==1.16.0
|
||||||
socrate @ file:///app/libs/socrate
|
socrate @ file:///app/libs/socrate
|
||||||
SQLAlchemy==1.4.50
|
SQLAlchemy==2.0.25
|
||||||
srslib==0.1.4
|
srslib==0.1.4
|
||||||
tabulate==0.9.0
|
tabulate==0.9.0
|
||||||
tenacity==8.2.3
|
tenacity==8.2.3
|
||||||
typing_extensions==4.8.0
|
typing_extensions==4.9.0
|
||||||
urllib3==2.0.7
|
urllib3==2.1.0
|
||||||
validators==0.22.0
|
validators==0.22.0
|
||||||
visitor==0.1.3
|
visitor==0.1.3
|
||||||
vobject==0.9.6.1
|
vobject==0.9.6.1
|
||||||
watchdog==3.0.0
|
watchdog==3.0.0
|
||||||
Werkzeug===2.3.7
|
Werkzeug==3.0.1
|
||||||
wrapt==1.15.0
|
wrapt==1.16.0
|
||||||
WTForms==3.1.1
|
WTForms==3.1.2
|
||||||
WTForms-Components==0.10.5
|
WTForms-Components==0.10.5
|
||||||
xmltodict==0.13.0
|
xmltodict==0.13.0
|
||||||
yarl==1.9.2
|
yarl==1.9.4
|
||||||
|
|||||||
Reference in New Issue
Block a user