summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolás Reynolds <fauno@endefensadelsl.org>2014-02-09 20:11:45 -0300
committerNicolás Reynolds <fauno@endefensadelsl.org>2014-02-09 20:11:45 -0300
commit4be5309ee3989d582faad90f46c934352eff82f0 (patch)
tree83ec48649316520026ea12f46fd7b501ac6bde31
parenta563eee81e9abd42251117d8cd74738e23e0fe70 (diff)
Perspectives Server
-rw-r--r--pcr/perspectives-server/PKGBUILD61
-rw-r--r--pcr/perspectives-server/perspectives-server.conf17
-rw-r--r--pcr/perspectives-server/perspectives-server.cron7
-rw-r--r--pcr/perspectives-server/perspectives-server.install27
-rw-r--r--pcr/perspectives-server/perspectives-server.service14
5 files changed, 126 insertions, 0 deletions
diff --git a/pcr/perspectives-server/PKGBUILD b/pcr/perspectives-server/PKGBUILD
new file mode 100644
index 000000000..f0e16f6dc
--- /dev/null
+++ b/pcr/perspectives-server/PKGBUILD
@@ -0,0 +1,61 @@
+# Maintainer: fauno
+# Based on the git version by
+# Maintainer: Robert Štětka <robert dot stetka at gmail dot com>
+pkgname=perspectives-server
+pkgver=3.3.1
+pkgrel=1
+url='https://perspectives-project.org/'
+pkgdesc='Perspectives notary server'
+arch=('any')
+license=('GPL3')
+depends=('openssl' 'python2>=2.7' 'python2-m2crypto'
+ 'python2-cherrypy' 'python2-sqlalchemy')
+source=("libre://${pkgname}-${pkgver}.tar.gz"
+ perspectives-server.{conf,cron,service,install})
+install="${pkgname}.install"
+optdepends=('python2-psycopg2: for postgresql storage'
+ 'memcache: for caching'
+ 'redis: for caching')
+
+mkdepends=('git')
+mksource=("$pkgname-$pkgver::git+https://github.com/danwent/Perspectives-Server/#tag=v$pkgver")
+mkmd5sums=('SKIP')
+
+mksource() {
+ :
+}
+
+package() {
+ install -dm 750 ${pkgdir}/usr/share/webapps/${pkgname}
+ install -dm 750 ${pkgdir}/etc/webapps/${pkgname}
+
+ install -Dm 640 ${srcdir}/${pkgname}.conf \
+ ${pkgdir}/etc/conf.d/${pkgname}.conf
+
+ install -Dm 755 ${srcdir}/${pkgname}.cron \
+ ${pkgdir}/etc/cron.daily/${pkgname}
+
+ cp -av "$srcdir/$pkgname-$pkgver/"* \
+ "${pkgdir}/usr/share/webapps/${pkgname}/"
+
+ install -Dm 644 ${srcdir}/${pkgname}.service \
+ ${pkgdir}/usr/lib/systemd/system/${pkgname}.service
+}
+
+
+# vim:set ts=2 sw=2 et:
+md5sums=('2ac787ab4f4c77639c29df7ae5b16d16'
+ 'a851e6fefbf883b695dea8920aa476bf'
+ '2343fe5f9756ffd7a70e39d04ba21d46'
+ '557218d32ef9ec92bb30aec19a54f730'
+ '57cea678130fe314f879e75a3420dd55')
+md5sums=('2ac787ab4f4c77639c29df7ae5b16d16'
+ '00c42be9b00186cd660645a0cf20fa4b'
+ '2343fe5f9756ffd7a70e39d04ba21d46'
+ '870bf3020c73c02853cf1c0d1668d005'
+ '57cea678130fe314f879e75a3420dd55')
+md5sums=('2ac787ab4f4c77639c29df7ae5b16d16'
+ '00c42be9b00186cd660645a0cf20fa4b'
+ '2343fe5f9756ffd7a70e39d04ba21d46'
+ '870bf3020c73c02853cf1c0d1668d005'
+ '7d51646e864e895d13a3eb682ebf78ec')
diff --git a/pcr/perspectives-server/perspectives-server.conf b/pcr/perspectives-server/perspectives-server.conf
new file mode 100644
index 000000000..fad23db68
--- /dev/null
+++ b/pcr/perspectives-server/perspectives-server.conf
@@ -0,0 +1,17 @@
+# Perspectives env vars
+FLAGS="--sni --metricsdb"
+
+# See notary_http.py -h to get this working
+NOTARY_PUBLIC_KEY=/etc/webapps/perspectives-server/notary.pub
+NOTARY_PRIVATE_KEY=/etc/webapps/perspectives-server/notary.priv
+PORT=8080
+
+#MEMCACHE_SERVER=
+#MEMCACHE_USERNAME=
+#MEMCACHE_PASSWORD=
+#MEMCACHIER_SERVERS=
+#MEMCACHIER_USERNAME=
+#MEMCACHIER_PASSWORD=
+#REDISTOGO_URL=
+#DATABASE_URL=
+#NOTARY_DB_PASSWORD=
diff --git a/pcr/perspectives-server/perspectives-server.cron b/pcr/perspectives-server/perspectives-server.cron
new file mode 100644
index 000000000..73a18ec44
--- /dev/null
+++ b/pcr/perspectives-server/perspectives-server.cron
@@ -0,0 +1,7 @@
+#!/bin/bash
+set -e
+
+pushd /usr/share/webapps/perspectives-server &>/dev/null
+
+/usr/bin/python2 notary_util/list_services.py |
+/usr/bin/python2 notary_util/threaded_scanner.py
diff --git a/pcr/perspectives-server/perspectives-server.install b/pcr/perspectives-server/perspectives-server.install
new file mode 100644
index 000000000..d07664cb7
--- /dev/null
+++ b/pcr/perspectives-server/perspectives-server.install
@@ -0,0 +1,27 @@
+_chown() {
+ chown -R perspectives:perspectives \
+ /usr/share/webapps/perspectives-server \
+ /etc/webapps/perspectives-server \
+ /etc/conf.d/perspectives-server.conf
+}
+
+post_install() {
+ groupadd --system perspectives
+
+ useradd --system \
+ --comment "Perspectives Notary Server" \
+ --gid perspectives \
+ --home /usr/share/webapps/perspectives-server -M \
+ --shell /bin/false \
+ perspectives &>/dev/null
+ _chown
+}
+
+post_upgrade() {
+ _chown
+}
+
+post_remove() {
+ userdel perspectives
+ groupdel perspectives
+}
diff --git a/pcr/perspectives-server/perspectives-server.service b/pcr/perspectives-server/perspectives-server.service
new file mode 100644
index 000000000..db5ca8808
--- /dev/null
+++ b/pcr/perspectives-server/perspectives-server.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Perspectives notary server
+After=network.target
+
+[Service]
+User=perspectives
+Type=forking
+EnvironmentFile=/etc/conf.d/perspectives-server.conf
+WorkingDirectory=/usr/share/webapps/perspectives-server
+ExecStart=/bin/sh -c "/usr/bin/python2 notary_http.py $FLAGS &"
+
+[Install]
+WantedBy=multi-user.target
+