1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Fix disable external check

This commit is contained in:
Ycarus 2019-04-15 22:14:35 +02:00
parent c40bd22fcd
commit 5208f753b4
2 changed files with 18 additions and 5 deletions

View file

@ -19,7 +19,7 @@ function index()
entry({"admin", "system", "openmptcprouter", "settings"}, template("openmptcprouter/settings"), _("Advanced Settings"), 3).leaf = true
entry({"admin", "system", "openmptcprouter", "settings_add"}, post("settings_add")).leaf = true
entry({"admin", "system", "openmptcprouter", "update_vps"}, post("update_vps")).leaf = true
entry({"admin", "system", "openmptcprouter", "debug"}, template("openmptcprouter/debug"), _("Show all settings"), 4).leaf = true
entry({"admin", "system", "openmptcprouter", "debug"}, template("openmptcprouter/debug"), _("Show all settings"), 5).leaf = true
end
function interface_from_device(dev)
@ -254,10 +254,6 @@ function wizard_add()
local disable_ipv6 = luci.http.formvalue("enableipv6") or "1"
set_ipv6_state(disable_ipv6)
-- Enable/disable external check
local externalcheck = luci.http.formvalue("externalcheck") or "1"
ucic:set("openmptcprouter","settings","external_check",externalcheck)
-- Get VPN set by default
local default_vpn = luci.http.formvalue("default_vpn") or "glorytun_tcp"
local vpn_port = ""
@ -535,15 +531,23 @@ function settings_add()
local disable_ipv6 = luci.http.formvalue("enableipv6") or "1"
set_ipv6_state(disable_ipv6)
-- Enable/disable external check
local externalcheck = luci.http.formvalue("externalcheck") or "1"
ucic:set("openmptcprouter","settings","external_check",externalcheck)
ucic:commit("openmptcprouter")
-- Enable/disable obfs
local obfs = luci.http.formvalue("obfs") or "0"
local obfs_plugin = luci.http.formvalue("obfs_plugin") or "v2ray"
local obfs_type = luci.http.formvalue("obfs_type") or "http"
ucic:foreach("shadowsocks-libev", "ss_redir", function (section)
ucic:set("shadowsocks-libev",section[".name"],"obfs",obfs)
ucic:set("shadowsocks-libev",section[".name"],"obfs_plugin",obfs_plugin)
ucic:set("shadowsocks-libev",section[".name"],"obfs_type",obfs_type)
end)
ucic:set("shadowsocks-libev","tracker","obfs",obfs)
ucic:set("shadowsocks-libev","tracker","obfs_plugin",obfs_plugin)
ucic:set("shadowsocks-libev","tracker","obfs_type",obfs_type)
ucic:save("shadowsocks-libev")
ucic:commit("shadowsocks-libev")

View file

@ -91,6 +91,15 @@
</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
%>