Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F167246605
D49128.id177565.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
6 KB
Referenced Files
None
Subscribers
None
D49128.id177565.diff
View Options
diff --git a/GIDs b/GIDs
--- a/GIDs
+++ b/GIDs
@@ -512,7 +512,7 @@
# free: 568
# free: 569
# free: 570
-# free: 571
+ttrssd:*:571:
# free: 572
# free: 573
# free: 574
diff --git a/UIDs b/UIDs
--- a/UIDs
+++ b/UIDs
@@ -518,7 +518,7 @@
# free: 568
# free: 569
# free: 570
-# free: 571
+ttrssd:*:571:571::0:0:ttrssd user:/nonexistent:/usr/sbin/nologin
# free: 572
# free: 573
# free: 574
diff --git a/www/tt-rss/Makefile b/www/tt-rss/Makefile
--- a/www/tt-rss/Makefile
+++ b/www/tt-rss/Makefile
@@ -27,9 +27,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}
@@ -50,12 +53,30 @@
(cd ${WRKSRC} && ${COPYTREE_SHARE} "*" ${STAGEDIR}${WWWDIR} \
"! -name LICENSE ! -name .empty ! -name docker-compose.yml")
${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}/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
.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,14 @@
# 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_LOCAL_PLUGINS_DIR=/var/tt-rss/local/plugins.local');
+ putenv('TTRSS_LOCAL_TEMPLATES_DIR=/var/tt-rss/local/templates.local');
+ putenv('TTRSS_LOCAL_THEMES_DIR=/var/tt-rss/local/themes.local');
+
#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,28 +1,39 @@
%%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%%/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/lock
+@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
+/var/tt-rss/local/plugins.local/index.html
+/var/tt-rss/local/templates.local/index.html
%%WWWDIR%%/CONTRIBUTING.md
%%WWWDIR%%/COPYING
%%WWWDIR%%/README.md
@@ -2008,7 +2019,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
@@ -2209,7 +2219,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
Details
Attached
Mime Type
text/plain
Expires
Fri, Aug 21, 8:18 AM (3 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37025623
Default Alt Text
D49128.id177565.diff (6 KB)
Attached To
Mode
D49128: www/tt-rss: Run ttrssd as ttrssd user and move data to /var
Attached
Detach File
Event Timeline
Log In to Comment