-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WebDAV extension for Seafile server. Package adds a WSGI application for easy deployment, which is lacking from upstream sources.
- Loading branch information
Showing
3 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ lib | ||
, fetchFromGitHub | ||
, python3 | ||
, makeWrapper | ||
}: | ||
python3.pkgs.buildPythonApplication rec { | ||
pname = "seafdav"; | ||
version = "9.0.7"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "haiwen"; | ||
repo = "seafdav"; | ||
rev = "v${version}-server"; | ||
sha256 = "0jdspxz9cakpx0vipqsqf02llz3w02fjid3kff0kclz9apmyvx55"; | ||
}; | ||
|
||
dontBuild = true; # $out will contain Python sources, no build necessary | ||
|
||
doCheck = false; # disabled because it requires a ccnet environment | ||
|
||
propagatedBuildInputs = with python3.pkgs; [ | ||
defusedxml | ||
future | ||
jinja2 | ||
json5 | ||
pysearpc | ||
python-pam | ||
pyyaml | ||
six | ||
lxml | ||
seaserv | ||
seafobj | ||
sqlalchemy | ||
gunicorn | ||
]; | ||
|
||
installPhase = '' | ||
cp -dr --no-preserve='ownership' . $out/ | ||
cp ${./seafdav.py} $out/seafdav.py | ||
''; | ||
|
||
passthru = { | ||
python = python3; | ||
pythonPath = python3.pkgs.makePythonPath propagatedBuildInputs; | ||
}; | ||
|
||
meta = with lib; { | ||
description = "Seafile WebDAV Server"; | ||
homepage = "https://github.com/haiwen/seafdav"; | ||
license = licenses.mit; | ||
maintainers = with maintainers; [ flyx ]; | ||
platforms = platforms.linux; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# This is a WSGI application that can be run via GUnicorn. | ||
# | ||
# It is unclear why Seafile does not provide this script with seafdav, | ||
# when a similar script does exist for seahub. The existing server_cli | ||
# script is not as flexible since it is a Python script that launches | ||
# GUnicorn (or other WSGI servers) instead of being a consumable | ||
# WSGI application. For example, server_cli isn't able to bind to a | ||
# unix socket. | ||
|
||
from wsgidav.default_conf import DEFAULT_CONFIG | ||
from wsgidav.wsgidav_app import WsgiDAVApp | ||
from wsgidav.server.server_cli import _loadSeafileSettings | ||
|
||
import copy, logging | ||
|
||
config = copy.deepcopy(DEFAULT_CONFIG) | ||
|
||
logging.info("share_name = %s", config.get("share_name")) | ||
|
||
# gets us data from seafdav.conf, | ||
# and sets up the general Seafile configuration. | ||
_loadSeafileSettings(config) | ||
|
||
application = WsgiDAVApp(config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters