From d08ae634a88408a82b53ec51ddd027fef113b3f3 Mon Sep 17 00:00:00 2001 From: Paul Donald Date: Wed, 11 Mar 2026 18:04:19 +0100 Subject: [PATCH] luci-proto-openvpn: sync with proto script updates make push(_reset) independent of server The manual notes that push is a legal option in a client context, i.e. the client can set these also. Add also push_remove. fix also the datatype for 'remote' to allow various combos. Signed-off-by: Paul Donald --- .../luci-static/resources/protocol/openvpn.js | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/protocols/luci-proto-openvpn/htdocs/luci-static/resources/protocol/openvpn.js b/protocols/luci-proto-openvpn/htdocs/luci-static/resources/protocol/openvpn.js index 956e91c3c5..84f27a7b4c 100644 --- a/protocols/luci-proto-openvpn/htdocs/luci-static/resources/protocol/openvpn.js +++ b/protocols/luci-proto-openvpn/htdocs/luci-static/resources/protocol/openvpn.js @@ -50,7 +50,7 @@ const openvpnOptions = [ tab: 'general', type: form.DynamicList, name: 'remote', - datatype: 'tuple(host,port,string)', + datatype: 'or(host,tuple(host,port),tuple(host,port,string))', label: _('Remote host name or IP address'), placeholder: '1.2.3.4' }, @@ -381,14 +381,6 @@ const openvpnOptions = [ label: _('Run up/down scripts for all restarts'), default: 0 }, - { - tab: 'scripts', - depends: { script_security: /[1-3]/ }, - type: form.Value, - name: 'route_pre_up', - placeholder: '/usr/bin/ovpn-routepreup', - label: _('Execute shell cmd before routes are added') - }, { tab: 'scripts', depends: { script_security: /[1-3]/ }, @@ -458,7 +450,7 @@ const openvpnOptions = [ depends: { script_security: /[1-3]/ }, type: form.Value, name: 'tls_crypt_v2_verify', - placeholder: '/usr/bin/ovpn-tlscryp2v2verify', + placeholder: '/usr/bin/ovpn-tlscryptv2verify', label: _('Run script cmd for client TLS verification') }, { @@ -1341,15 +1333,19 @@ const openvpnOptions = [ /* Push/Client */ { tab: 'push_opt', - depends: { server: "", "!reverse": true }, type: form.DynamicList, name: 'push', label: _('Push options to peer'), lvalues: ['redirect-gateway'] - }, // values: ['comp-lzo'] + }, + { + tab: 'push_opt', + type: form.DynamicList, + name: 'push_remove', + label: _('Remove Push options'), + }, { tab: 'push_opt', - depends: { server: "", "!reverse": true }, type: form.Flag, name: 'push_reset', label: _('Don\'t inherit global push options'),