2018-04-12 13:18:56 +00:00
< %+header%>
< % if stderr and #stderr > 0 then %>< pre class = "error" > < %=pcdata(stderr)%>< / pre > < % end %>
2018-12-06 12:50:56 +00:00
< %
local latest_omr_version=luci.model.uci.cursor():get("openmptcprouter","latest_versions","vps")
2020-11-22 14:51:31 +00:00
local ucic = luci.model.uci.cursor()
menuentry = ucic:get("openmptcprouter","settings","menu") or "openmptcprouter"
2018-12-21 15:20:20 +00:00
omr_test = false
uci:foreach("openmptcprouter","server", function(s)
servername = s[".name"]
local omr_version=luci.model.uci.cursor():get("openmptcprouter",servername,"omr_version")
if omr_version ~= "" and latest_omr_version ~= "" and omr_version ~= latest_omr_version then
omr_test = true
end
end)
if omr_test == true then
2018-12-06 12:50:56 +00:00
%>
2020-11-22 14:51:31 +00:00
< form class = "inline" method = "post" action = "<%=url('admin/system/' .. menuentry:lower() .. '/update_vps')%>" >
2018-12-06 12:50:56 +00:00
< div class = "cbi-map" >
2021-01-06 13:24:18 +00:00
< h2 name = "content" > < %:Update server%>< / h2 >
2018-12-06 12:50:56 +00:00
< fieldset class = "cbi-section" id = "update" >
2021-01-06 13:24:18 +00:00
< div class = "cbi-section-descr" > < %:Update remotly servers to latest version and reboot them.%> < b > < %:Beta%>< / b > < / div >
2018-12-06 12:50:56 +00:00
< div class = "cbi-value" >
2019-07-15 20:36:24 +00:00
< label class = "cbi-value-title" > < %:Update server%>< / label >
2018-12-06 12:50:56 +00:00
< div class = "cbi-value-field" >
< input type = "hidden" name = "token" value = "<%=token%>" / >
2018-12-21 15:20:20 +00:00
< input type = "hidden" name = "server" value = "<%=servername%>" / >
2018-12-06 12:50:56 +00:00
< input type = "hidden" name = "flash" value = "1" / >
< input type = "submit" name = "update_vps" class = "cbi-button cbi-button-apply" value = "<%:Update%>" >
< / div >
< / div >
< / div >
< / form >
< %
end
%>
2020-10-01 15:16:14 +00:00
< hr / >
2020-11-22 14:51:31 +00:00
< form class = "inline" method = "post" action = "<%=url('admin/system/' .. menuentry:lower() .. '/settings_add')%>" >
2018-04-12 13:18:56 +00:00
< div class = "cbi-map" >
< h2 name = "content" > < %:Advanced Settings%>< / h2 >
< fieldset class = "cbi-section" id = "networks" >
2021-01-06 13:24:18 +00:00
< legend > < %:Server settings%>< / legend >
2018-12-21 15:20:20 +00:00
< %
uci:foreach("openmptcprouter","server", function(s)
servername = s[".name"]
%>
< h3 > < %=servername%>< / h3 >
< div class = "cbi-section-node" >
< div class = "cbi-section-descr" > < / div >
< div class = "cbi-value" >
2019-07-15 20:36:24 +00:00
< label class = "cbi-value-title" > < %:Redirects all ports from server to this router%>< / label >
2019-01-07 06:54:18 +00:00
< div class = "cbi-value-field" >
< input type = "hidden" name = "server.<%=servername%>" value = "<%=servername%>" / >
2018-12-21 15:20:20 +00:00
< input type = "checkbox" name = "redirect_ports.<%=servername%>" class = "cbi-input-checkbox" value = "1" < % if luci . model . uci . cursor ( ) :get ( " openmptcprouter " , servername , " redirect_ports " ) = = " 1 " then % > checked< % end %>>
2020-11-01 08:35:03 +00:00
< br / >
< div class = "cbi-value-description" >
< %:You shouldn't do that and you should redirect only needed ports%>
< / div >
2018-12-21 15:20:20 +00:00
< / div >
2018-11-27 14:21:47 +00:00
< / div >
2019-10-01 17:43:36 +00:00
< div class = "cbi-value" >
< label class = "cbi-value-title" > < %:Disable ports redirection defined in firewall from server to this router%>< / label >
< div class = "cbi-value-field" >
< input type = "hidden" name = "server.<%=servername%>" value = "<%=servername%>" / >
< input type = "checkbox" name = "nofwredirect.<%=servername%>" class = "cbi-input-checkbox" value = "1" < % if luci . model . uci . cursor ( ) :get ( " openmptcprouter " , servername , " nofwredirect " ) = = " 1 " then % > checked< % end %>>
< / div >
< / div >
2018-11-27 14:21:47 +00:00
< / div >
2018-12-21 15:20:20 +00:00
< %
end)
%>
2019-01-30 17:38:40 +00:00
< %
local obfs_installed = nixio.fs.access("/usr/bin/obfs-local")
2019-11-21 08:19:16 +00:00
local v2ray_installed = nixio.fs.access("/usr/bin/v2ray-plugin")
2019-01-30 17:38:40 +00:00
if obfs_installed or v2ray_installed then
%>
2018-11-27 14:21:47 +00:00
< div class = "cbi-value" >
2019-01-26 12:51:53 +00:00
< label class = "cbi-value-title" > < %:Enable ShadowSocks Obfuscating%>< / label >
2018-11-27 14:21:47 +00:00
< div class = "cbi-value-field" >
2019-11-26 18:17:41 +00:00
< input type = "checkbox" name = "obfs" class = "cbi-input-checkbox" value = "1" < % if luci . model . uci . cursor ( ) :get ( " shadowsocks-libev " , " sss0 " , " obfs " ) = = " 1 " then % > checked< % end %>>
2018-11-27 14:21:47 +00:00
< br / >
< div class = "cbi-value-description" >
2019-01-26 12:51:53 +00:00
< %:Obfuscating will be enabled on both side%>
2018-11-27 14:21:47 +00:00
< / div >
2019-01-26 12:51:53 +00:00
< / div >
2019-01-28 17:28:56 +00:00
< / div >
< div class = "cbi-value" >
< label class = "cbi-value-title" > < %:Obfuscating plugin%>< / label >
2019-01-26 12:51:53 +00:00
< div class = "cbi-value-field" >
< select class = "cbi-input-select" name = "obfs_plugin" >
2019-01-30 17:38:40 +00:00
< %
if v2ray_installed then
%>
2019-11-26 18:17:41 +00:00
< option value = "v2ray" < % if luci . model . uci . cursor ( ) :get ( " shadowsocks-libev " , " sss0 " , " obfs_plugin " ) = = " v2ray " then % > selected="selected"< % end %>>v2ray< / option >
2019-01-30 17:38:40 +00:00
< %
end
if obfs_installed then
%>
2019-11-26 18:17:41 +00:00
< option value = "obfs-simple" < % if luci . model . uci . cursor ( ) :get ( " shadowsocks-libev " , " sss0 " , " obfs_plugin " ) = = " obfs-simple " then % > selected="selected"< % end %>>simple-obfs< / option >
2019-01-30 17:38:40 +00:00
< %
end
%>
2019-01-26 12:51:53 +00:00
< / select >
2019-04-15 20:14:35 +00:00
< / div >
< / div >
< div class = "cbi-value" >
< label class = "cbi-value-title" > < %:Obfuscating type%>< / label >
< div class = "cbi-value-field" >
< select class = "cbi-input-select" name = "obfs_type" >
< option value = "http" < % if luci . model . uci . cursor ( ) :get ( " shadowsocks-libev " , " tracker " , " obfs_type " ) = = " http " then % > selected="selected"< % end %>>http< / option >
< option value = "tls" < % if luci . model . uci . cursor ( ) :get ( " shadowsocks-libev " , " tracker " , " obfs_type " ) = = " tls " then % > selected="selected"< % end %>>tls< / option >
< / select >
2019-01-26 12:51:53 +00:00
< / div >
2018-11-27 14:21:47 +00:00
< / div >
2019-01-30 17:38:40 +00:00
< %
end
%>
2018-11-27 14:21:47 +00:00
< / fieldset >
2020-10-01 15:16:14 +00:00
< hr / >
2018-11-27 14:21:47 +00:00
< fieldset class = "cbi-section" id = "networks" >
2018-04-12 13:18:56 +00:00
< legend > < %:Networks settings%>< / legend >
< div class = "cbi-section-descr" > < / div >
< div class = "cbi-value" >
< label class = "cbi-value-title" > < %:IPv4 TCP Keepalive time%>< / label >
< div class = "cbi-value-field" >
< input type = "text" name = "tcp_keepalive_time" class = "cbi-input-text" value = "<%=tonumber((luci.sys.exec(" sysctl net . ipv4 . tcp_keepalive_time " ) ) :match ( " % d + " ) ) % > ">
2020-09-13 06:39:29 +00:00
< br / >
< div class = "cbi-value-description" >
< %:How often TCP sends out keepalive messages when keepalive is enabled.%>
< / div >
2018-04-12 13:18:56 +00:00
< / div >
< / div >
2018-07-22 13:23:02 +00:00
< div class = "cbi-value" >
< label class = "cbi-value-title" > < %:IPv4 TCP FIN timeout%>< / label >
< div class = "cbi-value-field" >
< input type = "text" name = "tcp_fin_timeout" class = "cbi-input-text" value = "<%=tonumber((luci.sys.exec(" sysctl net . ipv4 . tcp_fin_timeout " ) ) :match ( " % d + " ) ) % > ">
2020-09-13 06:39:29 +00:00
< br / >
< div class = "cbi-value-description" >
< %:The length of time an orphaned (no longer referenced by any application) connection will remain in the FIN_WAIT_2 state before it is aborted at the local end.%>
< / div >
2018-07-22 13:23:02 +00:00
< / div >
< / div >
2018-12-23 13:14:28 +00:00
< div class = "cbi-value" >
< label class = "cbi-value-title" > < %:IPv4 TCP SYN retries%>< / label >
< div class = "cbi-value-field" >
< input type = "text" name = "tcp_syn_retries" class = "cbi-input-text" value = "<%=tonumber((luci.sys.exec(" sysctl net . ipv4 . tcp_syn_retries " ) ) :match ( " % d + " ) ) % > ">
2020-09-13 06:39:29 +00:00
< br / >
< div class = "cbi-value-description" >
< %:Number of times initial SYNs for an active TCP connection attempt will be retransmitted.%>
< / div >
< / div >
< / div >
< div class = "cbi-value" >
< label class = "cbi-value-title" > < %:IPv4 TCP SYN retries1%>< / label >
< div class = "cbi-value-field" >
< input type = "text" name = "tcp_retries1" class = "cbi-input-text" value = "<%=tonumber((luci.sys.exec(" sysctl net . ipv4 . tcp_retries1 " ) ) :match ( " % d + " ) ) % > ">
< br / >
< div class = "cbi-value-description" >
< %:This value influences the time, after which TCP decides, that something is wrong due to unacknowledged RTO retransmissions, and reports this suspicion to the network layer.%>
< / div >
< / div >
< / div >
< div class = "cbi-value" >
< label class = "cbi-value-title" > < %:IPv4 TCP SYN retries2%>< / label >
< div class = "cbi-value-field" >
< input type = "text" name = "tcp_retries2" class = "cbi-input-text" value = "<%=tonumber((luci.sys.exec(" sysctl net . ipv4 . tcp_retries2 " ) ) :match ( " % d + " ) ) % > ">
< br / >
< div class = "cbi-value-description" >
< %:This value influences the timeout of an alive TCP connection, when RTO retransmissions remain unacknowledged.%>
< / div >
2018-12-23 13:14:28 +00:00
< / div >
< / div >
2019-01-17 19:43:53 +00:00
< div class = "cbi-value" >
< label class = "cbi-value-title" > < %:IPv4 TCP Fast Open%>< / label >
< div class = "cbi-value-field" >
< input type = "text" name = "tcp_fastopen" class = "cbi-input-text" value = "<%=tonumber((luci.sys.exec(" sysctl net . ipv4 . tcp_fastopen " ) ) :match ( " % d + " ) ) % > ">
< / div >
< / div >
2020-09-17 12:21:48 +00:00
< div class = "cbi-value" >
< label class = "cbi-value-title" > < %:IPv4 IP default TTL%>< / label >
< div class = "cbi-value-field" >
< input type = "text" name = "ip_default_ttl" class = "cbi-input-text" value = "<%=tonumber((luci.sys.exec(" sysctl net . ipv4 . ip_default_ttl " ) ) :match ( " % d + " ) ) % > ">
< / div >
< / div >
2018-04-12 13:18:56 +00:00
< div class = "cbi-value" >
2019-02-05 20:06:16 +00:00
< label class = "cbi-value-title" > < %:Enable IPv6%>< / label >
2018-04-12 13:18:56 +00:00
< div class = "cbi-value-field" >
2019-02-11 20:11:34 +00:00
< input type = "checkbox" name = "enableipv6" class = "cbi-input-checkbox" value = "0" < % if luci . model . uci . cursor ( ) :get ( " openmptcprouter " , " settings " , " disable_ipv6 " ) = = " 0 " then % > checked< % end %>>
2018-04-12 13:18:56 +00:00
< / div >
< / div >
2019-03-06 17:24:22 +00:00
< div class = "cbi-value" >
2019-03-09 18:18:19 +00:00
< label class = "cbi-value-title" > < %:Disable external check%>< / label >
2019-03-06 17:24:22 +00:00
< div class = "cbi-value-field" >
< input type = "checkbox" name = "externalcheck" class = "cbi-input-checkbox" value = "0" < % if luci . model . uci . cursor ( ) :get ( " openmptcprouter " , " settings " , " external_check " ) = = " 0 " then % > checked< % end %>>
2019-03-09 18:18:19 +00:00
< br / >
< div class = "cbi-value-description" >
< %:When enable check are done on external sites to get each WAN IP and the IP used to go outside.%>
< / div >
2019-03-06 17:24:22 +00:00
< / div >
< / div >
2019-07-15 20:36:24 +00:00
< div class = "cbi-value" >
< label class = "cbi-value-title" > < %:Disable TCP Fast Open%>< / label >
< div class = "cbi-value-field" >
2019-12-30 15:55:03 +00:00
< input type = "checkbox" name = "disablefastopen" class = "cbi-input-checkbox" value = "1" < % if luci . model . uci . cursor ( ) :get ( " openmptcprouter " , " settings " , " disable_fastopen " ) = = " 1 " then % > checked< % end %>>
2019-07-15 20:36:24 +00:00
< br / >
< div class = "cbi-value-description" >
2019-07-16 19:58:14 +00:00
< %:Disable TCP Fast Open on Linux and Shadowsocks configuration%>
2019-07-15 20:36:24 +00:00
< / div >
< / div >
< / div >
2020-05-05 08:48:28 +00:00
< div class = "cbi-value" >
< label class = "cbi-value-title" > < %:Enable TCP Low Latency%>< / label >
< div class = "cbi-value-field" >
< input type = "checkbox" name = "enablenodelay" class = "cbi-input-checkbox" value = "1" < % if luci . model . uci . cursor ( ) :get ( " openmptcprouter " , " settings " , " enable_nodelay " ) = = " 1 " then % > checked< % end %>>
< br / >
< div class = "cbi-value-description" >
< %:Optimize for latency instead of bandwidth%>
< / div >
< / div >
< / div >
2020-10-19 14:19:46 +00:00
< / fieldset >
< hr / >
< fieldset class = "cbi-section" id = "other" >
< legend > < %:Other settings%>< / legend >
< div class = "cbi-section-descr" > < / div >
2019-07-22 15:47:48 +00:00
< div class = "cbi-value" >
< label class = "cbi-value-title" > < %:Save vnstats stats%>< / label >
< div class = "cbi-value-field" >
2020-08-26 08:45:09 +00:00
< input type = "checkbox" name = "savevnstat" class = "cbi-input-checkbox" value = "1" < % if luci . util . trim ( luci . sys . exec ( " uci -q get openmptcprouter . settings . vnstat_backup " ) ) = = " 1 " then % > checked< % end %>>
2019-07-22 15:47:48 +00:00
< br / >
< div class = "cbi-value-description" >
< %:Save vnstats statistics on disk%>
< / div >
< / div >
< / div >
2019-08-16 08:33:38 +00:00
< div class = "cbi-value" >
< label class = "cbi-value-title" > < %:Disable gateway ping%>< / label >
< div class = "cbi-value-field" >
2019-12-30 15:55:03 +00:00
< input type = "checkbox" name = "disablegwping" class = "cbi-input-checkbox" value = "1" < % if luci . model . uci . cursor ( ) :get ( " openmptcprouter " , " settings " , " disablegwping " ) = = " 1 " then % > checked< % end %>>
2019-08-16 08:33:38 +00:00
< br / >
< div class = "cbi-value-description" >
< %:Disable gateway ping status check%>
< / div >
< / div >
< / div >
2020-12-28 13:45:13 +00:00
< div class = "cbi-value" >
< label class = "cbi-value-title" > < %:Disable interfaces auto rename%>< / label >
< div class = "cbi-value-field" >
< input type = "checkbox" name = "disableintfrename" class = "cbi-input-checkbox" value = "1" < % if luci . model . uci . cursor ( ) :get ( " openmptcprouter " , " settings " , " disableintfrename " ) = = " 1 " then % > checked< % end %>>
< br / >
< div class = "cbi-value-description" >
< %:Disable renaming interfaces%>
< / div >
< / div >
< / div >
2020-12-03 10:25:16 +00:00
< div class = "cbi-value" >
< label class = "cbi-value-title" > < %:When proxy shadowsocks is used, use it for UDP if proxy down%>< / label >
< div class = "cbi-value-field" >
< input type = "checkbox" name = "shadowsocksudp" class = "cbi-input-checkbox" value = "1" < % if luci . model . uci . cursor ( ) :get ( " openmptcprouter " , " settings " , " shadowsocksudp " ) = = " 1 " then % > checked< % end %>>
< / div >
< / div >
2020-05-05 08:48:28 +00:00
< div class = "cbi-value" >
< label class = "cbi-value-title" > < %:Disable default gateway%>< / label >
< div class = "cbi-value-field" >
< input type = "checkbox" name = "disabledefaultgw" class = "cbi-input-checkbox" value = "0" < % if luci . model . uci . cursor ( ) :get ( " openmptcprouter " , " settings " , " defaultgw " ) = = " 0 " then % > checked< % end %>>
< br / >
< div class = "cbi-value-description" >
< %:Disable default gateway, no internet if VPS are down%>
< / div >
< / div >
< / div >
2019-08-16 08:33:38 +00:00
< div class = "cbi-value" >
< label class = "cbi-value-title" > < %:Disable server ping%>< / label >
< div class = "cbi-value-field" >
2019-12-30 15:55:03 +00:00
< input type = "checkbox" name = "disableserverping" class = "cbi-input-checkbox" value = "1" < % if luci . model . uci . cursor ( ) :get ( " openmptcprouter " , " settings " , " disableserverping " ) = = " 1 " then % > checked< % end %>>
2019-08-16 08:33:38 +00:00
< br / >
< div class = "cbi-value-description" >
< %:Disable server ping status check%>
< / div >
< / div >
< / div >
2020-08-19 13:44:52 +00:00
< div class = "cbi-value" >
< label class = "cbi-value-title" > < %:Disable tracebox test%>< / label >
< div class = "cbi-value-field" >
< input type = "checkbox" name = "disabletracebox" class = "cbi-input-checkbox" value = "0" < % if luci . model . uci . cursor ( ) :get ( " openmptcprouter " , " settings " , " tracebox " ) = = " 0 " then % > checked< % end %>>
< br / >
< div class = "cbi-value-description" >
< %:Disable multipath test using tracebox%>
< / div >
< / div >
< / div >
2020-07-10 13:45:17 +00:00
< div class = "cbi-value" >
< label class = "cbi-value-title" > < %:Debug%>< / label >
< div class = "cbi-value-field" >
< input type = "checkbox" name = "debug" class = "cbi-input-checkbox" value = "1" < % if luci . model . uci . cursor ( ) :get ( " openmptcprouter " , " settings " , " debug " ) = = " 1 " then % > checked< % end %>>
< br / >
< div class = "cbi-value-description" >
< %:Enable debug logs%>
< / div >
< / div >
< / div >
2018-10-31 11:39:40 +00:00
< div class = "cbi-value" >
2018-12-13 12:54:06 +00:00
< label class = "cbi-value-title" > < %:Master interface selection%>< / label >
2018-10-31 11:39:40 +00:00
< div class = "cbi-value-field" >
2018-12-13 12:54:06 +00:00
< select class = "cbi-input-select" name = "master_type" >
< option value = "change" < % if luci . model . uci . cursor ( ) :get ( " openmptcprouter " , " settings " , " master " ) = = " change " then % > selected="selected"< % end %>>< %:On wizard change%>< / option >
< option value = "dynamic" < % if luci . model . uci . cursor ( ) :get ( " openmptcprouter " , " settings " , " master " ) = = " dynamic " then % > selected="selected"< % end %>>< %:Dynamic change%>< / option >
< option value = "static" < % if luci . model . uci . cursor ( ) :get ( " openmptcprouter " , " settings " , " master " ) = = " static " then % > selected="selected"< % end %>>< %:No change%>< / option >
2020-03-27 09:25:51 +00:00
< option value = "balancing" < % if luci . model . uci . cursor ( ) :get ( " openmptcprouter " , " settings " , " master " ) = = " balancing " then % > selected="selected"< % end %>>< %:Balancing%>< / option >
2018-12-13 12:54:06 +00:00
< / select >
2018-07-09 12:55:42 +00:00
< / div >
< / div >
2018-04-12 13:18:56 +00:00
< / fieldset >
2018-04-17 07:27:15 +00:00
< % if nixio.fs.access("/sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq") then %>
< fieldset class = "cbi-section" id = "system" >
< legend > < %:Systems settings%>< / legend >
< div class = "cbi-section-descr" > < / div >
< div class = "cbi-value" >
< label class = "cbi-value-title" > < %:Minimum scaling CPU frequency%>< / label >
< div class = "cbi-value-field" >
2018-04-17 12:48:55 +00:00
< input type = "text" name = "scaling_min_freq" class = "cbi-input-text" value = "<%=tonumber((luci.sys.exec(" cat / sys / devices / system / cpu / cpufreq / policy0 / scaling_min_freq " ) ) :match ( " % d + " ) ) % > ">
2018-04-17 07:27:15 +00:00
< / div >
< / div >
< div class = "cbi-value" >
< label class = "cbi-value-title" > < %:Maximum scaling CPU frequency%>< / label >
< div class = "cbi-value-field" >
2018-04-17 12:48:55 +00:00
< input type = "text" name = "scaling_max_freq" class = "cbi-input-text" value = "<%=tonumber((luci.sys.exec(" cat / sys / devices / system / cpu / cpufreq / policy0 / scaling_max_freq " ) ) :match ( " % d + " ) ) % > ">
2018-04-17 07:27:15 +00:00
< / div >
< / div >
< div class = "cbi-value" >
< label class = "cbi-value-title" > < %:Scaling governor%>< / label >
< div class = "cbi-value-field" >
< select class = "cbi-input-select" name = "scaling_governor" >
< %
2018-04-17 12:48:55 +00:00
governor=luci.util.trim(luci.sys.exec("cat /sys/devices/system/cpu/cpufreq/policy0/scaling_governor"))
2018-04-17 07:27:15 +00:00
available_governors=luci.sys.exec("cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors")
for gov in string.gmatch(available_governors, "[^%s]+") do
%>
2018-04-17 12:48:55 +00:00
< option value = "<%=gov%>" < % if governor = = gov then % > selected="selected"< % end %>>< %=gov%>< / option >
2018-04-17 07:27:15 +00:00
< %
end
%>
< / select >
< / div >
< / div >
< / fieldset >
< % end %>
2018-04-12 13:18:56 +00:00
< / div >
< div class = "cbi-page-actions" >
< input type = "hidden" name = "token" value = "<%=token%>" / >
2018-07-25 12:44:21 +00:00
< input class = "cbi-button cbi-button-apply" type = "submit" value = "<%:Save & Apply%>" / > < input class = "cbi-button cbi-button-reset" type = "button" value = "Reset" onclick = "location.href='<%=url('admin/system/openmptcprouter/settings')%>'" / >
2018-04-12 13:18:56 +00:00
< / div >
< / form >
< %+footer%>