From 665301915b1d5a04b695717c346fe5b4aedeb08e Mon Sep 17 00:00:00 2001 From: Joel Beckmeyer Date: Sat, 31 Dec 2022 16:15:19 -0500 Subject: [PATCH] New package: ntfy-1.31.0 --- srcpkgs/ntfy/files/ntfy-server/run | 3 +++ srcpkgs/ntfy/patches/config.patch | 31 ++++++++++++++++++++++++++++++ srcpkgs/ntfy/template | 30 +++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 srcpkgs/ntfy/files/ntfy-server/run create mode 100644 srcpkgs/ntfy/patches/config.patch create mode 100644 srcpkgs/ntfy/template diff --git a/srcpkgs/ntfy/files/ntfy-server/run b/srcpkgs/ntfy/files/ntfy-server/run new file mode 100644 index 000000000000..26e9f7928163 --- /dev/null +++ b/srcpkgs/ntfy/files/ntfy-server/run @@ -0,0 +1,3 @@ +#!/bin/sh +exec 2>&1 +exec chpst -u _ntfy:_ntfy ntfy serve diff --git a/srcpkgs/ntfy/patches/config.patch b/srcpkgs/ntfy/patches/config.patch new file mode 100644 index 000000000000..834570b03916 --- /dev/null +++ b/srcpkgs/ntfy/patches/config.patch @@ -0,0 +1,31 @@ +diff --git a/server/server.yml b/server/server.yml +index 1b26899..5de6ac1 100644 +--- a/server/server.yml ++++ b/server/server.yml +@@ -36,7 +36,7 @@ + # If set, also publish messages to a Firebase Cloud Messaging (FCM) topic for your app. + # This is optional and only required to save battery when using the Android app. + # +-# firebase-key-file: ++# firebase-key-file: /var/lib/ntfy/firebase.key + + # If "cache-file" is set, messages are cached in a local SQLite database instead of only in-memory. + # This allows for service restarts without losing messages in support of the since= parameter. +@@ -68,7 +68,7 @@ + # If you are running ntfy with systemd, make sure this cache file is owned by the + # ntfy user and group by running: chown ntfy.ntfy . + # +-# cache-file: ++# cache-file: /var/lib/ntfy/cache.sqlite + # cache-duration: "12h" + # cache-startup-queries: + # cache-batch-size: 0 +@@ -89,7 +89,7 @@ + # If you are running ntfy with systemd, make sure this user database file is owned by the + # ntfy user and group by running: chown ntfy.ntfy . + # +-# auth-file: ++# auth-file: /var/lib/ntfy/auth.sqlite + # auth-default-access: "read-write" + + # If set, the X-Forwarded-For header is used to determine the visitor IP address diff --git a/srcpkgs/ntfy/template b/srcpkgs/ntfy/template new file mode 100644 index 000000000000..20c15c89472b --- /dev/null +++ b/srcpkgs/ntfy/template @@ -0,0 +1,30 @@ +# Template file for 'ntfy' +pkgname=ntfy +version=1.31.0 +revision=1 +build_style=go +go_import_path="heckel.io/ntfy" +go_ldflags="-X main.version=${version} -X main.commit=v${version} + -X main.date=${SOURCE_DATE_EPOCH}" +hostmakedepends="nodejs" +short_desc="Send push notifications to your phone or desktop using PUT/POST" +maintainer="Joel Beckmeyer " +license="Apache-2.0,GPL-2.0-only" +homepage="https://ntfy.sh" +distfiles="https://github.com/binwiederhier/ntfy/archive/refs/tags/v${version}.tar.gz" +checksum=966f614a0e74dd09378e23b3580d4a90a83bce40d20237c1cb5511bda4ac8c78 +system_accounts="_ntfy" +make_dirs="/var/lib/ntfy 0700 _ntfy _ntfy" +_ntfy_homedir="/var/lib/ntfy" +conf_files="/etc/ntfy/server.yml" + +pre_build() { + make web + mkdir -p dist/ntfy_linux_server server/docs + touch server/docs/index.html server/site/app.html +} + +post_install() { + vsv ntfy-server + vinstall server/server.yml 644 etc/ntfy +}