mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-10-31 20:05: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.anonymous = true
|
||||||
s:append(Template(appname .. "/app_update/app_version"))
|
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 k, v
|
||||||
local com = require "luci.passwall.com"
|
local com = require "luci.passwall.com"
|
||||||
for _, k in ipairs(com.order) do
|
for _, k in ipairs(com.order) do
|
||||||
|
|||||||
@@ -996,7 +996,14 @@ local default_file_tree = {
|
|||||||
|
|
||||||
local function get_api_json(url)
|
local function get_api_json(url)
|
||||||
local jsonc = require "luci.jsonc"
|
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
|
if return_code ~= 0 or content == "" then return {} end
|
||||||
return jsonc.parse(content) or {}
|
return jsonc.parse(content) or {}
|
||||||
end
|
end
|
||||||
@@ -1113,7 +1120,14 @@ function to_download(app_name, url, size)
|
|||||||
local _curl_args = clone(curl_args)
|
local _curl_args = clone(curl_args)
|
||||||
table.insert(_curl_args, "--speed-limit 51200 --speed-time 15 --max-time 300")
|
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
|
result = return_code == 0
|
||||||
|
|
||||||
if not result then
|
if not result then
|
||||||
|
|||||||
@@ -1156,6 +1156,12 @@ msgstr "%s 客户端程序路径"
|
|||||||
msgid "alternate API URL for version checking"
|
msgid "alternate API URL for version checking"
|
||||||
msgstr "用于版本检查的 API URL"
|
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"
|
msgid "Node Subscribe"
|
||||||
msgstr "节点订阅"
|
msgstr "节点订阅"
|
||||||
|
|
||||||
|
|||||||
@@ -24,3 +24,7 @@ doh.pub
|
|||||||
dot.pub
|
dot.pub
|
||||||
doh.360.cn
|
doh.360.cn
|
||||||
dot.360.cn
|
dot.360.cn
|
||||||
|
|
||||||
|
#GitHub Proxy
|
||||||
|
gh-proxy.com
|
||||||
|
gh-proxy.org
|
||||||
+2
-2
@@ -5,12 +5,12 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=smartdns
|
PKG_NAME:=smartdns
|
||||||
PKG_VERSION:=48.1
|
PKG_VERSION:=48.2
|
||||||
PKG_RELEASE:=2
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=https://codeload.github.com/pymumu/smartdns/tar.gz/Release$(PKG_VERSION)?
|
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_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-Release$(PKG_VERSION)
|
||||||
|
|
||||||
PKG_MAINTAINER:=Nick Peng <pymumu@gmail.com>
|
PKG_MAINTAINER:=Nick Peng <pymumu@gmail.com>
|
||||||
|
|||||||
Reference in new issue
Block a user