diff --git a/management/mail_log.py b/management/mail_log.py index cfd4ca61..24d6d830 100755 --- a/management/mail_log.py +++ b/management/mail_log.py @@ -690,7 +690,7 @@ def print_user_table(users, data=None, sub_data=None, activity=None, latest=None data_accum[col] += d[row] try: - if None not in [latest, earliest]: + if None not in [latest, earliest]: # noqa PLR6201 vert_pos = len(line) e = earliest[row] l = latest[row] @@ -743,7 +743,7 @@ def print_user_table(users, data=None, sub_data=None, activity=None, latest=None else: header += l.rjust(max(5, len(l) + 1, col_widths[col])) - if None not in [latest, earliest]: + if None not in [latest, earliest]: # noqa PLR6201 header += " │ timespan " lines.insert(0, header.rstrip()) @@ -768,7 +768,7 @@ def print_user_table(users, data=None, sub_data=None, activity=None, latest=None footer += temp.format(data_accum[row]) try: - if None not in [latest, earliest]: + if None not in [latest, earliest]: # noqa PLR6201 max_l = max(latest) min_e = min(earliest) timespan = relativedelta(max_l, min_e) diff --git a/management/web_update.py b/management/web_update.py index b73fda3a..e88390b2 100644 --- a/management/web_update.py +++ b/management/web_update.py @@ -186,6 +186,7 @@ def make_domain_config(domain, templates, ssl_certificates, env): pass_http_host_header = False proxy_redirect_off = False frame_options_header_sameorigin = False + web_sockets = False m = re.search("#(.*)$", url) if m: for flag in m.group(1).split(","): @@ -195,6 +196,8 @@ def make_domain_config(domain, templates, ssl_certificates, env): proxy_redirect_off = True elif flag == "frame-options-sameorigin": frame_options_header_sameorigin = True + elif flag == "web-sockets": + web_sockets = True url = re.sub("#(.*)$", "", url) nginx_conf_extra += "\tlocation %s {" % path @@ -205,6 +208,10 @@ def make_domain_config(domain, templates, ssl_certificates, env): nginx_conf_extra += "\n\t\tproxy_set_header Host $http_host;" if frame_options_header_sameorigin: nginx_conf_extra += "\n\t\tproxy_set_header X-Frame-Options SAMEORIGIN;" + if web_sockets: + nginx_conf_extra += "\n\t\tproxy_http_version 1.1;" + nginx_conf_extra += "\n\t\tproxy_set_header Upgrade $http_upgrade;" + nginx_conf_extra += "\n\t\tproxy_set_header Connection 'Upgrade';" nginx_conf_extra += "\n\t\tproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;" nginx_conf_extra += "\n\t\tproxy_set_header X-Forwarded-Host $http_host;" nginx_conf_extra += "\n\t\tproxy_set_header X-Forwarded-Proto $scheme;" diff --git a/setup/zpush.sh b/setup/zpush.sh index 3c66a5e6..efb46663 100755 --- a/setup/zpush.sh +++ b/setup/zpush.sh @@ -26,13 +26,13 @@ source /etc/mailinabox.conf # load global vars echo "Installing Z-Push (Exchange/ActiveSync server)..." apt_install \ - php"${PHP_VER}"-soap php"${PHP_VER}"-imap libawl-php php"$PHP_VER"-xml + php"${PHP_VER}"-soap php"${PHP_VER}"-imap libawl-php php"$PHP_VER"-xml php"${PHP_VER}"-intl phpenmod -v "$PHP_VER" imap # Copy Z-Push into place. -VERSION=2.7.1 -TARGETHASH=f15c566b1ad50de24f3f08f505f0c3d8155c2d0d +VERSION=2.7.3 +TARGETHASH=9d4bec41935e9a4e07880c5ff915bcddbda4443b needs_update=0 #NODOC if [ ! -f /usr/local/lib/z-push/version ]; then needs_update=1 #NODOC