diff --git a/chinadns-ng/Makefile b/chinadns-ng/Makefile index 4f4945fc..61f8a283 100644 --- a/chinadns-ng/Makefile +++ b/chinadns-ng/Makefile @@ -42,6 +42,9 @@ else ifeq ($(ARCH),mipsel) else ifeq ($(ARCH),mips64) PKG_ARCH:=chinadns-ng+wolfssl@mips64-linux-musl@mips64+soft_float@fast+lto PKG_HASH:=65406d60af2fbc5fc165bbb6233002020407572a7214d8e5bc64ed3099003e60 +else ifeq ($(ARCH),mips64el) + PKG_ARCH:=chinadns-ng+wolfssl@mips64el-linux-musl@mips64+soft_float@fast+lto + PKG_HASH:=c37e804e4bcd05c22c432580c46fb98689e3079f26bfc06d9e039a1fda427639 else ifeq ($(ARCH),i386) ifneq ($(CONFIG_TARGET_x86_geode)$(CONFIG_TARGET_x86_legacy),) PKG_ARCH:=chinadns-ng+wolfssl@i386-linux-musl@i686@fast+lto @@ -73,7 +76,7 @@ define Package/chinadns-ng SUBMENU:=IP Addresses and Names TITLE:=ChinaDNS next generation, refactoring with epoll and ipset. URL:=https://github.com/zfl9/chinadns-ng - DEPENDS:=@(aarch64||arm||i386||mips||mipsel||mips64||x86_64) +ipset + DEPENDS:=@(aarch64||arm||i386||mips||mipsel||mips64||mips64el||x86_64) +ipset endef define Build/Compile diff --git a/luci-app-passwall/luasrc/passwall/api.lua b/luci-app-passwall/luasrc/passwall/api.lua index 054c4686..c27f14aa 100644 --- a/luci-app-passwall/luasrc/passwall/api.lua +++ b/luci-app-passwall/luasrc/passwall/api.lua @@ -720,6 +720,7 @@ local default_file_tree = { mips = "mips", mips64 = "mips64", mipsel = "mipsel", + mips64el = "mips64el", armv5 = "arm.*5", armv6 = "arm.*6[^4]*", armv7 = "arm.*7", diff --git a/luci-app-passwall/luasrc/passwall/com.lua b/luci-app-passwall/luasrc/passwall/com.lua index 7aa8390c..dffb2ac5 100644 --- a/luci-app-passwall/luasrc/passwall/com.lua +++ b/luci-app-passwall/luasrc/passwall/com.lua @@ -34,7 +34,8 @@ _M.singbox = { default_path = "/usr/bin/sing-box", match_fmt_str = "linux%%-%s", file_tree = { - x86_64 = "amd64" + x86_64 = "amd64", + mips64el = "mips64le" } } @@ -50,7 +51,8 @@ _M.xray = { x86_64 = "64", x86 = "32", mips = "mips32", - mipsel = "mips32le" + mipsel = "mips32le", + mips64el = "mips64le" } } @@ -68,6 +70,7 @@ _M["chinadns-ng"] = { mips = "wolfssl@mips%-.*mips32%+soft_float@", mips64 = "wolfssl@mips64%-.*mips64%+soft_float@", mipsel = "wolfssl@mipsel.*mips32%+soft_float@", + mips64el = "wolfssl@mips64el%-.*mips64%+soft_float@", aarch64 = "wolfssl_noasm@aarch64.*v8a", rockchip = "wolfssl@aarch64.*v8a", armv5 = "wolfssl@arm.*v5te", diff --git a/luci-app-passwall2/Makefile b/luci-app-passwall2/Makefile index 3be1733d..c6dc0729 100644 --- a/luci-app-passwall2/Makefile +++ b/luci-app-passwall2/Makefile @@ -5,8 +5,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall2 -PKG_VERSION:=1.31-1 -PKG_RELEASE:= +PKG_VERSION:=24.11.13 +PKG_RELEASE:=1 PKG_CONFIG_DEPENDS:= \ CONFIG_PACKAGE_$(PKG_NAME)_Iptables_Transparent_Proxy \ diff --git a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/type/sing-box.lua b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/type/sing-box.lua index d47f7a26..c7e27de0 100644 --- a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/type/sing-box.lua +++ b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/type/sing-box.lua @@ -408,9 +408,19 @@ if singbox_tags:find("with_ech") then o:depends({ [option_name("protocol")] = "hysteria" }) o:depends({ [option_name("protocol")] = "hysteria2" }) - o = s:option(Value, option_name("ech_config"), translate("ECH Config")) + o = s:option(TextValue, option_name("ech_config"), translate("ECH Config")) o.default = "" + o.rows = 5 + o.wrap = "off" o:depends({ [option_name("ech")] = true }) + o.validate = function(self, value) + value = value:gsub("^%s+", ""):gsub("%s+$","\n"):gsub("\r\n","\n"):gsub("[ \t]*\n[ \t]*", "\n") + value = value:gsub("^%s*\n", "") + if value:sub(-1) == "\n" then + value = value:sub(1, -2) + end + return value + end o = s:option(Flag, option_name("pq_signature_schemes_enabled"), translate("PQ signature schemes")) o.default = "0" diff --git a/luci-app-passwall2/luasrc/model/cbi/passwall2/server/type/sing-box.lua b/luci-app-passwall2/luasrc/model/cbi/passwall2/server/type/sing-box.lua index 2169a99c..68608738 100644 --- a/luci-app-passwall2/luasrc/model/cbi/passwall2/server/type/sing-box.lua +++ b/luci-app-passwall2/luasrc/model/cbi/passwall2/server/type/sing-box.lua @@ -291,9 +291,19 @@ if singbox_tags:find("with_ech") then o:depends({ [option_name("protocol")] = "tuic" }) o:depends({ [option_name("protocol")] = "hysteria2" }) - o = s:option(Value, option_name("ech_key"), translate("ECH Key")) + o = s:option(TextValue, option_name("ech_key"), translate("ECH Key")) o.default = "" + o.rows = 5 + o.wrap = "off" o:depends({ [option_name("ech")] = true }) + o.validate = function(self, value) + value = value:gsub("^%s+", ""):gsub("%s+$","\n"):gsub("\r\n","\n"):gsub("[ \t]*\n[ \t]*", "\n") + value = value:gsub("^%s*\n", "") + if value:sub(-1) == "\n" then + value = value:sub(1, -2) + end + return value + end o = s:option(Flag, option_name("pq_signature_schemes_enabled"), translate("PQ signature schemes")) o.default = "0" diff --git a/luci-app-passwall2/luasrc/passwall2/api.lua b/luci-app-passwall2/luasrc/passwall2/api.lua index 4c530c4a..bd969d48 100644 --- a/luci-app-passwall2/luasrc/passwall2/api.lua +++ b/luci-app-passwall2/luasrc/passwall2/api.lua @@ -694,8 +694,11 @@ local default_file_tree = { x86_64 = "amd64", x86 = "386", aarch64 = "arm64", + rockchip = "arm64", mips = "mips", - mipsel = "mipsle", + mips64 = "mips64", + mipsel = "mipsel", + mips64el = "mips64el", armv5 = "arm.*5", armv6 = "arm.*6[^4]*", armv7 = "arm.*7", diff --git a/luci-app-passwall2/luasrc/passwall2/com.lua b/luci-app-passwall2/luasrc/passwall2/com.lua index f3e24e0d..c9c50321 100644 --- a/luci-app-passwall2/luasrc/passwall2/com.lua +++ b/luci-app-passwall2/luasrc/passwall2/com.lua @@ -33,7 +33,8 @@ _M.singbox = { default_path = "/usr/bin/sing-box", match_fmt_str = "linux%%-%s", file_tree = { - x86_64 = "amd64" + x86_64 = "amd64", + mips64el = "mips64le" } } @@ -49,7 +50,8 @@ _M.xray = { x86_64 = "64", x86 = "32", mips = "mips32", - mipsel = "mips32le" + mipsel = "mips32le", + mips64el = "mips64le" } } diff --git a/luci-app-passwall2/luasrc/passwall2/util_sing-box.lua b/luci-app-passwall2/luasrc/passwall2/util_sing-box.lua index 9e498439..e26deaba 100644 --- a/luci-app-passwall2/luasrc/passwall2/util_sing-box.lua +++ b/luci-app-passwall2/luasrc/passwall2/util_sing-box.lua @@ -6,6 +6,7 @@ local jsonc = api.jsonc local appname = api.appname local fs = api.fs local CACHE_PATH = api.CACHE_PATH +local split = api.split local new_port @@ -97,7 +98,7 @@ function gen_outbound(flag, node, tag, proxy_table) --max_version = "1.3", ech = { enabled = (node.ech == "1") and true or false, - config = (node.ech_config and node.ech_config:gsub("\\n","\n")) and node.ech_config:gsub("\\n","\n") or nil, + config = node.ech_config and split(node.ech_config:gsub("\\n", "\n"), "\n") or {}, pq_signature_schemes_enabled = node.pq_signature_schemes_enabled and true or false, dynamic_record_sizing_disabled = node.dynamic_record_sizing_disabled and true or false }, @@ -307,7 +308,7 @@ function gen_outbound(flag, node, tag, proxy_table) } or nil, ech = { enabled = (node.ech == "1") and true or false, - config = (node.ech_config and node.ech_config:gsub("\\n","\n")) and node.ech_config:gsub("\\n","\n") or nil, + config = node.ech_config and split(node.ech_config:gsub("\\n", "\n"), "\n") or {}, pq_signature_schemes_enabled = node.pq_signature_schemes_enabled and true or false, dynamic_record_sizing_disabled = node.dynamic_record_sizing_disabled and true or false } @@ -341,7 +342,7 @@ function gen_outbound(flag, node, tag, proxy_table) } or nil, ech = { enabled = (node.ech == "1") and true or false, - config = (node.ech_config and node.ech_config:gsub("\\n","\n")) and node.ech_config:gsub("\\n","\n") or nil, + config = node.ech_config and split(node.ech_config:gsub("\\n", "\n"), "\n") or {}, pq_signature_schemes_enabled = node.pq_signature_schemes_enabled and true or false, dynamic_record_sizing_disabled = node.dynamic_record_sizing_disabled and true or false } @@ -364,7 +365,7 @@ function gen_outbound(flag, node, tag, proxy_table) insecure = (node.tls_allowInsecure == "1") and true or false, ech = { enabled = (node.ech == "1") and true or false, - config = (node.ech_config and node.ech_config:gsub("\\n","\n")) and node.ech_config:gsub("\\n","\n") or nil, + config = node.ech_config and split(node.ech_config:gsub("\\n", "\n"), "\n") or {}, pq_signature_schemes_enabled = node.pq_signature_schemes_enabled and true or false, dynamic_record_sizing_disabled = node.dynamic_record_sizing_disabled and true or false } @@ -412,7 +413,7 @@ function gen_config_server(node) if node.tls == "1" and node.ech == "1" then tls.ech = { enabled = true, - key = (node.ech_key and node.ech_key:gsub("\\n","\n")) and node.ech_key:gsub("\\n","\n") or nil, + key = node.ech_key and split(node.ech_key:gsub("\\n", "\n"), "\n") or {}, pq_signature_schemes_enabled = (node.pq_signature_schemes_enabled == "1") and true or false, dynamic_record_sizing_disabled = (node.dynamic_record_sizing_disabled == "1") and true or false, } diff --git a/luci-app-passwall2/root/usr/share/passwall2/app.sh b/luci-app-passwall2/root/usr/share/passwall2/app.sh index 1af69469..8db382a4 100755 --- a/luci-app-passwall2/root/usr/share/passwall2/app.sh +++ b/luci-app-passwall2/root/usr/share/passwall2/app.sh @@ -14,7 +14,8 @@ TMP_ACL_PATH=$TMP_PATH/acl TMP_IFACE_PATH=$TMP_PATH/iface TMP_PATH2=/tmp/etc/${CONFIG}_tmp DNSMASQ_PATH=/etc/dnsmasq.d -TMP_DNSMASQ_PATH=/tmp/dnsmasq.d/passwall2 +DNSMASQ_CONF_DIR=/tmp/dnsmasq.d +TMP_DNSMASQ_PATH=${DNSMASQ_CONF_DIR}/${CONFIG} LOG_FILE=/tmp/log/$CONFIG.log APP_PATH=/usr/share/$CONFIG RULES_PATH=/usr/share/${CONFIG}/rules @@ -284,6 +285,17 @@ lua_api() { echo $(lua -e "local api = require 'luci.passwall2.api' print(api.${func})") } +get_dnsmasq_conf_dir() { + local dnsmasq_conf_path=$(grep -l "^conf-dir=" /tmp/etc/dnsmasq.conf.${DEFAULT_DNSMASQ_CFGID}) + [ -n "$dnsmasq_conf_path" ] && { + local dnsmasq_conf_dir=$(grep '^conf-dir=' "$dnsmasq_conf_path" | cut -d'=' -f2 | head -n 1) + [ -n "$dnsmasq_conf_dir" ] && { + DNSMASQ_CONF_DIR=${dnsmasq_conf_dir%*/} + TMP_DNSMASQ_PATH=${DNSMASQ_CONF_DIR}/${CONFIG} + } + } +} + run_xray() { local flag node redir_port socks_address socks_port socks_username socks_password http_address http_port http_username http_password local dns_listen_port direct_dns_query_strategy remote_dns_protocol remote_dns_udp_server remote_dns_tcp_server remote_dns_doh remote_dns_client_ip remote_dns_detour remote_fakedns remote_dns_query_strategy dns_cache write_ipset_direct @@ -688,7 +700,7 @@ run_global() { echolog ${msg} source $APP_PATH/helper_dnsmasq.sh stretch - source $APP_PATH/helper_dnsmasq.sh add TMP_DNSMASQ_PATH=$TMP_DNSMASQ_PATH DNSMASQ_CONF_FILE=/tmp/dnsmasq.d/dnsmasq-passwall2.conf DEFAULT_DNS=$AUTO_DNS LOCAL_DNS=$LOCAL_DNS TUN_DNS=$TUN_DNS NFTFLAG=${nftflag:-0} + source $APP_PATH/helper_dnsmasq.sh add TMP_DNSMASQ_PATH=$TMP_DNSMASQ_PATH DNSMASQ_CONF_FILE=${DNSMASQ_CONF_DIR}/dnsmasq-${CONFIG}.conf DEFAULT_DNS=$AUTO_DNS LOCAL_DNS=$LOCAL_DNS TUN_DNS=$TUN_DNS NFTFLAG=${nftflag:-0} V2RAY_CONFIG=$TMP_ACL_PATH/default/global.json V2RAY_LOG=$TMP_ACL_PATH/default/global.log @@ -1178,6 +1190,8 @@ PROXY_IPV6=$(config_t_get global_forwarding ipv6_tproxy 0) XRAY_BIN=$(first_type $(config_t_get global_app xray_file) xray) SINGBOX_BIN=$(first_type $(config_t_get global_app singbox_file) sing-box) +get_dnsmasq_conf_dir + export V2RAY_LOCATION_ASSET=$(config_t_get global_rules v2ray_location_asset "/usr/share/v2ray/") export XRAY_LOCATION_ASSET=$V2RAY_LOCATION_ASSET mkdir -p /tmp/etc $TMP_PATH $TMP_BIN_PATH $TMP_SCRIPT_FUNC_PATH $TMP_ID_PATH $TMP_ROUTE_PATH $TMP_ACL_PATH $TMP_IFACE_PATH $TMP_PATH2 diff --git a/luci-app-passwall2/root/usr/share/passwall2/helper_dnsmasq.sh b/luci-app-passwall2/root/usr/share/passwall2/helper_dnsmasq.sh index c81d9f94..0e2f598a 100755 --- a/luci-app-passwall2/root/usr/share/passwall2/helper_dnsmasq.sh +++ b/luci-app-passwall2/root/usr/share/passwall2/helper_dnsmasq.sh @@ -90,7 +90,7 @@ add() { eval_set_val $@ _LOG_FILE=$LOG_FILE [ -n "$NO_LOGIC_LOG" ] && LOG_FILE="/dev/null" - mkdir -p "${TMP_DNSMASQ_PATH}" "${DNSMASQ_PATH}" "/tmp/dnsmasq.d" + mkdir -p "${TMP_DNSMASQ_PATH}" "${DNSMASQ_PATH}" "${DNSMASQ_CONF_DIR}" local set_type="ipset" [ "${NFTFLAG}" = "1" ] && { @@ -119,7 +119,7 @@ add() { } del() { - rm -rf /tmp/dnsmasq.d/dnsmasq-$CONFIG.conf + rm -rf $DNSMASQ_CONF_DIR/dnsmasq-$CONFIG.conf rm -rf $DNSMASQ_PATH/dnsmasq-$CONFIG.conf rm -rf $TMP_DNSMASQ_PATH }