luci-app-radicale3: use ip6 bracket notation
authorDaniel F. Dickinson <redacted>
Mon, 19 Jan 2026 07:44:52 +0000 (02:44 -0500)
committerPaul Donald <redacted>
Mon, 19 Jan 2026 15:07:49 +0000 (16:07 +0100)
Update iphostport validation to use bracket notation for ipv6 IP
addresses. Radicale understands it, and it is the preferred notation
when using an IP address and port, together.

Signed-off-by: Daniel F. Dickinson <redacted>
applications/luci-app-radicale3/htdocs/luci-static/resources/view/radicale3.js

index 8246b8ade352329a45ff66d63af1d289135c4048..038d425609d1ea2ab39eb043a5b476185e860074 100644 (file)
@@ -53,11 +53,11 @@ return view.extend({
 
                button = '';
 
-               if ((radicale_address == '127.0.0.1') || (radicale_address == '::1')) {
+               if ((radicale_address == '127.0.0.1') || (radicale_address == '[::1]') || radicale_host == 'localhost') {
                        ui.addNotification(_('Need a listen address'),
                                _('Radicale needs a non-loopback IP address for your browser to access the web interface'));
                } else {
-                       if (radicale_address == '0.0.0.0' || radicale_address == '::') {
+                       if (radicale_address == '0.0.0.0' || radicale_address == '[::]') {
                                radicale_address = window.location.hostname;
                        }
                        radicale_port = radicale_host.substring(radicale_host.lastIndexOf(':') + 1) || '5232';
@@ -84,8 +84,8 @@ return view.extend({
 
                o = s.taboption('main', form.DynamicList, 'host', _('Host:port'));
                o.optional = true;
-               o.datatype = 'or(hostport(0),ipaddrport(0))';
-               o.default = ['127.0.0.1:5232', '::1:5232'];
+               o.datatype = 'or(hostport(0),ipaddrport(1))';
+               o.default = ['127.0.0.1:5232', '[::1]:5232'];
 
                s.tab('advanced', _('Advanced'));
 
git clone https://git.99rst.org/PROJECT