From d1073fc0f839cbd9ba571d77fbb8ec54a8e4c852 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 21 Nov 2023 23:35:37 +0800 Subject: [PATCH] update 2023-11-21 23:35:37 --- luci-app-lucky/Makefile | 4 ++-- luci-app-lucky/luasrc/model/cbi/lucky.lua | 2 ++ luci-app-lucky/luasrc/view/lucky_status.htm | 2 +- luci-app-lucky/po/zh-cn/lucky.po | 6 ++++++ luci-app-lucky/po/zh_Hans/lucky.po | 6 ++++++ luci-app-lucky/root/etc/init.d/lucky | 11 +++++------ 6 files changed, 22 insertions(+), 9 deletions(-) mode change 100644 => 100755 luci-app-lucky/root/etc/init.d/lucky diff --git a/luci-app-lucky/Makefile b/luci-app-lucky/Makefile index 381a8048c..d0c1914dd 100644 --- a/luci-app-lucky/Makefile +++ b/luci-app-lucky/Makefile @@ -7,8 +7,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-lucky -PKG_VERSION:=1.1.1 -PKG_RELEASE:=5 +PKG_VERSION:=1.1.2 +PKG_RELEASE:=7 LUCI_TITLE:=LuCI Support for Dynamic lucky Client LUCI_DEPENDS:=+lucky diff --git a/luci-app-lucky/luasrc/model/cbi/lucky.lua b/luci-app-lucky/luasrc/model/cbi/lucky.lua index e5785b24d..ff20658ec 100644 --- a/luci-app-lucky/luasrc/model/cbi/lucky.lua +++ b/luci-app-lucky/luasrc/model/cbi/lucky.lua @@ -19,6 +19,8 @@ o = s:option(Value, "port",translate("Set the Lucky access port")) o.datatype = "uinteger" o.default = 16601 +o = s:option(Value, "safe",translate("Safe entrance"),translate("The panel management portal can only be set to log in to the panel through the specified security portal, such as:/lucky")) + o = s:option( Value, "configdir", translate("Config dir path"),translate("The path to store the config file")) o.placeholder = "/etc/lucky" o.default="/etc/lucky" diff --git a/luci-app-lucky/luasrc/view/lucky_status.htm b/luci-app-lucky/luasrc/view/lucky_status.htm index c545f0753..4a04e332b 100644 --- a/luci-app-lucky/luasrc/view/lucky_status.htm +++ b/luci-app-lucky/luasrc/view/lucky_status.htm @@ -30,7 +30,7 @@ function Luckyconfig() { Luckyconfig() tb.innerHTML = '<%:The Lucky service is running.%>'; tb.innerHTML +='

<%:Click the new page to open Lucky%>
'; - tb.innerHTML += ""; + tb.innerHTML += ""; } else { diff --git a/luci-app-lucky/po/zh-cn/lucky.po b/luci-app-lucky/po/zh-cn/lucky.po index 71fe5c50b..5e0c931f5 100644 --- a/luci-app-lucky/po/zh-cn/lucky.po +++ b/luci-app-lucky/po/zh-cn/lucky.po @@ -43,3 +43,9 @@ msgstr "基本设置" msgid "Click the new page to open Lucky" msgstr "点击新页面打开大吉" +msgid "Safe entrance" +msgstr "安全入口" + +msgid "The panel management portal can only be set to log in to the panel through the specified security portal, such as:/lucky" +msgstr "面板管理入口,设置后只能通过指定安全入口登录面板,如: /lucky" + diff --git a/luci-app-lucky/po/zh_Hans/lucky.po b/luci-app-lucky/po/zh_Hans/lucky.po index 71fe5c50b..5e0c931f5 100644 --- a/luci-app-lucky/po/zh_Hans/lucky.po +++ b/luci-app-lucky/po/zh_Hans/lucky.po @@ -43,3 +43,9 @@ msgstr "基本设置" msgid "Click the new page to open Lucky" msgstr "点击新页面打开大吉" +msgid "Safe entrance" +msgstr "安全入口" + +msgid "The panel management portal can only be set to log in to the panel through the specified security portal, such as:/lucky" +msgstr "面板管理入口,设置后只能通过指定安全入口登录面板,如: /lucky" + diff --git a/luci-app-lucky/root/etc/init.d/lucky b/luci-app-lucky/root/etc/init.d/lucky old mode 100644 new mode 100755 index 6f245d93a..d7df8fdf4 --- a/luci-app-lucky/root/etc/init.d/lucky +++ b/luci-app-lucky/root/etc/init.d/lucky @@ -14,36 +14,35 @@ STOP=15 CONF="lucky" PROG=/usr/bin/lucky DEFAULT_DIR='/etc/config/lucky.daji/' +SET_TZ="" get_tz() { - SET_TZ="" - [ -e "/etc/localtime" ] && return - for tzfile in /etc/TZ /var/etc/TZ do [ -e "$tzfile" ] || continue tz="$(cat $tzfile 2>/dev/null)" done - [ -z "$tz" ] && return - SET_TZ=$tz } get_config() { config_get_bool enabled $1 enabled 1 config_get_bool logger $1 logger 1 + config_get port $1 port 16601 + config_get SafeURL $1 safe config_get configdir $1 configdir $DEFAULT_DIR } start_service() { config_load "$CONF" config_foreach get_config "$CONF" - [ "x$enabled" = "x1" ] || return 1 [ ! -d $configdir ] && mkdir -p $configdir 2>/dev/null + [ $port != 16601 ] && $(which lucky) -setconf -key AdminWebListenPort -value $port -cd $configdir + [ $SafeURL ] && $(which lucky) -setconf -key SafeURL -value $SafeURL -cd $configdir procd_open_instance get_tz [[ -z "$SET_TZ" ]] || procd_set_param env TZ="$SET_TZ"