diff options
author | Matthew Gamble | 2017-12-19 08:41:36 +1100 |
---|---|---|
committer | Matthew Gamble | 2017-12-19 08:41:36 +1100 |
commit | 5985c2ef89943a8b2d89fca201c7910353a06563 (patch) | |
tree | f78475689695a2bfae35d65b132de9a034c4297b | |
parent | 652e1dcb88c8d06ac1a16aa6bc068032b8a31911 (diff) | |
download | aur-5985c2ef89943a8b2d89fca201c7910353a06563.tar.gz |
Add example files for uwsgi integration
-rw-r--r-- | .SRCINFO | 10 | ||||
-rw-r--r-- | PKGBUILD | 11 | ||||
-rw-r--r-- | config.example.json | 11 | ||||
-rw-r--r-- | uwsgi.ini | 9 | ||||
-rw-r--r-- | uwsgi.py | 11 |
5 files changed, 49 insertions, 3 deletions
@@ -1,9 +1,9 @@ # Generated by mksrcinfo v8 -# Sun Dec 17 22:04:33 UTC 2017 +# Mon Dec 18 21:41:13 UTC 2017 pkgbase = python-wsgidav pkgdesc = Generic WebDAV server based on WSGI pkgver = 2.2.4 - pkgrel = 1 + pkgrel = 2 url = https://github.com/mar10/wsgidav arch = any license = MIT @@ -14,8 +14,14 @@ pkgbase = python-wsgidav optdepends = python-cheroot: to use the built-in webserver source = https://pypi.python.org/packages/7e/75/9a56d97f19e2dad7166f48d073ad79678d8f26f195e9142b01c0e8fa5e94/WsgiDAV-2.2.4.tar.gz source = https://raw.githubusercontent.com/mar10/wsgidav/v2.2.4/LICENSE + source = uwsgi.py + source = uwsgi.ini + source = config.example.json sha512sums = 16cba8a6012576da88277525c297e7b8dcf0cf22beb6729829cafc4db1ad9ac28f87a753e8a0df665b8aac2fb525f4084c3b8e79faf38db2fb2903d60a83842f sha512sums = 3cd7f0442c32c90a6c6ecc86f59fd8f684b8ae9edd7303588c3d821f03e64ada98e12b5982ec412eea84cffebdbcf159d343d6cf815dfdceb4abbb129a0a6d03 + sha512sums = 0eb0563b1fda05af99c73d7824e4c410451b51bbf8ec9e65f702d6ce0a18998f31b05ba12d283d3f72a8d9c356bb0d19834868bc0705ce98e34b283b60ad0276 + sha512sums = a4f0de9c7625007efb0fe917da66c68a205b16035e8313663a9ab35a9bfe30afa814542f2ec9bb965d90911c2f1be0a4a389443efd5dab2e45c36d12c2371cb4 + sha512sums = d5286b64d083ac9fbfb49b6f71c0d06e21953b60bb7083a8affeceb9ffa28b7e4949233f63f7fd2d3d1de889ef3c1e91e77d6abbe06b88c626c4b5d2ac945f74 pkgname = python-wsgidav @@ -2,7 +2,7 @@ pkgname=python-wsgidav pkgver=2.2.4 -pkgrel=1 +pkgrel=2 pkgdesc="Generic WebDAV server based on WSGI" arch=("any") license=("MIT") @@ -16,10 +16,16 @@ optdepends=( source=( "https://pypi.python.org/packages/7e/75/9a56d97f19e2dad7166f48d073ad79678d8f26f195e9142b01c0e8fa5e94/WsgiDAV-${pkgver}.tar.gz" "https://raw.githubusercontent.com/mar10/wsgidav/v${pkgver}/LICENSE" + "uwsgi.py" + "uwsgi.ini" + "config.example.json" ) sha512sums=( "16cba8a6012576da88277525c297e7b8dcf0cf22beb6729829cafc4db1ad9ac28f87a753e8a0df665b8aac2fb525f4084c3b8e79faf38db2fb2903d60a83842f" "3cd7f0442c32c90a6c6ecc86f59fd8f684b8ae9edd7303588c3d821f03e64ada98e12b5982ec412eea84cffebdbcf159d343d6cf815dfdceb4abbb129a0a6d03" + "0eb0563b1fda05af99c73d7824e4c410451b51bbf8ec9e65f702d6ce0a18998f31b05ba12d283d3f72a8d9c356bb0d19834868bc0705ce98e34b283b60ad0276" + "a4f0de9c7625007efb0fe917da66c68a205b16035e8313663a9ab35a9bfe30afa814542f2ec9bb965d90911c2f1be0a4a389443efd5dab2e45c36d12c2371cb4" + "d5286b64d083ac9fbfb49b6f71c0d06e21953b60bb7083a8affeceb9ffa28b7e4949233f63f7fd2d3d1de889ef3c1e91e77d6abbe06b88c626c4b5d2ac945f74" ) build() { @@ -32,4 +38,7 @@ package() { python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1 --skip-build install -Dm644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/python-wsgidav/LICENSE" + install -Dm644 "${srcdir}/uwsgi.py" "${pkgdir}/usr/share/python-wsgidav/uwsgi.py" + install -Dm644 "${srcdir}/uwsgi.ini" "${pkgdir}/usr/share/python-wsgidav/uwsgi.ini" + install -Dm644 "${srcdir}/config.example.json" "${pkgdir}/usr/share/python-wsgidav/config.example.json" } diff --git a/config.example.json b/config.example.json new file mode 100644 index 000000000000..2a0e420a120d --- /dev/null +++ b/config.example.json @@ -0,0 +1,11 @@ +{ + "host": "files.example.com", + "mount_path": "/webdav", + "provider_mapping": {"/myfiles": "/path/to/files"}, + "user_mapping": { + "/myfiles": { + "myuser": {"password": "mypassword", "description": "", "roles": []} + } + }, + "verbose": 1 +} diff --git a/uwsgi.ini b/uwsgi.ini new file mode 100644 index 000000000000..7420a079a04c --- /dev/null +++ b/uwsgi.ini @@ -0,0 +1,9 @@ +[uwsgi] +plugins = python +processes = 4 +threads = 2 +socket = 127.0.0.1:3031 +chdir = /usr/share/python-wsgidav +manage-script-name = true +mount = /webdav=uwsgi.py +callable = app diff --git a/uwsgi.py b/uwsgi.py new file mode 100644 index 000000000000..0c11f7ccf66d --- /dev/null +++ b/uwsgi.py @@ -0,0 +1,11 @@ +import json +import os +from wsgidav.wsgidav_app import DEFAULT_CONFIG, WsgiDAVApp + +with open(os.environ.get("WSGIDAV_CONFIG_FILE", "/etc/wsgidav/config.json"), mode="r", encoding="utf-8") as json_file: + json_config = json.load(json_file) + +config = DEFAULT_CONFIG.copy() +config.update(json_config) + +app = WsgiDAVApp(config) |