summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Hoffmann2019-12-17 22:43:27 +0100
committerMarcus Hoffmann2019-12-17 23:01:46 +0100
commitfd72b7f5800804da935b97d0eea5c0517a9e15c6 (patch)
tree99f4e10d7b7f2733eb70ae77814dd2b8fdb05745
downloadaur-fd72b7f5800804da935b97d0eea5c0517a9e15c6.tar.gz
initial commit
-rw-r--r--.SRCINFO31
-rw-r--r--PKGBUILD56
-rw-r--r--matrix-registration.install13
-rw-r--r--matrix-registration.service15
4 files changed, 115 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..79a175f649a0
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,31 @@
+pkgbase = matrix-registration
+ pkgdesc = Webapp for token based matrix registration
+ pkgver = 0.5.5
+ pkgrel = 1
+ url = https://github.com/ZerataX/matrix-registration
+ install = matrix-registration.install
+ arch = any
+ license = MIT
+ checkdepends = flake8
+ checkdepends = python-parameterized
+ depends = python-appdirs
+ depends = python-flask
+ depends = python-flask-cors
+ depends = python-flask-httpauth
+ depends = python-flask-limiter
+ depends = python-dateutil
+ depends = python-yaml
+ depends = python-requests
+ depends = python-wtforms
+ depends = systemd
+ source = matrix-registration-0.5.5.tar.gz::https://github.com/ZerataX/matrix-registration/archive/v0.5.5.tar.gz
+ source = https://github.com/Bubu/matrix-registration/commit/0b1f172d5d5409ae83d23052b3e261562cfa2dc3.patch
+ source = https://github.com/Bubu/matrix-registration/commit/822c426d1a2015a9d383a41ef245c590abd130de.patch
+ source = matrix-registration.service
+ sha256sums = 77167413fdf46a2e5b6b38d6822208ee0550abd55091c2c27449555333afb9eb
+ sha256sums = 13ae49f07d00ce8567422634ccc15fd4d2331ee3bb127a980b99dde0ccc64c12
+ sha256sums = 315582a06dbe20778def87ca95f85fd15d16a582136c0a60ee5fbaed157b9b44
+ sha256sums = e6855f64adaeff6be8cdf1106f62d1fe0f66e5015ff856e6db41e05f25bcd29a
+
+pkgname = matrix-registration
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..b2a56e0d822d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,56 @@
+# Maintainer: Marcus Hoffmann <bubu@bubu1.eu>
+
+pkgname=matrix-registration
+pkgver=0.5.5
+pkgrel=1
+
+pkgdesc="Webapp for token based matrix registration"
+url="https://github.com/ZerataX/matrix-registration"
+arch=('any')
+license=('MIT')
+
+depends=('python-appdirs' 'python-flask' 'python-flask-cors'
+ 'python-flask-httpauth' 'python-flask-limiter'
+ 'python-dateutil' 'python-yaml' 'python-requests' 'python-wtforms' 'systemd')
+checkdepends=('flake8' 'python-parameterized')
+
+source=("matrix-registration-$pkgver.tar.gz::https://github.com/ZerataX/matrix-registration/archive/v$pkgver.tar.gz"
+ "https://github.com/Bubu/matrix-registration/commit/0b1f172d5d5409ae83d23052b3e261562cfa2dc3.patch"
+ "https://github.com/Bubu/matrix-registration/commit/822c426d1a2015a9d383a41ef245c590abd130de.patch"
+ "matrix-registration.service")
+
+sha256sums=('77167413fdf46a2e5b6b38d6822208ee0550abd55091c2c27449555333afb9eb'
+ '13ae49f07d00ce8567422634ccc15fd4d2331ee3bb127a980b99dde0ccc64c12'
+ '315582a06dbe20778def87ca95f85fd15d16a582136c0a60ee5fbaed157b9b44'
+ 'e6855f64adaeff6be8cdf1106f62d1fe0f66e5015ff856e6db41e05f25bcd29a')
+install=matrix-registration.install
+
+prepare() {
+ cd $pkgname-$pkgver
+ patch -p1 -i ../0b1f172d5d5409ae83d23052b3e261562cfa2dc3.patch
+ patch -p1 -i ../822c426d1a2015a9d383a41ef245c590abd130de.patch
+}
+
+build() {
+ cd $pkgname-$pkgver
+ sed -i 's|"config"|"/etc/matrix-registration"|' setup.py
+ python setup.py build
+}
+
+check() {
+ cd $pkgname-$pkgver
+ python -m tests.test_registration -v
+}
+
+package() {
+ install -Dm644 ${pkgname}.service "$pkgdir"/usr/lib/systemd/system/${pkgname}.service
+
+ cd $pkgname-$pkgver
+ python setup.py install --root "$pkgdir" --optimize=1 --skip-build
+
+ _requires="$pkgdir"/usr/lib/python3.8/site-packages/matrix_registration-${pkgver}-py3.8.egg-info/requires.txt
+ sed -i 's/flask-limiter==.*/flask-limiter/' ${_requires}
+ sed -i 's/flask-cors==.*/flask-cors/' ${_requires}
+ sed -i 's/flask-httpauth==.*/flask-httpauth/' ${_requires}
+ install -dm755 "$pkgdir"/etc/${pkgname}
+}
diff --git a/matrix-registration.install b/matrix-registration.install
new file mode 100644
index 000000000000..d5810bdf7bd0
--- /dev/null
+++ b/matrix-registration.install
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# arg 1: the new package version
+post_install() {
+ if [[ ! -e /var/lib/matrix-registration/config.yaml ]]; then
+ cat <<-EOF
+ ==> A configuration file called config.yaml needs to be created before you can start
+ the matrix-registration server.
+
+ You can start from /etc/matrix-registration/config.sample.yaml.
+ EOF
+ fi
+}
diff --git a/matrix-registration.service b/matrix-registration.service
new file mode 100644
index 000000000000..3f0b15c98299
--- /dev/null
+++ b/matrix-registration.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=A token based matrix registration api.
+After=network-online.target
+Requires=network-online.target
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/python3 -m matrix_registration --config-path /etc/matrix-registration/config.yaml api
+WorkingDirectory=/var/lib/matrix-registration
+DynamicUser=true
+ConfigurationDirectory=matrix-registration
+StateDirectory=matrix-registration
+
+[Install]
+WantedBy=multi-user.target