From c16c693971609a4a4cf7debb91afa45cc5332398 Mon Sep 17 00:00:00 2001 From: Robert William Vesterman Date: Tue, 1 Oct 2024 00:53:34 -0400 Subject: [PATCH 1/2] Update ttrssd.in - allow ttrssd to run as a specified user ttrssd (from www/tt-rss) currently runs as the user "www", and there doesn't seem to be a way to override that. This change adds an optional flag that can be specified in /etc/rc.conf to do so. The flag is "ttrssd_run_as_user"; for example to run as the user "mmm", add the following line to /etc/rc.conf: ttrssd_run_as_user="mmm" If it is not specified, it defaults to "www" (reproducing the behavior from before this change). --- www/tt-rss/files/ttrssd.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/www/tt-rss/files/ttrssd.in b/www/tt-rss/files/ttrssd.in index 7934b98a4afc8..74670b9450480 100644 --- a/www/tt-rss/files/ttrssd.in +++ b/www/tt-rss/files/ttrssd.in @@ -7,6 +7,9 @@ # Add the following lines to /etc/rc.conf to enable `ttrssd': # # ttrssd_enable="YES" +# +# Optional: +# ttrssd_run_as_user The user to run as (default www) . /etc/rc.subr @@ -18,6 +21,7 @@ rcvar=ttrssd_enable # read settings, set default values load_rc_config "${name}" : ${ttrssd_enable="NO"} +: ${ttrssd_run_as_user="%%WWWOWN%%"} long_name="Tiny Tiny RSS updating feeds daemon." required_files="%%WWWDIR%%/config.php" @@ -30,7 +34,7 @@ phpupd="%%WWWDIR%%/update_daemon2.php" ttrssd_log="/var/log/${name}.log" command="/usr/sbin/daemon" -command_args="-rR 10 -H -u %%WWWOWN%% \ +command_args="-rR 10 -H -u $ttrssd_run_as_user \ -P $pidfile -p $cpidfile \ -o $ttrssd_log sh -c \ '$initdb_php --update-schema=force-yes; \ From 532286508b37fdb6fec7317d67fe67e0762db691 Mon Sep 17 00:00:00 2001 From: Robert William Vesterman Date: Wed, 2 Oct 2024 21:46:39 -0400 Subject: [PATCH 2/2] Allow any user to read/execute ttrssd update scripts Part of a change to allow ttrssd to run as a specified user rather than always as ``www`` - ``chmod`` the ``update*.php`` files at install time rather than relying on the user to do it manually (in which case it would be overwritten upon reinstall or update). This part of the change was suggested by @derekschrock in response to [my earlier PR](https://github.com/freebsd/freebsd-ports/pull/304). --- www/tt-rss/pkg-plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/tt-rss/pkg-plist b/www/tt-rss/pkg-plist index 909f900cce5f3..9c4f139c3a0a5 100644 --- a/www/tt-rss/pkg-plist +++ b/www/tt-rss/pkg-plist @@ -1,7 +1,7 @@ %%DATADIR%%/httpd-tt-rss.conf @sample %%EXAMPLESDIR%%/newsyslog.sample etc/newsyslog.conf.d/ttrssd.conf @group %%WWWGRP%% -@mode ug=rx +@mode ugo=rx %%WWWDIR%%/update.php %%WWWDIR%%/update_daemon2.php @group