rclone: fix configuration saving
authorLiangbin Lian <jjm2473@gmail.com>
Fri, 12 Apr 2024 03:43:46 +0000 (11:43 +0800)
committerTianling Shen <cnsztl@immortalwrt.org>
Fri, 13 Dec 2024 11:57:36 +0000 (19:57 +0800)
The following error occurs when creating storage configuration in WEBUI:
```
Failed to save config after 10 tries: failed to create temp file for new config: open /etc/rclone/rclone.conf4258227003: permission denied
```

we should set the owner of the parent directory of the configuration
file to rclone.

Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
[split chown command, wrap commit message]
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
net/rclone/Makefile
net/rclone/files/rclone.init

index b4b23a330e9af2cc8956c6105bcb0f673e5e4ae8..22786c5e484d650c97c23dc134805fe9a055b011 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=rclone
 PKG_VERSION:=1.68.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/rclone/rclone/tar.gz/v$(PKG_VERSION)?
index 276a3b1914858cb74b06a9c5edfd2e74032ea70d..29fe2f2d21d3e55b8a943e8ce0ea4881faac26a4 100755 (executable)
@@ -58,6 +58,7 @@ start_service() {
        local config_dir="${config_path%/*}"
        [ -d "$config_dir" ] || mkdir -p "$config_dir"
        touch "${config_path}"
+       chown rclone "${config_dir}"
        chown rclone "${config_path}"
 
        [ -d "/lib/upgrade/keep.d" ] || mkdir -p "/lib/upgrade/keep.d/"