Serve webdav for multi-user with one configuration file

I used rclone to build a home webdav server, at first everyone shared one account and same directory, but then I found that everyone should have their own account and exclusive directory, so I created several htpasswd files and systemd services, every service with different port is proxy by nginx finally, it works fine, but it is very troublesome to stop and start several services every time when maintaining.
And if I want to add more webdav services later, such as creating dedicated accounts and directories for some applications, I will need to create more systemd services. which is really desperate.

I want to know if there is such a way, for example, I write a json file /home/<MYUSERNAME>/rclone/conf/webdav.json like this:

[{
"addr":12321,
"dir“:"/mnt/data_share/webdav_user_1/",
"baseurl":"/webdav_user_1",
"htpasswd":"/home/<MYUSERNAME>/rclone/auth/user_1"
},
{
"addr":12322,
"dir“:"/mnt/data_share/webdav_user_2/",
"baseurl":"/webdav_user_2",
"htpasswd":"/home/<MYUSERNAME>/rclone/auth/user_2"
},
...
{
"addr":12324,
"dir“:"/mnt/data_share/webdav_user_4/",
"baseurl":"/webdav_user_4",
"htpasswd":"/home/<MYUSERNAME>/rclone/auth/user_4"
},
]

then use command:

rclone serve webdav --conf “/home/<MYUSERNAME>/rclone/conf/webdav.json”

rclone will start multiple webdav services based on the configuration file.

Can this be done? Thanks!

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.