From b2b3891c0abe24be6723c962b60ba782fe820f1f Mon Sep 17 00:00:00 2001 From: action Date: Sun, 28 Jun 2026 21:25:50 +0800 Subject: [PATCH] update 2026-06-28 21:25:50 --- .../model/cbi/passwall/client/app_update.lua | 3 +++ luci-app-passwall/luasrc/passwall/api.lua | 18 ++++++++++++++++-- luci-app-passwall/po/zh-cn/passwall.po | 6 ++++++ .../root/usr/share/passwall/rules/direct_host | 4 ++++ smartdns/Makefile | 4 ++-- 5 files changed, 31 insertions(+), 4 deletions(-) diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/app_update.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/app_update.lua index f87781f9..9106571e 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/app_update.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/app_update.lua @@ -12,6 +12,9 @@ s = m:section(TypedSection, "global_app", translate("App Update"), s.anonymous = true s:append(Template(appname .. "/app_update/app_version")) +o = s:option(Flag, "github_proxy", translate("GitHub Proxy"), translate("Use gh-proxy instead of proxy nodes for component updates.")) +o.default = 0 + local k, v local com = require "luci.passwall.com" for _, k in ipairs(com.order) do diff --git a/luci-app-passwall/luasrc/passwall/api.lua b/luci-app-passwall/luasrc/passwall/api.lua index 372133a3..e91f996a 100644 --- a/luci-app-passwall/luasrc/passwall/api.lua +++ b/luci-app-passwall/luasrc/passwall/api.lua @@ -996,7 +996,14 @@ local default_file_tree = { local function get_api_json(url) local jsonc = require "luci.jsonc" - local return_code, content = curl_auto(url, nil, curl_args) + local gh_proxy = uci_get_type("global_app", "github_proxy", "0") + local return_code, content + if gh_proxy == "1" then + url = "https://gh-proxy.org/" .. url + return_code, content = curl_base(url, nil, curl_args) + else + return_code, content = curl_auto(url, nil, curl_args) + end if return_code ~= 0 or content == "" then return {} end return jsonc.parse(content) or {} end @@ -1113,7 +1120,14 @@ function to_download(app_name, url, size) local _curl_args = clone(curl_args) table.insert(_curl_args, "--speed-limit 51200 --speed-time 15 --max-time 300") - local return_code, result = curl_auto(url, tmp_file, _curl_args) + local gh_proxy = uci_get_type("global_app", "github_proxy", "0") + local return_code, result + if gh_proxy == "1" then + url = "https://gh-proxy.org/" .. url + return_code, result = curl_base(url, tmp_file, _curl_args) + else + return_code, result = curl_auto(url, tmp_file, _curl_args) + end result = return_code == 0 if not result then diff --git a/luci-app-passwall/po/zh-cn/passwall.po b/luci-app-passwall/po/zh-cn/passwall.po index 41b002d8..62890676 100644 --- a/luci-app-passwall/po/zh-cn/passwall.po +++ b/luci-app-passwall/po/zh-cn/passwall.po @@ -1156,6 +1156,12 @@ msgstr "%s 客户端程序路径" msgid "alternate API URL for version checking" msgstr "用于版本检查的 API URL" +msgid "GitHub Proxy" +msgstr "GitHub 反代" + +msgid "Use gh-proxy instead of proxy nodes for component updates." +msgstr "开启后将使用 gh-proxy 反向代理,不通过节点更新组件。" + msgid "Node Subscribe" msgstr "节点订阅" diff --git a/luci-app-passwall/root/usr/share/passwall/rules/direct_host b/luci-app-passwall/root/usr/share/passwall/rules/direct_host index bc168640..87959032 100644 --- a/luci-app-passwall/root/usr/share/passwall/rules/direct_host +++ b/luci-app-passwall/root/usr/share/passwall/rules/direct_host @@ -24,3 +24,7 @@ doh.pub dot.pub doh.360.cn dot.360.cn + +#GitHub Proxy +gh-proxy.com +gh-proxy.org diff --git a/smartdns/Makefile b/smartdns/Makefile index acd990de..59a2232b 100644 --- a/smartdns/Makefile +++ b/smartdns/Makefile @@ -5,12 +5,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=smartdns -PKG_VERSION:=48.1 +PKG_VERSION:=48.2 PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/pymumu/smartdns/tar.gz/Release$(PKG_VERSION)? -PKG_HASH:=fbc9e8de5e3bd6cd2d7e3823321d5caed22b7c704ae66ed7274f8012246cb285 +PKG_HASH:=46efffbe46615d628b5dbb5dc8150da8dcecfdc6eec339f561638896ae66486b PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-Release$(PKG_VERSION) PKG_MAINTAINER:=Nick Peng