new ebuild www-apps/ntfy

Send push notifications to your phone or desktop using PUT/POST
This commit is contained in:
2026-06-01 15:23:18 +02:00
parent 9e72279007
commit 498e5b5f6f
6 changed files with 143 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
# Copyright 2020-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit acct-group
DESCRIPTION="gid for www-apps/ntfy"
ACCT_GROUP_ID=778
+13
View File
@@ -0,0 +1,13 @@
# Copyright 2020-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit acct-user
DESCRIPTION="uid for www-apps/ntfy"
ACCT_USER_ID=778
ACCT_USER_HOME=/var/lib/ntfy
ACCT_USER_GROUPS=( ${PN} )
acct-user_add_deps
+1
View File
@@ -0,0 +1 @@
DIST ntfy_2.23.0_linux_amd64.tar.gz 31238864 BLAKE2B 9eaa06d6bb63b1c6aaf60ec76cdb53b3eba98073967361919615b143447eb1846c301fb9fc8c85ac2167ff684f3e4a5493269408b22e80a924e451a3a472d5a3 SHA512 ce491c1d5114a60967b56bb9027013f810259510b05e4a8bb8d932632d86f262be1f612b6e10161332f7bc46e3c43f631a962cbedfb73c1579ea38abe0d97f29
+16
View File
@@ -0,0 +1,16 @@
#!/sbin/openrc-run
# Copyright 1999-2026 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
name="ntfy-client - Send push notifications to your phone or desktop using PUT/POST"
command="/usr/bin/ntfy"
command_args="subscribe --config /etc/ntfy/client.yml --from-config"
command_background="true"
command_user="ntfy:ntfy"
error_log="/var/log/ntfy-client.log"
pidfile="/run/ntfy-client.pid"
depend() {
need net
}
+49
View File
@@ -0,0 +1,49 @@
#!/sbin/openrc-run
# OpenRC service configuration for ntfy Server.
# Should be placed in /etc/init.d/ as "ntfy" or "ntfy-server" (no extension), owned by root:root and with permissions 755.
# Assumes an ntfy system user and group have been created, for example using this command:
# useradd --system --home-dir /var/lib/ntfy --shell /bin/false --comment "User for the simple HTTP-based pub-sub notification service" ntfy
name=$RC_SVCNAME
description="ntfy server"
command="/usr/bin/ntfy"
command_background=true
command_args="serve"
command_user="ntfy:ntfy"
extra_started_commands="reload"
pidfile="/run/${RC_SVCNAME}/${RC_SVCNAME}.pid"
# Changes the hard number of open files (nofile) limit to 2048 for the service.
rc_ulimit="-n 2048"
# Allows the service to bind to privileged ports (<1024).
capabilities="^cap_net_bind_service"
error_log="/var/log/ntfy.log"
# Service dependencies
depend() {
use net
after firewall
}
# Check for - and if necessary - create required files and folders. Might require some adjustment dependings on the content of the server.yml file.
start_pre() {
checkpath -f --owner "$command_user" --mode 0644 \
/var/log/ntfy.log
checkpath -d --owner "$command_user" --mode 0750 \
/run/ntfy/
checkpath -d --owner "$command_user" --mode 0755 \
/var/lib/ntfy/
checkpath -d --owner "$command_user" --mode 0750 \
/var/cache/ntfy/
}
reload() {
ebegin "Reloading $RC_SVCNAME's configuration"
start-stop-daemon --signal SIGHUP --pidfile "${pidfile}"
eend $? "Failed to reload $RC_SVCNAME's configuration"
}
+54
View File
@@ -0,0 +1,54 @@
# Copyright 1999-2026 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit systemd
DESCRIPTION="Send push notifications to your phone or desktop using PUT/POST"
HOMEPAGE="https://ntfy.sh/"
IUSE="server"
SRC_URI="
amd64? ( https://github.com/binwiederhier/ntfy/releases/download/v${PV}/ntfy_${PV}_linux_amd64.tar.gz )
"
RESTRICT="mirror strip bindist"
S=${WORKDIR}/ntfy_${PV}_linux_amd64
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64"
DEPEND="
"
RDEPEND="
${DEPEND}
acct-group/ntfy
acct-user/ntfy
"
DOCS=( README.md )
src_prepare() {
default
sed -i -e "s!# listen-http: \":80\"!listen-http: \"[::1]:8778\"!" server/server.yml || die
}
src_install() {
default
dobin ntfy
keepdir /etc/ntfy
insinto /etc/ntfy
doins client/client.yml
systemd_dounit client/ntfy-client.service
systemd_douserunit client/user/ntfy-client.service
newinitd "${FILESDIR}/client.initd" ntfy-client
if use server ; then
doins server/server.yml
systemd_dounit server/ntfy.service
newinitd "${FILESDIR}/server.initd" ntfy
fi
}