Page MenuHomeFreeBSD

D49128.id.diff
No OneTemporary

D49128.id.diff

diff --git a/GIDs b/GIDs
--- a/GIDs
+++ b/GIDs
@@ -797,7 +797,7 @@
_geodns:*:853:
ebusd:*:854:
opensearch:*:855:
-# free: 856
+ttrssd:*:856:
kanidmd:*:857:
umurmur:*:858:
kanidm:*:859:
diff --git a/UIDs b/UIDs
--- a/UIDs
+++ b/UIDs
@@ -803,7 +803,7 @@
_geodns:*:853:853::0:0:GeoDNS User:/var/empty:/usr/sbin/nologin
ebusd:*:854:854::0:0:eBUS Daemon user:/nonexistent:/usr/sbin/nologin
opensearch:*:855:855::0:0:opensearch user:/nonexistent:/usr/sbin/nologin
-# free: 856
+ttrssd:*:856:856::0:0:ttrssd user:/nonexistent:/usr/sbin/nologin
kanidmd:*:857:857::0:0:Kanidmd server:/nonexistent:/usr/sbin/nologin
umurmur:*:858:858::0:0:uMurmur:/nonexistent:/usr/sbin/nologin
kanidm:*:859:859::0:0:Kanidm client resolver:/nonexistent:/usr/sbin/nologin
diff --git a/www/tt-rss/Makefile b/www/tt-rss/Makefile
--- a/www/tt-rss/Makefile
+++ b/www/tt-rss/Makefile
@@ -29,9 +29,12 @@
NO_ARCH= yes
NO_BUILD= yes
-SUB_FILES= config.php httpd-tt-rss.conf pkg-message
+SUB_FILES= config.php httpd-tt-rss.conf pkg-message start.sh
SUB_LIST= WWWOWN=${WWWOWN}
+USERS= ttrssd
+GROUPS= ttrssd
+
PLIST_SUB= WWWGRP=${WWWGRP} \
WWWOWN=${WWWOWN}
@@ -53,12 +56,37 @@
"! -name LICENSE ! -name .empty ! -name Jenkinsfile")
${RM} -r ${STAGEDIR}${WWWDIR}/debian
${INSTALL_DATA} ${WRKDIR}/httpd-tt-rss.conf ${STAGEDIR}${DATADIR}
- ${ECHO} "${OPSYS}:${PORTVERSION}:${GH_TAGNAME:C/^(.{11}).*$/\1/W}}" > \
+ ${ECHO} "${OPSYS}:${PORTVERSION}:${GH_TAGNAME:C/^(.{11}).*$/\1/W}" > \
"${STAGEDIR}${WWWDIR}/version_static.txt"
${RM} ${STAGEDIR}${WWWDIR}/config.php-dist
${INSTALL_DATA} ${WRKDIR}/config.php \
${STAGEDIR}${WWWDIR}/config.php.sample
${INSTALL_DATA} ${FILESDIR}/newsyslog.sample \
${STAGEDIR}${EXAMPLESDIR}
+ ${INSTALL_DATA} ${WRKDIR}/start.sh ${STAGEDIR}${WWWDIR}
+ ${MKDIR} ${STAGEDIR}/var/log/ttrssd
+ ${MKDIR} ${STAGEDIR}/var/run/ttrssd
+
+ ${MKDIR} ${STAGEDIR}/var/tt-rss
+ ${MV} ${STAGEDIR}${WWWDIR}/cache \
+ ${STAGEDIR}${WWWDIR}/feed-icons \
+ ${STAGEDIR}${WWWDIR}/lock \
+ ${STAGEDIR}/var/tt-rss
+
+ ${MKDIR} ${STAGEDIR}/var/tt-rss/local/
+ ${MV} ${STAGEDIR}${WWWDIR}/plugins.local \
+ ${STAGEDIR}${WWWDIR}/templates.local \
+ ${STAGEDIR}${WWWDIR}/themes.local \
+ ${STAGEDIR}/var/tt-rss/local
+
+ ${MKDIR} ${STAGEDIR}/var/tt-rss/local/plugins/af_comics
+ ${MV} ${STAGEDIR}${WWWDIR}/plugins/af_comics/filters.local \
+ ${STAGEDIR}/var/tt-rss/local/plugins/af_comics
+
+ ${RLN} ${STAGEDIR}/var/tt-rss/local/plugins.local ${STAGEDIR}${WWWDIR}
+ ${RLN} ${STAGEDIR}/var/tt-rss/local/templates.local ${STAGEDIR}${WWWDIR}
+ ${RLN} ${STAGEDIR}/var/tt-rss/local/themes.local ${STAGEDIR}${WWWDIR}
+ ${RLN} ${STAGEDIR}/var/tt-rss/local/plugins/af_comics/filters.local \
+ ${STAGEDIR}${WWWDIR}/plugins/af_comics
.include <bsd.port.mk>
diff --git a/www/tt-rss/files/config.php.in b/www/tt-rss/files/config.php.in
--- a/www/tt-rss/files/config.php.in
+++ b/www/tt-rss/files/config.php.in
@@ -21,6 +21,10 @@
# Required for plugin installer usage of git
putenv("PATH=%%LOCALBASE%%/bin/:" . getenv("PATH"));
+ putenv('TTRSS_CACHE_DIR=/var/tt-rss/cache');
+ putenv('TTRSS_ICONS_DIR=/var/tt-rss/feed-icons');
+ putenv('TTRSS_LOCK_DIRECTORY=/var/tt-rss/lock');
+
#putenv('TTRSS_SINGLE_USER_MODE=true');
#putenv('TTRSS_SELF_URL_PATH=');
diff --git a/www/tt-rss/files/newsyslog.sample b/www/tt-rss/files/newsyslog.sample
--- a/www/tt-rss/files/newsyslog.sample
+++ b/www/tt-rss/files/newsyslog.sample
@@ -1 +1 @@
-/var/log/ttrssd.log root:wheel 644 3 * $W0 JC /var/run/ttrssd.pid
+/var/log/ttrssd/ttrssd.log ttrssd:ttrssd 660 3 * $W0 JC /var/run/ttrssd/ttrssd.pid
diff --git a/www/tt-rss/files/start.sh.in b/www/tt-rss/files/start.sh.in
new file mode 100644
--- /dev/null
+++ b/www/tt-rss/files/start.sh.in
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+trap 'kill -INT $child' INT
+trap 'kill -TERM $child' TERM
+
+%%WWWDIR%%/update.php --update-schema=force-yes
+%%WWWDIR%%/update_daemon2.php &
+
+child="$!"
+
+wait "$child"
+
diff --git a/www/tt-rss/files/ttrssd.in b/www/tt-rss/files/ttrssd.in
--- a/www/tt-rss/files/ttrssd.in
+++ b/www/tt-rss/files/ttrssd.in
@@ -17,23 +17,37 @@
# read settings, set default values
load_rc_config "${name}"
-: ${ttrssd_enable="NO"}
+: ${ttrssd_enable=NO}
+: ${ttrssd_user="$name"}
+: ${ttrssd_group="$name"}
long_name="Tiny Tiny RSS updating feeds daemon."
required_files="%%WWWDIR%%/config.php"
-pidfile="/var/run/${name}.pid"
-cpidfile="/var/run/${name}_child.pid"
+pidfile="/var/run/${name}/${name}.pid"
+cpidfile="/var/run/${name}/${name}_child.pid"
phpcli="%%LOCALBASE%%/bin/php"
initdb_php="%%WWWDIR%%/update.php"
phpupd="%%WWWDIR%%/update_daemon2.php"
-ttrssd_log="/var/log/${name}.log"
+ttrssd_log="/var/log/${name}/${name}.log"
+ttrssd_cmd="%%WWWDIR%%/start.sh"
+ttrssd_umask="0003"
command="/usr/sbin/daemon"
-command_args="-rR 10 -H -u %%WWWOWN%% \
- -P $pidfile -p $cpidfile \
- -o $ttrssd_log sh -c \
- '$initdb_php --update-schema=force-yes; \
- $phpupd;'"
+command_args="-rR 10 -H -P $pidfile -p $cpidfile \
+ -o $ttrssd_log $ttrssd_cmd"
+
+start_precmd="${name}_start_precmd"
+
+ttrssd_start_precmd()
+{
+ # daemon defaults to 0600 when using -o
+ if [ -f "$ttrssd_log" ]; then
+ if ! chown "$ttrssd_user" "$ttrssd_log"; then
+ echo "Setting ${ttrssd_log} owner failed"
+ exit 1
+ fi
+ fi
+}
run_rc_command "$1"
diff --git a/www/tt-rss/pkg-plist b/www/tt-rss/pkg-plist
--- a/www/tt-rss/pkg-plist
+++ b/www/tt-rss/pkg-plist
@@ -1,29 +1,47 @@
%%DATADIR%%/httpd-tt-rss.conf
+@dir /var/tt-rss
@sample %%EXAMPLESDIR%%/newsyslog.sample etc/newsyslog.conf.d/ttrssd.conf
-@group %%WWWGRP%%
-@mode ug=rx
+@dir etc/newsyslog.conf.d
+@group ttrssd
+@mode 0454
+%%WWWDIR%%/start.sh
+@owner %%WWWOWN%%
%%WWWDIR%%/update.php
%%WWWDIR%%/update_daemon2.php
-@group
@mode
-@owner %%WWWOWN%%
-@mode 0400
+@mode 0440
@sample %%WWWDIR%%/config.php.sample
-@mode
-@dir %%WWWDIR%%/cache
-@dir %%WWWDIR%%/cache/export
-@dir %%WWWDIR%%/cache/feeds
-@dir %%WWWDIR%%/cache/images
-@dir %%WWWDIR%%/cache/upload
-@dir %%WWWDIR%%/feed-icons
-@dir %%WWWDIR%%/lock
-@dir %%WWWDIR%%/plugins.local
-@dir %%WWWDIR%%/plugins/af_comics/filters.local
-@dir %%WWWDIR%%/templates.local
-@dir %%WWWDIR%%/themes.local
+@mode 0770
+@dir /var/tt-rss/cache
+@dir /var/tt-rss/cache/export
+@dir /var/tt-rss/cache/feeds
+@dir /var/tt-rss/cache/images
+@dir /var/tt-rss/cache/upload
+@dir /var/tt-rss/feed-icons
+@dir /var/tt-rss/lock
+@group
+@mode 0700
+@dir /var/tt-rss/local/plugins.local
+@dir /var/tt-rss/local/plugins/af_comics/filters.local
+@dir /var/tt-rss/local/templates.local
+@dir /var/tt-rss/local/themes.local
@owner
+@group ttrssd
+@mode 775
+@dir /var/log/ttrssd
+@dir /var/run/ttrssd
+@dir /var/tt-rss/local
+@dir /var/tt-rss/local/plugins
+@dir /var/tt-rss/local/plugins/af_comics
@group
@mode
+%%WWWDIR%%/plugins.local
+%%WWWDIR%%/plugins/af_comics/filters.local
+%%WWWDIR%%/templates.local
+%%WWWDIR%%/themes.local
+/var/tt-rss/feed-icons/index.html
+/var/tt-rss/local/plugins.local/index.html
+/var/tt-rss/local/templates.local/index.html
%%WWWDIR%%/CONTRIBUTING.md
%%WWWDIR%%/COPYING
%%WWWDIR%%/README.md
@@ -91,7 +109,6 @@
%%WWWDIR%%/composer.lock
%%WWWDIR%%/docker-compose.yml
%%WWWDIR%%/eslint.config.js
-%%WWWDIR%%/feed-icons/index.html
%%WWWDIR%%/gulpfile.js
%%WWWDIR%%/images/blank_icon.gif
%%WWWDIR%%/images/favicon-512px.png
@@ -2004,7 +2021,6 @@
%%WWWDIR%%/package.json
%%WWWDIR%%/phpstan.neon
%%WWWDIR%%/phpunit.xml
-%%WWWDIR%%/plugins.local/index.html
%%WWWDIR%%/plugins/af_comics/af_comics_template.php
%%WWWDIR%%/plugins/af_comics/filter_base.php
%%WWWDIR%%/plugins/af_comics/filters/af_comics_cad.php
@@ -2205,7 +2221,6 @@
%%WWWDIR%%/sql/pgsql/migrations/150.sql
%%WWWDIR%%/sql/pgsql/migrations/151.sql
%%WWWDIR%%/sql/pgsql/schema.sql
-%%WWWDIR%%/templates.local/index.html
%%WWWDIR%%/templates/digest_template.txt
%%WWWDIR%%/templates/digest_template_html.txt
%%WWWDIR%%/templates/email_article_template.txt

File Metadata

Mime Type
text/plain
Expires
Sat, Apr 4, 5:32 PM (20 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30831797
Default Alt Text
D49128.id.diff (7 KB)

Event Timeline