mgutt Posted March 5, 2021 Share Posted March 5, 2021 Overview: Support for my Apache WebDAV container (forked from bytemark) Docker: https://hub.docker.com/r/apachewebdav/apachewebdav Github: https://github.com/mgutt/docker-apachewebdav This is a very simple WebDAV server. To upload files you need to use a WebDAV client like Filezilla, Nextcloud, CyberDuck, WinSCP, Nautilus, ... or you could even mount it in Windows. Read the following post to add multiple logins or allow files downloads by guests. Donate? Paypal or Github 🤗 Quote Link to comment
mgutt Posted March 5, 2021 Author Share Posted March 5, 2021 Multi-user setup Specifying USERNAME and PASSWORD only supports a single user. If you want to have lots of different logins for various users, bind mount user.passwd as follows: Open the Unraid WebTerminal >_ and execute the following: mkdir /mnt/user/appdata/apachewebdav && touch /mnt/user/appdata/apachewebdav/user.passwd Edit the container, scroll down and click on to add a new Path as follows: Container Path: /user.passwd Host Path: /mnt/user/appdata/apachewebdav/user.passwd Screenshot: After starting the container, click on the container icon and open its console and execute the following for "Basic" authentification by changing "John" to your username: htpasswd -B /user.passwd John or this if you choosed "Digest" authentification: htdigest user.passwd WebDAV-Login John Execute the command multiple times with different usernames to add more users. Access files without login If you like to allow guests (without login) to download files, you can add "GET" as a public method: Quote Link to comment
benediktleb Posted March 6, 2021 Share Posted March 6, 2021 (edited) Hi Marc, just what I needed, thank you so much! I was able to get the docker to boot, although it only worked with leaving server name blank (wouldn't take my server's IP). But that's fine. What I'm having problems with is I think permissions: the WebDAV WebUI (but also when connected through a client) shows no files, but "Container Path: /var/lib/dav" points towards one that is populated with many files and folders. I already ran the Docker Permission tool but that didn't help. Did you run into the same problem by any chance? I'm looking into it now, but wanted to leave this comment here already. Thanks so much again! All the best, Benedikt Edited March 6, 2021 by benediktleb Quote Link to comment
kennymc.c Posted March 8, 2021 Share Posted March 8, 2021 (edited) When I try to start the container it immediately stops after creating the username and privkey.pem with this error: httpd: Syntax error on line 159 of /usr/local/apache2/conf/httpd.conf: Cannot load modules/mod_ssl.so into server: Error relocating /usr/local/apache2/modules/mod_ssl.so: SSL_CTX_set_post_handshake_auth: symbol not found Enable SSL is set to selfsigned I noticed that the image hasn't been updated for over 2 years. Could this lead to security issues? Edit: @mgutt This image will not work with SSL enabled according to https://github.com/BytemarkHosting/docker-webdav/issues/5. I'm now using the k3vmcd/webdav fork instead which fixes this problem. Edited March 11, 2021 by kennymc.c Quote Link to comment
jinlife Posted March 12, 2021 Share Posted March 12, 2021 Same issue when use SSL with selfsigned. It should use the httpd:2.4.35-alpine https://github.com/BytemarkHosting/docker-webdav/issues/5 Quote Link to comment
Tidus Posted July 7, 2021 Share Posted July 7, 2021 Hi Mgutt! Thanks a lot. But I encountered a problem. After I edit a file (for example an Excel file) by opening it through webdav, I can only open the same file with READ ONLY mode when I come back home where my unRaid server is through smb. Could you please tell me why and how to fix it? Thank you so much! Quote Link to comment
mgutt Posted July 9, 2021 Author Share Posted July 9, 2021 On 7/7/2021 at 4:09 AM, Tidus said: Could you please tell me why and how to fix it? This happens because this container uses different user / group ids for the files than the Unraid defaults. It was a bad decision from me to use this container. The same is valid for @kennymc.c chosen container. I think I will update the template and use this one in the next release: https://github.com/noodlefighter/docker-webdav He was the last user who posted an udpate (pull request) for bytemark's container: https://github.com/BytemarkHosting/docker-webdav/pulls Quote Link to comment
mgutt Posted July 9, 2021 Author Share Posted July 9, 2021 Ok, I found a docker container which uses noodlefighter's last pull request: https://hub.docker.com/r/shouya/docker-webdav I updated the Unraid template accordingly. It should be online in the Unraid Apps in around 2 hours. It should support SSL certificates and set correct UID and GID for uploaded files. Quote Link to comment
Tidus Posted July 10, 2021 Share Posted July 10, 2021 22 hours ago, mgutt said: Ok, I found a docker container which uses noodlefighter's last pull request: https://hub.docker.com/r/shouya/docker-webdav I updated the Unraid template accordingly. It should be online in the Unraid Apps in around 2 hours. It should support SSL certificates and set correct UID and GID for uploaded files. Thank you so much for your kind effort. I tried just now and the problem has perfectly solved. But it seems there is another problem: I specified the share path for this container as above: /mnt/user/Documents/ When I log in through webdav remotely, I did have access to the webdav server, but it was empty. Then I carefully checked everything and found that it seemed that this container created a new folder (/mnt/user/Documents/data) under Documents where I specified, which means that I can only have access to /mnt/user/Documents/data instead of what I specified (/mnt/user/Documents/) I'll be so grateful if you may tell me how to fix it. I do need to have access to /mnt/user/Documents/ through webdav. Thank you so much! Quote Link to comment
mgutt Posted July 10, 2021 Author Share Posted July 10, 2021 8 minutes ago, Tidus said: I'll be so grateful if you may tell me how to fix it. Usually this is not provided, but I solved it by adding two different mounts: This means /mnt/user/webdav or in your case /mnt/user/Documents is linked to /var/lib/dav/data and the parent dir /var/lib/dav is linked to /mnt/user/appdata/webdav. But there is still a problem: If I create a file through SMB in the directory /mnt/user/webdav, it has the correct user "marc" and chmod 666, but if I upload a file through a WebDAV client (Filezilla Pro) which uses the Docker itself, the file has the correct user "nobody", but the chmod is only 644 which disallows "marc" to edit the file: @ich777 Do you have a hint for me to solve this or is this related to the container's source code? Quote Link to comment
Tidus Posted July 11, 2021 Share Posted July 11, 2021 8 hours ago, mgutt said: Usually this is not provided, but I solved it by adding two different mounts: This means /mnt/user/webdav or in your case /mnt/user/Documents is linked to /var/lib/dav/data and the parent dir /var/lib/dav is linked to /mnt/user/appdata/webdav. But there is still a problem: If I create a file through SMB in the directory /mnt/user/webdav, it has the correct user "marc" and chmod 666, but if I upload a file through a WebDAV client (Filezilla Pro) which uses the Docker itself, the file has the correct user "nobody", but the chmod is only 644 which disallows "marc" to edit the file: @ich777 Do you have a hint for me to solve this or is this related to the container's source code? Thank you sooo much for your kind help! I've already solved my problem by changing the path, linking /var/lib/dav/data to the dir I needed. But I ignored the other mount "Config" you mentioned aboved. I don't know why but it seemed everything is fine up to now. I have the access to my webDAV and the dir is what I specified (I don't want to have access to all the files in my NAS through this webDAV so I did need to specify the very dir). I know nothing about coding but everything now is perfect for me. Thank you once again for your kind help! Quote Link to comment
ich777 Posted July 11, 2021 Share Posted July 11, 2021 9 hours ago, mgutt said: @ich777 Do you have a hint for me to solve this or is this related to the container's source code? Looked trough the code and see nothing suspicious. May I ask why the file that you uploaded is dedicated to the user "marc" shouldn't files that are uploaded to unRAID through samba also have the user nobody? Quote Link to comment
mgutt Posted July 11, 2021 Author Share Posted July 11, 2021 25 minutes ago, ich777 said: shouldn't files that are uploaded to unRAID through samba also have the user nobody? As of my experience, this is the usual behavior if the SMB share is set to private?! Quote Link to comment
ich777 Posted July 11, 2021 Share Posted July 11, 2021 34 minutes ago, mgutt said: As of my experience, this is the usual behavior if the SMB share is set to private?! You are completely right. I will have to take a look later on an report back. EDIT: One thought about that, can't be a UMASK value implemented in the container or is this value ignored from WebDAV? Quote Link to comment
mgutt Posted July 11, 2021 Author Share Posted July 11, 2021 17 minutes ago, ich777 said: can't be a UMASK value implemented in the container Maybe this is the default UMASK of apache and I need to add a different one. Found this example: https://askubuntu.com/a/250748 Will try it later. 1 Quote Link to comment
mgutt Posted July 12, 2021 Author Share Posted July 12, 2021 @ich777 I've added a path as follows: I added "umask 000" to the envvars file. I checked it inside the container and it has the correct content: But after deleting and re-uploading a file through Filezilla (WebDAV) it still has 644: And its the only envvars file in this container 🤷♂️ The default umask of the terminal is still 0022 as well: I've tried to set umask through a shell command, but it has no effect: Test: It seems only be possible through the docker-entrypoint.sh. Is it possible to change / add something to this file without being the container maintainer? Quote Link to comment
ich777 Posted July 12, 2021 Share Posted July 12, 2021 4 minutes ago, mgutt said: It seems only be possible through the docker-entrypoint.sh. Is it possible to change / add something to this file without being the container maintainer? No, that is not possible, at least not to make it permanent. You can edit the file inside the container with nano or vi and test if everthing is working after a container restart and then create a Github issue on the maintainers Github if he can actually implement this to his container. Quote Link to comment
mgutt Posted July 12, 2021 Author Share Posted July 12, 2021 37 minutes ago, ich777 said: No, that is not possible After investigating further, I throught it should be possible by using the --entrypoint flag: I copied the file and added "chmod +x", but the container directly crashes (after successful start) without any errors in the logs: Usually it looks like this: 37 minutes ago, ich777 said: You can edit the file inside the container with nano or vi and test if everthing is working after a container restart nano etc was not available. But I was successful by doing this: sed -i "$ d" /usr/local/bin/docker-entrypoint.sh echo "umask 0000" >> /usr/local/bin/docker-entrypoint.sh echo 'exec "[email protected]"' >> /usr/local/bin/docker-entrypoint.sh Now it's correct: Now I tried it by opening a pull request. I hope the user is still active and accepts it. 1 Quote Link to comment
ich777 Posted July 13, 2021 Share Posted July 13, 2021 15 hours ago, mgutt said: After investigating further, I throught it should be possible by using the --entrypoint flag: Yes, but this is a workaround and I don't recommend to do it that way because if the maintainer changes something trivial to his container it could of course break the workaround itself and the function of the container. 15 hours ago, mgutt said: nano etc was not available. But I was successful by doing this: But you should be able to install it inside the container for testing purpouses as in a normal Linux environment. 15 hours ago, mgutt said: Now I tried it by opening a pull request. I hope the user is still active and accepts it. I also hope so, I think everyone would benefit from this. Eventually another idea is to put a ENV in the Dockerfile for the UMASK value and then set it in the entrypoint so that if someone needs it he can actually change the value with a variable for the container. Dockerfile: ENV UMASK=0000 Entrypoint: umask ${UMASK} Quote Link to comment
poobahuk Posted August 3, 2021 Share Posted August 3, 2021 (edited) I've recently migrated to Unraid from Synology, and I've been looking for an Unraid equivalent solution to DS FIle on iOS for remote file management. The critical stumbling block was avoiding a download to the iOS device during file copy between shares. I'm not sure how far I am from intended purpose, but I now have it working with this container and the Documents app on iOS. To achieve my goal I've had to: 1. Disable SSL with the 'Digest' variable, but I only connect via Wireguard tunnel, so I'm assuming this is safe enough. 2. Set the WebDav Share to /mnt/usr/ Firstly, if this continues to work as well as I think it does, thank you very much, please keep this container alive! But perhaps more importantly, aside from the risk of my accidental deletion of all shares....can you tell me of any fundemental issues with this approach? Edited August 3, 2021 by poobahuk missing info/typo Quote Link to comment
mgutt Posted August 11, 2021 Author Share Posted August 11, 2021 As the maintainers bytemark and noodlefighter are not active anymore, I created a new repository and included most of the open pull requests: https://github.com/mgutt/docker-apachewebdav https://hub.docker.com/r/apachewebdav/apachewebdav In addition I changed the look of the WebUI by enabling Icons and switching to an HTML table: With more effort it would be possible to realize something similar to this project: https://github.com/jmlemetayer/abba If anyone is interested in this, then let me know. 2 1 Quote Link to comment
htkoca Posted August 21, 2021 Share Posted August 21, 2021 On 8/11/2021 at 7:14 AM, mgutt said: As the maintainers bytemark and noodlefighter are not active anymore, I created a new repository and included most of the open pull requests: https://github.com/mgutt/docker-apachewebdav https://hub.docker.com/r/apachewebdav/apachewebdav In addition I changed the look of the WebUI by enabling Icons and switching to an HTML table: ... With more effort it would be possible to realize something similar to this project: https://github.com/jmlemetayer/abba ,,, If anyone is interested in this, then let me know. This is pretty spectacular. I am not an unraid user but this image is very useful to me (who hosts webdav through docker on my linux server). Thanks for your work in assembling this 1 Quote Link to comment
laniv Posted November 24, 2021 Share Posted November 24, 2021 你好,感谢开发出这么好的软件。 我在使用 多用户 的时候,创建了 用户id 但是登陆后提示下面的错误: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error. More information about this error may be available in the server error log. 求助下,这个问题怎么解决? Quote Link to comment
laniv Posted November 24, 2021 Share Posted November 24, 2021 你好,感谢开发出这么好的软件。 我在使用 多用户 的时候,创建了 用户id 但是登陆后提示下面的错误: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error. More information about this error may be available in the server error log. 求助下,这个问题怎么解决? Quote Link to comment
Hime0698 Posted March 29, 2022 Share Posted March 29, 2022 Is there a way to create a user that only has access to certain folders? Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.