diff options
author | William Fleurant <meshnet@protonmail.com> | 2023-11-12 12:49:50 +0100 |
---|---|---|
committer | William Fleurant <meshnet@protonmail.com> | 2023-11-12 12:49:50 +0100 |
commit | 2fde5fb515308c52fc9e1510a2ffa5cd6fe0d4f5 (patch) | |
tree | 0781adbfb839a3fbd28357eb9f374a6a9b179cf3 /protocols/luci-proto-yggdrasil | |
parent | 6fa509d0e47a31d0974af914f53e35025444f70d (diff) |
luci-proto-yggdrasil: add support for v0.5.2 features
Signed-off-by: William Fleurant <meshnet@protonmail.com>
Diffstat (limited to 'protocols/luci-proto-yggdrasil')
-rw-r--r-- | protocols/luci-proto-yggdrasil/htdocs/luci-static/resources/protocol/yggdrasil.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/protocols/luci-proto-yggdrasil/htdocs/luci-static/resources/protocol/yggdrasil.js b/protocols/luci-proto-yggdrasil/htdocs/luci-static/resources/protocol/yggdrasil.js index 08c2450118..b6507fd440 100644 --- a/protocols/luci-proto-yggdrasil/htdocs/luci-static/resources/protocol/yggdrasil.js +++ b/protocols/luci-proto-yggdrasil/htdocs/luci-static/resources/protocol/yggdrasil.js @@ -29,14 +29,17 @@ function validatePublicKey(section_id,value) { return true; }; -function validateYggdrasilUri(section_id,value) { +function validateYggdrasilListenUri(section_id,value) { + if (value.length == 0) { + return true; + }; if (!value.match(/^(tls|tcp|unix|quic):\/\//)) return _('URI scheme not supported'); return true; }; function validateYggdrasilPeerUri(section_id,value) { - if (!value.match(/^(tls|tcp|unix|socks|quic):\/\//)) + if (!value.match(/^(tls|tcp|unix|quic|socks|socktls):\/\//)) return _('URI scheme not supported'); return true; }; @@ -219,6 +222,7 @@ return network.registerProtocol('yggdrasil', o=ss.option(form.DynamicList,'listen_address',_('Listen addresses'),_('Listen addresses for incoming connections. You will need to add listeners in order to accept incoming peerings from non-local nodes. Multicast peer discovery will work regardless of any listeners set here. Each listener should be specified in URI format, e.g.tls://0.0.0.0:0 or tls://[::]:0 to listen on all interfaces.')); o.placeholder="tls://0.0.0.0:0" + o.validate=validateYggdrasilListenUri; o=s.taboption('peers',form.DynamicList,'allowed_public_key',_('Allowed public keys'),_('List of peer public keys to allow incoming peering connections from. If left empty then all connections will be allowed by default. This does not affect outgoing peerings, nor does it affect link-local peers discovered via multicast.')); o.validate=validatePublicKey; @@ -231,6 +235,7 @@ return network.registerProtocol('yggdrasil', o=ss.option(form.Value,"address",_("Peer URI")); o.placeholder="tls://0.0.0.0:0" + o.validate=validateYggdrasilPeerUri; ss.option(widgets.NetworkSelect,"interface",_("Peer interface")); o=s.taboption('peers', form.SectionValue, '_interfaces', form.TableSection, 'yggdrasil_%s_interface'.format(this.sid), _("Multicast rules")) |