From 2f173fb36626f3bc4fa03dcc8e02f03ce2a445f3 Mon Sep 17 00:00:00 2001 From: Beginner <70857188+Beginner-Go@users.noreply.github.com> Date: Thu, 3 Feb 2022 01:50:45 +0800 Subject: [PATCH] aliyundrive-webdav: update to 1.2.1 (#8801) Co-authored-by: messense --- package/lean/aliyundrive-webdav/Makefile | 2 +- .../files/aliyundrive-webdav.config | 2 ++ .../files/aliyundrive-webdav.init | 6 ++++++ package/lean/luci-app-aliyundrive-webdav/Makefile | 4 ++-- .../luasrc/controller/aliyundrive-webdav.lua | 15 ++++++++++----- .../model/cbi/aliyundrive-webdav/client.lua | 6 +++--- .../po/zh-cn/aliyundrive-webdav.po | 6 ++++++ .../lean/luci-app-aliyundrive-webdav/po/zh_Hans | 1 + .../rpcd/acl.d/luci-app-aliyundrive-webdav.json | 11 +++++++++++ 9 files changed, 42 insertions(+), 11 deletions(-) create mode 120000 package/lean/luci-app-aliyundrive-webdav/po/zh_Hans create mode 100644 package/lean/luci-app-aliyundrive-webdav/root/usr/share/rpcd/acl.d/luci-app-aliyundrive-webdav.json diff --git a/package/lean/aliyundrive-webdav/Makefile b/package/lean/aliyundrive-webdav/Makefile index 8c5da36b9..0b65a0fa2 100644 --- a/package/lean/aliyundrive-webdav/Makefile +++ b/package/lean/aliyundrive-webdav/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=aliyundrive-webdav -PKG_VERSION:=1.1.1 +PKG_VERSION:=1.2.1 PKG_RELEASE:=$(AUTORELESE) PKG_LICENSE:=MIT diff --git a/package/lean/aliyundrive-webdav/files/aliyundrive-webdav.config b/package/lean/aliyundrive-webdav/files/aliyundrive-webdav.config index e5d041268..6c27837e2 100644 --- a/package/lean/aliyundrive-webdav/files/aliyundrive-webdav.config +++ b/package/lean/aliyundrive-webdav/files/aliyundrive-webdav.config @@ -13,3 +13,5 @@ config server option no_trash '0' option domain_id '' option read_only '0' + option tls_cert '' + option tls_key '' diff --git a/package/lean/aliyundrive-webdav/files/aliyundrive-webdav.init b/package/lean/aliyundrive-webdav/files/aliyundrive-webdav.init index b274edc26..8b1b1a107 100755 --- a/package/lean/aliyundrive-webdav/files/aliyundrive-webdav.init +++ b/package/lean/aliyundrive-webdav/files/aliyundrive-webdav.init @@ -26,6 +26,8 @@ start_service() { local port=$(uci_get_by_type server port 8080) local root=$(uci_get_by_type server root /) local domain_id=$(uci_get_by_type server domain_id) + local tls_cert=$(uci_get_by_type server tls_cert) + local tls_key=$(uci_get_by_type server tls_key) local extra_options="-I" @@ -47,6 +49,10 @@ start_service() { esac fi + if [[ ! -z "$tls_cert" && ! -z "$tls_key" ]]; then + extra_options="$extra_options --tls-cert $tls_cert --tls-key $tls_key" + fi + procd_open_instance procd_set_param command /bin/sh -c "/usr/bin/$NAME $extra_options --host $host --port $port --root $root -S $read_buf_size --cache-size $cache_size --cache-ttl $cache_ttl --workdir /var/run/$NAME >>/var/log/$NAME.log 2>&1" procd_set_param pidfile /var/run/$NAME.pid diff --git a/package/lean/luci-app-aliyundrive-webdav/Makefile b/package/lean/luci-app-aliyundrive-webdav/Makefile index e0076b14c..46113f9b1 100644 --- a/package/lean/luci-app-aliyundrive-webdav/Makefile +++ b/package/lean/luci-app-aliyundrive-webdav/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-aliyundrive-webdav -PKG_VERSION:=1.1.1 +PKG_VERSION:=1.2.1 PKG_RELEASE:=1 PKG_LICENSE:=MIT @@ -9,7 +9,7 @@ PKG_MAINTAINER:=messense LUCI_TITLE:=LuCI Support for aliyundrive-webdav LUCI_PKGARCH:=all -LUCI_DEPENDS:=+aliyundrive-webdav +lua +libuci-lua +LUCI_DEPENDS:=+aliyundrive-webdav include $(TOPDIR)/feeds/luci/luci.mk diff --git a/package/lean/luci-app-aliyundrive-webdav/luasrc/controller/aliyundrive-webdav.lua b/package/lean/luci-app-aliyundrive-webdav/luasrc/controller/aliyundrive-webdav.lua index 0829ad2a3..0426e3842 100644 --- a/package/lean/luci-app-aliyundrive-webdav/luasrc/controller/aliyundrive-webdav.lua +++ b/package/lean/luci-app-aliyundrive-webdav/luasrc/controller/aliyundrive-webdav.lua @@ -4,12 +4,17 @@ function index() if not nixio.fs.access("/etc/config/aliyundrive-webdav") then return end - entry({"admin", "services", "aliyundrive-webdav"}, alias("admin", "services", "aliyundrive-webdav", "client"),_("AliyunDrive WebDAV"), 10).dependent = true -- 首页 - entry({"admin", "services", "aliyundrive-webdav", "client"}, cbi("aliyundrive-webdav/client"),_("Settings"), 10).leaf = true -- 客户端配置 - entry({"admin", "services", "aliyundrive-webdav", "log"}, form("aliyundrive-webdav/log"),_("Log"), 30).leaf = true -- 日志页面 - entry({"admin", "services", "aliyundrive-webdav", "status"}, call("action_status")).leaf = true - entry({"admin", "services", "aliyundrive-webdav", "logtail"}, call("action_logtail")).leaf = true + local page + page = entry({"admin", "services", "aliyundrive-webdav"}, alias("admin", "services", "aliyundrive-webdav", "client"), _("AliyunDrive WebDAV"), 10) -- 首页 + page.dependent = true + page.acl_depends = { "luci-app-aliyundrive-webdav" } + + entry({"admin", "services", "aliyundrive-webdav", "client"}, cbi("aliyundrive-webdav/client"), _("Settings"), 10).leaf = true -- 客户端配置 + entry({"admin", "services", "aliyundrive-webdav", "log"}, form("aliyundrive-webdav/log"), _("Log"), 30).leaf = true -- 日志页面 + + entry({"admin", "services", "aliyundrive-webdav", "status"}, call("action_status")).leaf = true -- 运行状态 + entry({"admin", "services", "aliyundrive-webdav", "logtail"}, call("action_logtail")).leaf = true -- 日志采集 end function action_status() diff --git a/package/lean/luci-app-aliyundrive-webdav/luasrc/model/cbi/aliyundrive-webdav/client.lua b/package/lean/luci-app-aliyundrive-webdav/luasrc/model/cbi/aliyundrive-webdav/client.lua index ec6d324ea..3e72e2d5b 100644 --- a/package/lean/luci-app-aliyundrive-webdav/luasrc/model/cbi/aliyundrive-webdav/client.lua +++ b/package/lean/luci-app-aliyundrive-webdav/luasrc/model/cbi/aliyundrive-webdav/client.lua @@ -1,6 +1,3 @@ -local uci = luci.model.uci.cursor() -local m, e - m = Map("aliyundrive-webdav") m.title = translate("AliyunDrive WebDAV") m.description = translate("Project GitHub URL") @@ -28,6 +25,9 @@ port = e:option(Value, "port", translate("Port")) port.default = "8080" port.datatype = "port" +tls_cert = e:option(Value, "tls_cert", translate("TLS certificate file path")) +tls_key = e:option(Value, "tls_key", translate("TLS private key file path")) + auth_user = e:option(Value, "auth_user", translate("Username")) auth_password = e:option(Value, "auth_password", translate("Password")) auth_password.password = true diff --git a/package/lean/luci-app-aliyundrive-webdav/po/zh-cn/aliyundrive-webdav.po b/package/lean/luci-app-aliyundrive-webdav/po/zh-cn/aliyundrive-webdav.po index 84d8c5162..8c93882a3 100644 --- a/package/lean/luci-app-aliyundrive-webdav/po/zh-cn/aliyundrive-webdav.po +++ b/package/lean/luci-app-aliyundrive-webdav/po/zh-cn/aliyundrive-webdav.po @@ -22,6 +22,12 @@ msgstr "监听主机" msgid "Port" msgstr "监听端口" +msgid "TLS certificate file path" +msgstr "TLS 证书文件路径" + +msgid "TLS private key file path" +msgstr "TLS 私钥文件路径" + msgid "Username" msgstr "用户名" diff --git a/package/lean/luci-app-aliyundrive-webdav/po/zh_Hans b/package/lean/luci-app-aliyundrive-webdav/po/zh_Hans new file mode 120000 index 000000000..41451e4a1 --- /dev/null +++ b/package/lean/luci-app-aliyundrive-webdav/po/zh_Hans @@ -0,0 +1 @@ +zh-cn \ No newline at end of file diff --git a/package/lean/luci-app-aliyundrive-webdav/root/usr/share/rpcd/acl.d/luci-app-aliyundrive-webdav.json b/package/lean/luci-app-aliyundrive-webdav/root/usr/share/rpcd/acl.d/luci-app-aliyundrive-webdav.json new file mode 100644 index 000000000..31dec7f6e --- /dev/null +++ b/package/lean/luci-app-aliyundrive-webdav/root/usr/share/rpcd/acl.d/luci-app-aliyundrive-webdav.json @@ -0,0 +1,11 @@ +{ + "luci-app-aliyundrive-webdav": { + "description": "Grant UCI access for luci-app-aliyundrive-webdav", + "read": { + "uci": [ "aliyundrive-webdav" ] + }, + "write": { + "uci": [ "aliyundrive-webdav" ] + } + } +}