mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-13 19:11:51 +00:00
211 lines
9.5 KiB
HTML
211 lines
9.5 KiB
HTML
<%+header%>
|
|
|
|
<% if stderr and #stderr > 0 then %><pre class="error"><%=pcdata(stderr)%></pre><% end %>
|
|
<%
|
|
local latest_omr_version=luci.model.uci.cursor():get("openmptcprouter","latest_versions","vps")
|
|
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
|
|
%>
|
|
<form class="inline" method="post" action="<%=url('admin/system/openmptcprouter/update_vps')%>">
|
|
<div class="cbi-map">
|
|
<h2 name="content"><%:Update VPS%></h2>
|
|
<fieldset class="cbi-section" id="update">
|
|
<div class="cbi-section-descr"><%:Update remotly the server to latest version when needed.%> <b><%:Beta%></b></div>
|
|
<div class="cbi-value">
|
|
<label class="cbi-value-title"><%:Update server%></label>
|
|
<div class="cbi-value-field">
|
|
<input type="hidden" name="token" value="<%=token%>" />
|
|
<input type="hidden" name="server" value="<%=servername%>" />
|
|
<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
|
|
%>
|
|
|
|
|
|
<form class="inline" method="post" action="<%=url('admin/system/openmptcprouter/settings_add')%>">
|
|
<div class="cbi-map">
|
|
<h2 name="content"><%:Advanced Settings%></h2>
|
|
<fieldset class="cbi-section" id="networks">
|
|
<legend><%:VPS settings%></legend>
|
|
<%
|
|
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">
|
|
<label class="cbi-value-title"><%:Redirects all ports from server to this router%></label>
|
|
<div class="cbi-value-field">
|
|
<input type="hidden" name="server.<%=servername%>" value="<%=servername%>" />
|
|
<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 %>>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<%
|
|
end)
|
|
%>
|
|
<%
|
|
local obfs_installed = nixio.fs.access("/usr/bin/obfs-local")
|
|
local v2ray_installed = nixio.fs.access("/usr/bin/obfs-local")
|
|
if obfs_installed or v2ray_installed then
|
|
%>
|
|
<div class="cbi-value">
|
|
<label class="cbi-value-title"><%:Enable ShadowSocks Obfuscating%></label>
|
|
<div class="cbi-value-field">
|
|
<input type="checkbox" name="obfs" class="cbi-input-checkbox" value="1" <% if luci.model.uci.cursor():get("shadowsocks-libev","tracker","obfs") == "1" then %>checked<% end %>>
|
|
<br />
|
|
<div class="cbi-value-description">
|
|
<%:Obfuscating will be enabled on both side%>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="cbi-value">
|
|
<label class="cbi-value-title"><%:Obfuscating plugin%></label>
|
|
<div class="cbi-value-field">
|
|
<select class="cbi-input-select" name="obfs_plugin">
|
|
<%
|
|
if v2ray_installed then
|
|
%>
|
|
<option value="v2ray" <% if luci.model.uci.cursor():get("shadowsocks-libev","tracker","obfs_plugin") == "v2ray" then %>selected="selected"<% end %>>v2ray</option>
|
|
<%
|
|
end
|
|
if obfs_installed then
|
|
%>
|
|
<option value="obfs" <% if luci.model.uci.cursor():get("shadowsocks-libev","tracker","obfs_plugin") == "obfs" then %>selected="selected"<% end %>>simple-obfs</option>
|
|
<%
|
|
end
|
|
%>
|
|
</select>
|
|
</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>
|
|
</div>
|
|
</div>
|
|
<%
|
|
end
|
|
%>
|
|
</fieldset>
|
|
<fieldset class="cbi-section" id="networks">
|
|
<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+"))%>">
|
|
</div>
|
|
</div>
|
|
<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+"))%>">
|
|
</div>
|
|
</div>
|
|
<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+"))%>">
|
|
</div>
|
|
</div>
|
|
<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>
|
|
<div class="cbi-value">
|
|
<label class="cbi-value-title"><%:Enable IPv6%></label>
|
|
<div class="cbi-value-field">
|
|
<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 %>>
|
|
</div>
|
|
</div>
|
|
<div class="cbi-value">
|
|
<label class="cbi-value-title"><%:Disable external check%></label>
|
|
<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 %>>
|
|
<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>
|
|
</div>
|
|
</div>
|
|
<div class="cbi-value">
|
|
<label class="cbi-value-title"><%:Disable TCP Fast Open%></label>
|
|
<div class="cbi-value-field">
|
|
<input type="checkbox" name="disablefastopen" class="cbi-input-checkbox" value="0" <% if luci.model.uci.cursor():get("openmptcprouter","settings","disable_fastopen") == "1" then %>checked<% end %>>
|
|
<br />
|
|
<div class="cbi-value-description">
|
|
<%:Disable TCP Fast Open on Linux and Shadowsocks configuration%>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="cbi-value">
|
|
<label class="cbi-value-title"><%:Master interface selection%></label>
|
|
<div class="cbi-value-field">
|
|
<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>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
<% 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">
|
|
<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+"))%>">
|
|
</div>
|
|
</div>
|
|
<div class="cbi-value">
|
|
<label class="cbi-value-title"><%:Maximum scaling CPU frequency%></label>
|
|
<div class="cbi-value-field">
|
|
<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+"))%>">
|
|
</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">
|
|
<%
|
|
governor=luci.util.trim(luci.sys.exec("cat /sys/devices/system/cpu/cpufreq/policy0/scaling_governor"))
|
|
available_governors=luci.sys.exec("cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors")
|
|
for gov in string.gmatch(available_governors, "[^%s]+") do
|
|
%>
|
|
<option value="<%=gov%>" <% if governor == gov then %>selected="selected"<% end %>><%=gov%></option>
|
|
<%
|
|
end
|
|
%>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
<% end %>
|
|
</div>
|
|
<div class="cbi-page-actions">
|
|
<input type="hidden" name="token" value="<%=token%>" />
|
|
<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')%>'" />
|
|
</div>
|
|
</form>
|
|
<%+footer%>
|