luci-proto-openvpn: sync with proto script updates
authorPaul Donald <redacted>
Wed, 11 Mar 2026 17:04:19 +0000 (18:04 +0100)
committerPaul Donald <redacted>
Thu, 12 Mar 2026 04:06:06 +0000 (05:06 +0100)
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 <redacted>
protocols/luci-proto-openvpn/htdocs/luci-static/resources/protocol/openvpn.js

index 956e91c3c55eaf0db3c9e127895043757a999786..84f27a7b4c1d94125b1ffbec792ea40c5764aad9 100644 (file)
@@ -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'),
git clone https://git.99rst.org/PROJECT