From f045145f00e9edafc06bd0c34385eef9e1fcf1ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anna=20=E2=80=9CCyberTailor=E2=80=9D?= Date: Wed, 10 May 2023 06:48:56 +0500 Subject: [PATCH 1/3] Added OpenRC service --- contrib/mastoposter.initd | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 contrib/mastoposter.initd diff --git a/contrib/mastoposter.initd b/contrib/mastoposter.initd new file mode 100644 index 0000000..a35730f --- /dev/null +++ b/contrib/mastoposter.initd @@ -0,0 +1,26 @@ +#!/sbin/openrc-run +# mastoposter - configurable reposter from Mastodon-compatible Fediverse servers +# Copyright (C) 2022-2023 hatkidchan +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# shellcheck shell=sh + +command="/usr/bin/mastoposter" +command_args="${MASTOPOSTER_CONFIG_FILE:=/etc/mastoposter/config.ini}" +command_background=1 +pidfile="/run/${RC_SVCNAME}.pid" +output_log="/var/log/${RC_SVCNAME}.log" +error_log="${output_log}" + +depend() { + need net +} From d168db772c5ce7dd714b56f6e5a462a162966808 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anna=20=E2=80=9CCyberTailor=E2=80=9D?= Date: Wed, 10 May 2023 06:49:39 +0500 Subject: [PATCH 2/3] Added SystemD service --- contrib/mastoposter.service | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 contrib/mastoposter.service diff --git a/contrib/mastoposter.service b/contrib/mastoposter.service new file mode 100644 index 0000000..028cb77 --- /dev/null +++ b/contrib/mastoposter.service @@ -0,0 +1,28 @@ +# mastoposter - configurable reposter from Mastodon-compatible Fediverse servers +# Copyright (C) 2022-2023 hatkidchan +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +[Unit] +Description=Configurable reposter from Mastodon-compatible Fediverse servers +After=network.target +Wants=network-online.target + +[Service] +Type=simple +ExecStart=/usr/bin/mastoposter /etc/mastoposter/config.ini +Restart=always +RestartSec=5 +StandardOutput=journal +StandardError=inherit + +[Install] +WantedBy=multi-user.target From 8c8d3040667b601780002f79a49f514e36a7c583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anna=20=E2=80=9CCyberTailor=E2=80=9D?= Date: Wed, 10 May 2023 06:50:14 +0500 Subject: [PATCH 3/3] Include 'contrib' in sdist --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8cfac9f..cd08aa1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,4 +34,4 @@ Source = "https://github.com/hatkidchan/mastoposter" mastoposter = "mastoposter.__main__:main" [tool.flit.sdist] -include = ["config.ini"] +include = ["config.ini", "contrib/*"]