Seafile, Windows (server), and WebDAV

windows

#1

Hello!

I recently downloaded the latest (6.0.7) version of the Seafile Community Edition Server for Windows. I have installed it on my server, and it works great - I can access it from the web or the client, sync properly, upload and download, etc.

However.

I have been attempting to get the proported WebDAV capabilities (advertised here) to work. I attempted placing the seafdav.conf file in $root_drive\seafile-server\conf, and set the configuration file so the server would be operating on port 8080 as a standalone server - no Apache or nginx integration (as found here) That doesn’t work. At all. I have restared the server process multiple times trying to tweak the configuration, and nothing comes up from either a WebDAV client or just trying to access it through a web browser. I’ve also searched the seafile-server and normal Seafile directories for a “seafdav” plugin, and found nothing.

I have two questions:

1.) Is the WebDAV integration actually supported in the Windows server edition 6.0.7?

If so…

2.) Is there a configuration step that I am missing to get the WebDAV server process up and running?

Thank you for your time.


#2

WebDAV should work on Windows server too. What error do you get when you access it from web browser?


#3

When I try to access http://seafile.lithorien.net:8080/ (as configured in the conf file), the browser returns “The page can’t be displayed,” and when I try to just telnet to port 8080, it tells me “connection failed”. I know the seafile server is running because http://seafile.lithorien.net:8000/ works just fine.

Additionally

I checked the Windows Firewall settings. Both seaf-server.exe and ccnet-server.exe are accepting connections through TCP and UDP. The configured ports are “Any,” so presumably there’s nothing there that would block 8080.

When I run “netstat -a,” there’s nothing even listening on port 8080. This makes me wonder if I am missing files, though I did try redownloading and reinstalling the server before I posted here.


#4

Can you post your seafdav.conf?


#5

Sure can!

seafdav.conf

[WEBDAV]
enabled = true
port = 8080
fastcgi = false
share_name = /


#6

Have you made sure that no other application uses port 8080?


#7

Yes. I changed the port in the configuration file to 5001 (which I know is free also) and restarted the server. Again, netstat -a did not show any listening service on that port. I changed it /back/ to 8080, checked netstat -a again, and still nothing.


#8

You can check controller.log to see whether seafdav was started.


#9

You can check controller.log to see whether seafdav was started.

Ah… that log doesn’t exist for me. Anywhere - I did a full search of the drive the seafile server is installed to.

I have ccnet, seafile, seafserv, seafserv-applet, seahub, and seahub_django_request. Of those logfiles, none of them mention WebDAV or seafdav anywhere in them - or any attempt to spin up a WebDAV server.

Edit: As confirmation, I also just now tried downloading a fresh 6.0.7 tar.gz, installing it on my home computer (Windows 10 Pro), configuring for WebDAV… and the same symptoms - no controller.log, no seafdav startup, nothing like that. The main server still runs just fine either way.


#10

Ok, so on further digging, I found the GitHub page here for the Seafdav server. I was under the impression that it was supposed to be integrated with the initial installer - not something I have to pull down from a GitHub repo and configure?

If I do have to pull it from GH, is there documentation on how to modify it to work on a Windows server (since I can’t exactly run bash shell scripts from Windows, AFAIK…)?

Thank you for all the ideas so far, I appreciate the help.


#11

Just checking up to see if anyone else has any ideas on why I may be missing the controller.log, or why the WebDAV server aspect isn’t running…

I appreciate all and any help.


#12

I got it working by extracting seafdav to C:, then copying the libraries from seafile-server’s libs folders to my python27 libraries folder, then changing the paths such as

CCNET_CONF_PATH = 'C:\seafile-server\ccnet'
SEAFILE_CONF_DIR = 'C:\seafile-server\seafile-data'
SEAFILE_CENTRAL_CONF_DIR = 'C:\seafile-server\conf'

in services.py (at C:\python27\lib\site-packages\seaserve\service.py)

then installing seafobj from github into that python libraries directory (C:\python27\lib\site-packages) and modifying the config paths in it inside objstore_factory.py

then again setting the config directories in seaf_utils.py in C:\seafdav\wsgidav\addons\seafile\seaf_utils.py

then running the webdav server with the command “python -m wsgidav.server.run_server” from C:\seafdav\

Im certain I went about this the complete wrong way, I probably could have just added some environment variables and have been done without edits, but I just wanted to see if it would work. Its all pretty self-explantory if you fix the error messages one after another that you get when trying to run the server “python -m wsgidav.server.run_server” , so good luck lol


#13

Alright, cool, Naka. Thank you - there is some progress here. The server comes up and binds to localhost:8080, though it’s not accessable from an external client (yet) even with the port open. That’s ok though.

I do have a question for you: What do you use for seafile.ini? I had to create my own, and in it, I put c:\seafile-server\seafile-data. The file resides in the ccnet directory (which I then pointed CCNET_CONF_PATH to as an environment variable - it does work). I don’t think it’s being read, however, because when I point the local browser to it, I just get a blank directory listing.

Thank you for getting me started! I do appreciate it, a lot.


#14

HAHA! IT WORKS!

Alright, so for anyone in the future who comes across this issue, Naka’s stuff was correct. I will put the step-by-step below for easy following…

1.) Download the seafdav server from here, and the seafobj files from here.

2.) Extract the seafdav files into a folder in the root directory (such as c:\seafdav)

3.) Copy the files from C:\Seafile\seafile\lib (or wherever your seafile install directory was) into C:\Python27\Lib.

4.) Copy the files from the seafobj into C:\Python27\Lib\site-packages

5.) Set your environment variables as follows:

CCNET_CONF_PATH = ‘C:\seafile-server\ccnet’
SEAFILE_CONF_DIR = ‘C:\seafile-server\seafile-data’
SEAFILE_CENTRAL_CONF_DIR = ‘C:\seafile-server\conf’

6.) Create a file called “seafile.ini” in your C:\seafile-server\ccnet folder, and in it, put the path to your data directory (such as c:\seafile-server\seafile-data).

7.) Execute the server by opening a command prompt, navigating to c:\seafdav, and running the following:

python -m wsgidav.server.run_server -H 0.0.0.0

This will make it publically accessable - and it’s what worked for me. Browsers won’t show anything, but connecting with a WebDAV client (such as WPS Office on a Kindle Fire) will navigate just fine.

Edit: For those who want to run this as a service, I recommend NSSM. When installing, just point it to your python.exe file, set the startup directory to be c:\seafdav, and the parameters will be “-m wsgidav.server.run_server -H 0.0.0.0”.


Webdav for seafile on windows server
#16

Hello,
Help me figure out what I’m doing wrong. I try to configure the seadav server to windows 10, follow your prompts and as a result it turns out:

c:\Seafdav>python -m wsgidav.server.run_server -H 0.0.0.0
Traceback (most recent call last):
  File "C:\Python27\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "c:\Seafdav\wsgidav\server\run_server.py", line 50, in <module>
    from wsgidav.addons.seafile.domain_controller import SeafileDomainController
  File "wsgidav\addons\seafile\domain_controller.py", line 2, in <module>
    import ccnet
ImportError: No module named ccnet

I realized my mistake with: …ImportError: No module named ccnet…
Now I do not understand where to register variables ))) please, help me…
… understood everything - CCNET_CONF_PATH - wrong, CCNET_CONF_DIR - true. thanks to all.

new: How to do with HTTPS?


#17

I’m getting the same error as above…

Anyone have any ideas as to the fix?


#19

I’ve also tried creating the environment variable [quote=“3xl81, post:16, topic:2119”]
CCNET_CONF_DIR
[/quote]

But that did not work either


#20

okay with some further tinkering i managed go get it to run - however now i cant manage go push or pull data via webdav - albeit i can connect, so im one step closer…


#21

A little more info on the error I get when pushing or pulling data from the WebDAV:

<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/html4/strict.dtd'> 
<html><head> 
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'> 
<title>403 Forbidden</title> 
</head><body> 
<h1>403 Forbidden</h1> 
<p>403 Forbidden: Access denied to the specified resource</p> 
<hr/> 
<a href='https://github.com/mar10/wsgidav/'>WsgiDAV/1.2.0.pre</a> - 2017-08-22 20:17:52.289000 
</body></html>

#23

I had the same issue and set the environment variable CCNET_CONF_DIR but still without success. How did you eventually get it going, please?