net-im/mastoposter: don't run as root

Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
This commit is contained in:
Anna (cybertailor) Vyalkova 2023-05-14 07:31:21 +05:00
parent 01e94549ad
commit 31af51e4bf
No known key found for this signature in database
GPG Key ID: E7B76EDC50864BB1
3 changed files with 9 additions and 1 deletions

View File

@ -6,6 +6,7 @@
command="/usr/bin/mastoposter"
command_args="${MASTOPOSTER_CONFIG_FILE:=/etc/mastoposter/config.ini}"
command_user="mastoposter:mastoposter"
command_background=1
pidfile="/run/${RC_SVCNAME}.pid"
output_log="/var/log/${RC_SVCNAME}.log"
@ -14,3 +15,7 @@ error_log="${output_log}"
depend() {
need net
}
start_pre() {
checkpath -fo "${command_user}" "${output_log}"
}

View File

@ -5,6 +5,8 @@ Wants=network-online.target
[Service]
Type=simple
User=mastoposter
Group=mastoposter
ExecStart=/usr/bin/mastoposter /etc/mastoposter/config.ini
Restart=always
RestartSec=5

View File

@ -18,6 +18,7 @@ SLOT="0"
KEYWORDS="~amd64"
RDEPEND="
acct-user/mastoposter
dev-python/beautifulsoup4[${PYTHON_USEDEP}]
dev-python/emoji[${PYTHON_USEDEP}]
dev-python/httpx[${PYTHON_USEDEP}]
@ -33,6 +34,6 @@ src_install() {
newconfd "${FILESDIR}"/mastoposter.confd mastoposter
insinto /etc/mastoposter
insopts --mode 600
insopts --mode=600 --owner=${PN} --group=${PN}
doins config.ini
}