From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 420351FF146 for ; Tue, 09 Jun 2026 10:35:58 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id AA9738B88; Tue, 9 Jun 2026 10:35:57 +0200 (CEST) From: Gabriel Goller To: pmg-devel@lists.proxmox.com Subject: [PATCH api] pmgbanner: fix URL IPv6 address formatting Date: Tue, 9 Jun 2026 10:35:16 +0200 Message-ID: <20260609083520.41275-1-g.goller@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1780994079385 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.028 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com] Message-ID-Hash: F4KNMJCNV3NU3QN6SKZ7IMPTHHZEDHB5 X-Message-ID-Hash: F4KNMJCNV3NU3QN6SKZ7IMPTHHZEDHB5 X-MailFrom: g.goller@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Mail Gateway development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Wrap IPv6 local IP address in brackets when generating the web UI URL. Otherwise browsers (firefox and chromium tested) can't tell the difference between port and ipv6 address segment. Similar to the PVE patch: https://lore.proxmox.com/20260511093554.102397-1-g.goller@proxmox.com Signed-off-by: Gabriel Goller --- src/bin/pmgbanner | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/pmgbanner b/src/bin/pmgbanner index 715db99e8fb9..0d442c8b0ed9 100755 --- a/src/bin/pmgbanner +++ b/src/bin/pmgbanner @@ -28,7 +28,8 @@ for (my $try = 1; $try <= 15; $try++) { $addr //= ''; # useless but we must _not_ fail here -$banner .= " https://${addr}:8006/\n"; +my $urlip = $addr =~ m/:/ ? "[$addr]" : $addr; +$banner .= " https://${urlip}:8006/\n"; $banner .= "\n$xline\n\n"; -- 2.47.3