From 984fdadcbc0cff42dffb7253b79e62ba1ce6a0b8 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 18 Dec 2020 19:43:58 +0100 Subject: [PATCH 1/5] Fix error if adding firewall rules while rules are incorrect --- openmptcprouter/files/etc/init.d/openmptcprouter-vps | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openmptcprouter/files/etc/init.d/openmptcprouter-vps b/openmptcprouter/files/etc/init.d/openmptcprouter-vps index 05ef1c2de..0ec6b55de 100755 --- a/openmptcprouter/files/etc/init.d/openmptcprouter-vps +++ b/openmptcprouter/files/etc/init.d/openmptcprouter-vps @@ -467,6 +467,13 @@ _get_gre_tunnel() { set network.omrip${i}.netmask="255.255.255.252" set network.omrip${i}.lookup="667${i}" commit network + EOF + allintf=$(uci -q get firewall.zone_vpn.network) + uci -q del firewall.zone_vpn.network + for intf in $allintf; do + uci -q add_list firewall.zone_vpn.network=$intf + done + uci -q batch <<-EOF >/dev/null add_list firewall.zone_vpn.network="omrip${i}gre" add_list firewall.zone_vpn.network="omrip${i}" commit firewall From 28992270af580ac1ba69088c59a7067676ba2055 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 18 Dec 2020 19:44:51 +0100 Subject: [PATCH 2/5] Use omr settings to get current vpn --- .../luasrc/view/openmptcprouter/wizard.htm | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm index b29175167..78a31a1fc 100644 --- a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm +++ b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm @@ -295,17 +295,17 @@ for _, vpn in pairs(available_vpns) do if vpn == "glorytun_tcp" then %> - <% if nixio.fs.access("/usr/sbin/glorytun") then %><% end %> + <% if nixio.fs.access("/usr/sbin/glorytun") then %><% end %> <% elseif vpn == "glorytun_udp" then %> - <% if nixio.fs.access("/usr/sbin/glorytun-udp") then %><% end %> + <% if nixio.fs.access("/usr/sbin/glorytun-udp") then %><% end %> <% elseif vpn == "dsvpn" then %> - <% if nixio.fs.access("/usr/sbin/dsvpn") then %><% end %> + <% if nixio.fs.access("/usr/sbin/dsvpn") then %><% end %> <% elseif vpn == "mlvpn" then %> - <% if nixio.fs.access("/usr/sbin/mlvpn") then %><% end %> + <% if nixio.fs.access("/usr/sbin/mlvpn") then %><% end %> <% elseif vpn == "ubond" then %> - <% if nixio.fs.access("/usr/sbin/ubond") then %><% end %> + <% if nixio.fs.access("/usr/sbin/ubond") then %><% end %> <% elseif vpn == "openvpn" then %> - <% if nixio.fs.access("/etc/init.d/openvpn") then %><% end %> + <% if nixio.fs.access("/etc/init.d/openvpn") then %><% end %> <% elseif vpn == "openvpn_bonding" then %> <% if nixio.fs.access("/etc/init.d/openvpnbonding") then %><% end %> <% @@ -316,12 +316,12 @@ <% else %> - <% if nixio.fs.access("/usr/sbin/glorytun") then %><% end %> - <% if nixio.fs.access("/usr/sbin/glorytun-udp") then %><% end %> - <% if nixio.fs.access("/usr/sbin/dsvpn") then %><% end %> - <% if nixio.fs.access("/usr/sbin/mlvpn") then %><% end %> - <% if nixio.fs.access("/usr/sbin/ubond") then %><% end %> - <% if nixio.fs.access("/etc/init.d/openvpn") then %><% end %> + <% if nixio.fs.access("/usr/sbin/glorytun") then %><% end %> + <% if nixio.fs.access("/usr/sbin/glorytun-udp") then %><% end %> + <% if nixio.fs.access("/usr/sbin/dsvpn") then %><% end %> + <% if nixio.fs.access("/usr/sbin/mlvpn") then %><% end %> + <% if nixio.fs.access("/usr/sbin/ubond") then %><% end %> + <% if nixio.fs.access("/etc/init.d/openvpn") then %><% end %> <% if nixio.fs.access("/etc/init.d/openvpnbonding") then %><% end %> <% From 2b2cdc259a0d21bc8b27bf85c6cc8a91e2db755f Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 18 Dec 2020 19:45:15 +0100 Subject: [PATCH 3/5] Change help line for DHCP --- .../htdocs/luci-static/resources/view/network/dhcp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js b/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js index dafb89b26..d51c0b33d 100644 --- a/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js +++ b/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js @@ -491,7 +491,7 @@ return view.extend({ so.datatype = 'or(ip4addr,"ignore")'; so.rmempty = true; - so = ss.option(form.Value, 'leasetime', _('Lease time'), _('The lease time is in seconds, or minutes (eg 45m) or hours (eg 1h) or "infinite"')); + so = ss.option(form.Value, 'leasetime', _('Lease time'), _('The lease time is minutes (mini 2m), hours (eg 1h) or "infinite"')); so.placeholder = '12h'; so.rmempty = true; From 5186a6693856e2248ea2d408f52d7a8988025b7e Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 18 Dec 2020 20:42:44 +0100 Subject: [PATCH 4/5] Firewall zone must be a list --- .../htdocs/luci-static/resources/view/firewall/zones.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js b/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js index 00e272677..5ece96be2 100644 --- a/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js +++ b/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js @@ -163,8 +163,10 @@ return view.extend({ var name = uci.get('firewall', section_id, 'name'), cfgvalue = this.cfgvalue(section_id); + /* if (typeof(cfgvalue) == 'string' && Array.isArray(formvalue) && (cfgvalue == formvalue.join(' '))) return; + */ var tasks = [ firewall.getZone(name) ]; From 5b4b95a64203f87ee16764431a760cb1955dd800 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Sat, 19 Dec 2020 07:16:10 +0100 Subject: [PATCH 5/5] Fix typo --- luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm index 78a31a1fc..55ec6e531 100644 --- a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm +++ b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm @@ -318,7 +318,7 @@ %> <% if nixio.fs.access("/usr/sbin/glorytun") then %><% end %> <% if nixio.fs.access("/usr/sbin/glorytun-udp") then %><% end %> - <% if nixio.fs.access("/usr/sbin/dsvpn") then %><% end %> + <% if nixio.fs.access("/usr/sbin/dsvpn") then %><% end %> <% if nixio.fs.access("/usr/sbin/mlvpn") then %><% end %> <% if nixio.fs.access("/usr/sbin/ubond") then %><% end %> <% if nixio.fs.access("/etc/init.d/openvpn") then %><% end %>