From 619fb4c9e3b911335527674db5063d8135d47b7c Mon Sep 17 00:00:00 2001 From: kenzok8 Date: Thu, 30 May 2024 14:13:01 +0800 Subject: [PATCH] update 2024-05-30 14:13:01 --- luci-app-daed-next/po/zh_Hans/daed-next.po | 2 +- .../luasrc/controller/easyupdate.lua | 4 ++-- .../luasrc/model/cbi/easyupdate.lua | 6 +++--- luci-app-easyupdate/po/zh-cn/easyupdate.po | 7 +++++-- luci-app-easyupdate/root/usr/bin/easyupdate.sh | 16 ++++------------ .../luasrc/controller/supervisord.lua | 5 ----- 6 files changed, 15 insertions(+), 25 deletions(-) diff --git a/luci-app-daed-next/po/zh_Hans/daed-next.po b/luci-app-daed-next/po/zh_Hans/daed-next.po index ff04a0f78..cb6919984 100644 --- a/luci-app-daed-next/po/zh_Hans/daed-next.po +++ b/luci-app-daed-next/po/zh_Hans/daed-next.po @@ -83,4 +83,4 @@ msgid "Toggle" msgstr "开/关" msgid "Dashboard is a frontend management panel, meant for configuration use only." -msgstr "仪表板是一个前端管理面板,仅应在配置过程中启用。" +msgstr "仪表板是一个前端管理面板,仅应在配置过程中启用。(登录后若浏览器未自动跳转,请手动刷新页面)" diff --git a/luci-app-easyupdate/luasrc/controller/easyupdate.lua b/luci-app-easyupdate/luasrc/controller/easyupdate.lua index da422d3e3..cf5b81bb0 100644 --- a/luci-app-easyupdate/luasrc/controller/easyupdate.lua +++ b/luci-app-easyupdate/luasrc/controller/easyupdate.lua @@ -6,9 +6,9 @@ function index() end local c=luci.model.uci.cursor() local r=0 - if not c:get("easyupdate", "main", "proxy") then + if not c:get("easyupdate", "main", "mirror") then r=1 - c:set("easyupdate", "main", "proxy", "1") + c:set("easyupdate", "main", "mirror", "") end if not c:get("easyupdate", "main", "keepconfig") then r=1 diff --git a/luci-app-easyupdate/luasrc/model/cbi/easyupdate.lua b/luci-app-easyupdate/luasrc/model/cbi/easyupdate.lua index 64426ba08..43e4d2880 100644 --- a/luci-app-easyupdate/luasrc/model/cbi/easyupdate.lua +++ b/luci-app-easyupdate/luasrc/model/cbi/easyupdate.lua @@ -11,9 +11,9 @@ e=s:option(Flag, "enable", translate("Enable"),translate("When selected, firmwar e.default=0 e.optional=false -p=s:option(Flag, "proxy", translate("Use China Mirror"),translate("When selected, will use the China mirror when accessing Github.")) -p.default=1 -p.optional=false +p=s:option(Value,"mirror",translate("Mirror Url"),translate("Once configured, the mirror URL will be used when accessing Github.")) +p.default='' +p.rmempty=false k= s:option(Flag, "keepconfig", translate("KEEP CONFIG"),translate("When selected, configuration is retained when firmware upgrade.")) k.default=1 diff --git a/luci-app-easyupdate/po/zh-cn/easyupdate.po b/luci-app-easyupdate/po/zh-cn/easyupdate.po index 7fa52c215..2ad32355f 100644 --- a/luci-app-easyupdate/po/zh-cn/easyupdate.po +++ b/luci-app-easyupdate/po/zh-cn/easyupdate.po @@ -10,8 +10,11 @@ msgstr "升级可能导致重启失败,请谨慎选择自动升级" msgid "When selected, firmware upgrade will be automatically at the specified time." msgstr "选中后,系统将在指定的时间自动升级固件。" -msgid "When selected, will use the China mirror when accessing Github." -msgstr "选中后,将在访问Github时使用中国镜像。" +msgid "Mirror Url" +msgstr "镜像网址" + +msgid "Once configured, the mirror URL will be used when accessing Github." +msgstr "配置后,在访问Github时将使用镜像网址。" msgid "KEEP CONFIG" msgstr "保留配置" diff --git a/luci-app-easyupdate/root/usr/bin/easyupdate.sh b/luci-app-easyupdate/root/usr/bin/easyupdate.sh index a73b91a9e..bfa5a78fa 100755 --- a/luci-app-easyupdate/root/usr/bin/easyupdate.sh +++ b/luci-app-easyupdate/root/usr/bin/easyupdate.sh @@ -50,19 +50,11 @@ function downCloudVer() { writeLog 'Get the cloud firmware link(获取云端固件链接)' url=$(curl "https://api.github.com/repos/${github[2]}/${github[3]}/releases/latest" | jsonfilter -e '@.assets[*].browser_download_url' | sed -n "/$suffix/p") writeLog "Cloud firmware link(云端固件链接):$url" - writeLog 'Get whether to use Chinese mirror(读取是否使用中国镜像)' - proxy=$(uci get easyupdate.main.proxy) - if [ $proxy -eq 1 ]; then - proxy='https://ghproxy.com/' - res='yes' - else - proxy='' - res='no' - fi - writeLog "Whether to use Chinese mirror(是否使用中国镜像):$res" + mirror=$(uci get easyupdate.main.mirror) + writeLog "Use mirror URL(使用镜像网站):$mirror" fileName=(${url//// }) - curl -o "/tmp/${fileName[7]}-sha256" "$proxy${url/${fileName[7]}/sha256sums}" - curl -o "/tmp/${fileName[7]}" "$proxy$url" >/tmp/easyupdate.log 2>&1 & + curl -o "/tmp/${fileName[7]}-sha256" -L "$mirror${url/${fileName[7]}/sha256sums}" + curl -o "/tmp/${fileName[7]}" -L "$mirror$url" >/tmp/easyupdate.log 2>&1 & writeLog 'Start downloading firmware, log output in /tmp/easyupdate.log(开始下载固件,日志输出在/tmp/easyupdate.log)' } diff --git a/luci-app-supervisord/luasrc/controller/supervisord.lua b/luci-app-supervisord/luasrc/controller/supervisord.lua index d6f05a949..cfd50f2fa 100644 --- a/luci-app-supervisord/luasrc/controller/supervisord.lua +++ b/luci-app-supervisord/luasrc/controller/supervisord.lua @@ -77,11 +77,6 @@ function update() filename = "supervisord_" .. version:gsub("v", "") .. "_Linux_" .. arch .. ".tar.gz" nixio.fs.remove("/tmp/" .. filename) u=c:get("supervisord", "main", "usechinamirror") - if u then - u="https://ghproxy.com/" - else - u="" - end e.error=luci.sys.call("uclient-fetch -qO- -O '/tmp/" .. filename .. "' '" .. u .. "https://github.com/ochinchina/supervisord/releases/download/" .. version .. "/" .. filename .. "'") if e.error == 0 then e.error=luci.sys.exec("tar -xzvf '/tmp/" .. filename .. "' -C /tmp")