diff --git a/config/Config-build.in b/config/Config-build.in
index 830d65812f..5ee0667f3d 100644
--- a/config/Config-build.in
+++ b/config/Config-build.in
@@ -245,10 +245,8 @@ menu "Global build settings"
bool "None"
config PKG_CC_STACKPROTECTOR_REGULAR
bool "Regular"
- depends on KERNEL_CC_STACKPROTECTOR_REGULAR
config PKG_CC_STACKPROTECTOR_STRONG
bool "Strong"
- depends on KERNEL_CC_STACKPROTECTOR_STRONG
endchoice
choice
diff --git a/package/boot/uboot-mediatek/Makefile b/package/boot/uboot-mediatek/Makefile
index f6745f6cad..a7b47ecae5 100644
--- a/package/boot/uboot-mediatek/Makefile
+++ b/package/boot/uboot-mediatek/Makefile
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_VERSION:=2020.04
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_HASH:=fe732aaf037d9cc3c0909bad8362af366ae964bbdac6913a34081ff4ad565372
include $(INCLUDE_DIR)/u-boot.mk
diff --git a/package/boot/uboot-mediatek/patches/010-no-binman.patch b/package/boot/uboot-mediatek/patches/010-no-binman.patch
new file mode 100644
index 0000000000..8a05a2d41d
--- /dev/null
+++ b/package/boot/uboot-mediatek/patches/010-no-binman.patch
@@ -0,0 +1,25 @@
+--- a/Makefile
++++ b/Makefile
+@@ -1667,8 +1667,10 @@ u-boot-elf.lds: arch/u-boot-elf.lds prepare FORCE
+ ifeq ($(CONFIG_SPL),y)
+ spl/u-boot-spl-mtk.bin: spl/u-boot-spl
+
+-u-boot-mtk.bin: u-boot.dtb u-boot.img spl/u-boot-spl-mtk.bin FORCE
+- $(call if_changed,binman)
++OBJCOPYFLAGS_u-boot-mtk.bin = -I binary -O binary \
++ --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff
++u-boot-mtk.bin: u-boot.img spl/u-boot-spl-mtk.bin FORCE
++ $(call if_changed,pad_cat)
+ else
+ MKIMAGEFLAGS_u-boot-mtk.bin = -T mtk_image \
+ -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) \
+--- a/arch/arm/mach-mediatek/Kconfig
++++ b/arch/arm/mach-mediatek/Kconfig
+@@ -36,7 +36,6 @@ config TARGET_MT7629
+ bool "MediaTek MT7629 SoC"
+ select CPU_V7A
+ select SPL
+- select BINMAN
+ help
+ The MediaTek MT7629 is a ARM-based SoC with a dual-core Cortex-A7
+ including DDR3, crypto engine, 3x3 11n/ac Wi-Fi, Gigabit Ethernet,
diff --git a/package/ctcgfw/luci-app-openclash/files/etc/config/openclash b/package/ctcgfw/luci-app-openclash/files/etc/config/openclash
index 72e9b7c109..dcaf098074 100644
--- a/package/ctcgfw/luci-app-openclash/files/etc/config/openclash
+++ b/package/ctcgfw/luci-app-openclash/files/etc/config/openclash
@@ -21,7 +21,7 @@ config openclash 'config'
option disable_masq_cache '0'
option servers_update '0'
option log_level 'silent'
- option proxy_mode 'Rule'
+ option proxy_mode 'rule'
option intranet_allowed '0'
option enable_udp_proxy '1'
option lan_ac_mode '0'
diff --git a/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/servers-config.lua b/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/servers-config.lua
index 4db030137a..e5ae9f222d 100644
--- a/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/servers-config.lua
+++ b/package/ctcgfw/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/servers-config.lua
@@ -42,11 +42,42 @@ local encrypt_methods_ss = {
"xchacha20-ietf-poly1305",
}
+local encrypt_methods_ssr = {
+
+ "rc4-md5",
+ "aes-128-cfb",
+ "aes-192-cfb",
+ "aes-256-cfb",
+ "aes-128-ctr",
+ "aes-192-ctr",
+ "aes-256-ctr",
+ "chacha20-ietf",
+ "xchacha20",
+}
+
local securitys = {
- "auto",
- "none",
- "aes-128-gcm",
- "chacha20-poly1305"
+ "auto",
+ "none",
+ "aes-128-gcm",
+ "chacha20-poly1305"
+}
+
+local protocols = {
+ "origin",
+ "auth_sha1_v4",
+ "auth_aes128_md5",
+ "auth_aes128_sha1",
+ "auth_chain_a",
+ "auth_chain_b",
+}
+
+local obfs = {
+ "plain",
+ "http_simple",
+ "http_post",
+ "random_head",
+ "tls1.2_ticket_auth",
+ "tls1.2_ticket_fastauth",
}
m = Map(openclash, translate("Edit Server"))
@@ -79,6 +110,7 @@ end
o = s:option(ListValue, "type", translate("Server Node Type"))
o:value("ss", translate("Shadowsocks"))
+o:value("ssr", translate("ShadowsocksR"))
o:value("vmess", translate("Vmess"))
o:value("trojan", translate("trojan"))
o:value("snell", translate("Snell"))
@@ -102,6 +134,7 @@ o = s:option(Value, "password", translate("Password"))
o.password = true
o.rmempty = false
o:depends("type", "ss")
+o:depends("type", "ssr")
o:depends("type", "trojan")
o = s:option(Value, "psk", translate("Psk"))
@@ -113,11 +146,32 @@ for _, v in ipairs(encrypt_methods_ss) do o:value(v) end
o.rmempty = true
o:depends("type", "ss")
+o = s:option(ListValue, "cipher_ssr", translate("Encrypt Method"))
+for _, v in ipairs(encrypt_methods_ssr) do o:value(v) end
+o.rmempty = true
+o:depends("type", "ssr")
+
+o = s:option(ListValue, "protocol", translate("Protocol"))
+for _, v in ipairs(protocols) do o:value(v) end
+o.rmempty = true
+o:depends("type", "ssr")
+
+o = s:option(Value, "protocol_param", translate("Protocol param(optional)"))
+o:depends("type", "ssr")
+
o = s:option(ListValue, "securitys", translate("Encrypt Method"))
for _, v in ipairs(securitys) do o:value(v) end
o.rmempty = true
o:depends("type", "vmess")
+o = s:option(ListValue, "obfs_ssr", translate("Obfs"))
+for _, v in ipairs(obfs) do o:value(v) end
+o.rmempty = true
+o:depends("type", "ssr")
+
+o = s:option(Value, "obfs_param", translate("Obfs param(optional)"))
+o:depends("type", "ssr")
+
-- AlterId
o = s:option(Value, "alterId", translate("AlterId"))
o.datatype = "port"
@@ -137,6 +191,7 @@ o.default = "false"
o:value("true")
o:value("false")
o:depends("type", "ss")
+o:depends("type", "ssr")
o:depends("type", "vmess")
o:depends("type", "socks5")
o:depends("type", "trojan")
diff --git a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_proxys_get.sh b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_proxys_get.sh
index c991c6fdeb..40f32e2488 100755
--- a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_proxys_get.sh
+++ b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_proxys_get.sh
@@ -539,6 +539,21 @@ do
obfs_host="$(cfg_get "obfs-host:" "$single_server")"
fi
+ if [ "$server_type" = "ssr" ]; then
+ #cipher
+ cipher="$(cfg_get "cipher:" "$single_server")"
+ #password
+ password="$(cfg_get "password:" "$single_server")"
+ #obfs:
+ obfs="$(cfg_get "obfs:" "$single_server")"
+ #protocol:
+ protocol="$(cfg_get "protocol:" "$single_server")"
+ #obfs-param:
+ obfs_param="$(cfg_get "obfs-param:" "$single_server")"
+ #protocol-param:
+ protocol_param="$(cfg_get "protocol-param:" "$single_server")"
+ fi
+
if [ "$server_type" = "vmess" ]; then
#uuid:
uuid="$(cfg_get "uuid:" "$single_server")"
@@ -608,6 +623,7 @@ do
if [ "$server_type" = "ss" ]; then
${uci_set}cipher="$cipher"
+ ${uci_set}password="$password"
${uci_set}obfs="$obfs"
${uci_set}host="$obfs_host"
${uci_set}path="$path"
@@ -618,6 +634,16 @@ do
fi
[ -z "$obfs_host" ] && ${uci_set}host="$host"
+ if [ "$server_type" = "ssr" ]; then
+ ${uci_set}cipher_ssr="$cipher"
+ ${uci_set}password="$password"
+ ${uci_set}obfs_ssr="$obfs"
+ ${uci_set}obfs_param="$obfs_param"
+ ${uci_set}protocol="$protocol"
+ ${uci_set}protocol_param="$protocol_param"
+
+ fi
+
if [ "$server_type" = "snell" ]; then
${uci_set}obfs_snell="$mode"
[ -z "$mode" ] && ${uci_set}obfs_snell="none"
@@ -692,6 +718,7 @@ do
if [ "$server_type" = "ss" ]; then
${uci_set}cipher="$cipher"
+ ${uci_set}password="$password"
${uci_set}obfs="$obfs"
${uci_set}host="$obfs_host"
${uci_set}path="$path"
@@ -702,6 +729,16 @@ do
fi
[ -z "$obfs_host" ] && ${uci_set}host="$host"
+ if [ "$server_type" = "ssr" ]; then
+ ${uci_set}cipher_ssr="$cipher"
+ ${uci_set}password="$password"
+ ${uci_set}obfs_ssr="$obfs"
+ ${uci_set}obfs_param="$obfs_param"
+ ${uci_set}protocol="$protocol"
+ ${uci_set}protocol_param="$protocol_param"
+
+ fi
+
if [ "$server_type" = "snell" ]; then
${uci_set}obfs_snell="$mode"
[ -z "$mode" ] && ${uci_set}obfs_snell="none"
diff --git a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_proxys_set.sh b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_proxys_set.sh
index dde49017cb..b7ae5bae30 100755
--- a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_proxys_set.sh
+++ b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_proxys_set.sh
@@ -133,11 +133,16 @@ yml_servers_set()
config_get "server" "$section" "server" ""
config_get "port" "$section" "port" ""
config_get "cipher" "$section" "cipher" ""
+ config_get "cipher_ssr" "$section" "cipher_ssr" ""
config_get "password" "$section" "password" ""
config_get "securitys" "$section" "securitys" ""
config_get "udp" "$section" "udp" ""
config_get "obfs" "$section" "obfs" ""
+ config_get "obfs_ssr" "$section" "obfs_ssr" ""
+ config_get "obfs_param" "$section" "obfs_param" ""
config_get "obfs_vmess" "$section" "obfs_vmess" ""
+ config_get "protocol" "$section" "protocol" ""
+ config_get "protocol_param" "$section" "protocol_param" ""
config_get "host" "$section" "host" ""
config_get "mux" "$section" "mux" ""
config_get "custom" "$section" "custom" ""
@@ -185,7 +190,7 @@ yml_servers_set()
fi
if [ -z "$password" ]; then
- if [ "$type" = "ss" ] || [ "$type" = "trojan" ]; then
+ if [ "$type" = "ss" ] || [ "$type" = "trojan" ] || [ "$type" = "ssr" ]; then
return
fi
fi
@@ -278,6 +283,35 @@ EOF
fi
fi
fi
+
+#ssr
+if [ "$type" = "ssr" ]; then
+cat >> "$SERVER_FILE" <<-EOF
+- name: "$name"
+ type: $type
+ server: $server
+ port: $port
+ cipher: $cipher_ssr
+ password: "$password"
+ obfs: "$obfs_ssr"
+ protocol: "$protocol"
+EOF
+ if [ ! -z "$obfs_param" ]; then
+cat >> "$SERVER_FILE" <<-EOF
+ obfs-param: $obfs_param
+EOF
+ fi
+ if [ ! -z "$protocol_param" ]; then
+cat >> "$SERVER_FILE" <<-EOF
+ protocol-param: $protocol_param
+EOF
+ fi
+ if [ ! -z "$udp" ]; then
+cat >> "$SERVER_FILE" <<-EOF
+ udp: $udp
+EOF
+ fi
+fi
#vmess
if [ "$type" = "vmess" ]; then
diff --git a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_rules_change.sh b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_rules_change.sh
index 09e177d021..944fef817d 100755
--- a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_rules_change.sh
+++ b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/yml_rules_change.sh
@@ -24,9 +24,6 @@ yml_other_set()
if [ -z "$(grep '^- IP-CIDR,198.18.0.1/16,REJECT,no-resolve' "$4")" ]; then
sed -i '1,/^ \{0,\}- MATCH/{/^ \{0,\}- MATCH/s/^ \{0,\}- MATCH/- IP-CIDR,198.18.0.1\/16,REJECT,no-resolve\n&/}' "$4" 2>/dev/null
fi
- if [ -z "$(grep '^- IP-CIDR,198.18.0.1/16,REJECT,no-resolve' "$4")" ]; then
- sed -i '1,/^ \{0,\}- FINAL/{/^ \{0,\}- FINAL/s/^ \{0,\}- FINAL/- IP-CIDR,198.18.0.1\/16,REJECT,no-resolve\n&/}' "$4" 2>/dev/null
- fi
fi
fi
diff --git a/package/ctcgfw/luci-app-openclash/i18n/zh-cn/openclash.zh-cn.po b/package/ctcgfw/luci-app-openclash/i18n/zh-cn/openclash.zh-cn.po
index ddd5cad403..c72332c9ae 100644
--- a/package/ctcgfw/luci-app-openclash/i18n/zh-cn/openclash.zh-cn.po
+++ b/package/ctcgfw/luci-app-openclash/i18n/zh-cn/openclash.zh-cn.po
@@ -6,7 +6,7 @@ msgid "OpenClash"
msgstr "OpenClash"
msgid "A Clash Client For OpenWrt"
-msgstr "一个运行在OpenWrt上的Clash客户端,兼容Shadowsocks、Vmess、Trojan、Snell等协议,根据灵活的规则配置实现策略代理"
+msgstr "一个运行在OpenWrt上的Clash客户端,兼容Shadowsocks、ShadowsocksR、Vmess、Trojan、Snell等协议,根据灵活的规则配置实现策略代理"
msgid "Global Settings(Will Modify The Config File Or Subscribe According To The Settings On This Page)"
msgstr "全局设置(将按照本页设置自动修改配置文件和获取订阅)"
@@ -633,6 +633,18 @@ msgstr "密码"
msgid "Encrypt Method"
msgstr "加密方式"
+msgid "Protocol"
+msgstr "协议"
+
+msgid "Protocol param(optional)"
+msgstr "传输协议参数(可选)"
+
+msgid "Obfs"
+msgstr "混淆插件"
+
+msgid "Obfs param(optional)"
+msgstr "混淆参数(可选)"
+
msgid "UDP Enable"
msgstr "UDP支持"
diff --git a/package/lean/luci-app-ssr-plus/Makefile b/package/lean/luci-app-ssr-plus/Makefile
index 3e3df05a63..32db9ce6e4 100644
--- a/package/lean/luci-app-ssr-plus/Makefile
+++ b/package/lean/luci-app-ssr-plus/Makefile
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-ssr-plus
PKG_VERSION:=180
-PKG_RELEASE:=1
+PKG_RELEASE:=2
include $(INCLUDE_DIR)/package.mk
diff --git a/package/lean/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/control.lua b/package/lean/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/control.lua
index ef4a6ba102..166eae0f1a 100644
--- a/package/lean/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/control.lua
+++ b/package/lean/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/control.lua
@@ -2,7 +2,7 @@ require "luci.ip"
require "nixio.fs"
local m, s, o
-m = Map("shadowsocksr", translate("IP black-and-white list"))
+m = Map("shadowsocksr", translate("Block and Allow List"))
s = m:section(TypedSection, "access_control")
s.anonymous = true
diff --git a/package/lean/luci-app-ssr-plus/po/zh-cn/ssr-plus.po b/package/lean/luci-app-ssr-plus/po/zh-cn/ssr-plus.po
index 7676547003..f0602513b9 100644
--- a/package/lean/luci-app-ssr-plus/po/zh-cn/ssr-plus.po
+++ b/package/lean/luci-app-ssr-plus/po/zh-cn/ssr-plus.po
@@ -454,8 +454,8 @@ msgstr "更新"
msgid "Server Count"
msgstr "服务器节点数量"
-msgid "IP black-and-white list"
-msgstr "黑白名单"
+msgid "Block and Allow List"
+msgstr "禁止/通行名单"
msgid "WAN IP AC"
msgstr "WAN IP访问控制"
diff --git a/package/lienol/luci-app-passwall/Makefile b/package/lienol/luci-app-passwall/Makefile
index 8adffdeb60..ec21bb418f 100644
--- a/package/lienol/luci-app-passwall/Makefile
+++ b/package/lienol/luci-app-passwall/Makefile
@@ -7,8 +7,8 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-passwall
PKG_VERSION:=3.9
-PKG_RELEASE:=20
-PKG_DATE:=20200719
+PKG_RELEASE:=22
+PKG_DATE:=20200724
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
@@ -118,10 +118,10 @@ endef
define Package/$(PKG_NAME)/conffiles
/etc/config/passwall
/etc/config/passwall_server
-/usr/share/passwall/rules/blacklist_host
-/usr/share/passwall/rules/blacklist_ip
-/usr/share/passwall/rules/whitelist_host
-/usr/share/passwall/rules/whitelist_ip
+/usr/share/passwall/rules/proxy_host
+/usr/share/passwall/rules/proxy_ip
+/usr/share/passwall/rules/direct_host
+/usr/share/passwall/rules/direct_ip
endef
define Package/$(PKG_NAME)/install
diff --git a/package/lienol/luci-app-passwall/luasrc/controller/passwall.lua b/package/lienol/luci-app-passwall/luasrc/controller/passwall.lua
index bb91db2301..9d180b2f12 100644
--- a/package/lienol/luci-app-passwall/luasrc/controller/passwall.lua
+++ b/package/lienol/luci-app-passwall/luasrc/controller/passwall.lua
@@ -10,59 +10,57 @@ local trojan_go = require "luci.model.cbi.passwall.api.trojan_go"
function index()
if not nixio.fs.access("/etc/config/passwall") then return end
- entry({"admin", "vpn"}, firstchild(), "VPN", 45).dependent = false
- entry({"admin", "vpn", "passwall", "reset_config"}, call("reset_config")).leaf = true
- entry({"admin", "vpn", "passwall", "show"}, call("show_menu")).leaf = true
- entry({"admin", "vpn", "passwall", "hide"}, call("hide_menu")).leaf = true
- if nixio.fs.access("/etc/config/passwall") and
- nixio.fs.access("/etc/config/passwall_show") then
- entry({"admin", "vpn", "passwall"}, alias("admin", "vpn", "passwall", "settings"), _("Pass Wall"), 1).dependent = true
+ entry({"admin", "services", "passwall", "reset_config"}, call("reset_config")).leaf = true
+ entry({"admin", "services", "passwall", "show"}, call("show_menu")).leaf = true
+ entry({"admin", "services", "passwall", "hide"}, call("hide_menu")).leaf = true
+ if nixio.fs.access("/etc/config/passwall_show") then
+ entry({"admin", "services", "passwall"}, alias("admin", "services", "passwall", "settings"), _("Pass Wall"), 1).dependent = true
end
- entry({"admin", "vpn", "passwall", "settings"}, cbi("passwall/global"), _("Basic Settings"), 1).dependent = true
- entry({"admin", "vpn", "passwall", "node_list"}, cbi("passwall/node_list"), _("Node List"), 2).dependent = true
- entry({"admin", "vpn", "passwall", "auto_switch"}, cbi("passwall/auto_switch"), _("Auto Switch"), 3).leaf = true
- entry({"admin", "vpn", "passwall", "other"}, cbi("passwall/other", {autoapply = true}), _("Other Settings"), 93).leaf = true
+ entry({"admin", "services", "passwall", "settings"}, cbi("passwall/global"), _("Basic Settings"), 1).dependent = true
+ entry({"admin", "services", "passwall", "node_list"}, cbi("passwall/node_list"), _("Node List"), 2).dependent = true
+ entry({"admin", "services", "passwall", "auto_switch"}, cbi("passwall/auto_switch"), _("Auto Switch"), 3).leaf = true
+ entry({"admin", "services", "passwall", "other"}, cbi("passwall/other", {autoapply = true}), _("Other Settings"), 93).leaf = true
if nixio.fs.access("/usr/sbin/haproxy") then
- entry({"admin", "vpn", "passwall", "haproxy"}, cbi("passwall/haproxy"), _("Load Balancing"), 94).leaf = true
+ entry({"admin", "services", "passwall", "haproxy"}, cbi("passwall/haproxy"), _("Load Balancing"), 94).leaf = true
end
- entry({"admin", "vpn", "passwall", "node_subscribe"}, cbi("passwall/node_subscribe"), _("Node Subscribe"), 95).dependent = true
- entry({"admin", "vpn", "passwall", "rule"}, cbi("passwall/rule"), _("Rule Update"), 96).leaf = true
- entry({"admin", "vpn", "passwall", "node_config"}, cbi("passwall/node_config")).leaf = true
- entry({"admin", "vpn", "passwall", "shunt_rules"}, cbi("passwall/shunt_rules")).leaf = true
- entry({"admin", "vpn", "passwall", "acl"}, cbi("passwall/acl"), _("Access control"), 97).leaf = true
- entry({"admin", "vpn", "passwall", "log"}, form("passwall/log"), _("Watch Logs"), 999).leaf = true
- entry({"admin", "vpn", "passwall", "server"}, cbi("passwall/server/index"), _("Server-Side"), 99).leaf = true
- entry({"admin", "vpn", "passwall", "server_user"}, cbi("passwall/server/user")).leaf = true
+ entry({"admin", "services", "passwall", "node_subscribe"}, cbi("passwall/node_subscribe"), _("Node Subscribe"), 95).dependent = true
+ entry({"admin", "services", "passwall", "rule"}, cbi("passwall/rule"), _("Rule Update"), 96).leaf = true
+ entry({"admin", "services", "passwall", "node_config"}, cbi("passwall/node_config")).leaf = true
+ entry({"admin", "services", "passwall", "shunt_rules"}, cbi("passwall/shunt_rules")).leaf = true
+ entry({"admin", "services", "passwall", "acl"}, cbi("passwall/acl"), _("Access control"), 97).leaf = true
+ entry({"admin", "services", "passwall", "log"}, form("passwall/log"), _("Watch Logs"), 999).leaf = true
+ entry({"admin", "services", "passwall", "server"}, cbi("passwall/server/index"), _("Server-Side"), 99).leaf = true
+ entry({"admin", "services", "passwall", "server_user"}, cbi("passwall/server/user")).leaf = true
- entry({"admin", "vpn", "passwall", "server_user_status"}, call("server_user_status")).leaf = true
- entry({"admin", "vpn", "passwall", "server_get_log"}, call("server_get_log")).leaf = true
- entry({"admin", "vpn", "passwall", "server_clear_log"}, call("server_clear_log")).leaf = true
- entry({"admin", "vpn", "passwall", "link_append_temp"}, call("link_append_temp")).leaf = true
- entry({"admin", "vpn", "passwall", "link_load_temp"}, call("link_load_temp")).leaf = true
- entry({"admin", "vpn", "passwall", "link_clear_temp"}, call("link_clear_temp")).leaf = true
- entry({"admin", "vpn", "passwall", "link_add_node"}, call("link_add_node")).leaf = true
- entry({"admin", "vpn", "passwall", "get_log"}, call("get_log")).leaf = true
- entry({"admin", "vpn", "passwall", "clear_log"}, call("clear_log")).leaf = true
- entry({"admin", "vpn", "passwall", "status"}, call("status")).leaf = true
- entry({"admin", "vpn", "passwall", "socks_status"}, call("socks_status")).leaf = true
- entry({"admin", "vpn", "passwall", "connect_status"}, call("connect_status")).leaf = true
- entry({"admin", "vpn", "passwall", "check_port"}, call("check_port")).leaf = true
- entry({"admin", "vpn", "passwall", "ping_node"}, call("ping_node")).leaf = true
- entry({"admin", "vpn", "passwall", "set_node"}, call("set_node")).leaf = true
- entry({"admin", "vpn", "passwall", "copy_node"}, call("copy_node")).leaf = true
- entry({"admin", "vpn", "passwall", "clear_all_nodes"}, call("clear_all_nodes")).leaf = true
- entry({"admin", "vpn", "passwall", "delete_select_nodes"}, call("delete_select_nodes")).leaf = true
- entry({"admin", "vpn", "passwall", "update_rules"}, call("update_rules")).leaf = true
- entry({"admin", "vpn", "passwall", "luci_check"}, call("luci_check")).leaf = true
- entry({"admin", "vpn", "passwall", "luci_update"}, call("luci_update")).leaf = true
- entry({"admin", "vpn", "passwall", "kcptun_check"}, call("kcptun_check")).leaf = true
- entry({"admin", "vpn", "passwall", "kcptun_update"}, call("kcptun_update")).leaf = true
- entry({"admin", "vpn", "passwall", "brook_check"}, call("brook_check")).leaf = true
- entry({"admin", "vpn", "passwall", "brook_update"}, call("brook_update")).leaf = true
- entry({"admin", "vpn", "passwall", "v2ray_check"}, call("v2ray_check")).leaf = true
- entry({"admin", "vpn", "passwall", "v2ray_update"}, call("v2ray_update")).leaf = true
- entry({"admin", "vpn", "passwall", "trojan_go_check"}, call("trojan_go_check")).leaf = true
- entry({"admin", "vpn", "passwall", "trojan_go_update"}, call("trojan_go_update")).leaf = true
+ entry({"admin", "services", "passwall", "server_user_status"}, call("server_user_status")).leaf = true
+ entry({"admin", "services", "passwall", "server_get_log"}, call("server_get_log")).leaf = true
+ entry({"admin", "services", "passwall", "server_clear_log"}, call("server_clear_log")).leaf = true
+ entry({"admin", "services", "passwall", "link_append_temp"}, call("link_append_temp")).leaf = true
+ entry({"admin", "services", "passwall", "link_load_temp"}, call("link_load_temp")).leaf = true
+ entry({"admin", "services", "passwall", "link_clear_temp"}, call("link_clear_temp")).leaf = true
+ entry({"admin", "services", "passwall", "link_add_node"}, call("link_add_node")).leaf = true
+ entry({"admin", "services", "passwall", "get_log"}, call("get_log")).leaf = true
+ entry({"admin", "services", "passwall", "clear_log"}, call("clear_log")).leaf = true
+ entry({"admin", "services", "passwall", "status"}, call("status")).leaf = true
+ entry({"admin", "services", "passwall", "socks_status"}, call("socks_status")).leaf = true
+ entry({"admin", "services", "passwall", "connect_status"}, call("connect_status")).leaf = true
+ entry({"admin", "services", "passwall", "check_port"}, call("check_port")).leaf = true
+ entry({"admin", "services", "passwall", "ping_node"}, call("ping_node")).leaf = true
+ entry({"admin", "services", "passwall", "set_node"}, call("set_node")).leaf = true
+ entry({"admin", "services", "passwall", "copy_node"}, call("copy_node")).leaf = true
+ entry({"admin", "services", "passwall", "clear_all_nodes"}, call("clear_all_nodes")).leaf = true
+ entry({"admin", "services", "passwall", "delete_select_nodes"}, call("delete_select_nodes")).leaf = true
+ entry({"admin", "services", "passwall", "update_rules"}, call("update_rules")).leaf = true
+ entry({"admin", "services", "passwall", "luci_check"}, call("luci_check")).leaf = true
+ entry({"admin", "services", "passwall", "luci_update"}, call("luci_update")).leaf = true
+ entry({"admin", "services", "passwall", "kcptun_check"}, call("kcptun_check")).leaf = true
+ entry({"admin", "services", "passwall", "kcptun_update"}, call("kcptun_update")).leaf = true
+ entry({"admin", "services", "passwall", "brook_check"}, call("brook_check")).leaf = true
+ entry({"admin", "services", "passwall", "brook_update"}, call("brook_update")).leaf = true
+ entry({"admin", "services", "passwall", "v2ray_check"}, call("v2ray_check")).leaf = true
+ entry({"admin", "services", "passwall", "v2ray_update"}, call("v2ray_update")).leaf = true
+ entry({"admin", "services", "passwall", "trojan_go_check"}, call("trojan_go_check")).leaf = true
+ entry({"admin", "services", "passwall", "trojan_go_update"}, call("trojan_go_update")).leaf = true
end
local function http_write_json(content)
@@ -72,12 +70,12 @@ end
function reset_config()
luci.sys.call('[ -f "/usr/share/passwall/config.default" ] && cp -f /usr/share/passwall/config.default /etc/config/passwall && /etc/init.d/passwall reload')
- luci.http.redirect(luci.dispatcher.build_url("admin", "vpn", "passwall"))
+ luci.http.redirect(luci.dispatcher.build_url("admin", "services", "passwall"))
end
function show_menu()
luci.sys.call("touch /etc/config/passwall_show")
- luci.http.redirect(luci.dispatcher.build_url("admin", "vpn", "passwall"))
+ luci.http.redirect(luci.dispatcher.build_url("admin", "services", "passwall"))
end
function hide_menu()
@@ -200,7 +198,7 @@ function set_node()
ucic:set(appname, "@global[0]", protocol .. "_node" .. number, section)
ucic:commit(appname)
luci.sys.call("/etc/init.d/passwall restart > /dev/null 2>&1 &")
- luci.http.redirect(luci.dispatcher.build_url("admin", "vpn", "passwall", "log"))
+ luci.http.redirect(luci.dispatcher.build_url("admin", "services", "passwall", "log"))
end
function copy_node()
diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/acl.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/acl.lua
index a25334607f..74997fc152 100644
--- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/acl.lua
+++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/acl.lua
@@ -8,70 +8,55 @@ m = Map(appname)
s = m:section(TypedSection, "global_rules")
s.anonymous = true
----- Whitelist Hosts
-s:tab("w_hosts", translate("Whitelist Hosts"), "" ..
- translate("Join the white list of domain names will not go agent.") ..
- "")
-local w_host_file = string.format("/usr/share/%s/rules/whitelist_host", appname)
-o = s:taboption("w_hosts", TextValue, "whitelist_host")
-o.rows = 8
-o.wrap = "off"
-o.cfgvalue = function(self, section) return fs.readfile(w_host_file) or "" end
-o.write = function(self, section, value)
- fs.writefile(w_host_file, value:gsub("\r\n", "\n"):gsub("https://", ""):gsub(
- "http://", ""))
-end
-o.remove = function(self, section, value) fs.writefile(w_host_file, "") end
+s:tab("direct_list", translate("Direct List"))
+s:tab("proxy_list", translate("Proxy List"))
----- Whitelist IP
-s:tab("w_ip", translate("Whitelist IP"), "" .. translate(
- "These had been joined ip addresses will not use proxy.Please input the ip address or ip address segment,every line can input only one ip address.For example,192.168.0.0/24 or 223.5.5.5.") ..
- "")
-local w_ip_file = string.format("/usr/share/%s/rules/whitelist_ip", appname)
-o = s:taboption("w_ip", TextValue, "whitelist_ip")
+---- Direct Hosts
+local direct_host = string.format("/usr/share/%s/rules/direct_host", appname)
+o = s:taboption("direct_list", TextValue, "direct_hosts", "", "" .. translate("Join the direct hosts list of domain names will not proxy.") .. "")
o.rows = 8
o.wrap = "off"
-o.cfgvalue = function(self, section) return fs.readfile(w_ip_file) or "" end
+o.cfgvalue = function(self, section) return fs.readfile(direct_host) or "" end
o.write = function(self, section, value)
- fs.writefile(w_ip_file, value:gsub("\r\n", "\n"):gsub("https://", ""):gsub(
- "http://", ""))
+ fs.writefile(direct_host, value:gsub("\r\n", "\n"):gsub("https://", ""):gsub("http://", ""))
end
-o.remove = function(self, section, value) fs.writefile(w_ip_file, "") end
+o.remove = function(self, section, value) fs.writefile(direct_host, "") end
----- Blacklist Hosts
-s:tab("b_hosts", translate("Blacklist Hosts"),
- "" .. translate(
- "These had been joined websites will use proxy.Please input the domain names of websites,every line can input only one website domain.For example,google.com.") ..
- "")
-local b_host_file = string.format("/usr/share/%s/rules/blacklist_host", appname)
-o = s:taboption("b_hosts", TextValue, "blacklist_host")
+---- Direct IP
+local direct_ip = string.format("/usr/share/%s/rules/direct_ip", appname)
+o = s:taboption("direct_list", TextValue, "direct_ip", "", "" .. translate("These had been joined ip addresses will not proxy. Please input the ip address or ip address segment,every line can input only one ip address. For example: 192.168.0.0/24 or 223.5.5.5.") .. "")
o.rows = 8
o.wrap = "off"
-o.cfgvalue = function(self, section) return fs.readfile(b_host_file) or "" end
+o.cfgvalue = function(self, section) return fs.readfile(direct_ip) or "" end
o.write = function(self, section, value)
- fs.writefile(b_host_file, value:gsub("\r\n", "\n"):gsub("https://", ""):gsub(
- "http://", ""))
+ fs.writefile(direct_ip, value:gsub("\r\n", "\n"):gsub("https://", ""):gsub("http://", ""))
end
-o.remove = function(self, section, value) fs.writefile(b_host_file, "") end
+o.remove = function(self, section, value) fs.writefile(direct_ip, "") end
----- Blacklist IP
-s:tab("b_ip", translate("Blacklist IP"), "" .. translate(
- "These had been joined ip addresses will use proxy.Please input the ip address or ip address segment,every line can input only one ip address.For example,35.24.0.0/24 or 8.8.4.4.") ..
- "")
-local b_ip_file = string.format("/usr/share/%s/rules/blacklist_ip", appname)
-o = s:taboption("b_ip", TextValue, "blacklist_ip")
+---- Proxy Hosts
+local proxy_host = string.format("/usr/share/%s/rules/proxy_host", appname)
+o = s:taboption("proxy_list", TextValue, "proxy_host", "", "" .. translate("These had been joined websites will use proxy. Please input the domain names of websites,every line can input only one website domain. For example: google.com.") .. "")
o.rows = 8
o.wrap = "off"
-o.cfgvalue = function(self, section) return fs.readfile(b_ip_file) or "" end
+o.cfgvalue = function(self, section) return fs.readfile(proxy_host) or "" end
o.write = function(self, section, value)
- fs.writefile(b_ip_file, value:gsub("\r\n", "\n"):gsub("https://", ""):gsub(
- "http://", ""))
+ fs.writefile(proxy_host, value:gsub("\r\n", "\n"):gsub("https://", ""):gsub("http://", ""))
end
-o.remove = function(self, section, value) fs.writefile(b_ip_file, "") end
+o.remove = function(self, section, value) fs.writefile(proxy_host, "") end
+
+---- Proxy IP
+local proxy_ip = string.format("/usr/share/%s/rules/proxy_ip", appname)
+o = s:taboption("proxy_list", TextValue, "blacklist_ip", "", "" .. translate("These had been joined ip addresses will use proxy.Please input the ip address or ip address segment,every line can input only one ip address.For example: 35.24.0.0/24 or 8.8.4.4.") .. "")
+o.rows = 8
+o.wrap = "off"
+o.cfgvalue = function(self, section) return fs.readfile(proxy_ip) or "" end
+o.write = function(self, section, value)
+ fs.writefile(proxy_ip, value:gsub("\r\n", "\n"):gsub("https://", ""):gsub("http://", ""))
+end
+o.remove = function(self, section, value) fs.writefile(proxy_ip, "") end
-- [[ ACLs Settings ]]--
-s = m:section(TypedSection, "acl_rule", translate("ACLs"), "" .. translate(
- "ACLs is a tools which used to designate specific IP proxy mode, IP or MAC address can be entered.") .. "")
+s = m:section(TypedSection, "acl_rule", translate("ACLs"), "" .. translate("ACLs is a tools which used to designate specific IP proxy mode, IP or MAC address can be entered.") .. "")
s.template = "cbi/tblsection"
s.sortable = true
s.anonymous = true
diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_trojan.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_trojan.lua
index 1a6fed51c2..e5c0f8cf36 100644
--- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_trojan.lua
+++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_trojan.lua
@@ -52,7 +52,7 @@ if node.type == "Trojan-Go" then
enabled = node.plugin_type ~= nil,
type = node.plugin_type or "plaintext",
command = node.plugin_type ~= "plaintext" and node.plugin_cmd or nil,
- plugin_option = node.plugin_type ~= "plaintext" and node.plugin_option or nil,
+ option = node.plugin_type ~= "plaintext" and node.plugin_option or nil,
arg = node.plugin_type ~= "plaintext" and { node.plugin_arg } or nil,
env = {}
} or nil
diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_v2ray.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_v2ray.lua
index d17549f924..61f5247a99 100644
--- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_v2ray.lua
+++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_v2ray.lua
@@ -27,7 +27,7 @@ local function gen_outbound(node, tag)
local node_type = (proto and proto ~= "nil") and proto or "socks"
local new_port = sys.exec(string.format("echo -n $(/usr/share/%s/app.sh get_new_port auto tcp)", appname))
node.port = new_port
- sys.call(string.format("/usr/share/%s/app.sh run_socks %s %s %s %s %s",
+ sys.call(string.format("/usr/share/%s/app.sh run_socks %s %s %s %s %s > /dev/null",
appname,
node_id,
"127.0.0.1",
diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/global.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/global.lua
index 7bc3647e1a..b9e615e72b 100644
--- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/global.lua
+++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/global.lua
@@ -2,6 +2,7 @@ local o = require "luci.dispatcher"
local sys = require "luci.sys"
local ipkg = require("luci.model.ipkg")
local uci = require"luci.model.uci".cursor()
+local _api = require "luci.model.cbi.passwall.api.api"
local appname = "passwall"
local function is_installed(e) return ipkg.installed(e) end
@@ -32,6 +33,32 @@ uci:foreach(appname, "nodes", function(e)
end
end)
+local socks_table = {}
+socks_table[#socks_table + 1] = {
+ id = "",
+ remarks = "127.0.0.1:9050 - dns2sock" .. translate(" Default")
+}
+uci:foreach(appname, "socks", function(s)
+ if s.enabled == "1" and s.node then
+ local id, remarks
+ local same, i = s.node:match("^(tcp)([1-9])$")
+ if same then
+ remarks = translatef("Same as the tcp %s node", i)
+ else
+ for k, n in pairs(nodes_table) do
+ if (s.node == n.id) then
+ remarks = n.remarks; break
+ end
+ end
+ end
+ id = "0.0.0.0" .. ":" .. s.port
+ socks_table[#socks_table + 1] = {
+ id = id,
+ remarks = id .. " - " .. (remarks or translate("Misconfigured"))
+ }
+ end
+end)
+
m = Map(appname)
local status_use_big_icon = m:get("@global_other[0]", "status_use_big_icon") or 1
if status_use_big_icon and tonumber(status_use_big_icon) == 1 then
@@ -41,23 +68,25 @@ else
end
-- [[ Global Settings ]]--
-s = m:section(TypedSection, "global", translate("Global Settings"))
+s = m:section(TypedSection, "global", translate("Main Settings"))
-- s.description = translate("If you can use it, very stable. If not, GG !!!")
s.anonymous = true
s.addremove = false
+s:tab("Main", translate("Main Settings"))
+
---- Main switch
-o = s:option(Flag, "enabled", translate("Main switch"))
+o = s:taboption("Main", Flag, "enabled", translate("Main switch"))
o.rmempty = false
---- TCP Node
local tcp_node_num = tonumber(m:get("@global_other[0]", "tcp_node_num") or 1)
for i = 1, tcp_node_num, 1 do
if i == 1 then
- o = s:option(ListValue, "tcp_node" .. i, translate("TCP Node"))
+ o = s:taboption("Main", ListValue, "tcp_node" .. i, translate("TCP Node"))
-- o.description = translate("For used to surf the Internet.")
else
- o = s:option(ListValue, "tcp_node" .. i,
+ o = s:taboption("Main", ListValue, "tcp_node" .. i,
translate("TCP Node") .. " " .. i)
end
o:value("nil", translate("Close"))
@@ -68,20 +97,22 @@ end
local udp_node_num = tonumber(m:get("@global_other[0]", "udp_node_num") or 1)
for i = 1, udp_node_num, 1 do
if i == 1 then
- o = s:option(ListValue, "udp_node" .. i, translate("UDP Node"))
+ o = s:taboption("Main", ListValue, "udp_node" .. i, translate("UDP Node"))
-- o.description = translate("For Game Mode or DNS resolution and more.") .. translate("The selected server will not use Kcptun.")
o:value("nil", translate("Close"))
o:value("tcp", translate("Same as the tcp node"))
o:value("tcp_", translate("Same as the tcp node") .. "(" .. translate("New process") .. ")")
else
- o = s:option(ListValue, "udp_node" .. i,
+ o = s:taboption("Main", ListValue, "udp_node" .. i,
translate("UDP Node") .. " " .. i)
o:value("nil", translate("Close"))
end
for k, v in pairs(nodes_table) do o:value(v.id, v.remarks) end
end
-o = s:option(Value, "up_china_dns", translate("China DNS Server") .. "(UDP)")
+s:tab("DNS", translate("DNS Settings"))
+
+o = s:taboption("DNS", Value, "up_china_dns", translate("China DNS Server") .. "(UDP)")
-- o.description = translate("If you want to work with other DNS acceleration services, use the default.
Only use two at most, english comma separation, If you do not fill in the # and the following port, you are using port 53.")
o.default = "default"
o:value("default", translate("Default"))
@@ -97,7 +128,7 @@ o:value("210.2.4.8", "210.2.4.8 (CNNIC DNS)")
o:value("180.76.76.76", "180.76.76.76 (" .. translate("Baidu") .. "DNS)")
---- DNS Forward Mode
-o = s:option(ListValue, "dns_mode", translate("DNS Mode"))
+o = s:taboption("DNS", ListValue, "dns_mode", translate("DNS Mode"))
-- o.description = translate("if has problem, please try another mode.
if you use no patterns are used, DNS of wan will be used by default as upstream of dnsmasq.")
o.rmempty = false
o:reset_values()
@@ -114,7 +145,7 @@ o:value("local_7913", translate("Use local port 7913 as DNS"))
o:value("nonuse", translate("No patterns are used"))
---- Upstream trust DNS Server for ChinaDNS-NG
-o = s:option(ListValue, "up_trust_chinadns_ng_dns",
+o = s:taboption("DNS", ListValue, "up_trust_chinadns_ng_dns",
translate("Upstream trust DNS Server for ChinaDNS-NG") .. "(UDP)")
-- o.description = translate("You can use other resolving DNS services as trusted DNS, Example: dns2socks, dns-forwarder... 127.0.0.1#5353
Only use two at most, english comma separation, If you do not fill in the # and the following port, you are using port 53.")
o.default = "pdnsd"
@@ -129,24 +160,25 @@ o:depends("dns_mode", "chinadns-ng")
---- Use TCP Node Resolve DNS
--[[ if is_installed("pdnsd") or is_installed("pdnsd-alt") or is_finded("pdnsd") then
- o = s:option(Flag, "use_tcp_node_resolve_dns", translate("Use TCP Node Resolve DNS"))
+ o = s:taboption("DNS", Flag, "use_tcp_node_resolve_dns", translate("Use TCP Node Resolve DNS"))
o.description = translate("If checked, DNS is resolved using the TCP node.")
o.default = 1
o:depends("dns_mode", "pdnsd")
end
--]]
-o = s:option(Value, "socks_server", translate("Socks Server"))
-o.default = "127.0.0.1:1080"
+o = s:taboption("DNS", Value, "socks_server", translate("Socks Server"))
+o.default = ""
o:depends({dns_mode = "dns2socks"})
o:depends({dns_mode = "chinadns-ng", up_trust_chinadns_ng_dns = "dns2socks"})
+for k, v in pairs(socks_table) do o:value(v.id, v.remarks) end
-o = s:option(Flag, "fair_mode", translate("Fair Mode"))
+o = s:taboption("DNS", Flag, "fair_mode", translate("Fair Mode"))
o.default = "1"
o:depends({dns_mode = "chinadns-ng"})
---- DNS Forward
-o = s:option(Value, "dns_forward", translate("DNS Address"))
+o = s:taboption("DNS", Value, "dns_forward", translate("DNS Address"))
o.default = "8.8.4.4"
o:value("8.8.4.4", "8.8.4.4 (Google DNS)")
o:value("8.8.8.8", "8.8.8.8 (Google DNS)")
@@ -156,15 +188,17 @@ o:depends({dns_mode = "chinadns-ng"})
o:depends({dns_mode = "dns2socks"})
o:depends({dns_mode = "pdnsd"})
-o = s:option(Flag, "dns_cache", translate("DNS Cache"))
+o = s:taboption("DNS", Flag, "dns_cache", translate("DNS Cache"))
o.default = "1"
o:depends({dns_mode = "chinadns-ng", up_trust_chinadns_ng_dns = "pdnsd"})
o:depends({dns_mode = "chinadns-ng", up_trust_chinadns_ng_dns = "dns2socks"})
o:depends({dns_mode = "dns2socks"})
o:depends({dns_mode = "pdnsd"})
+s:tab("Mode", translate("Proxy Mode"))
+
---- TCP Default Proxy Mode
-o = s:option(ListValue, "tcp_proxy_mode",
+o = s:taboption("Mode", ListValue, "tcp_proxy_mode",
"TCP" .. translate("Default") .. translate("Proxy Mode"))
-- o.description = translate("If not available, try clearing the cache.")
o.default = "chnroute"
@@ -176,7 +210,7 @@ o:value("chnroute", translate("China WhiteList"))
o:value("returnhome", translate("Return Home"))
---- UDP Default Proxy Mode
-o = s:option(ListValue, "udp_proxy_mode",
+o = s:taboption("Mode", ListValue, "udp_proxy_mode",
"UDP" .. translate("Default") .. translate("Proxy Mode"))
o.default = "chnroute"
o.rmempty = false
@@ -187,7 +221,7 @@ o:value("chnroute", translate("Game Mode") .. "(" .. translate("China WhiteLis
o:value("returnhome", translate("Return Home"))
---- Localhost TCP Proxy Mode
-o = s:option(ListValue, "localhost_tcp_proxy_mode",
+o = s:taboption("Mode", ListValue, "localhost_tcp_proxy_mode",
translate("Router Localhost") .. "TCP" .. translate("Proxy Mode"))
-- o.description = translate("The server client can also use this rule to scientifically surf the Internet.")
o:value("default", translate("Default"))
@@ -198,7 +232,7 @@ o.default = "default"
o.rmempty = false
---- Localhost UDP Proxy Mode
-o = s:option(ListValue, "localhost_udp_proxy_mode",
+o = s:taboption("Mode", ListValue, "localhost_udp_proxy_mode",
translate("Router Localhost") .. "UDP" .. translate("Proxy Mode"))
o:value("disable", translate("No Proxy"))
o:value("default", translate("Default"))
@@ -208,8 +242,38 @@ o:value("global", translate("Global Proxy"))
o.default = "default"
o.rmempty = false
+-- [[ Socks Server ]]--
+s = m:section(TypedSection, "socks", translate("Socks Config"))
+s.anonymous = true
+s.addremove = true
+s.template = "cbi/tblsection"
+function s.create(e, t)
+ TypedSection.create(e, _api.gen_uuid())
+end
+
+o = s:option(DummyValue, "status", translate("Status"))
+o.template = appname .. "/global/socks_status"
+
+---- Enable
+o = s:option(Flag, "enabled", translate("Enable"))
+o.default = 1
+o.rmempty = false
+
+o = s:option(ListValue, "node", translate("Socks Node"))
+local tcp_node_num = tonumber(m:get("@global_other[0]", "tcp_node_num") or 1)
+for i = 1, tcp_node_num, 1 do
+ o:value("tcp" .. i, translatef("Same as the tcp %s node", i))
+end
+for k, v in pairs(nodes_table) do o:value(v.id, v.remarks) end
+
+o = s:option(Value, "port", translate("Listen Port"))
+o.datatype = "port"
+o.rmempty = false
+
---- Tips
-s:append(Template(appname .. "/global/tips"))
+m:append(Template(appname .. "/global/tips"))
+
+m:append(Template(appname .. "/global/footer"))
--[[
local apply = luci.http.formvalue("cbi.apply")
diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/node_config.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/node_config.lua
index 8929d77a1f..8475882e29 100644
--- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/node_config.lua
+++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/node_config.lua
@@ -66,7 +66,7 @@ local encrypt_methods_ss_aead = {
}
m = Map(appname, translate("Node Config"))
-m.redirect = d.build_url("admin", "vpn", appname)
+m.redirect = d.build_url("admin", "services", appname)
s = m:section(NamedSection, arg[1], "nodes", "")
s.addremove = false
diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/node_list.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/node_list.lua
index b573e4b5d6..958adc4808 100644
--- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/node_list.lua
+++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/node_list.lua
@@ -38,7 +38,7 @@ s = m:section(TypedSection, "nodes")
s.anonymous = true
s.addremove = true
s.template = "cbi/tblsection"
-s.extedit = d.build_url("admin", "vpn", appname, "node_config", "%s")
+s.extedit = d.build_url("admin", "services", appname, "node_config", "%s")
function s.create(e, t)
local uuid = _api.gen_uuid()
t = uuid
@@ -49,7 +49,7 @@ end
function s.remove(e, t)
s.map.proceed = true
s.map:del(t)
- luci.http.redirect(d.build_url("admin", "vpn", appname, "node_list"))
+ luci.http.redirect(d.build_url("admin", "services", appname, "node_list"))
end
if m:get("@global_other[0]", "show_group") == "1" then
diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/node_subscribe.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/node_subscribe.lua
index 0afd1a1726..37879ba92a 100644
--- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/node_subscribe.lua
+++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/node_subscribe.lua
@@ -36,7 +36,7 @@ o = s:option(Button, "_update", translate("Manual subscription"))
o.inputstyle = "apply"
function o.write(e, e)
luci.sys.call("lua /usr/share/" .. appname .. "/subscribe.lua start log > /dev/null 2>&1 &")
- luci.http.redirect(luci.dispatcher.build_url("admin", "vpn", appname, "log"))
+ luci.http.redirect(luci.dispatcher.build_url("admin", "services", appname, "log"))
end
---- Subscribe Delete All
@@ -44,7 +44,7 @@ o = s:option(Button, "_stop", translate("Delete All Subscribe Node"))
o.inputstyle = "remove"
function o.write(e, e)
luci.sys.call("lua /usr/share/" .. appname .. "/subscribe.lua truncate log > /dev/null 2>&1 &")
- luci.http.redirect(luci.dispatcher.build_url("admin", "vpn", appname, "log"))
+ luci.http.redirect(luci.dispatcher.build_url("admin", "services", appname, "log"))
end
filter_enabled = s:option(Flag, "filter_enabled", translate("Filter keyword switch"), translate("When checked, below options can only be take effect."))
diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/other.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/other.lua
index 3fe56770cc..adcba7b5dd 100644
--- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/other.lua
+++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/other.lua
@@ -1,4 +1,3 @@
-local _api = require "luci.model.cbi.passwall.api.api"
local uci = require"luci.model.uci".cursor()
local appname = "passwall"
@@ -181,34 +180,4 @@ uci:foreach(appname, "nodes", function(e)
end
end)
--- [[ Node List ]]--
-s = m:section(TypedSection, "socks", translate("Socks Config"))
-s.anonymous = true
-s.addremove = true
-s.template = "cbi/tblsection"
-function s.create(e, t)
- TypedSection.create(e, _api.gen_uuid())
-end
-
-o = s:option(DummyValue, "status", translate("Status"))
-o.template = appname .. "/other/socks_status"
-
----- Enable
-o = s:option(Flag, "enabled", translate("Enable"))
-o.default = 1
-o.rmempty = false
-
-o = s:option(ListValue, "node", translate("Socks Node"))
-local tcp_node_num = tonumber(m:get("@global_other[0]", "tcp_node_num") or 1)
-for i = 1, tcp_node_num, 1 do
- o:value("tcp" .. i, translatef("Same as the tcp %s node", i))
-end
-for k, v in pairs(nodes_table) do o:value(v.id, v.remarks) end
-
-o = s:option(Value, "port", translate("Listen Port"))
-o.datatype = "port"
-o.rmempty = false
-
-m:append(Template(appname .. "/other/footer"))
-
return m
diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/rule.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/rule.lua
index ffac408df9..e9e82b5093 100644
--- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/rule.lua
+++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/rule.lua
@@ -13,23 +13,25 @@ o.rmempty = false
]]--
---- Enable custom url
+--[[
o = s:option(Flag, "enable_custom_url", translate("Enable custom url"))
o.default = 0
o.rmempty = false
+]]--
---- gfwlist URL
o = s:option(Value, "gfwlist_url", translate("gfwlist Update url"))
o:value("https://cdn.jsdelivr.net/gh/Loukky/gfwlist-by-loukky/gfwlist.txt", translate("Loukky/gfwlist-by-loukky"))
o:value("https://cdn.jsdelivr.net/gh/gfwlist/gfwlist/gfwlist.txt", translate("gfwlist/gfwlist"))
o.default = "https://cdn.jsdelivr.net/gh/Loukky/gfwlist-by-loukky/gfwlist.txt"
-o:depends("enable_custom_url", 1)
+--o:depends("enable_custom_url", 1)
----chnroute URL
o = s:option(Value, "chnroute_url", translate("Chnroute Update url"))
o:value("https://ispip.clang.cn/all_cn.txt", translate("Clang.CN"))
o:value("https://ispip.clang.cn/all_cn_cidr.txt", translate("Clang.CN.CIDR"))
o.default = "https://ispip.clang.cn/all_cn.txt"
-o:depends("enable_custom_url", 1)
+--o:depends("enable_custom_url", 1)
---- Auto Update
o = s:option(Flag, "auto_update", translate("Enable auto update rules"))
@@ -54,7 +56,7 @@ s = m:section(TypedSection, "shunt_rules", "V2ray" .. translate("Shunt") .. tran
s.template = "cbi/tblsection"
s.anonymous = false
s.addremove = true
-s.extedit = d.build_url("admin", "vpn", appname, "shunt_rules", "%s")
+s.extedit = d.build_url("admin", "services", appname, "shunt_rules", "%s")
function s.create(e, t)
TypedSection.create(e, t)
luci.http.redirect(e.extedit:format(t))
diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/api/trojan.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/api/trojan.lua
index b1c80c3333..144ea8fa6b 100644
--- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/api/trojan.lua
+++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/api/trojan.lua
@@ -33,7 +33,7 @@ function gen_config(user)
enabled = user.plugin_type ~= nil,
type = user.plugin_type or "plaintext",
command = user.plugin_type ~= "plaintext" and user.plugin_cmd or nil,
- plugin_option = user.plugin_type ~= "plaintext" and user.plugin_option or nil,
+ option = user.plugin_type ~= "plaintext" and user.plugin_option or nil,
arg = user.plugin_type ~= "plaintext" and { user.plugin_arg } or nil,
env = {}
} or nil,
diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/index.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/index.lua
index c16f3a4c1c..f346fe2550 100644
--- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/index.lua
+++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/index.lua
@@ -15,7 +15,7 @@ t = m:section(TypedSection, "user", translate("Users Manager"))
t.anonymous = true
t.addremove = true
t.template = "cbi/tblsection"
-t.extedit = d.build_url("admin", "vpn", "passwall", "server_user", "%s")
+t.extedit = d.build_url("admin", "services", "passwall", "server_user", "%s")
function t.create(e, t)
local uuid = _api.gen_uuid()
t = uuid
@@ -25,7 +25,7 @@ end
function t.remove(e, t)
e.map.proceed = true
e.map:del(t)
- luci.http.redirect(d.build_url("admin", "vpn", "passwall", "server"))
+ luci.http.redirect(d.build_url("admin", "services", "passwall", "server"))
end
e = t:option(Flag, "enable", translate("Enable"))
diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/user.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/user.lua
index bda28b2bbc..27bd046fcf 100644
--- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/user.lua
+++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/user.lua
@@ -50,7 +50,7 @@ local encrypt_methods_ss_aead = {
}
map = Map("passwall_server", translate("Server Config"))
-map.redirect = d.build_url("admin", "vpn", "passwall", "server")
+map.redirect = d.build_url("admin", "services", "passwall", "server")
s = map:section(NamedSection, arg[1], "user", "")
s.addremove = false
diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/shunt_rules.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/shunt_rules.lua
index d53c26af7c..fed88a783f 100644
--- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/shunt_rules.lua
+++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/shunt_rules.lua
@@ -2,7 +2,7 @@ local d = require "luci.dispatcher"
local appname = "passwall"
m = Map(appname, "V2ray" .. translate("Shunt") .. translate("Rule"))
-m.redirect = d.build_url("admin", "vpn", appname)
+m.redirect = d.build_url("admin", "services", appname)
s = m:section(NamedSection, arg[1], "shunt_rules", "")
s.addremove = false
diff --git a/package/lienol/luci-app-passwall/luasrc/view/passwall/other/footer.htm b/package/lienol/luci-app-passwall/luasrc/view/passwall/global/footer.htm
similarity index 86%
rename from package/lienol/luci-app-passwall/luasrc/view/passwall/other/footer.htm
rename to package/lienol/luci-app-passwall/luasrc/view/passwall/global/footer.htm
index 446bf04ff1..447fe2d993 100644
--- a/package/lienol/luci-app-passwall/luasrc/view/passwall/other/footer.htm
+++ b/package/lienol/luci-app-passwall/luasrc/view/passwall/global/footer.htm
@@ -3,7 +3,7 @@
var _status = document.getElementsByClassName('_status');
for (var i = 0; i < _status.length; i++) {
var id = _status[i].getAttribute("socks_id");
- XHR.get('<%=url([[admin]], [[vpn]], [[passwall]], [[socks_status]])%>', {
+ XHR.get('<%=url([[admin]], [[services]], [[passwall]], [[socks_status]])%>', {
index: i,
id: id
},
diff --git a/package/lienol/luci-app-passwall/luasrc/view/passwall/other/socks_status.htm b/package/lienol/luci-app-passwall/luasrc/view/passwall/global/socks_status.htm
similarity index 100%
rename from package/lienol/luci-app-passwall/luasrc/view/passwall/other/socks_status.htm
rename to package/lienol/luci-app-passwall/luasrc/view/passwall/global/socks_status.htm
diff --git a/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status.htm b/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status.htm
index 7dadda6b64..c1e00c144b 100644
--- a/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status.htm
+++ b/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status.htm
@@ -241,7 +241,7 @@ https://github.com/pure-css/pure/blob/master/LICENSE.md
document.getElementsByTagName('img')[i].setAttribute("oncontextmenu","return false;");
document.getElementsByTagName('img')[i].setAttribute("ondragstart","return false;");
}
- XHR.poll(5, '<%=dsp.build_url("admin/vpn/passwall/status")%>', null,
+ XHR.poll(5, '<%=dsp.build_url("admin/services/passwall/status")%>', null,
function (x, data) {
var status_dns = document.getElementById('status_dns');
var status_haproxy = document.getElementById('status_haproxy');
@@ -334,7 +334,7 @@ https://github.com/pure-css/pure/blob/master/LICENSE.md
div.removeAttribute('onclick');
s.innerHTML = '<%:Check...%>';
var sendDate = (new Date()).getTime();
- XHR.get('<%=dsp.build_url("admin/vpn/passwall/connect_status")%>', {
+ XHR.get('<%=dsp.build_url("admin/services/passwall/connect_status")%>', {
type: type,
url : url
},
@@ -369,7 +369,7 @@ https://github.com/pure-css/pure/blob/master/LICENSE.md
if (s) {
dom.removeAttribute('onclick');
s.innerHTML = '<%:Check...%>';
- XHR.get('<%=dsp.build_url("admin/vpn/passwall/check_port")%>', null,
+ XHR.get('<%=dsp.build_url("admin/services/passwall/check_port")%>', null,
function(x, rv) {
if (rv.ret) {
s.innerHTML = rv.ret;
diff --git a/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status2.htm b/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status2.htm
index 61f169cb19..722531d294 100644
--- a/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status2.htm
+++ b/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status2.htm
@@ -169,7 +169,7 @@ local status_show_ip111 = api.uci_get_type("global_other", "status_show_ip111",
var kcptun_status = document.getElementById('_kcptun_status');
var baidu_status = document.getElementById('_baidu_status');
var google_status = document.getElementById('_google_status');
- XHR.poll(3, '<%=dsp.build_url("admin/vpn/passwall/status")%>', null,
+ XHR.poll(3, '<%=dsp.build_url("admin/services/passwall/status")%>', null,
function(x, json) {
if (x && x.status == 200) {
var tcp_node_status = document.getElementById('_tcp_node_status');
@@ -247,7 +247,7 @@ local status_show_ip111 = api.uci_get_type("global_other", "status_show_ip111",
btn.disabled = true;
btn.value = '<%:Check...%>';
var sendDate = (new Date()).getTime();
- XHR.get('<%=dsp.build_url("admin/vpn/passwall/connect_status")%>', {
+ XHR.get('<%=dsp.build_url("admin/services/passwall/connect_status")%>', {
type: type,
url: url
},
@@ -286,7 +286,7 @@ local status_show_ip111 = api.uci_get_type("global_other", "status_show_ip111",
function check_port(btn) {
btn.disabled = true;
btn.value = '<%:Check...%>';
- XHR.get('<%=dsp.build_url("admin/vpn/passwall/check_port")%>', null,
+ XHR.get('<%=dsp.build_url("admin/services/passwall/check_port")%>', null,
function(x, rv) {
var s = document.getElementById('_node_status');
if (s) {
diff --git a/package/lienol/luci-app-passwall/luasrc/view/passwall/global/tips.htm b/package/lienol/luci-app-passwall/luasrc/view/passwall/global/tips.htm
index c71b0f7da4..d28b1742ab 100644
--- a/package/lienol/luci-app-passwall/luasrc/view/passwall/global/tips.htm
+++ b/package/lienol/luci-app-passwall/luasrc/view/passwall/global/tips.htm
@@ -1,12 +1,11 @@
-