summaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorChloe Kudryavtsev <toast@toastin.space>2019-03-27 20:43:33 -0400
committerChloe Kudryavtsev <toast@toastin.space>2019-03-27 20:43:33 -0400
commitaac7fba8bb16c38e97e6809b8e0faa37fb299dfc (patch)
treea6eb154ea5228798cfb2b7d7ac424bcad88ea234 /server
parent[client] new shell script (diff)
[server] Add openrc configuration
Diffstat (limited to 'server')
-rw-r--r--server/brpaste.confd10
-rwxr-xr-xserver/brpaste.initd21
2 files changed, 31 insertions, 0 deletions
diff --git a/server/brpaste.confd b/server/brpaste.confd
new file mode 100644
index 0000000..2755b94
--- /dev/null
+++ b/server/brpaste.confd
@@ -0,0 +1,10 @@
+BRPASTE_USER=nobody
+BRPASTE_GROUP=nobody
+
+# defaults to localhost, set to :: to listen on all
+#BRPASTE_IP=::
+#BRPASTE_PORT=8080
+
+# if your redis is listening on a different address
+# accepts redis:// style strings
+#BRPASTE_REDIS=
diff --git a/server/brpaste.initd b/server/brpaste.initd
new file mode 100755
index 0000000..ab024b0
--- /dev/null
+++ b/server/brpaste.initd
@@ -0,0 +1,21 @@
+#!/sbin/openrc-run
+supervisor=supervise-daemon
+
+healthcheck_timer=30
+respawn_delay=30
+
+command=/usr/bin/brpaste
+command_args="\
+ ${BRPASTE_USER:+--uid $BRPASTE_USER} ${BRPASTE_GROUP:+--gid $BRPASTE_GROUP} \
+ ${BRPASTE_REDIS:+-r $BRPASTE_REDIS} \
+ ${BRPASTE_IP:+-b $BRPASTE_IP} ${BRPASTE_PORT:+-p $BRPASTE_PORT}"
+
+depend() {
+ need redis
+}
+
+health() {
+ curl -s "${BRPASTE_IP:-localhost}:${BRPASTE_PORT:-8080}/health"
+}
+
+unhealthy() {}