Davfs2: Difference between revisions

From Newroco Tech Docs
Jump to navigationJump to search
No edit summary
No edit summary
Line 36: Line 36:
fusermount -u ~/nextcloud
fusermount -u ~/nextcloud
</pre>
</pre>
==Tips==
===Nextcloud with CAS auth===
If you want to connect to a Nextcloud server that has CAS auth enabled you'll need to tell davfs2 to send a header to NC so it doesn't redirect you to CAS
<pre>#vi /etc/davfs2/davfs2.conf
add_header noredir 1</pre>
No need to restart any service for this to be taken into consideration, '''BUT DO NOTE''' that the '''noredir''' option added is most probably restricted by IP on the http proxy so you'll need to check that and add your server's IP if not already.
==Troubleshooting==
==Troubleshooting==
If you get something like this when mounting '''/sbin/mount.davfs: warning: the server does not support locks''' then edit /etc/davfs2/davfs2.conf file and set '''use_locks 0'''
If you get something like this when mounting '''/sbin/mount.davfs: warning: the server does not support locks''' then edit /etc/davfs2/davfs2.conf file and set '''use_locks 0'''

Revision as of 08:01, 4 April 2023

Davfs2 allows you to access resources on a remote server like it would be a local disk, in this case nextcloud.

Install and configure davfs2

Install davfs2:

sudo apt-get install davfs2

Add yourself to davfs group:

sudo usermod -aG davfs2 <username>

Create a directory, and mount it:

mkdir ~/nextcloud
sudo mount -t davfs https://files.newro.co/remote.php/dav/files/<username>/ ~/nextcloud

After the mount you will be prompted for your username and password from nextcloud.

If you want to mount a specific folder from nextcloud simply add the path after <username>:

sudo mount -t davfs https://files.newro.co/remote.php/dav/files/<username>/My/Super/folder/Path ~/nextcloud


Please unmount the nextcloud directory when finished, makes it harder to scan for big directories in case a VM has storage issues. Plus, you're leaving your nextcloud files exposed to others.

You can unmount the directory like this:

umount ~/nextcloud

If that doesn't remove it use instead

fusermount -u ~/nextcloud

Tips

Nextcloud with CAS auth

If you want to connect to a Nextcloud server that has CAS auth enabled you'll need to tell davfs2 to send a header to NC so it doesn't redirect you to CAS

#vi /etc/davfs2/davfs2.conf

add_header noredir 1

No need to restart any service for this to be taken into consideration, BUT DO NOTE that the noredir option added is most probably restricted by IP on the http proxy so you'll need to check that and add your server's IP if not already.

Troubleshooting

If you get something like this when mounting /sbin/mount.davfs: warning: the server does not support locks then edit /etc/davfs2/davfs2.conf file and set use_locks 0