mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-10-29 16:15:13 +08:00
update 2026-06-28 21:25:50
This commit is contained in:
1 parent
f0cb8f77bd
commit
b2b3891c0a
5 files changed
+31
-4
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 "节点订阅"
|
||||
|
||||
|
||||
@@ -24,3 +24,7 @@ doh.pub
|
||||
dot.pub
|
||||
doh.360.cn
|
||||
dot.360.cn
|
||||
|
||||
#GitHub Proxy
|
||||
gh-proxy.com
|
||||
gh-proxy.org
|
||||
Reference in new issue
Block a user