summaryrefslogtreecommitdiffstats
path: root/net-im/dendrite/files
diff options
context:
space:
mode:
Diffstat (limited to 'net-im/dendrite/files')
-rw-r--r--net-im/dendrite/files/dendrite-monolith.confd3
-rw-r--r--net-im/dendrite/files/dendrite-monolith.initd28
-rw-r--r--net-im/dendrite/files/dendrite-monolith.service17
-rw-r--r--net-im/dendrite/files/dendrite.confd5
-rw-r--r--net-im/dendrite/files/dendrite.initd27
-rw-r--r--net-im/dendrite/files/dendrite.service17
6 files changed, 97 insertions, 0 deletions
diff --git a/net-im/dendrite/files/dendrite-monolith.confd b/net-im/dendrite/files/dendrite-monolith.confd
new file mode 100644
index 0000000..8c09541
--- /dev/null
+++ b/net-im/dendrite/files/dendrite-monolith.confd
@@ -0,0 +1,3 @@
+# extra arguments for dendrite monolith
+
+EXTRA_ARGS=""
diff --git a/net-im/dendrite/files/dendrite-monolith.initd b/net-im/dendrite/files/dendrite-monolith.initd
new file mode 100644
index 0000000..52dba9e
--- /dev/null
+++ b/net-im/dendrite/files/dendrite-monolith.initd
@@ -0,0 +1,28 @@
+#!/sbin/openrc-run
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+name="dendrite-monolith daemon"
+description="Dendrite (Matrix Homeserver)"
+command=/usr/bin/dendrite-monolith-server
+command_args="--config /etc/dendrite/dendrite.monolith.yaml ${EXTRA_ARGS}"
+pidfile="/run/dendrite-monolith.pid"
+command_background="yes"
+command_user="dendrite:dendrite"
+directory="/var/lib/dendrite"
+output_log="/var/log/dendrite/dendrite.log"
+error_log="/var/log/dendrite/dendrite.log"
+
+depend() {
+ need net
+}
+
+start_pre() {
+ _pem="/var/lib/dendrite/matrix_key.pem"
+ if [[ ! -e "${_pem}" ]]; then
+ /usr/bin/generate-keys --private-key "${_pem}"
+ chown dendrite:dendrite "${_pem}"
+ chmod 600 "${_pem}"
+ fi
+ ulimit -n 65535
+}
diff --git a/net-im/dendrite/files/dendrite-monolith.service b/net-im/dendrite/files/dendrite-monolith.service
new file mode 100644
index 0000000..55c1d6f
--- /dev/null
+++ b/net-im/dendrite/files/dendrite-monolith.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Dendrite (Matrix Homeserver)
+After=syslog.target
+After=network.target
+
+[Service]
+RestartSec=2s
+Type=simple
+User=dendrite
+Group=dendrite
+WorkingDirectory=/var/lib/dendrite/
+ExecStart=/usr/bin/dendrite-monolith-server
+Restart=always
+LimitNOFILE=65535
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-im/dendrite/files/dendrite.confd b/net-im/dendrite/files/dendrite.confd
new file mode 100644
index 0000000..0c4a069
--- /dev/null
+++ b/net-im/dendrite/files/dendrite.confd
@@ -0,0 +1,5 @@
+# extra arguments for dendrite
+
+EXTRA_ARGS=""
+
+rc_ulimit="-n 65535"
diff --git a/net-im/dendrite/files/dendrite.initd b/net-im/dendrite/files/dendrite.initd
new file mode 100644
index 0000000..ee210a2
--- /dev/null
+++ b/net-im/dendrite/files/dendrite.initd
@@ -0,0 +1,27 @@
+#!/sbin/openrc-run
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+name="dendrite daemon"
+description="Dendrite (Matrix Homeserver)"
+command=/usr/bin/dendrite
+command_args="--config /etc/dendrite/dendrite.yaml ${EXTRA_ARGS}"
+pidfile="/run/dendrite.pid"
+command_background="yes"
+command_user="dendrite:dendrite"
+directory="/var/lib/dendrite"
+output_log="/var/log/dendrite/dendrite.log"
+error_log="/var/log/dendrite/dendrite.log"
+
+depend() {
+ need net
+}
+
+start_pre() {
+ _pem="/var/lib/dendrite/matrix_key.pem"
+ if [ ! -e "${_pem}" ]; then
+ /usr/bin/generate-keys --private-key "${_pem}"
+ chown dendrite:dendrite "${_pem}"
+ chmod 600 "${_pem}"
+ fi
+}
diff --git a/net-im/dendrite/files/dendrite.service b/net-im/dendrite/files/dendrite.service
new file mode 100644
index 0000000..0b7a1da
--- /dev/null
+++ b/net-im/dendrite/files/dendrite.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Dendrite (Matrix Homeserver)
+After=syslog.target
+After=network.target
+
+[Service]
+RestartSec=2s
+Type=simple
+User=dendrite
+Group=dendrite
+WorkingDirectory=/var/lib/dendrite/
+ExecStart=/usr/bin/dendrite
+Restart=always
+LimitNOFILE=65535
+
+[Install]
+WantedBy=multi-user.target