diff --git a/core/admin/mailu/internal/views/postfix.py b/core/admin/mailu/internal/views/postfix.py index cc8a0950..c2399cf7 100644 --- a/core/admin/mailu/internal/views/postfix.py +++ b/core/admin/mailu/internal/views/postfix.py @@ -14,7 +14,7 @@ def postfix_dane_map(domain_name): @internal.route("/postfix/domain/") def postfix_mailbox_domain(domain_name): - if re.match("^\[.*\]$", domain_name): + if re.match(r'^\[.*\]$', domain_name): return flask.abort(404) domain = models.Domain.query.get(domain_name) or \ models.Alternative.query.get(domain_name) or \ @@ -39,7 +39,7 @@ def postfix_alias_map(alias): @internal.route("/postfix/transport/") def postfix_transport(email): - if email == '*' or re.match("(^|.*@)\[.*\]$", email): + if email == '*' or re.match(r'(^|.*@)\[.*\]$', email): return flask.abort(404) _, domain_name = models.Email.resolve_domain(email) relay = models.Relay.query.get(domain_name) or flask.abort(404) diff --git a/core/admin/mailu/ui/forms.py b/core/admin/mailu/ui/forms.py index b6c45189..798bd923 100644 --- a/core/admin/mailu/ui/forms.py +++ b/core/admin/mailu/ui/forms.py @@ -7,7 +7,7 @@ import flask_wtf import re import ipaddress -LOCALPART_REGEX = "^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*$" +LOCALPART_REGEX = r'^[a-zA-Z0-9!#$%&\'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&\'*+/=?^_`{|}~-]+)*$' class DestinationField(fields.SelectMultipleField): """ Allow for multiple emails selection from current user choices and diff --git a/core/base/libs/socrate/socrate/system.py b/core/base/libs/socrate/socrate/system.py index 3dcdea3d..fe233a5b 100644 --- a/core/base/libs/socrate/socrate/system.py +++ b/core/base/libs/socrate/socrate/system.py @@ -33,7 +33,7 @@ class LogFilter(object): def __init__(self, stream, re_patterns): self.stream = stream if isinstance(re_patterns, list): - self.pattern = re.compile('|'.join([f'(?:{pattern})' for pattern in re_patterns])) + self.pattern = re.compile('|'.join([fr'(?:{pattern})' for pattern in re_patterns])) elif isinstance(re_patterns, str): self.pattern = re.compile(re_patterns) else: diff --git a/core/nginx/conf/nginx.conf b/core/nginx/conf/nginx.conf index e7d4885e..60c263a9 100644 --- a/core/nginx/conf/nginx.conf +++ b/core/nginx/conf/nginx.conf @@ -104,9 +104,10 @@ http { # Only enable HTTPS if TLS is enabled with no error {% if TLS_443 and not TLS_ERROR %} - listen 443 ssl http2{% if PROXY_PROTOCOL_443 %} proxy_protocol{% endif %}; + listen 443 ssl{% if PROXY_PROTOCOL_443 %} proxy_protocol{% endif %}; {% if SUBNET6 %} - listen [::]:443 ssl http2{% if PROXY_PROTOCOL_443 %} proxy_protocol{% endif %}; + listen [::]:443 ssl{% if PROXY_PROTOCOL_443 %} proxy_protocol{% endif %}; + http2 on; {% endif %} include /etc/nginx/tls.conf; diff --git a/core/nginx/config.py b/core/nginx/config.py index 1f06424b..4a381c2c 100755 --- a/core/nginx/config.py +++ b/core/nginx/config.py @@ -85,6 +85,8 @@ for item in args.get('PROXY_PROTOCOL', '').split(','): for p in PROTO_ALL_BUT_HTTP: args[f'PROXY_PROTOCOL_{p}']=True elif item == 'all': for p in PROTO_ALL: args[f'PROXY_PROTOCOL_{p}']=True + elif item == '': + pass else: log.error(f'Not sure what to do with {item} in PROXY_PROTOCOL ({args.get("PROXY_PROTOCOL")})') diff --git a/docs/compose/docker-compose.yml b/docs/compose/docker-compose.yml index 3b964449..4c997c4c 100644 --- a/docs/compose/docker-compose.yml +++ b/docs/compose/docker-compose.yml @@ -1,6 +1,5 @@ # WARNING: this file is being deprecated over the new setup utility, found at https://setup.mailu.io -version: '2' services: diff --git a/docs/docker-compose.yml b/docs/docker-compose.yml index 9c5d2473..eccc14a1 100644 --- a/docs/docker-compose.yml +++ b/docs/docker-compose.yml @@ -1,7 +1,6 @@ # This file is used to test the mailu/docs website # Deployment files can be found on github.com/mailu/infra -version: '3' services: docs: diff --git a/setup/docker-compose.yml b/setup/docker-compose.yml index 9c93fd6f..680dd9ab 100644 --- a/setup/docker-compose.yml +++ b/setup/docker-compose.yml @@ -1,7 +1,6 @@ # This file is used to test the mailu/setup utility # Deployment files can be found on github.com/mailu/infra -version: '3.6' services: redis: diff --git a/setup/flavors/compose/docker-compose.yml b/setup/flavors/compose/docker-compose.yml index 8cd374cd..3eeba1d4 100644 --- a/setup/flavors/compose/docker-compose.yml +++ b/setup/flavors/compose/docker-compose.yml @@ -3,8 +3,6 @@ # Please read the documentation before attempting any change. # Generated for {{ flavor }} flavor -version: '2.2' - services: # External dependencies diff --git a/tests/compose/api/docker-compose.yml b/tests/compose/api/docker-compose.yml index 384e89cd..03879edb 100644 --- a/tests/compose/api/docker-compose.yml +++ b/tests/compose/api/docker-compose.yml @@ -2,7 +2,6 @@ # Please read the documentation before attempting any change. # Generated for compose flavor -version: '3.6' services: diff --git a/tests/compose/core/docker-compose.yml b/tests/compose/core/docker-compose.yml index 384e89cd..03879edb 100644 --- a/tests/compose/core/docker-compose.yml +++ b/tests/compose/core/docker-compose.yml @@ -2,7 +2,6 @@ # Please read the documentation before attempting any change. # Generated for compose flavor -version: '3.6' services: diff --git a/tests/compose/fetchmail/docker-compose.yml b/tests/compose/fetchmail/docker-compose.yml index 067532fa..edd4140e 100644 --- a/tests/compose/fetchmail/docker-compose.yml +++ b/tests/compose/fetchmail/docker-compose.yml @@ -2,7 +2,6 @@ # Please read the documentation before attempting any change. # Generated for compose flavor -version: '3.6' services: diff --git a/tests/compose/filters/docker-compose.yml b/tests/compose/filters/docker-compose.yml index 5a508d58..2d2562a4 100644 --- a/tests/compose/filters/docker-compose.yml +++ b/tests/compose/filters/docker-compose.yml @@ -2,7 +2,6 @@ # Please read the documentation before attempting any change. # Generated for compose flavor -version: '3.6' services: diff --git a/tests/compose/webdav/docker-compose.yml b/tests/compose/webdav/docker-compose.yml index 1391b68d..78bce9d7 100644 --- a/tests/compose/webdav/docker-compose.yml +++ b/tests/compose/webdav/docker-compose.yml @@ -2,7 +2,6 @@ # Please read the documentation before attempting any change. # Generated for compose flavor -version: '3.6' services: diff --git a/tests/compose/webmail/docker-compose.yml b/tests/compose/webmail/docker-compose.yml index d61621d3..0fdc3e5f 100644 --- a/tests/compose/webmail/docker-compose.yml +++ b/tests/compose/webmail/docker-compose.yml @@ -2,7 +2,6 @@ # Please read the documentation before attempting any change. # Generated for compose flavor -version: '3.6' services: