update 2022-07-05 20:17:17

This commit is contained in:
github-actions[bot] 2022-07-05 20:17:17 +08:00
parent 59056d1ba5
commit f2fef9b647
8 changed files with 40 additions and 49 deletions

View File

@ -12,7 +12,7 @@ do
done
if [ -z "${TOKEN}" ]; then
echo "the token is empty, get token from https://www.ddnsto.com/ "
logger "ddnsto: the token is empty, get token from https://www.ddnsto.com/ "
exit 2
fi
@ -20,6 +20,7 @@ echo "ddnsto version device_id is is:"
/usr/sbin/ddnsto -u ${TOKEN} -w
_term() {
logger "ddnsto: SIGTERM"
killall ddnsto 2>/dev/null
killall ddwebdav 2>/dev/null
@ -33,14 +34,14 @@ trap "_term;" SIGTERM
while true ; do
if ! pidof "ddnsto" > /dev/null ; then
echo "ddnsto try running"
logger "ddnsto try running"
/usr/sbin/ddnsto -u ${TOKEN} -x ${DEVICE_IDX} &
PID=$!
wait $PID
RET=$?
echo "EXIT CODE: ${RET}"
logger "ddnsto EXIT CODE: ${RET}"
if [ "${RET}" == "100" ]; then
echo "token error, please set a correct token from https://www.ddnsto.com/ "
logger "ddnsto token error, please set a correct token from https://www.ddnsto.com/ "
exit 100
fi
fi

View File

@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for ddnsto
LUCI_DEPENDS:=+ddnsto
LUCI_PKGARCH:=all
PKG_VERSION:=3.0.0
PKG_RELEASE:=1
PKG_VERSION:=3.0.1
PKG_RELEASE:=0
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -30,18 +30,6 @@ local function trim(input)
return (string.gsub(input, "^%s*(.-)%s*$", "%1"))
end
local function ddnsto_removelog()
local fs = require "nixio.fs"
fs.remove("/tmp/ddnsto/ddnsto-luci.log")
end
local function ddnsto_writelog(content)
local fs = require "nixio.fs"
content = content .."XU6J03M6"
fs.mkdirr("/tmp/ddnsto/")
fs.writefile("/tmp/ddnsto/ddnsto-luci.log",content)
end
local function get_data()
local uci = require "luci.model.uci".cursor()
@ -295,14 +283,12 @@ function ddnsto_form()
scope = scope,
success = success,
result = result,
}
ddnsto_removelog()
}
luci.http.prepare_content("application/json")
luci.http.write_json(response)
end
function ddnsto_submit()
ddnsto_removelog()
local http = require "luci.http"
local content = http.content()
@ -418,11 +404,9 @@ function ddnsto_submit()
if success == 0 then
log = log .. "正在保存参数...\n"
log = log .. "保存成功!\n"
log = log .. "请关闭对话框\n"
ddnsto_writelog(log)
log = log .. "请关闭对话框\n"
luci.util.exec("/etc/init.d/ddnsto stop")
luci.util.exec("sleep 1")
luci.util.exec("/etc/init.d/ddnsto stop")
luci.util.exec("/etc/init.d/ddnsto start")
luci.util.exec("sleep 1")
else
@ -431,19 +415,19 @@ function ddnsto_submit()
log = log .. error .."\n"
log = log .. "\n"
log = log .. "保存失败!\n"
log = log .. "请关闭对话框\n"
ddnsto_writelog(log)
log = log .. "请关闭对话框\n"
luci.util.exec("sleep 1")
end
local result = {
async = false,
log = log,
data = get_data(),
schema = get_schema()
}
local response = {
success = success,
error = error,
success = 0,
result = result,
}
http.prepare_content("application/json")

View File

@ -1,16 +1,19 @@
<%+header%>
<script>
(function(){
})();
window.IstoreosFormEnv = {
getApi: '/cgi-bin/luci/admin/services/ddnsto/form/',
logApi: '/cgi-bin/luci/admin/services/ddnsto/log',
submitApi: '/cgi-bin/luci/admin/services/ddnsto/submit/'
}
</script>
<div id="app">
</div>
<script type="module" crossorigin src="/luci-static/ddnsto/index.js?v=<%=math.random(1,100000)%>"></script>
<link rel="stylesheet" href="/luci-static/ddnsto/style.css?v=<%=math.random(1,100000)%>">
<script>
window.IstoreosFormConfig = {
getApi:"/cgi-bin/luci/admin/services/ddnsto/form/",
logApi:"/cgi-bin/luci/admin/services/ddnsto/log",
submitApi:"/cgi-bin/luci/admin/services/ddnsto/submit/",
}
</script>
<script type="module" crossorigin src="/luci-static/ddnsto/index.js?v=<%=math.random(1,100000)%>"></script>
<link rel="stylesheet" href="/luci-static/ddnsto/style.css?v=<%=math.random(1,100000)%>">
<%+footer%>

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
[lock-scroll=true]{overflow:hidden!important}.software-log_shade[data-v-41d6b36f],.software-log_shade *[data-v-41d6b36f]{-webkit-box-sizing:border-box;-webkit-tap-highlight-color:transparent;box-sizing:border-box;word-wrap:break-word;outline:none}.software-log_shade[data-v-41d6b36f]{width:100%;height:100%;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;position:fixed;inset:0;z-index:99999}.software-log_shade .software-log_shade__bg[data-v-41d6b36f]{position:fixed;inset:0;background:rgba(68,79,83,.94) none repeat scroll 0 0!important;background-position:0 0;background-size:cover;opacity:.94}.software-log_shade .software-log_shade__pannel[data-v-41d6b36f]{width:800px;min-width:800px;border-radius:10px;z-index:100;box-shadow:3px 3px 10px #000;background:rgba(0,0,0,.9);padding:10px}.software-log_shade .software-log_shade__pannel .software-log_shade__pannel-title[data-v-41d6b36f]{text-align:center;font-size:18px;color:#9f0;padding:10px;font-weight:700}.software-log_shade .software-log_shade__pannel .software-log_shade__pannel-now i[data-v-41d6b36f]{color:#fc0;font-style:normal}.software-log_shade .software-log_shade__pannel .software-log_shade__pannel-content[data-v-41d6b36f]{padding:10px;width:100%;text-align:center;overflow:hidden}.software-log_shade .software-log_shade__pannel .software-log_shade__pannel-content textarea[data-v-41d6b36f]{width:100%;border:0px solid #222;font-family:Lucida Console;font-size:11px;background:transparent;color:#fff;outline:none;overflow-x:hidden;resize:none;transition:.5s}.software-log_shade .software-log_shade__pannel .software-log_shade__pannel-content textarea[data-v-41d6b36f]:focus,.software-log_shade .software-log_shade__pannel .software-log_shade__pannel-content textarea[data-v-41d6b36f]:hover{box-shadow:none;border-color:#fff0!important}.software-log_shade .software-log_shade__pannel .software-log_shade__pannel-content textarea[data-v-41d6b36f]::-webkit-scrollbar{width:5px;height:5px}.software-log_shade .software-log_shade__pannel .software-log_shade__pannel-content textarea[data-v-41d6b36f]::-webkit-scrollbar-thumb{height:30px;outline:none;border:none;border-radius:1rem;background-color:#4c595c;-webkit-border-radius:1rem}.software-log_shade .software-log_shade__pannel .software-log_shade__pannel-content textarea[data-v-41d6b36f]::-webkit-scrollbar-track-piece{background:none;-webkit-border-radius:0;border-radius:0}.software-log_shade .software-log_shade__pannel .software-log_shade__pannel-btn[data-v-41d6b36f]{width:100%;display:flex;flex-wrap:wrap;align-items:center;justify-content:center}.software-log_shade .software-log_shade__pannel .software-log_shade__pannel-btn button[data-v-41d6b36f]{visibility:visible;min-width:88px;font-weight:bolder;text-shadow:1px 1px 0px black;border-radius:8px;height:33px;font-family:Verdana,Microsoft Yahei UI,sans-serif;font-size:12px;padding:0 .7em;width:auto;min-width:122px;margin:0 10px;cursor:pointer;background:#090a0a!important;border:1px solid #fff!important;color:#fff!important;opacity:1!important}.software-log_shade .software-log_shade__pannel .software-log_shade__pannel-btn button[data-v-41d6b36f]:hover{opacity:.9!important}.cbi-section .title{font-size:1.1rem;line-height:1;display:block;width:100%;margin:0;color:#32325d;padding:1rem 1.25rem}.cbi-page-actions{display:inline-block;width:100%}#app{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
[lock-scroll=true]{overflow:hidden!important}.software-log_shade[data-v-27cc98a0],.software-log_shade *[data-v-27cc98a0]{-webkit-box-sizing:border-box;-webkit-tap-highlight-color:transparent;box-sizing:border-box;word-wrap:break-word;outline:none}.software-log_shade[data-v-27cc98a0]{width:100%;height:100%;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;position:fixed;inset:0;z-index:99999}.software-log_shade .software-log_shade__bg[data-v-27cc98a0]{position:fixed;inset:0;background:rgba(68,79,83,.94) none repeat scroll 0 0!important;background-position:0 0;background-size:cover;opacity:.94}.software-log_shade .software-log_shade__pannel[data-v-27cc98a0]{width:800px;min-width:800px;border-radius:10px;z-index:100;box-shadow:3px 3px 10px #000;background:rgba(0,0,0,.9);padding:10px}.software-log_shade .software-log_shade__pannel .software-log_shade__pannel-title[data-v-27cc98a0]{text-align:center;font-size:18px;color:#9f0;padding:10px;font-weight:700}.software-log_shade .software-log_shade__pannel .software-log_shade__pannel-now i[data-v-27cc98a0]{color:#fc0;font-style:normal}.software-log_shade .software-log_shade__pannel .software-log_shade__pannel-content[data-v-27cc98a0]{padding:10px;width:100%;text-align:center;overflow:hidden;height:400px;overflow:overlay}.software-log_shade .software-log_shade__pannel .software-log_shade__pannel-content textarea[data-v-27cc98a0]{width:100%;border:0px solid #222;font-family:Lucida Console;font-size:11px;background:transparent;color:#fff;outline:none;overflow-x:hidden;resize:none;transition:.5s}.software-log_shade .software-log_shade__pannel .software-log_shade__pannel-content textarea[data-v-27cc98a0]:focus,.software-log_shade .software-log_shade__pannel .software-log_shade__pannel-content textarea[data-v-27cc98a0]:hover{box-shadow:none;border-color:#fff0!important}.software-log_shade .software-log_shade__pannel .software-log_shade__pannel-content textarea[data-v-27cc98a0]::-webkit-scrollbar{width:5px;height:5px}.software-log_shade .software-log_shade__pannel .software-log_shade__pannel-content textarea[data-v-27cc98a0]::-webkit-scrollbar-thumb{height:30px;outline:none;border:none;border-radius:1rem;background-color:#4c595c;-webkit-border-radius:1rem}.software-log_shade .software-log_shade__pannel .software-log_shade__pannel-content textarea[data-v-27cc98a0]::-webkit-scrollbar-track-piece{background:none;-webkit-border-radius:0;border-radius:0}.software-log_shade .software-log_shade__pannel .software-log_shade__pannel-btn[data-v-27cc98a0]{width:100%;display:flex;flex-wrap:wrap;align-items:center;justify-content:center}.software-log_shade .software-log_shade__pannel .software-log_shade__pannel-btn button[data-v-27cc98a0]{visibility:visible;min-width:88px;font-weight:bolder;text-shadow:1px 1px 0px black;border-radius:8px;height:33px;font-family:Verdana,Microsoft Yahei UI,sans-serif;font-size:12px;padding:0 .7em;width:auto;min-width:122px;margin:0 10px;cursor:pointer;background:#090a0a!important;border:1px solid #fff!important;color:#fff!important;opacity:1!important}.software-log_shade .software-log_shade__pannel .software-log_shade__pannel-btn button[data-v-27cc98a0]:hover{opacity:.9!important}.cbi-section .title{font-size:1.1rem;line-height:1;display:block;width:100%;margin:0;color:#32325d;padding:1rem 1.25rem}.cbi-page-actions{display:inline-block;width:100%}#app{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}

View File

@ -462,13 +462,15 @@ o = s:option(Value, "serviceName", translate("gRPC Service Name"))
o:depends("transport", "grpc")
o.rmempty = true
if is_installed("sagernet-core") then
if is_finded("xray") or is_installed("sagernet-core") then
-- gPRC模式
o = s:option(ListValue, "grpc_mode", translate("gRPC Mode"))
o:depends("transport", "grpc")
o:value("gun", translate("Gun"))
o:value("multi", translate("Multi"))
o:value("raw", translate("Raw"))
if is_installed("sagernet-core") then
o:value("raw", translate("Raw"))
end
o.rmempty = true
end

View File

@ -224,6 +224,7 @@ local Xray = {
-- grpc
serviceName = server.serviceName or "",
mode = (server.grpc_mode ~= "gun") and server.grpc_mode or nil,
multiMode = (server.grpc_mode == "multi") and true or false,
idle_timeout = tonumber(server.idle_timeout) or nil,
health_check_timeout = tonumber(server.health_check_timeout) or nil,
permit_without_stream = (server.permit_without_stream == "1") and true or nil,