From aa38a460b6da9d9e3ab6004bb54a94def44d6adf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 16 Jul 2022 23:41:36 +0800 Subject: [PATCH] update 2022-07-16 23:41:36 --- aliyundrive-webdav/Makefile | 2 +- aliyundrive-webdav/files/aliyundrive-webdav.config | 2 ++ aliyundrive-webdav/files/aliyundrive-webdav.init | 12 ++++++++++-- luci-app-aliyundrive-webdav/Makefile | 2 +- .../luasrc/model/cbi/aliyundrive-webdav/client.lua | 8 ++++++++ .../po/zh-cn/aliyundrive-webdav.po | 9 +++++++++ 6 files changed, 31 insertions(+), 4 deletions(-) diff --git a/aliyundrive-webdav/Makefile b/aliyundrive-webdav/Makefile index c0a1b174a..4d439131c 100644 --- a/aliyundrive-webdav/Makefile +++ b/aliyundrive-webdav/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=aliyundrive-webdav -PKG_VERSION:=1.7.4 +PKG_VERSION:=1.8.0 PKG_RELEASE:=$(AUTORELEASE) PKG_LICENSE:=MIT diff --git a/aliyundrive-webdav/files/aliyundrive-webdav.config b/aliyundrive-webdav/files/aliyundrive-webdav.config index 6c27837e2..8b94b9810 100644 --- a/aliyundrive-webdav/files/aliyundrive-webdav.config +++ b/aliyundrive-webdav/files/aliyundrive-webdav.config @@ -7,6 +7,7 @@ config server option auth_user '' option auth_password '' option read_buffer_size '10485760' + option upload_buffer_size '16777216' option cache_size '1000' option cache_ttl '600' option root '/' @@ -15,3 +16,4 @@ config server option read_only '0' option tls_cert '' option tls_key '' + option skip_upload_same_size '0' diff --git a/aliyundrive-webdav/files/aliyundrive-webdav.init b/aliyundrive-webdav/files/aliyundrive-webdav.init index 8b1b1a107..b3e8222d1 100755 --- a/aliyundrive-webdav/files/aliyundrive-webdav.init +++ b/aliyundrive-webdav/files/aliyundrive-webdav.init @@ -20,6 +20,7 @@ start_service() { local auth_user=$(uci_get_by_type server auth_user) local auth_password=$(uci_get_by_type server auth_password) local read_buf_size=$(uci_get_by_type server read_buffer_size 10485760) + local upload_buf_size=$(uci_get_by_type server upload_buffer_size 16777216) 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) @@ -29,7 +30,7 @@ start_service() { local tls_cert=$(uci_get_by_type server tls_cert) local tls_key=$(uci_get_by_type server tls_key) - local extra_options="-I" + local extra_options="--auto-index" if [[ ! -z "$domain_id" ]]; then extra_options="$extra_options --domain-id $domain_id" @@ -47,6 +48,13 @@ start_service() { ;; *) ;; esac + + case "$(uci_get_by_type server skip_upload_same_size 0)" in + 1|on|true|yes|enabled) + extra_options="$extra_options --skip-upload-same-size" + ;; + *) ;; + esac fi if [[ ! -z "$tls_cert" && ! -z "$tls_key" ]]; then @@ -54,7 +62,7 @@ start_service() { 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 command /bin/sh -c "/usr/bin/$NAME $extra_options --host $host --port $port --root $root --read-buffer-size $read_buf_size --upload-buffer-size $upload_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" diff --git a/luci-app-aliyundrive-webdav/Makefile b/luci-app-aliyundrive-webdav/Makefile index bdd83e529..30ff2e18a 100644 --- a/luci-app-aliyundrive-webdav/Makefile +++ b/luci-app-aliyundrive-webdav/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-aliyundrive-webdav -PKG_VERSION:=1.7.4 +PKG_VERSION:=1.8.0 PKG_RELEASE:=1 PKG_PO_VERSION:=$(PKG_VERSION)-$(PKG_RELEASE) diff --git a/luci-app-aliyundrive-webdav/luasrc/model/cbi/aliyundrive-webdav/client.lua b/luci-app-aliyundrive-webdav/luasrc/model/cbi/aliyundrive-webdav/client.lua index 39931e586..a27ded434 100644 --- a/luci-app-aliyundrive-webdav/luasrc/model/cbi/aliyundrive-webdav/client.lua +++ b/luci-app-aliyundrive-webdav/luasrc/model/cbi/aliyundrive-webdav/client.lua @@ -40,6 +40,14 @@ read_buffer_size = e:option(Value, "read_buffer_size", translate("Read Buffer Si read_buffer_size.default = "10485760" read_buffer_size.datatype = "uinteger" +upload_buffer_size = e:option(Value, "upload_buffer_size", translate("Upload Buffer Size")) +upload_buffer_size.default = "16777216" +upload_buffer_size.datatype = "uinteger" + +skip_upload_same_size = e:option(Flag, "skip_upload_same_size", translate("Skip uploading same size files")) +skip_upload_same_size.description = translate("Reduce the upload traffic by skipping uploading files with the same size") +skip_upload_same_size.rmempty = false + cache_size = e:option(Value, "cache_size", translate("Cache Size")) cache_size.default = "1000" cache_size.datatype = "uinteger" diff --git a/luci-app-aliyundrive-webdav/po/zh-cn/aliyundrive-webdav.po b/luci-app-aliyundrive-webdav/po/zh-cn/aliyundrive-webdav.po index 103fe7c85..de950faa9 100644 --- a/luci-app-aliyundrive-webdav/po/zh-cn/aliyundrive-webdav.po +++ b/luci-app-aliyundrive-webdav/po/zh-cn/aliyundrive-webdav.po @@ -37,6 +37,9 @@ msgstr "密码" msgid "Read Buffer Size" msgstr "下载缓冲大小(bytes)" +msgid "Upload Buffer Size" +msgstr "上传缓冲大小(bytes)" + msgid "Cache Size" msgstr "目录缓存大小" @@ -84,3 +87,9 @@ msgstr "阿里云相册与云盘服务 domainId" msgid "Input domain_id option will use Aliyun PDS instead of AliyunDrive" msgstr "填写此选项将使用阿里云相册与网盘服务而不是阿里云盘" + +msgid "Skip uploading same size files" +msgstr "跳过上传相同大小的文件" + +msgid "Reduce the upload traffic by skipping uploading files with the same size" +msgstr "跳过上传相同大小的文件减少上传流量消耗,但可能会导致修改过的同样大小的文件不会被上传"