aboutsummaryrefslogtreecommitdiff
path: root/system/davfs2/MINI_HOWTO
blob: e7f6914f51bc15b0715caba3d3489e805f492362 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
HOW TO CONNECT WITH A WEBDAV SERVER WITH THE DAVF2 APPLICATION

In this HOWTO, the user is named "user"
Amend as required for your choice of username.

1. Login as root

2. Define a davfs2 group and user:

	# groupadd -g 230 davfs2
	# useradd -u 230 -d /var/cache/davfs2 -g davfs2 davfs2

3. If (and only if) you have a Slack64 install;
	# export ARCH=x86_64
   
4. You may want to set the Package type that you will build:
	# export PKGTYPE=txz

5. Build and install your package:
	# tar xvf  davfs2.tar.gz
	# cd davfs2
	# wget http://ftp.cc.uoc.gr/mirrors/nongnu.org/davfs2/davfs2-1.4.6.tar.gz
	# ./davfs.SlackBuild 
	# installpkg /tmp/davfs2-1.4.5-x86_64-2_SBo.txz

6. Add the user if not already defined. My user shall be called user, so:

	# adduser user
   
   Read the Slackbook for more details on adduser, choose default settings BUT:
   with the default group list add also davfs2:

	Press ENTER to continue without adding any additional groups
	Or press the UP arrow to add/select/edit additional groups
	:  audio cdrom floppy plugdev video power netdev davfs2

   If the user was already defined, then add davfs2 to the groups:
	
	# usermod -ga davfs2 user

7. Edit /etc/fstab with the following line:
	WEBDAV_SERVER_URL		mount_point		davfs	noauto,user	0	0
	
	For example:
	https://example.org/user	/home/user/mnt/dav   	davfs   noauto,user	0	0

8. logout

9. Login again as your davfs user ("user" in my case).

10. 	$ mkdir -p $HOME/.davfs2/certs/private/ $HOME/mnt/dav

11. Move the certificate to $HOME/davfs2/certs/private and restrict the permission to rw-------:
    For example:

	$ mv CERTIFICATE.pfx	$HOME/.davfs2/certs/private/
	$ chmod 600 $HOME/.davfs2/certs/private/CERIFICATE.pfx

12. Optionally: Switch user to root and copy the system configuration file. 
    Then change ownership to the davfs user and exit back to the davfs user. There 
    are a lot of interesting comments in these files that might be helpful.

	$ su -
	# cp /etc/davfs2/davfs2.conf ~user/.davfs2/
	# cp /etc/davfs2/secrets ~user/.davfs2/
	# chown -R user:users ~user/.davfs2/
	# exit

13. Edit $HOME/.davfs2/davfs2.conf with the following line:

	clientcert	~/.davfs2/certs/private/CERTIFICATE.pfx

   Read: 

	$ man davfs2.conf 

   for all the details and options. Tests have shown that you do not need more
   than the line above, but you may want to set many other interesting 
   parameters.

14. Edit $HOME/.davfs2/secrets with the following 2 lines:

	/home/user/mnt/dav		username	password
	CERTIFICATE.pfx			passphrase

    The username and password are relevant to the Webdav server, not for the
    local account.
    passphrase is the password for the PFX certificate
    You should obtain all these from the Webdav server Administrator

15. Restrict permssion for $HOME/.davfs2/secrets to rw-------:

 	$ chmod 600 $HOME/.davfs2/secrets

16. Mount the davfs service on $HOME/mnt/dav 

	$ mount https://example.org/user

    You should be able to see your WEBDAV server on $HOME/mnt/user 

17. When you would like to disconnect:

	$ umount $HOME/mnt/dav

    You should get a similar response (the pid number is random):

	/sbin/umount.davfs: waiting while mount.davfs (pid 5700) synchronizes the cache .. OK