diff --git a/ntfy-matrix-bridge.service b/ntfy-matrix-bridge.service new file mode 100644 index 0000000..f184102 --- /dev/null +++ b/ntfy-matrix-bridge.service @@ -0,0 +1,19 @@ +[Unit] +Description=ntfy -> Matrix bridge +After=network-online.target +Wants=network-online.target + +[Service] +Type=simple +User=ntfybridge +WorkingDirectory=/opt/ntfy-matrix-bridge +# Keep the token out of the config file by passing it in here (chmod 600 the +# unit, or use an EnvironmentFile=/etc/ntfy-matrix-bridge.env instead). +Environment=MATRIX_ACCESS_TOKEN=replace-me +# EnvironmentFile=/etc/ntfy-matrix-bridge.env +ExecStart=/opt/ntfy-matrix-bridge/venv/bin/python /opt/ntfy-matrix-bridge/bridge.py --config /opt/ntfy-matrix-bridge/config.yaml +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target