-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/seafile: add optional seafdav service #152069
Draft
Pacman99
wants to merge
3
commits into
NixOS:master
Choose a base branch
from
Pacman99:seafdav
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -16,11 +16,16 @@ import ./make-test-python.nix ({ pkgs, ... }: | |
ccnetSettings.General.SERVICE_URL = "http://server"; | ||
adminEmail = "[email protected]"; | ||
initialAdminPassword = "seafile_password"; | ||
seafdavSettings = { | ||
enabled = true; | ||
share_name = "/seafdav"; | ||
}; | ||
}; | ||
services.nginx = { | ||
enable = true; | ||
virtualHosts."server" = { | ||
locations."/".proxyPass = "http://unix:/run/seahub/gunicorn.sock"; | ||
locations."/seafdav".proxyPass = "http://127.0.0.1:6001"; | ||
locations."/seafhttp" = { | ||
proxyPass = "http://127.0.0.1:8082"; | ||
extraConfig = '' | ||
|
@@ -50,6 +55,7 @@ import ./make-test-python.nix ({ pkgs, ... }: | |
|
||
with subtest("start seahub"): | ||
server.wait_for_unit("seahub.service") | ||
server.wait_for_unit("seafdav.service") | ||
server.wait_for_unit("nginx.service") | ||
server.wait_for_file("/run/seahub/gunicorn.sock") | ||
|
||
|
@@ -117,5 +123,8 @@ import ./make-test-python.nix ({ pkgs, ... }: | |
client2.succeed("ls -la test01 >&2") | ||
|
||
client2.succeed('[ `cat test01/first_file` = "bla" ]') | ||
|
||
with subtest("seafdav query"): | ||
client1.succeed("curl --anyauth --user '[email protected]:seafile_password' http://server/seafdav | grep 'Authenticated user' >&2") | ||
''; | ||
}) |
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,30 @@ | ||
{ lib | ||
, fetchFromGitHub | ||
, buildPythonPackage | ||
}: | ||
|
||
buildPythonPackage rec { | ||
pname = "seafobj"; | ||
version = "unstable-2021-07-08"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "haiwen"; | ||
repo = "seafobj"; | ||
rev = "df13a98e7e32c926083ca60bb7fb1bbc4dfcdbd0"; | ||
sha256 = "0jwgbx083mwwh18x7450igq748bbld9s7zgibwv1cxwrrny1aari"; | ||
}; | ||
|
||
patches = [ | ||
./setuptools.patch | ||
]; | ||
|
||
doCheck = false; # disabled because it requires a ccnet environment | ||
|
||
meta = with lib; { | ||
homepage = "https://github.com/haiwen/seafobj"; | ||
description = "Python library for accessing seafile data model"; | ||
license = licenses.asl20; | ||
platforms = platforms.linux; | ||
maintainers = with maintainers; [ pacman99 ]; | ||
}; | ||
} |
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 @@ | ||
diff --git a/setup.py b/setup.py | ||
new file mode 100644 | ||
index 0000000..898cbe7 | ||
--- /dev/null | ||
+++ b/setup.py | ||
@@ -0,0 +1,18 @@ | ||
+from setuptools import setup, find_packages | ||
+ | ||
+__version__ = '7.0.0' | ||
+ | ||
+ | ||
+setup(name='seafobj', | ||
+ version=__version__, | ||
+ license='ASL2', | ||
+ description='python library for accessing seafile data model', | ||
+ author='Shuai Lin', | ||
+ author_email='[email protected]', | ||
+ url='http://seafile.com', | ||
+ platforms=['Any'], | ||
+ packages=find_packages(exclude=["test.*", "test"]), | ||
+ classifiers=['Development Status :: 4 - Beta', | ||
+ 'License :: OSI Approved :: Apache Software License', | ||
+ 'Operating System :: OS Independent', | ||
+ 'Programming Language :: Python']) |
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,40 @@ | ||
{ lib, fetchFromGitHub, python3 }: | ||
|
||
python3.pkgs.buildPythonApplication rec { | ||
pname = "seafdav"; | ||
version = "unstable-2021-05-09"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "haiwen"; | ||
repo = "seafdav"; | ||
rev = "0f178088879a8d03c22d9a6b55e7e7ddc39a0c0c"; # using a fixed revision because upstream may re-tag releases :/ | ||
sha256 = "1gpvmfamjbw90gh9njgmba58qnzxji1w1sra46spnhi9k778mds3"; | ||
}; | ||
|
||
doCheck = false; # disabled because it requires a ccnet environment | ||
|
||
|
||
propagatedBuildInputs = with python3.pkgs; [ | ||
seaserv | ||
seafobj | ||
defusedxml | ||
pysearpc | ||
future | ||
gunicorn | ||
jinja2 | ||
json5 | ||
python-pam | ||
pyyaml | ||
six | ||
lxml | ||
sqlalchemy | ||
]; | ||
|
||
meta = with lib; { | ||
homepage = "https://github.com/haiwen/seafdav"; | ||
description = "WebDAV server for seafile"; | ||
license = licenses.mit; | ||
platforms = platforms.linux; | ||
maintainers = with maintainers; [ pacman99 ]; | ||
}; | ||
} |
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should be changed since you didn't actually package version 7.0.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I packaged the pre-release of the next version, but then I'd have to predict what the next version number for seafobj would be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed an issue upstream for adding setuptools support: haiwen/seafobj#57