Skip to content

Commit

Permalink
seafdav: init at 9.0.7
Browse files Browse the repository at this point in the history
WebDAV extension for Seafile server.
Package adds a WSGI application for easy deployment, which is
lacking from upstream sources.
  • Loading branch information
flyx committed Aug 10, 2022
1 parent 45ed435 commit 6fa5ee6
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 0 deletions.
54 changes: 54 additions & 0 deletions pkgs/applications/networking/seafdav/default.nix
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;
};
}
24 changes: 24 additions & 0 deletions pkgs/applications/networking/seafdav/seafdav.py
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)
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30300,6 +30300,8 @@ with pkgs;
scribus_1_5 = libsForQt5.callPackage ../applications/office/scribus/default.nix { };
scribus = scribus_1_5;

seafdav = callPackage ../applications/networking/seafdav { };

seafile-client = libsForQt5.callPackage ../applications/networking/seafile-client { };

seahub = callPackage ../applications/networking/seahub { };
Expand Down

0 comments on commit 6fa5ee6

Please sign in to comment.