summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg2021-07-21 12:34:32 +0200
committerGeorg2021-07-21 12:34:32 +0200
commita7b59a951b5b884bb2ba0fd1105918d2d5150fcd (patch)
tree5e906079ed4d34c928722aba17225b2894f4f293
parent8e5f49e946dfbe915301894390a8105d88cd40f3 (diff)
downloadsystem-a7b59a951b5b884bb2ba0fd1105918d2d5150fcd.tar.gz
system-a7b59a951b5b884bb2ba0fd1105918d2d5150fcd.tar.bz2
system-a7b59a951b5b884bb2ba0fd1105918d2d5150fcd.zip
Initial Systemd Service Run: 1/3
Signed-off-by: Georg <georg@lysergic.dev>
-rw-r--r--README.md3
-rw-r--r--systemd/README.md1
-rw-r--r--systemd/convos.service14
-rw-r--r--systemd/flask_libertacasa.service17
-rw-r--r--systemd/irccat.service14
-rw-r--r--systemd/katyusha.service19
-rw-r--r--systemd/matrix-appserviceirc.service14
-rw-r--r--systemd/matrix-dimension.service21
-rw-r--r--systemd/matrix-keyserver.service12
-rw-r--r--systemd/matrix-maubot.service16
-rw-r--r--systemd/matrix-sydent.service14
-rw-r--r--systemd/matrix-synapse.service23
-rw-r--r--systemd/mattermost.service17
-rw-r--r--systemd/mysqld_oracle.service15
-rw-r--r--systemd/mysqld_percona.service15
-rw-r--r--systemd/node_exporter.service12
-rw-r--r--systemd/omnidb.service13
-rw-r--r--systemd/openfire.service12
-rw-r--r--systemd/oragono.service19
-rw-r--r--systemd/prosody-filer.service13
-rw-r--r--systemd/ssh-chat_lc_libcasa.service15
-rw-r--r--systemd/syslog2IRC@.service13
-rw-r--r--systemd/watbot@.service13
-rw-r--r--systemd/xabber-websocket.service13
24 files changed, 338 insertions, 0 deletions
diff --git a/README.md b/README.md
index e69de29..a2cf426 100644
--- a/README.md
+++ b/README.md
@@ -0,0 +1,3 @@
+LibertaCasa Systems
+
+System configurations and other nerdy things. Intended to be specific to LibertaCasa, however might overflow with other projects.
diff --git a/systemd/README.md b/systemd/README.md
new file mode 100644
index 0000000..e7a1722
--- /dev/null
+++ b/systemd/README.md
@@ -0,0 +1 @@
+This contains manually created systemd services, consolidated from all systems. Packaged systemd unit files will only appear if modifications have been performed.
diff --git a/systemd/convos.service b/systemd/convos.service
new file mode 100644
index 0000000..d4932a1
--- /dev/null
+++ b/systemd/convos.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Convos Daemon
+After=network.target
+
+[Service]
+User=convos
+Group=convos
+Environment=CONVOS_REVERSE_PROXY=1
+Environment=CONVOS_HOME=/srv/www/convos/.local/share/convos
+Environment=CONVOS_DEBUG=0
+ExecStart=/srv/www/convos/convos/script/convos daemon -l http://[::1]:8089
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/flask_libertacasa.service b/systemd/flask_libertacasa.service
new file mode 100644
index 0000000..21af2e3
--- /dev/null
+++ b/systemd/flask_libertacasa.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Liberta.Casa Flask / Webregistration for IRCd
+After=network.target
+
+[Service]
+WorkingDirectory=/mnt/gluster01/web/liberta.casa/flask
+Environment="PATH=/mnt/gluster01/web/liberta.casa/flask/.local/bin"
+Type=simple
+ExecStart=/mnt/gluster01/web/liberta.casa/flask/.local/bin/gunicorn -b localhost:8965 -w 3 flaskapp:app
+ExecReload=/bin/kill -HUP $MAINPID
+Restart=always
+User=flask
+Group=flask
+SyslogIdentifier=flask-lc
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/irccat.service b/systemd/irccat.service
new file mode 100644
index 0000000..7a0ff00
--- /dev/null
+++ b/systemd/irccat.service
@@ -0,0 +1,14 @@
+[Unit]
+After=network.target
+Description=irccat
+
+[Service]
+Type=simple
+User=irccat
+Group=irccat
+WorkingDirectory=/opt/irccat
+Restart=always
+ExecStart=/opt/irccat/irccat
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/katyusha.service b/systemd/katyusha.service
new file mode 100644
index 0000000..b1baa80
--- /dev/null
+++ b/systemd/katyusha.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Limnoria (katyusha)
+After=network.target
+
+[Service]
+Type=simple
+ExecStart=/opt/limnoria/katyusha/katyusha-venv-3.7.2/bin/supybot /opt/limnoria/katyusha/katyusha.conf
+ExecReload=/bin/kill -HUP $MAINPID
+Restart=always
+User=katyusha
+Group=katyusha
+SyslogIdentifier=katyusha
+SystemCallFilter=~@raw-io @clock @cpu-emulation @debug @keyring @module @mount @obsolete @privileged @raw-io
+ProtectSystem=strict
+ProtectHome=read-only
+ReadWritePaths=/opt/limnoria/katyusha /tmp
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/matrix-appserviceirc.service b/systemd/matrix-appserviceirc.service
new file mode 100644
index 0000000..a26ea98
--- /dev/null
+++ b/systemd/matrix-appserviceirc.service
@@ -0,0 +1,14 @@
+[Unit]
+After=network.target postgresql.service matrix-synapse.service
+Description=Matrix IRC Bridge
+
+[Service]
+Type=simple
+User=appserviceirc
+Group=matrix
+WorkingDirectory=/opt/matrix/appserviceirc
+Restart=always
+ExecStart=/opt/matrix/appserviceirc/.nvm/versions/node/v14.17.0/bin/node /opt/matrix/appserviceirc/matrix-appservice-irc/app.js -c /opt/matrix/appserviceirc/config.yaml -f /opt/matrix/appserviceirc/registration-local-1133.yaml
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/matrix-dimension.service b/systemd/matrix-dimension.service
new file mode 100644
index 0000000..a89987e
--- /dev/null
+++ b/systemd/matrix-dimension.service
@@ -0,0 +1,21 @@
+[Unit]
+Description=Matrix Integrations Server
+Requires=matrix-synapse.service postgresql.service
+After=network.target
+
+[Service]
+Type=simple
+ExecStart=/opt/matrix/dimension/start.sh
+ExecStop=/opt/matrix/dimension/stop.sh
+WorkingDirectory=/opt/matrix/dimension
+
+Restart=always
+RestartSec=60
+
+SyslogIdentifier=dimension
+
+User=dimension
+Group=matrix
+
+[Install]
+WantedBy=default.target
diff --git a/systemd/matrix-keyserver.service b/systemd/matrix-keyserver.service
new file mode 100644
index 0000000..62031d1
--- /dev/null
+++ b/systemd/matrix-keyserver.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Matrix Key Server
+Requires=postgresql.service
+
+[Service]
+Type=simple
+User=keyserver
+Group=matrix
+ExecStart=/opt/matrix/keyserver/matrix-key-server/bin/matrix-key-server -address="127.0.0.2" -port=8076 -domain="keys.matrix.liberta.casa" -postgres="postgres://$USER:$PASS@$SERVER/$DB?sslmode=$SSL"
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/matrix-maubot.service b/systemd/matrix-maubot.service
new file mode 100644
index 0000000..cc94e41
--- /dev/null
+++ b/systemd/matrix-maubot.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Matrix Maubot
+Requires=matrix-synapse.service
+
+[Service]
+Type=simple
+NotifyAccess=main
+Restart=on-abort
+User=maubot
+Group=matrix
+WorkingDirectory=/opt/matrix/maubot
+ExecStart=/opt/matrix/maubot/maubot-venv/bin/python3 -m maubot
+SyslogIdentifier=maubot
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/matrix-sydent.service b/systemd/matrix-sydent.service
new file mode 100644
index 0000000..4334491
--- /dev/null
+++ b/systemd/matrix-sydent.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Matrix Ident Server
+
+[Service]
+Type=simple
+Restart=on-failure
+User=sydent
+Group=matrix
+WorkingDirectory=/opt/matrix/sydent
+ExecStart=/opt/matrix/sydent/sydent-venv/bin/python -m sydent.sydent
+SyslogIdentifier=sydent
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/matrix-synapse.service b/systemd/matrix-synapse.service
new file mode 100644
index 0000000..b5cb286
--- /dev/null
+++ b/systemd/matrix-synapse.service
@@ -0,0 +1,23 @@
+[Unit]
+Description=Matrix Homeserver
+Requires=matrix-keyserver.service matrix-sydent.service
+After=postgresql.service
+
+[Service]
+#Type=notify
+Type=forking
+NotifyAccess=main
+ExecReload=/bin/kill -HUP $MAINPID
+Restart=on-abort
+User=synapse
+Group=matrix
+WorkingDirectory=/opt/matrix
+ExecStart=/opt/matrix/synapse/synapse-venv/bin/synctl start /etc/matrix-synapse/homeserver.yaml
+ExecStop=/opt/matrix/synapse/synapse-venv/bin/synctl stop
+SyslogIdentifier=synapse
+RuntimeDirectory=matrix
+
+# Environment=SYNAPSE_CACHE_FACTOR=2.0
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/mattermost.service b/systemd/mattermost.service
new file mode 100644
index 0000000..14d0a4d
--- /dev/null
+++ b/systemd/mattermost.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Mattermost
+After=syslog.target network.target mysql.service
+
+[Service]
+Type=notify
+WorkingDirectory=/opt/mattermost
+User=mattermost
+Group=mattermost
+ExecStart=/opt/mattermost/bin/mattermost
+PIDFile=/run/mattermost/master.pid
+TimeoutStartSec=3600
+LimitNOFILE=49152
+RuntimeDirectory=mattermost
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/mysqld_oracle.service b/systemd/mysqld_oracle.service
new file mode 100644
index 0000000..68ee265
--- /dev/null
+++ b/systemd/mysqld_oracle.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=MySQL Server (Standalone)
+After=syslog.target network.target
+
+[Service]
+User=mysql2
+Group=mysql2
+Type=simple
+PIDFile=/run/mysql-standalone/mysqld.pid
+ExecStart=/opt/mysql-standalone/bin/mysqld --defaults-file=/etc/my-standalone.cnf -h /var/lib/mysql-standalone --socket=/run/mysql-standalone/mysql.sock --pid-file=/run/mysql-standalone/mysqld.pid
+#ExecStop=/usr/bin/kill $MAINPID
+RuntimeDirectory=mysql-standalone
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/mysqld_percona.service b/systemd/mysqld_percona.service
new file mode 100644
index 0000000..7f98750
--- /dev/null
+++ b/systemd/mysqld_percona.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Percona XtraDB Cluster Server
+After=syslog.target network.target
+
+[Service]
+User=mysql
+Group=mysql
+Type=simple
+PIDFile=/run/mysql/mysqld.pid
+ExecStart=/opt/mysql/bin/mysqld --defaults-file=/etc/my.cnf -h /var/lib/mysql --socket=/run/mysql/mysql.sock --pid-file=/run/mysql/mysqld.pid
+#ExecStop=/usr/bin/kill $MAINPID
+RuntimeDirectory=mysql
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/node_exporter.service b/systemd/node_exporter.service
new file mode 100644
index 0000000..edc1482
--- /dev/null
+++ b/systemd/node_exporter.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Prometheus Node Exporter
+After=network.target
+
+[Service]
+User=node_exporter
+Group=prometheus
+Type=simple
+ExecStart=/opt/node_exporter/node_exporter --web.listen-address=":9200"
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/omnidb.service b/systemd/omnidb.service
new file mode 100644
index 0000000..406cbe5
--- /dev/null
+++ b/systemd/omnidb.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=OmniDB server daemon
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=/bin/bash -c "/opt/omnidb-server/omnidb-server -c /etc/omnidb.conf &"
+RemainAfterExit=yes
+User=root
+Group=root
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/openfire.service b/systemd/openfire.service
new file mode 100644
index 0000000..c75fff8
--- /dev/null
+++ b/systemd/openfire.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Openfire XMPP Server
+
+[Service]
+Type=forking
+User=openfire
+Group=openfire
+Environment=JAVA_HOME=/opt/jdk
+ExecStart=/opt/openfire/bin/openfire start
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/oragono.service b/systemd/oragono.service
new file mode 100644
index 0000000..3583352
--- /dev/null
+++ b/systemd/oragono.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=oragono
+After=network.target mnt-gluster01.mount
+# Requires=mysql.service
+# After=network.target mnt-gluster01.mount mysql.service
+
+[Service]
+Type=simple
+User=oragono
+Group=oragono
+WorkingDirectory=/opt/oragono/ergo
+ExecStart=/opt/oragono/ergo/ergo run --conf /mnt/gluster01/oragono/ircd.yaml
+ExecReload=/bin/kill -HUP $MAINPID
+Restart=on-failure
+LimitNOFILE=1048576
+SyslogIdentifier=ergo
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/prosody-filer.service b/systemd/prosody-filer.service
new file mode 100644
index 0000000..14ab8a1
--- /dev/null
+++ b/systemd/prosody-filer.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Prosody File Server
+
+[Service]
+Type=simple
+User=prosody-filer
+Group=prosody-filer
+WorkingDirectory=/opt/prosody-filer
+Restart=always
+ExecStart=/opt/prosody-filer/prosody-filer_linux_x86_64
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/ssh-chat_lc_libcasa.service b/systemd/ssh-chat_lc_libcasa.service
new file mode 100644
index 0000000..c662b36
--- /dev/null
+++ b/systemd/ssh-chat_lc_libcasa.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=ssh-chat LibertaCasa lucy
+After=network.target
+
+[Service]
+Type=simple
+User=ssh-chat
+Group=ssh-chat
+
+ExecStart=/opt/ssh-chat/ssh-chat --bind=":2220" -i="/opt/ssh-chat/.ssh/id_rsa" --admin="/etc/ssh/keys/ssh-chat" motd=""
+AmbientCapabilities=CAP_NET_BIND_SERVICE
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/syslog2IRC@.service b/systemd/syslog2IRC@.service
new file mode 100644
index 0000000..90973e9
--- /dev/null
+++ b/systemd/syslog2IRC@.service
@@ -0,0 +1,13 @@
+[Unit]
+Description = syslog2IRC for %i
+After = oragono.service
+
+[Service]
+User = syslog2IRC
+ExecStart = /opt/syslog2IRC/syslog2IRC-venv-3.7.2/bin/syslog2irc /opt/syslog2IRC/%i.toml
+StandardOutput = null
+StandardError = journal
+SyslogIdentifier = syslog2IRC-%i
+
+[Install]
+WantedBy = multi-user.target
diff --git a/systemd/watbot@.service b/systemd/watbot@.service
new file mode 100644
index 0000000..6dc2f58
--- /dev/null
+++ b/systemd/watbot@.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=watbot for %i
+Wants=network.target
+
+[Service]
+User=watbot
+Group=watbot
+ExecStart=/opt/watbot/watbot-%i.sh
+Restart=always
+RestartSec=15
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/xabber-websocket.service b/systemd/xabber-websocket.service
new file mode 100644
index 0000000..d8bf1d4
--- /dev/null
+++ b/systemd/xabber-websocket.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Xabber Websocket
+
+[Service]
+Type=simple
+User=xabber
+Group=xabber
+WorkingDirectory=/opt/xabber/xabber-websocket/_rel/xabber_ws
+ExecStart=/opt/xabber/xabber-websocket/_rel/xabber_ws/bin/xabber_ws start
+TimeOutStopSec=2
+
+[Install]
+WantedBy=multi-user.target