Unclear how to get WebDAV running

I’m trying to enable the WebDAV extension. I’m running seaf-server 8.0.8 on NixOS. A couple of things are unclear to me:

  • Where is the seafdav.conf file supposed to go? NixOS puts all the other conf files in /etc/seafile but the manual states that for some reason seafdav.conf needs to go in the installation folder? That folder is read-only in NixOS. When putting seafdav.conf in /etc/seafile, I don’t see WebDAV listening in netstat so that doesn’t seem to work. I also tried /etc/seafile/conf/seafdav.conf without success.
  • You can specify the port but not the host? Will it use the host in seafile.conf under [fileserver]?
  • The docs say that I need to modify share_name if I deploy behind nginx (which I do). But… to what? I don’t want to WebDAV just into one single share.

Content of /etc/seafile/seafdav.conf is

[WEBDAV]
enabled = true
port = 8032
share_name = /
workers = 5
timeout = 1200

You should find official instructions here : https://manual.seafile.com/extension/webdav/

I’m trying to follow those but as I described, they tell me to place the config file in the installation folder and I can’t do that since it’s read-only. I tried figuring out whether seaf-server takes command line arguments to tell it where the config files are located but it neither has a manpage nor accepts -h and the manual is silent on this issue.

Edit: I see that NixOS’ config starts seaf-server with

-F /etc/seafile

I didn’t find any docs on that option but since the other config files are located there, I assume seafdav.conf should also be there. However placing it there does not lead to WebDAV listening on the specified port.

Hi flyx

You seem to have installed seafile inside the /etc folder, which I have never done and I am not sure if that is a good idea or causes any issues.

In any case let me try and help.

→ The correct seafdav.conf should be the one in /etc/seafile/conf/seafdav.conf
→ It will use the host from seafile.conf, e.g. https://example.seafile.com
→ It requires a share name, e.g. https://example.seafile.com/webdav

Now this share name in seafdav (e.g. /webdav) needs to work together with your nginx config.
Something like below.

seafdav.conf:

[WEBDAV]
enabled = true
port = 8080
share_name = /webdav

conf file in nginx:

location /webdav {
proxy_pass http://127.0.0.1:8080/webdav;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 1200s;
client_max_body_size 0;
proxy_request_buffering off;

   access_log      /var/log/nginx/seafdav.access.log;
   error_log       /var/log/nginx/seafdav.error.log;

}

The webdav server should then be accessible under https://example.seafile.com/webdav

I hope that gives you the right direction.

Thanks for this detailed answer.

I do not have installed seafile in /etc. For reference, NixOS installs it in /nix/store/p8b44145a5v7xziyp0h8rsiz3qpx5vrx-seafile-server-8.0.8 but that shouldn’t matter. I believe the -F /etc/seafile argument causes the server to look for the config files in /etc/seafile.

I have already setup nginx with a /seafdav location and added this as share_name. However the nginx config will only become relevant after I succeeded in getting seafile to listen to the given WebDAV port in the first place, which currently isn’t the case. netstat shows

tcp        0      0 127.0.0.1:8031          0.0.0.0:*               LISTEN      108432/seaf-server

for the server, but the WebDAV listener at configured port 8032 is missing. I can guess two possible reasons:

  • seafdav.conf isn’t read from the folder given with -F and needs a separate command line option. I failed to find docs on this.
  • seafdav doesn’t use the proper host. If it simply uses the host from [fileserver] config, it should be 127.0.0.1 but I haven’t found any docs on this either.

Hi flyx

I am sorry but I don’t know NixOS and couldn’t really help you with this specific item.
The only thing that looks wrong to me is that the conf file is looked for in /etc/seafile. It should be /etc/seafile/conf

My seafile folder lhas the following content:

@~> ls -l seafile
ccnet/
conf/
logs/
pids/
seafile-data/
seafile-server-9.0.4/
seafile-server-latest → seafile-server-9.0.4/

And the seafile/conf folder has this content:

~> ls -l seafile/conf/
ccnet.conf
gunicorn.conf.py
pycache/
seafdav.conf
seafile.conf
seahub_settings.py*

I don’t think my NixOS setup is relevant for this issue. The admin manual seems to assume I download the release from seafile instead of using a package manager, so these issues will probably arise with any package manager.

All the other configs are directly under /etc/seafile and they work fine:

~> ls -l /etc/seafile
total 0
lrwxrwxrwx 1 root root 30 May  5 11:04 ccnet.conf -> /etc/static/seafile/ccnet.conf
lrwxrwxrwx 1 root root 32 May  5 11:04 seafdav.conf -> /etc/static/seafile/seafdav.conf
lrwxrwxrwx 1 root root 32 May  5 11:04 seafile.conf -> /etc/static/seafile/seafile.conf
lrwxrwxrwx 1 root root 38 May  5 11:04 seahub_settings.py -> /etc/static/seafile/seahub_settings.py

(The symlinks are just an artefact from NixOS building the system config from declarative input.)

My systemd service for seahub does this:

ExecStart=/nix/store/i65vw40j6ngzbs57hngkv0dac3zhqsyn-python3.9-gunicorn-20.1.0/bin/gunicorn seahub.wsgi:application \
--name seahub \
--workers 4 \
--log-level=info \
--preload \
--timeout=1200 \
--limit-request-line=8190 \
--bind unix:/run/seahub/gunicorn.sock

Since the WebDAV manual mentions gunicorn, do I need to give similar config to seaf-server that is currently missing? seaf-server.service is:

ExecStart=/nix/store/ygi22wlcrfbhl7cnkx1akscm75v2cpil-seafile-server-8.0.8/bin/seaf-server \
--foreground \
-F /etc/seafile \
-c /var/lib/seafile/ccnet \
-d /var/lib/seafile/data \
-l /var/log/seafile/server.log \
-P /run/seafile/server.pid \
-p /run/seafile

Sorry flyx - I am out :slight_smile:

I am not good enough with these things, I am just relatively experienced with setting up Seafile on normal Ubuntu.

I hope someone else can help you,

Chris

I finally figured this out: seafdav is a completely separate application. Neither seafile-server nor seahub will read the seafdav.conf file or act on it. The seafdav application is not packaged in NixOS which is why I didn’t find any information on it. The solution is packaging it, which I am doing now.

Thanks to everyone who commented.

Hi,
maybe I can jump on this one to get my SeafDAV running. It is a new installation, hasn’t been running before. This is my seafdav.conf which I collected together mostly from the manual:

[WEBDAV]
enabled = true
port = 8080
fastcgi = false
share_name = /seafdav
workers = 5
timeout = 1200
show_repo_id = true

nginx in proxy mode has the corresponding share_name so as a result I can access SeafDAV backend via browser:

Screenshot 2022-06-08 at 10.05.31

Which is great, it confirms config is okay. I also created a couple users with DAV passwords, which are different from seafile passwords for some reason. Entering user/pw always gives me 401 Access not authorized.

What’s wrong? What else needs to be done to get SeafDAV working? Are there additional steps neccessary the manual is omitting?

In regard to the 401, the logfile(s) aren’t very helpful:

In seafdav.access.log one entry per request
- 10.0.2.11 [08/Jun/2022:10:05:13 +0200] "GET /seafdav HTTP/1.1" 401 139 "-" "Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0" 0.009

In seafdav.error.log no single character stopped by so far.

@stuntmanray Where do you set „DAV passwords“? I don’t see this anywhere and for me just using the Seafile user’s login works just fine.

Hi flyx,
in user’s profile admin:

You’re right. That did the trick. Thanks!

Precisely: it has to be the login acct name, not the username. For instance you chose fred@mysea.tld as login account and fred as your name to share stuff, then DAV account also is fred@mysea.tld, not fred.

Ah, there’s a config option in seahub_settings.py:

# In old version, if you use Single Sign On, the password is not saved in Seafile.
# Users can't use WebDAV because Seafile can't check whether the password is correct.
# Since version 6.3.8, you can enable this option to let user's to specific a password for WebDAV login.
# Users login via SSO can use this password to login in WebDAV.
# Enable the feature. pycryptodome should be installed first.
# sudo pip install pycryptodome==3.12.0
ENABLE_WEBDAV_SECRET = True

So yeah if you have SSO configured you’ll need that, otherwise you can disable it and use the Seafile password.

Right. Makes sense in some way. Thanks!

Where did you get that config and comment fragment from? I find myself collecting bits and pieces from all over the web (mainly manual, forum, howtos, google) and copy&paste them into the appropriate config files under .../conf/* for the better part of the last three days. Nowhere near how e.g. dovecot has its stuff together tbh.

Speaking of manual: https://manual.seafile.com/config/seahub_settings_py.html seems a bit broken atm.

https://manual.seafile.com/config/seahub_settings_py/

and

https://manual.seafile.com/