From 280c1478f157362be875e48e0fe4540e35f44f3f Mon Sep 17 00:00:00 2001 From: Beginner <70857188+Beginner-Go@users.noreply.github.com> Date: Tue, 19 Oct 2021 22:51:14 +0800 Subject: [PATCH] luci-app-aliyundrive-webdav: update to 0.4.7 (#8084) Co-authored-by: messense --- package/lean/aliyundrive-webdav/Makefile | 4 ++-- .../files/aliyundrive-webdav.config | 2 ++ .../files/aliyundrive-webdav.init | 14 ++++++++++++-- package/lean/luci-app-aliyundrive-webdav/Makefile | 2 +- .../luasrc/model/cbi/aliyundrive-webdav/client.lua | 14 +++++++++----- .../po/zh-cn/aliyundrive-webdav.po | 11 ++++++++++- 6 files changed, 36 insertions(+), 11 deletions(-) diff --git a/package/lean/aliyundrive-webdav/Makefile b/package/lean/aliyundrive-webdav/Makefile index 6bce290e8..b93c2f89c 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:=0.4.0 +PKG_VERSION:=0.4.7 PKG_RELEASE:=1 PKG_LICENSE:=MIT @@ -22,7 +22,7 @@ ifeq ($(ARCH),i386) PKG_ARCH:=i686 endif -PKG_SOURCE:=aliyundrive-webdav-$(PKG_ARCH)-unknown-linux-$(PKG_LIBC).tar.gz +PKG_SOURCE:=aliyundrive-webdav-v$(PKG_VERSION).$(PKG_ARCH)-unknown-linux-$(PKG_LIBC).tar.gz PKG_SOURCE_URL:=https://github.com/messense/aliyundrive-webdav/releases/download/v$(PKG_VERSION)/ PKG_HASH:=skip diff --git a/package/lean/aliyundrive-webdav/files/aliyundrive-webdav.config b/package/lean/aliyundrive-webdav/files/aliyundrive-webdav.config index 74248f63e..cc9ce6016 100644 --- a/package/lean/aliyundrive-webdav/files/aliyundrive-webdav.config +++ b/package/lean/aliyundrive-webdav/files/aliyundrive-webdav.config @@ -8,4 +8,6 @@ config server option auth_password '' option read_buffer_size '10485760' option cache_size '1000' + option cache_ttl '600' option root '/' + option no_trash '0' diff --git a/package/lean/aliyundrive-webdav/files/aliyundrive-webdav.init b/package/lean/aliyundrive-webdav/files/aliyundrive-webdav.init index 6a5212653..f762e46dd 100755 --- a/package/lean/aliyundrive-webdav/files/aliyundrive-webdav.init +++ b/package/lean/aliyundrive-webdav/files/aliyundrive-webdav.init @@ -21,12 +21,22 @@ start_service() { local auth_password=$(uci_get_by_type server auth_password) local read_buf_size=$(uci_get_by_type server read_buffer_size 10485760) local cache_size=$(uci_get_by_type server cache_size 1000) + local cache_ttl=$(uci_get_by_type server cache_ttl 600) local host=$(uci_get_by_type server host 127.0.0.1) local port=$(uci_get_by_type server port 8080) local root=$(uci_get_by_type server root /) + local no_trash=$(uci_get_by_type server no_trash 0) + + local extra_options="-I" + case "$no_trash" in + 1|on|true|yes|enabled) + extra_options="$extra_options --no-trash" + ;; + *) ;; + esac procd_open_instance - procd_set_param command /bin/sh -c "/usr/bin/$NAME -I --host $host --port $port --root $root -S $read_buf_size --cache-size $cache_size --workdir /var/run/$NAME >>/var/log/$NAME.log 2>&1" + 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 procd_set_param env REFRESH_TOKEN="$refresh_token" [[ ! -z "$auth_user" ]] && procd_append_param env WEBDAV_AUTH_USER="$auth_user" @@ -43,5 +53,5 @@ start_service() { } service_triggers() { - procd_add_reload_trigger "/etc/config/$NAME" + procd_add_reload_trigger "aliyundrive-webdav" } diff --git a/package/lean/luci-app-aliyundrive-webdav/Makefile b/package/lean/luci-app-aliyundrive-webdav/Makefile index a36cb36a5..3bd6a49a6 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:=0.4.0 +PKG_VERSION:=0.4.7 PKG_RELEASE:=1 PKG_LICENSE:=MIT 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 98c319db5..bc9f7cf3d 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 @@ -15,7 +15,8 @@ enable.rmempty = false refresh_token = e:option(Value, "refresh_token", translate("Refresh Token"), translate("How to get refresh token")) -root = e:option(Value, "root", translate("Root Directory")) +root = e:option(Value, "root", translate("Root Directory"), + translate("Restrict access to a folder of aliyundrive, defaults to / which means no restrictions")) root.default = "/" host = e:option(Value, "host", translate("Host")) @@ -38,11 +39,14 @@ cache_size = e:option(Value, "cache_size", translate("Cache Size")) cache_size.default = "1000" cache_size.datatype = "uinteger" +cache_ttl = e:option(Value, "cache_ttl", translate("Cache Expiration Time (seconds)")) +cache_ttl.default = "600" +cache_ttl.datatype = "uinteger" + +no_trash = e:option(Flag, "no_trash", translate("Delete file permanently instead of trashing")) +no_trash.rmempty = false + debug = e:option(Flag, "debug", translate("Debug Mode")) debug.rmempty = false -local e = luci.http.formvalue("cbi.apply") -if e then - io.popen("/etc/init.d/aliyundrive-webdav restart") -end return m 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 95347df5c..f0bf4e284 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 @@ -14,7 +14,7 @@ msgid "Refresh Token" msgstr "Refresh Token" msgid "Root Directory" -msgstr "根目录" +msgstr "云盘根目录" msgid "Host" msgstr "监听主机" @@ -34,6 +34,9 @@ msgstr "下载缓冲大小(bytes)" msgid "Cache Size" msgstr "目录缓存大小" +msgid "Cache Expiration Time (seconds)" +msgstr "目录缓存过期时间(单位为秒)" + msgid "Collecting data..." msgstr "获取数据中..." @@ -57,3 +60,9 @@ msgstr "How to get refresh token" msgstr "查看获取 refresh token 的方法" + +msgid "Restrict access to a folder of aliyundrive, defaults to / which means no restrictions" +msgstr "限制只能访问该云盘目录,默认为 / 表示不限制,注意这个参数不是本地磁盘路径" + +msgid "Delete file permanently instead of trashing" +msgstr "删除文件不放入回收站"