From 72a9ec5b7c46dbaf006182141ade3d1bd228ff83 Mon Sep 17 00:00:00 2001 From: cbachert Date: Sat, 24 Oct 2020 00:25:53 +0100 Subject: [PATCH 1/3] Fix extract_host_port port separation Regex quantifier should be lazy to make port separation work. --- core/admin/mailu/internal/nginx.py | 2 +- optional/fetchmail/fetchmail.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/admin/mailu/internal/nginx.py b/core/admin/mailu/internal/nginx.py index fa127584..1e0b16c2 100644 --- a/core/admin/mailu/internal/nginx.py +++ b/core/admin/mailu/internal/nginx.py @@ -84,7 +84,7 @@ def get_status(protocol, status): return status, codes[protocol] def extract_host_port(host_and_port, default_port): - host, _, port = re.match('^(.*)(:([0-9]*))?$', host_and_port).groups() + host, _, port = re.match('^(.*?)(:([0-9]*))?$', host_and_port).groups() return host, int(port) if port else default_port def get_server(protocol, authenticated=False): diff --git a/optional/fetchmail/fetchmail.py b/optional/fetchmail/fetchmail.py index 98b61c4c..4be3c2bd 100755 --- a/optional/fetchmail/fetchmail.py +++ b/optional/fetchmail/fetchmail.py @@ -28,7 +28,7 @@ poll "{host}" proto {protocol} port {port} def extract_host_port(host_and_port, default_port): - host, _, port = re.match('^(.*)(:([0-9]*))?$', host_and_port).groups() + host, _, port = re.match('^(.*?)(:([0-9]*))?$', host_and_port).groups() return host, int(port) if port else default_port From 862086ea3793b4b3c5099d1376ab2eea2099b6d7 Mon Sep 17 00:00:00 2001 From: cbachert Date: Sat, 24 Oct 2020 21:52:21 +0100 Subject: [PATCH 2/3] Fix extract_host_port port separation Add towncrier newsfragment --- towncrier/newsfragments/1669.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 towncrier/newsfragments/1669.bugfix diff --git a/towncrier/newsfragments/1669.bugfix b/towncrier/newsfragments/1669.bugfix new file mode 100644 index 00000000..7409b2d2 --- /dev/null +++ b/towncrier/newsfragments/1669.bugfix @@ -0,0 +1 @@ +Fix "extract_host_port" function to support containers with custom / dynamic ports From 708e31660fd172093f78710c16652badbd687450 Mon Sep 17 00:00:00 2001 From: lub Date: Tue, 27 Oct 2020 12:52:07 +0100 Subject: [PATCH 3/3] mark radio buttons in setup utility as required Otherwise it's possible to submit the form without selecting e.g. any flavor, which would need additional handling on the server side. --- setup/templates/macros.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/templates/macros.html b/setup/templates/macros.html index 4af20c4e..17cef872 100644 --- a/setup/templates/macros.html +++ b/setup/templates/macros.html @@ -12,7 +12,7 @@ {% macro radio(name, value, emph, text, current) %}