diff --git a/sysutils/go-ntfy/Makefile b/sysutils/go-ntfy/Makefile index 421b505c6a01..6fe5d2bb14ad 100644 --- a/sysutils/go-ntfy/Makefile +++ b/sysutils/go-ntfy/Makefile @@ -1,68 +1,71 @@ PORTNAME= ntfy DISTVERSIONPREFIX= v DISTVERSION= 2.26.3 CATEGORIES= sysutils MASTER_SITES= LOCAL/dtxdf/${PORTNAME}/:assets PKGNAMEPREFIX= go- # For instructions on how to create assets: # https://github.com/DtxdF/port-assets-makejails/tree/main/ntfy DISTFILES= ${PORTNAME}-${DISTVERSIONPREFIX}${DISTVERSION}.frontend${EXTRACT_SUFX}:assets MAINTAINER= dtxdf@FreeBSD.org COMMENT= Send push notifications to your phone or desktop using PUT/POST WWW= https://ntfy.sh LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE USES= go:1.26+,modules USE_GITHUB= yes GH_ACCOUNT= binwiederhier USE_RC_SUBR= ${PORTNAME} GO_MOD_DIST= github GO_MODULE= github.com/binwiederhier/${PORTNAME} GO_BUILDFLAGS= -ldflags "\ -X 'main.version=${DISTVERSION}' \ -X 'main.commit=${GITID}' \ -X 'main.date=${BUILD_DATE}'" CONFLICTS_INSTALL= sysutils/ntfy PLIST_FILES= "@sample ${ETCDIR}/client.yml.sample" \ "@sample ${ETCDIR}/server.yml.sample" \ + "@sample etc/newsyslog.conf.d/${PORTNAME}.conf.sample" \ bin/${PORTNAME} OPTIONS_DEFINE= DOCS DOCS_BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}mkdocs-material>=0:textproc/py-mkdocs-material@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}mkdocs-minify-plugin>=0:textproc/py-mkdocs-minify-plugin@${PY_FLAVOR} DOCS_USES= python # Run 'git checkout ${DISTVERSIONPREFIX}${DISTVERSION} && git rev-parse --short HEAD' # in the ntfy repository to get the value of GITID. GITID= 311138e BUILD_DATE= $$(date -u "+%Y-%m-%dT%H:%M:%SZ") post-patch: @${GREP} -rl "/etc/${PORTNAME}" ${WRKSRC}/cmd ${WRKSRC}/server \ | ${XARGS} ${REINPLACE_CMD} -e 's#/etc/${PORTNAME}#${ETCDIR}#g' pre-build: @${MKDIR} ${WRKSRC}/server/docs ${TOUCH} ${WRKSRC}/server/docs/index.html ${RM} -r ${WRKSRC}/server/site @${MKDIR} ${WRKSRC}/server/site @cd ${WRKDIR}/ntfy-frontend && ${COPYTREE_SHARE} . ${WRKSRC}/server/site pre-build-DOCS-on: @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} mkdocs build post-install: @${MKDIR} ${STAGEDIR}${ETCDIR} ${INSTALL_DATA} ${WRKSRC}/server/server.yml ${STAGEDIR}${ETCDIR}/server.yml.sample ${INSTALL_DATA} ${WRKSRC}/client/client.yml ${STAGEDIR}${ETCDIR}/client.yml.sample + @${MKDIR} ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d + ${INSTALL_DATA} ${FILESDIR}/newsyslog.conf ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d/${PORTNAME}.conf.sample .include diff --git a/sysutils/go-ntfy/files/newsyslog.conf b/sysutils/go-ntfy/files/newsyslog.conf new file mode 100644 index 000000000000..b51ea98a5d20 --- /dev/null +++ b/sysutils/go-ntfy/files/newsyslog.conf @@ -0,0 +1,6 @@ +# configuration file for newsyslog for ntfy +# +# see newsyslog.conf(5) for details +# +# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] +/var/log/ntfy.log 644 7 1000 * JC /var/run/ntfyd.pid diff --git a/sysutils/go-ntfy/files/ntfy.in b/sysutils/go-ntfy/files/ntfy.in index f205ad6ad038..2c9c1ddeb824 100644 --- a/sysutils/go-ntfy/files/ntfy.in +++ b/sysutils/go-ntfy/files/ntfy.in @@ -1,32 +1,33 @@ #!/bin/sh # PROVIDE: ntfy # REQUIRE: LOGIN # KEYWORD: shutdown # # Configuration settings for ntfy in /etc/rc.conf # # ntfy_enable (bool): Enable ntfy. (default=NO) # ntfy_log (str): Log output. (default=/var/log/ntfy.log) # ntfy_runas (str): User to run ntfy as. (default=www) # . /etc/rc.subr name="ntfy" desc="Send push notifications to your phone or desktop using PUT/POST" rcvar="${name}_enable" load_rc_config $name : ${ntfy_enable:="NO"} : ${ntfy_log:="/var/log/ntfy.log"} : ${ntfy_runas:="www"} : ${ntfy_args=""} pidfile="/var/run/${name}.pid" +supervisor_pidfile="/var/run/${name}d.pid" procname="%%LOCALBASE%%/bin/${name}" command="/usr/sbin/daemon" -command_args="-c -u '${ntfy_runas}' -p '${pidfile}' -t '${desc}' -o '${ntfy_log}' '${procname}' serve ${ntfy_args}" +command_args="-cH -u '${ntfy_runas}' -P '${supervisor_pidfile}' -p '${pidfile}' -t '${name}: ${desc}' -o '${ntfy_log}' '${procname}' serve ${ntfy_args}" run_rc_command "$1"