public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: www-apps/tt-rss/, www-apps/tt-rss/files/
@ 2018-01-18 13:44 James Le Cuirot
  0 siblings, 0 replies; 5+ messages in thread
From: James Le Cuirot @ 2018-01-18 13:44 UTC (permalink / raw
  To: gentoo-commits

commit:     9605ea072743f9a1a27eaf8437de2a41a263bdaf
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 18 13:39:08 2018 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Thu Jan 18 13:43:48 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9605ea07

www-apps/tt-rss: Bump to 20180105, security fix, other fixes

* Addresses unsafe use of recursive chown/chmod in the init script
  whilst also dealing with poor permissions handling that may have led
  to issues in the past.
* Fixes "postgresql" misspelling in the init script.
* Fixes logrotate issue using delaycompress directive.
* Allows options to be passed to the daemon.

Bug: https://bugs.gentoo.org/603518
Closes: https://bugs.gentoo.org/609044
Closes: https://bugs.gentoo.org/620878
Closes: https://bugs.gentoo.org/627048
Closes: https://bugs.gentoo.org/639918
Package-Manager: Portage-2.3.19, Repoman-2.3.6

 www-apps/tt-rss/Manifest                           |  1 +
 www-apps/tt-rss/files/permissions                  | 25 ++++++
 .../tt-rss/files/postinstall-en-with-daemon-r1.txt | 14 ++++
 .../tt-rss/files/postinstall-en-with-daemon.txt    |  2 +-
 www-apps/tt-rss/files/postinstall-en.txt           |  7 +-
 www-apps/tt-rss/files/ttrssd.confd-r2              | 47 ++++++++++++
 www-apps/tt-rss/files/ttrssd.initd-r3              | 88 ++++++++++++++++++++++
 www-apps/tt-rss/files/ttrssd.logrotated            |  1 +
 .../{ttrssd.logrotated => ttrssd.logrotated-r1}    |  3 +-
 www-apps/tt-rss/tt-rss-20180105.ebuild             | 84 +++++++++++++++++++++
 10 files changed, 264 insertions(+), 8 deletions(-)

diff --git a/www-apps/tt-rss/Manifest b/www-apps/tt-rss/Manifest
index c04edba0436..2c45842b727 100644
--- a/www-apps/tt-rss/Manifest
+++ b/www-apps/tt-rss/Manifest
@@ -1,2 +1,3 @@
 DIST tt-rss-20160527.tar.bz2 2064633 BLAKE2B 406c2ff551e2ba616a8f4696d7deaf8a3f85e4f86f0b09f57507af7f4657930f11fc0aa9df467af5ad2c56657d95e12b75bae721da4d86480b06bbbc0ab72744 SHA512 8d482303868a08f4d65ef252f71f66ec3219d4f67e968a026a0302d29930cd5af45cedea81171db2ff0927497079d3bedd8fd70e4e9904f5d9987a92a6dfcb89
 DIST tt-rss-20160930.tar.bz2 2072888 BLAKE2B e6ca0a72730cdf9a1106d7098e6a6bfc9bf35f545a67e9b569552644b23543b4168000afe2e5fbf5a1fd81371e72e570e270a77d5345bca5f22d79c1a86409b0 SHA512 d420e7efdf7d17e153ef0aa487a330379afe20fe9e9a6209de40b797d36e425cbcbdf2280eaf5ada8b9bef1ae37146253556ff602bbff22a9a7c311ff525d9e2
+DIST tt-rss-20180105.tar.gz 3070929 BLAKE2B 2370104c70f5381d690a29b216269c749bf1f7c6b925eb9499b741e5df3e686d95fce430a144946fd915414481280b67e6d0c881edcdd13aee0fa344dc0bec3f SHA512 86ceec3646629ad7fd3fde2f3c3237e48ad96bd08b46e73c34c76507d9b17613ea309e1bd5e6e85a0d9eb96029e54b54e5ee367c56aab31be3dcec9169c5ada5

diff --git a/www-apps/tt-rss/files/permissions b/www-apps/tt-rss/files/permissions
new file mode 100644
index 00000000000..a26b87f4e71
--- /dev/null
+++ b/www-apps/tt-rss/files/permissions
@@ -0,0 +1,25 @@
+#!/bin/bash -e
+
+cd "${MY_INSTALLDIR}"
+
+if [[ $1 = install ]]; then
+	# We need to lock down cache/ for the operations below to be
+	# safe. The permissions match the webapp-config defaults but these
+	# can be changed and existing installations may also differ.
+	chown root:root cache/
+	chmod 00755 cache/
+
+	chgrp --no-dereference ttrssd feed-icons/ lock/ cache/*/
+	chmod g+ws feed-icons/ lock/ cache/*/
+
+	# Files within lock/ are exclusively written by the update
+	# daemon. Files within feed-icons/ are always unlinked before
+	# modification. Only cache/ holds files that are modified in place
+	# by both processes and therefore ACLs are required to ensure that
+	# the files themselves are created as group writable.
+	if ! setfacl --modify d:g::rwX cache/*/; then
+		echo "WARNING: ACLs are not available on this filesystem. Either enable them or set TTRSSD_USER to your PHP user in /etc/conf.d/ttrssd to avoid permission issues."
+	elif [[ -n $(find cache/ -type f ! -name ".*" ! \( -group ttrssd -perm -020 \) -print -quit) ]]; then
+		echo "WARNING: Files that are not writable by the ttrssd group found within the cache directory. Either delete them or correct their permissions."
+	fi
+fi

diff --git a/www-apps/tt-rss/files/postinstall-en-with-daemon-r1.txt b/www-apps/tt-rss/files/postinstall-en-with-daemon-r1.txt
new file mode 100644
index 00000000000..8c72406d76d
--- /dev/null
+++ b/www-apps/tt-rss/files/postinstall-en-with-daemon-r1.txt
@@ -0,0 +1,14 @@
+Please read https://tt-rss.org/wiki/InstallationNotes.
+
+Once you have configured TT-RSS, tweak /etc/conf.d/ttrssd to your
+needs if you have not already done so. If ACLs are unavailable on the
+filesystem you have just installed to then you will need to set
+TTRSSD_USER to your PHP user. When everything is ready, (re)start the
+update daemon like so:
+
+  /etc/init.d/ttrssd restart
+
+This will periodically update your feeds in the background. Add the
+daemon to your default runlevel to start it on every boot:
+
+  rc-update add ttrssd default

diff --git a/www-apps/tt-rss/files/postinstall-en-with-daemon.txt b/www-apps/tt-rss/files/postinstall-en-with-daemon.txt
index 7d269d7165f..25545842a38 100644
--- a/www-apps/tt-rss/files/postinstall-en-with-daemon.txt
+++ b/www-apps/tt-rss/files/postinstall-en-with-daemon.txt
@@ -1,4 +1,4 @@
-Please read http://tt-rss.org/redmine/projects/tt-rss/wiki/InstallationNotes
+Please read https://tt-rss.org/wiki/InstallationNotes.
 
 Once you have configured TT-RSS, put the path to this instance into
 the INSTANCE_DIRS variable in /etc/conf.d/ttrssd. Make sure that

diff --git a/www-apps/tt-rss/files/postinstall-en.txt b/www-apps/tt-rss/files/postinstall-en.txt
index 7b4b279e5be..67a16111f3d 100644
--- a/www-apps/tt-rss/files/postinstall-en.txt
+++ b/www-apps/tt-rss/files/postinstall-en.txt
@@ -1,6 +1 @@
-Please read http://tt-rss.org/redmine/projects/tt-rss/wiki/InstallationNotes
-
-With the update to 1.7.0 the 'magpie' RSS parser has been removed.
-That means TT-RSS will use the 'simplepie' parser. If you have been 
-using 'magpie' so far, the switch might cause lots of duplicate
-articles - it's a one-time thing for each instance.
+Please read https://tt-rss.org/wiki/InstallationNotes.

diff --git a/www-apps/tt-rss/files/ttrssd.confd-r2 b/www-apps/tt-rss/files/ttrssd.confd-r2
new file mode 100644
index 00000000000..b169b548bb9
--- /dev/null
+++ b/www-apps/tt-rss/files/ttrssd.confd-r2
@@ -0,0 +1,47 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# Space-separated paths of TT-RSS instances that you want to start the
+# update daemon for. If left empty, these will be automatically
+# detected using data from /var/db/webapps/tt-rss. Instances without
+# the update_daemon2.php script present will be skipped.
+#
+# Default:
+#  INSTANCE_DIRS=""
+# Example:
+#  INSTANCE_DIRS="/some/webhost/htdocs/tt-rss /some/otherwebhost/htdocs/newsreader"
+#
+INSTANCE_DIRS=""
+
+# Path to the log files. One log file will be created for each TT-RSS
+# instance. Update the logrotate file after changing this.
+#
+# Default:
+#  LOG_DIR="/var/log/ttrssd"
+#
+LOG_DIR="/var/log/ttrssd"
+
+# User to run the update daemon as. You should not run this as
+# root. If ACLs are unavailable on the filesystem used by the TT-RSS
+# instances then choosing the same user that serves the PHP web
+# interface is recommended to avoid permission issues. You *must* add
+# this user to the ttrssd group. If the PHP user is not the same as
+# the web server user (e.g. apache or nginx) then this user must be
+# added to the ttrssd group too.
+#
+# Default:
+#  TTRSSD_USER="ttrssd"
+#
+TTRSSD_USER="ttrssd"
+
+# Additional options to pass to the update daemon. If you want to pass
+# different options to different TT-RSS instances then create symlinks
+# of the ttrssd init.d script (e.g. ttrssd.foo, ttrssd.bar) and
+# configure INSTANCE_DIRS and TTRSSD_OPTS for each of these.
+#
+# Default:
+#  TTRSSD_OPTS=""
+# Example:
+#  TTRSSD_OPTS="--tasks=1 --interval=300"
+#
+TTRSSD_OPTS=""

diff --git a/www-apps/tt-rss/files/ttrssd.initd-r3 b/www-apps/tt-rss/files/ttrssd.initd-r3
new file mode 100644
index 00000000000..a6f3b8a78ef
--- /dev/null
+++ b/www-apps/tt-rss/files/ttrssd.initd-r3
@@ -0,0 +1,88 @@
+#!/sbin/openrc-run
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+	need net
+	after postgresql mysql
+}
+
+PID_DIR="/run/ttrssd"
+LOG_DIR=${LOG_DIR:-"/var/log/ttrssd"}
+TTRSSD_USER=${TTRSSD_USER:-"ttrssd"}
+
+setup() {
+	mkdir -p "${PID_DIR}" "${LOG_DIR}" || return 1
+	chown "${TTRSSD_USER}":ttrssd "${LOG_DIR}" || return 1
+}
+
+list_instance_dirs() {
+	if [ -z "${INSTANCE_DIRS}" ]; then
+		cut -d" " -f4 /var/db/webapps/tt-rss/*/installs 2>/dev/null
+	else
+		printf "%s\n" ${INSTANCE_DIRS}
+	fi
+}
+
+instance_dir_to_name() {
+	local name=${1#/}
+	echo ${name//\//--}
+}
+
+start() {
+	setup || return 1
+	local instance_dir instance_name ret=1
+
+	IFS=$'\n'
+	for instance_dir in $(list_instance_dirs); do
+		if [ -d "${instance_dir}" ]; then
+			if [ ! -f "${instance_dir}"/update_daemon2.php ]; then
+				ewarn "TT-RSS instance in ${instance_dir} has no update_daemon2.php script"
+			elif [ ! -f "${instance_dir}"/config.php ]; then
+				eerror "TT-RSS instance in ${instance_dir} is not configured"
+			else
+				instance_name=$(instance_dir_to_name "${instance_dir}")
+				ebegin "Starting TT-RSS update daemon in ${instance_dir}"
+				start-stop-daemon --start --user "${TTRSSD_USER}":ttrssd \
+								  --background --wait 2000 \
+								  --stdout "${LOG_DIR}/${instance_name}.log" \
+								  --stderr "${LOG_DIR}/${instance_name}.log" \
+								  --make-pidfile --pidfile "${PID_DIR}/${instance_name}.pid" \
+								  --exec /usr/bin/php -- -f "${instance_dir}"/update_daemon2.php \
+								  -- ${TTRSSD_OPTS}
+				eend $? && ret=0
+			fi
+		else
+			eerror "TT-RSS instance in ${instance_dir} is missing"
+		fi
+	done
+	unset IFS
+
+	# Succeed if at least one started.
+	return ${ret}
+}
+
+stop() {
+	local instance_dir instance_name
+
+	IFS=$'\n'
+	for instance_dir in $(list_instance_dirs); do
+		instance_name=$(instance_dir_to_name "${instance_dir}")
+
+		[ -f "${PID_DIR}/${instance_name}.pid" ] ||
+			[ -f "${instance_dir}"/update_daemon2.php ] ||
+			continue
+
+		ebegin "Stopping TT-RSS update daemon in ${instance_dir}"
+		start-stop-daemon --stop --retry 5 --pidfile "${PID_DIR}/${instance_name}.pid" \
+						  --exec /usr/bin/php -- -f "${instance_dir}"/update_daemon2.php \
+						  -- ${TTRSSD_OPTS}
+		eend $?
+
+		rm -f "${instance_dir}"/lock/*.lock
+	done
+	unset IFS
+
+	# Always succeed.
+	return 0
+}

diff --git a/www-apps/tt-rss/files/ttrssd.logrotated b/www-apps/tt-rss/files/ttrssd.logrotated
index 9616a98c302..2bb0d0c1dd3 100644
--- a/www-apps/tt-rss/files/ttrssd.logrotated
+++ b/www-apps/tt-rss/files/ttrssd.logrotated
@@ -1,5 +1,6 @@
 /var/log/ttrssd.log {
 	daily
+	delaycompress
 	missingok
 	notifempty
 	postrotate

diff --git a/www-apps/tt-rss/files/ttrssd.logrotated b/www-apps/tt-rss/files/ttrssd.logrotated-r1
similarity index 71%
copy from www-apps/tt-rss/files/ttrssd.logrotated
copy to www-apps/tt-rss/files/ttrssd.logrotated-r1
index 9616a98c302..c2bf08f7561 100644
--- a/www-apps/tt-rss/files/ttrssd.logrotated
+++ b/www-apps/tt-rss/files/ttrssd.logrotated-r1
@@ -1,5 +1,6 @@
-/var/log/ttrssd.log {
+/var/log/ttrssd/*.log {
 	daily
+	delaycompress
 	missingok
 	notifempty
 	postrotate

diff --git a/www-apps/tt-rss/tt-rss-20180105.ebuild b/www-apps/tt-rss/tt-rss-20180105.ebuild
new file mode 100644
index 00000000000..9affdac7e13
--- /dev/null
+++ b/www-apps/tt-rss/tt-rss-20180105.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit prefix user webapp
+
+COMMIT="c30f5e18119d1935e8fe6d422053b127e8f4f1b3"
+DESCRIPTION="Tiny Tiny RSS - A web-based news feed (RSS/Atom) aggregator using AJAX"
+HOMEPAGE="https://tt-rss.org/"
+SRC_URI="https://git.tt-rss.org/git/${PN}/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
+LICENSE="GPL-3"
+KEYWORDS="~amd64 ~arm ~mips ~x86"
+IUSE="+acl daemon +mysqli postgres"
+REQUIRED_USE="|| ( mysqli postgres )"
+
+DEPEND="daemon? ( acl? ( sys-apps/acl ) )"
+
+RDEPEND="${DEPEND}
+	daemon? ( dev-lang/php:*[mysqli?,postgres?,curl,cli,pcntl,pdo] )
+	!daemon? ( dev-lang/php:*[mysqli?,postgres?,curl,pdo] )
+	virtual/httpd-php:*"
+
+DEPEND="!vhosts? ( ${DEPEND} )"
+
+need_httpd_cgi # From webapp.eclass
+
+S="${WORKDIR}/${PN}"
+
+pkg_setup() {
+	webapp_pkg_setup
+
+	if use daemon; then
+		enewgroup ttrssd
+		enewuser ttrssd -1 /bin/sh /dev/null ttrssd
+	fi
+}
+
+src_configure() {
+	hprefixify config.php-dist
+
+	sed -i -r \
+		-e "/'DB_TYPE'/s:,.*:, '$(usex mysqli mysql pgsql)'); // mysql or pgsql:" \
+		-e "/'CHECK_FOR_UPDATES'/s/true/false/" \
+		config.php-dist || die
+}
+
+src_install() {
+	webapp_src_preinst
+
+	insinto "${MY_HTDOCSDIR}"
+	doins -r *
+
+	# When updating, grep the plugins directory for additional CACHE_DIR
+	# instances as they cannot be created later due to permissions.
+	dodir "${MY_HTDOCSDIR}"/cache/starred-images
+
+	local dir
+	for dir in "${ED}${MY_HTDOCSDIR}"/{cache/*,feed-icons,lock}/; do
+		webapp_serverowned "${dir#${ED}}"
+	done
+
+	if use daemon; then
+		webapp_hook_script "${FILESDIR}"/permissions
+		webapp_postinst_txt en "${FILESDIR}"/postinstall-en-with-daemon-r1.txt
+
+		newinitd "${FILESDIR}"/ttrssd.initd-r3 ttrssd
+		newconfd "${FILESDIR}"/ttrssd.confd-r2 ttrssd
+
+		insinto /etc/logrotate.d
+		newins "${FILESDIR}"/ttrssd.logrotated-r1 ttrssd
+
+		elog "After upgrading, please restart ttrssd."
+	else
+		webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt
+	fi
+
+	webapp_src_install
+}
+
+pkg_postinst() {
+	elog "You need to merge config.php-dist into config.php manually when upgrading."
+	webapp_pkg_postinst
+}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: www-apps/tt-rss/, www-apps/tt-rss/files/
@ 2018-01-18 13:44 James Le Cuirot
  0 siblings, 0 replies; 5+ messages in thread
From: James Le Cuirot @ 2018-01-18 13:44 UTC (permalink / raw
  To: gentoo-commits

commit:     0a44f2b78a7d114b0de6cf05f8ae19f4d82bbf74
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 18 13:41:26 2018 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Thu Jan 18 13:43:50 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0a44f2b7

www-apps/tt-rss: Drop vulnerable 20160527 and 20160930 versions

Package-Manager: Portage-2.3.19, Repoman-2.3.6

 www-apps/tt-rss/Manifest                           |  2 -
 .../tt-rss/files/postinstall-en-with-daemon.txt    | 19 -----
 www-apps/tt-rss/files/ttrssd.confd-r1              | 14 ----
 www-apps/tt-rss/files/ttrssd.initd-r2              | 83 --------------------
 www-apps/tt-rss/files/ttrssd.logrotated            |  9 ---
 www-apps/tt-rss/tt-rss-20160527.ebuild             | 88 ----------------------
 www-apps/tt-rss/tt-rss-20160930.ebuild             | 88 ----------------------
 7 files changed, 303 deletions(-)

diff --git a/www-apps/tt-rss/Manifest b/www-apps/tt-rss/Manifest
index 2c45842b727..1f555aa5e71 100644
--- a/www-apps/tt-rss/Manifest
+++ b/www-apps/tt-rss/Manifest
@@ -1,3 +1 @@
-DIST tt-rss-20160527.tar.bz2 2064633 BLAKE2B 406c2ff551e2ba616a8f4696d7deaf8a3f85e4f86f0b09f57507af7f4657930f11fc0aa9df467af5ad2c56657d95e12b75bae721da4d86480b06bbbc0ab72744 SHA512 8d482303868a08f4d65ef252f71f66ec3219d4f67e968a026a0302d29930cd5af45cedea81171db2ff0927497079d3bedd8fd70e4e9904f5d9987a92a6dfcb89
-DIST tt-rss-20160930.tar.bz2 2072888 BLAKE2B e6ca0a72730cdf9a1106d7098e6a6bfc9bf35f545a67e9b569552644b23543b4168000afe2e5fbf5a1fd81371e72e570e270a77d5345bca5f22d79c1a86409b0 SHA512 d420e7efdf7d17e153ef0aa487a330379afe20fe9e9a6209de40b797d36e425cbcbdf2280eaf5ada8b9bef1ae37146253556ff602bbff22a9a7c311ff525d9e2
 DIST tt-rss-20180105.tar.gz 3070929 BLAKE2B 2370104c70f5381d690a29b216269c749bf1f7c6b925eb9499b741e5df3e686d95fce430a144946fd915414481280b67e6d0c881edcdd13aee0fa344dc0bec3f SHA512 86ceec3646629ad7fd3fde2f3c3237e48ad96bd08b46e73c34c76507d9b17613ea309e1bd5e6e85a0d9eb96029e54b54e5ee367c56aab31be3dcec9169c5ada5

diff --git a/www-apps/tt-rss/files/postinstall-en-with-daemon.txt b/www-apps/tt-rss/files/postinstall-en-with-daemon.txt
deleted file mode 100644
index 25545842a38..00000000000
--- a/www-apps/tt-rss/files/postinstall-en-with-daemon.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-Please read https://tt-rss.org/wiki/InstallationNotes.
-
-Once you have configured TT-RSS, put the path to this instance into
-the INSTANCE_DIRS variable in /etc/conf.d/ttrssd. Make sure that
-the ttrssd user can access the path, and then start the update daemon
-with
-
-  /etc/init.d/ttrssd start
-
-to get your feeds updated. Add the daemon to your default runlevel,
-so that it gets launched after a system restart:
-
-  rc-update add ttrssd default
-
-
-With the update to 1.7.0 the 'magpie' RSS parser has been removed.
-That means TT-RSS will use the 'simplepie' parser. If you have been
-using 'magpie' so far, the switch might cause lots of duplicate
-articles - it's a one-time thing for each instance.

diff --git a/www-apps/tt-rss/files/ttrssd.confd-r1 b/www-apps/tt-rss/files/ttrssd.confd-r1
deleted file mode 100644
index cf74794e22d..00000000000
--- a/www-apps/tt-rss/files/ttrssd.confd-r1
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 1999-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-# Path to TT-RSS instances which should have running update daemon.
-# EXAMPLE: INSTANCE_DIRS="/some/webhost/htdocs/tt-rss /some/otherwebhost/htdocs/newsreader"
-INSTANCE_DIRS=""
-
-# Path to log file. Remember to alter logrotate file if you change it here.
-LOGFILE="/var/log/ttrssd.log"
-
-# User and group which run the update daemon.
-# NOTE: you should really avoid running it as root.
-TTRSSD_USER="ttrssd"
-TTRSSD_GROUP="ttrssd"

diff --git a/www-apps/tt-rss/files/ttrssd.initd-r2 b/www-apps/tt-rss/files/ttrssd.initd-r2
deleted file mode 100644
index d46d5890a1f..00000000000
--- a/www-apps/tt-rss/files/ttrssd.initd-r2
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-depend() {
-	need logger net
-	after postgres mysql
-}
-
-LOGFILE=${LOGFILE:-"/var/log/ttrssd.log"}
-TTRSSD_USER=${TTRSSD_USER:-"ttrssd"}
-TTRSSD_GROUP=${TTRSSD_GROUP:-"ttrssd"}
-INSTANCE_FOLDERS="cache lock feed-icons"
-BASE_PID="/run/ttrssd"
-
-checkconfig() {
-	local instance instancepidname dir
-
-	# check instances
-	if [ -z "${INSTANCE_DIRS}" ]; then
-		eerror "There is no defined instance directory in /etc/conf.d/ttrssd"
-		return 1
-	fi
-
-	# verify log file accessibility
-	if [ ! -e "${LOGFILE}" ]; then
-		touch "${LOGFILE}" || return 1
-	fi
-	chown "${TTRSSD_USER}":"${TTRSSD_GROUP}" "${LOGFILE}" || return 1
-
-	mkdir -p "${BASE_PID}"
-
-	# check instances for errors
-	for instance in ${INSTANCE_DIRS}; do
-		instancepidname=$(echo "${instance}.pid" | sed -e 's|/||' -e 's|/|--|g')
-
-		if [ ! -f "${instance}/update_daemon2.php" ]; then
-			eerror "\"${instance}\" does not contain update_daemon2.php script."
-			eerror "Please check your installation or the INSTANCE_DIRS variable."
-			return 1
-		fi
-
-		# NOTE: This can't be done by webapp-config if we want runtime configurable TTRSSD_GROUP
-		for dir in ${INSTANCE_FOLDERS}; do
-			if [ -d "${instance}/${dir}" ]; then
-				chown -R ":${TTRSSD_GROUP}" "${instance}/${dir}" || return 1
-				chmod -R g+w "${instance}/${dir}" || return 1
-			fi
-		done
-	done
-}
-
-start () {
-	local instance instancepidname
-
-	checkconfig || return 1
-
-	for instance in ${INSTANCE_DIRS}; do
-		instancepidname=$(echo "${instance}.pid" | sed -e 's|/||' -e 's|/|--|g')
-		mypid="${BASE_PID}/${instancepidname}"
-		ebegin "Starting TT-RSS update daemon in \"${instance}\""
-		start-stop-daemon --start --user "${TTRSSD_USER}":"${TTRSSD_GROUP}" --background \
-			--stdout "${LOGFILE}" --stderr "${LOGFILE}" \
-			--make-pidfile --pidfile "${mypid}" \
-			--exec /usr/bin/php -- -f "${instance}/update_daemon2.php"
-		eend $?
-	done
-}
-
-stop() {
-	local instance instancepidname
-
-	for instance in ${INSTANCE_DIRS}; do
-		instancepidname=$(echo "${instance}.pid" | sed -e 's|/||' -e 's|/|--|g')
-		mypid="${BASE_PID}/${instancepidname}"
-		ebegin "Stopping TT-RSS update daemon in \"${instance}\""
-		start-stop-daemon --stop \
-			--pidfile "${mypid}" \
-			--exec /usr/bin/php -- -f "${instance}/update_daemon2.php"
-		eend $?
-		rm -f ${instance}/lock/*.lock
-	done
-}

diff --git a/www-apps/tt-rss/files/ttrssd.logrotated b/www-apps/tt-rss/files/ttrssd.logrotated
deleted file mode 100644
index 2bb0d0c1dd3..00000000000
--- a/www-apps/tt-rss/files/ttrssd.logrotated
+++ /dev/null
@@ -1,9 +0,0 @@
-/var/log/ttrssd.log {
-	daily
-	delaycompress
-	missingok
-	notifempty
-	postrotate
-		/etc/init.d/ttrssd restart > /dev/null
-	endscript
-}

diff --git a/www-apps/tt-rss/tt-rss-20160527.ebuild b/www-apps/tt-rss/tt-rss-20160527.ebuild
deleted file mode 100644
index 5803aae4ddb..00000000000
--- a/www-apps/tt-rss/tt-rss-20160527.ebuild
+++ /dev/null
@@ -1,88 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-inherit user eutils webapp vcs-snapshot
-
-DESCRIPTION="Tiny Tiny RSS - A web-based news feed (RSS/Atom) aggregator using AJAX"
-HOMEPAGE="http://tt-rss.org/"
-SRC_URI="https://dev.gentoo.org/~tomka/files/${P}.tar.bz2"
-
-LICENSE="GPL-3"
-KEYWORDS="~amd64 ~mips ~x86"
-IUSE="daemon +mysqli postgres"
-
-DEPEND="
-	daemon? ( dev-lang/php:*[mysqli?,postgres?,pcntl,curl] )
-	!daemon? ( dev-lang/php:*[mysqli?,postgres?,curl] )
-	virtual/httpd-php:*
-"
-RDEPEND="${DEPEND}"
-
-REQUIRED_USE="|| ( mysqli postgres )"
-
-need_httpd_cgi  # From webapp.eclass
-
-pkg_setup() {
-	webapp_pkg_setup
-
-	if use daemon; then
-			enewgroup ttrssd
-			enewuser ttrssd -1 /bin/sh /dev/null ttrssd
-	fi
-}
-
-src_prepare() {
-	# Customize config.php-dist so that the right 'DB_TYPE' is already set (according to the USE flag)
-	einfo "Customizing config.php-dist..."
-
-	if use mysqli && ! use postgres; then
-			sed -i \
-				-e "/define('DB_TYPE',/{s:pgsql:mysql:}" \
-				config.php-dist || die
-	fi
-
-	sed -i \
-		-e "/define('DB_TYPE',/{s:// \(or mysql\):// pgsql \1:}" \
-		config.php-dist || die
-
-	# per 462578
-	epatch_user
-}
-
-src_install() {
-	webapp_src_preinst
-
-	insinto "/${MY_HTDOCSDIR}"
-	doins -r *
-	keepdir "/${MY_HTDOCSDIR}"/feed-icons
-
-	for DIR in cache lock feed-icons; do
-			webapp_serverowned -R "${MY_HTDOCSDIR}/${DIR}"
-	done
-
-	# In the old days we put a config.php directly and tried to
-	# protect it with the following which did not work reliably.
-	# These days we only install the config.php-dist file.
-	# webapp_configfile "${MY_HTDOCSDIR}"/config.php
-
-	if use daemon; then
-			webapp_postinst_txt en "${FILESDIR}"/postinstall-en-with-daemon.txt
-			newinitd "${FILESDIR}"/ttrssd.initd-r2 ttrssd
-			newconfd "${FILESDIR}"/ttrssd.confd-r1 ttrssd
-			insinto /etc/logrotate.d/
-			newins "${FILESDIR}"/ttrssd.logrotated ttrssd
-
-			elog "After upgrading, please restart ttrssd"
-	else
-			webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt
-	fi
-
-	webapp_src_install
-}
-
-pkg_postinst() {
-	elog "You need to merge config.php and config.php-dist manually now."
-	webapp_pkg_postinst
-}

diff --git a/www-apps/tt-rss/tt-rss-20160930.ebuild b/www-apps/tt-rss/tt-rss-20160930.ebuild
deleted file mode 100644
index 5803aae4ddb..00000000000
--- a/www-apps/tt-rss/tt-rss-20160930.ebuild
+++ /dev/null
@@ -1,88 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-inherit user eutils webapp vcs-snapshot
-
-DESCRIPTION="Tiny Tiny RSS - A web-based news feed (RSS/Atom) aggregator using AJAX"
-HOMEPAGE="http://tt-rss.org/"
-SRC_URI="https://dev.gentoo.org/~tomka/files/${P}.tar.bz2"
-
-LICENSE="GPL-3"
-KEYWORDS="~amd64 ~mips ~x86"
-IUSE="daemon +mysqli postgres"
-
-DEPEND="
-	daemon? ( dev-lang/php:*[mysqli?,postgres?,pcntl,curl] )
-	!daemon? ( dev-lang/php:*[mysqli?,postgres?,curl] )
-	virtual/httpd-php:*
-"
-RDEPEND="${DEPEND}"
-
-REQUIRED_USE="|| ( mysqli postgres )"
-
-need_httpd_cgi  # From webapp.eclass
-
-pkg_setup() {
-	webapp_pkg_setup
-
-	if use daemon; then
-			enewgroup ttrssd
-			enewuser ttrssd -1 /bin/sh /dev/null ttrssd
-	fi
-}
-
-src_prepare() {
-	# Customize config.php-dist so that the right 'DB_TYPE' is already set (according to the USE flag)
-	einfo "Customizing config.php-dist..."
-
-	if use mysqli && ! use postgres; then
-			sed -i \
-				-e "/define('DB_TYPE',/{s:pgsql:mysql:}" \
-				config.php-dist || die
-	fi
-
-	sed -i \
-		-e "/define('DB_TYPE',/{s:// \(or mysql\):// pgsql \1:}" \
-		config.php-dist || die
-
-	# per 462578
-	epatch_user
-}
-
-src_install() {
-	webapp_src_preinst
-
-	insinto "/${MY_HTDOCSDIR}"
-	doins -r *
-	keepdir "/${MY_HTDOCSDIR}"/feed-icons
-
-	for DIR in cache lock feed-icons; do
-			webapp_serverowned -R "${MY_HTDOCSDIR}/${DIR}"
-	done
-
-	# In the old days we put a config.php directly and tried to
-	# protect it with the following which did not work reliably.
-	# These days we only install the config.php-dist file.
-	# webapp_configfile "${MY_HTDOCSDIR}"/config.php
-
-	if use daemon; then
-			webapp_postinst_txt en "${FILESDIR}"/postinstall-en-with-daemon.txt
-			newinitd "${FILESDIR}"/ttrssd.initd-r2 ttrssd
-			newconfd "${FILESDIR}"/ttrssd.confd-r1 ttrssd
-			insinto /etc/logrotate.d/
-			newins "${FILESDIR}"/ttrssd.logrotated ttrssd
-
-			elog "After upgrading, please restart ttrssd"
-	else
-			webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt
-	fi
-
-	webapp_src_install
-}
-
-pkg_postinst() {
-	elog "You need to merge config.php and config.php-dist manually now."
-	webapp_pkg_postinst
-}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: www-apps/tt-rss/, www-apps/tt-rss/files/
@ 2022-02-19 16:00 James Le Cuirot
  0 siblings, 0 replies; 5+ messages in thread
From: James Le Cuirot @ 2022-02-19 16:00 UTC (permalink / raw
  To: gentoo-commits

commit:     6bbd050f9ecc0fadd9fae6eabc7206a6042d397f
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 19 15:59:25 2022 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Sat Feb 19 16:00:37 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6bbd050f

www-apps/tt-rss: Bump to 20220218, EAPI 8, fix for dash, fix permissions

Thanks to Anna Vyalkova for the dash fix. Note that the configuration syntax has
changed since the last version.

Closes: https://bugs.gentoo.org/833206
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>

 www-apps/tt-rss/Manifest                           |   1 +
 www-apps/tt-rss/files/permissions-r1               |  24 +++++
 .../tt-rss/files/postinstall-en-with-daemon-r1.txt |   3 +-
 www-apps/tt-rss/files/postinstall-en.txt           |   3 +-
 www-apps/tt-rss/files/tt-rss-no-chmod.patch        |  26 +++++
 www-apps/tt-rss/files/ttrssd.initd-r4              | 119 +++++++++++++++++++++
 www-apps/tt-rss/tt-rss-20200922.ebuild             |   5 -
 ...-rss-20200922.ebuild => tt-rss-20220218.ebuild} |  26 ++---
 www-apps/tt-rss/tt-rss-99999999.ebuild             |  20 ++--
 9 files changed, 189 insertions(+), 38 deletions(-)

diff --git a/www-apps/tt-rss/Manifest b/www-apps/tt-rss/Manifest
index a650767d6971..5a6f1e2a2113 100644
--- a/www-apps/tt-rss/Manifest
+++ b/www-apps/tt-rss/Manifest
@@ -1 +1,2 @@
 DIST tt-rss-20200922.tar.gz 3406007 BLAKE2B 7058253fbbba1c121d11eace8a3ef024b7ef83b05fd8b10b0ba0d017fa75d16b970e2c95c13091f760b21bcf092f609d81a5649de03672b0394113412f90beb0 SHA512 90387d07af76bc90bfb2e740dcfa0b2e13ed9af679a6c9258edd053511277bc36fca8edd4b3862c3f1957fa65a827b161abf3ed7fa603d4b84514fd456947a47
+DIST tt-rss-20220218.tar.gz 9916433 BLAKE2B 318969b6e5156842079bf68c4ea614e5e60e21d8caa46b1a78f2cef051904da30e5091838f6e10f6f610d8ee39c7922137aeb60b7cd5004cabc1d2cdf65edfa8 SHA512 38a81dd737462724bc52ca3915350c175abe548cd566a4f9a5e1d5efda9287d0666e9348e5b13dd20549360501de5b0bfb659292fb650f7a60fdab8b63cf8202

diff --git a/www-apps/tt-rss/files/permissions-r1 b/www-apps/tt-rss/files/permissions-r1
new file mode 100644
index 000000000000..e50b4406646d
--- /dev/null
+++ b/www-apps/tt-rss/files/permissions-r1
@@ -0,0 +1,24 @@
+#!/bin/bash -e
+
+cd "${MY_INSTALLDIR}"
+
+if [[ $1 = install ]]; then
+	# We need to lock down cache/ for the operations below to be
+	# safe. The permissions match the webapp-config defaults but these
+	# can be changed and existing installations may also differ.
+	chown root:root cache/
+	chmod 00755 cache/
+
+	chgrp --no-dereference ttrssd feed-icons/ lock/ cache/*/
+	chmod g+ws feed-icons/ lock/ cache/*/
+
+	# Files within lock/ are exclusively written by the update daemon.
+	# feed-icons/ and cache/ holds files that are modified in place by both
+	# processes and therefore ACLs are required to ensure that the files
+	# themselves are created as group writable.
+	if ! setfacl --modify d:g::rwX feed-icons/ cache/*/; then
+		echo "WARNING: ACLs are not available on this filesystem. Either enable them or set TTRSSD_USER to your PHP user in /etc/conf.d/ttrssd to avoid permission issues."
+	elif [[ -n $(find feed-icons/ cache/ -type f ! -name ".*" ! -name index.html ! \( -group ttrssd -perm -020 \) -print -quit) ]]; then
+		echo "WARNING: Files that are not writable by the ttrssd group found within the cache or feed-icons directories. Either delete them or correct their permissions."
+	fi
+fi

diff --git a/www-apps/tt-rss/files/postinstall-en-with-daemon-r1.txt b/www-apps/tt-rss/files/postinstall-en-with-daemon-r1.txt
index 8c72406d76d2..92d1fa315c72 100644
--- a/www-apps/tt-rss/files/postinstall-en-with-daemon-r1.txt
+++ b/www-apps/tt-rss/files/postinstall-en-with-daemon-r1.txt
@@ -1,4 +1,5 @@
-Please read https://tt-rss.org/wiki/InstallationNotes.
+Please read https://tt-rss.org/wiki/GlobalConfig. Note that the configuration
+syntax changed in 2021.
 
 Once you have configured TT-RSS, tweak /etc/conf.d/ttrssd to your
 needs if you have not already done so. If ACLs are unavailable on the

diff --git a/www-apps/tt-rss/files/postinstall-en.txt b/www-apps/tt-rss/files/postinstall-en.txt
index 67a16111f3d5..f28a19d991bf 100644
--- a/www-apps/tt-rss/files/postinstall-en.txt
+++ b/www-apps/tt-rss/files/postinstall-en.txt
@@ -1 +1,2 @@
-Please read https://tt-rss.org/wiki/InstallationNotes.
+Please read https://tt-rss.org/wiki/GlobalConfig. Note that the configuration
+syntax changed in 2021.

diff --git a/www-apps/tt-rss/files/tt-rss-no-chmod.patch b/www-apps/tt-rss/files/tt-rss-no-chmod.patch
new file mode 100644
index 000000000000..e51e66eaed22
--- /dev/null
+++ b/www-apps/tt-rss/files/tt-rss-no-chmod.patch
@@ -0,0 +1,26 @@
+These files may be written and then updated by the web interface user or the
+update daemon user, so they need to be group writeable. We enforce this with
+ACLs rather than chmod though.
+
+diff --color -Naur a/classes/pref/feeds.php b/classes/pref/feeds.php
+--- a/classes/pref/feeds.php	2022-02-18 13:44:03.000000000 +0000
++++ b/classes/pref/feeds.php	2022-02-19 15:37:55.000723992 +0000
+@@ -490,7 +490,6 @@
+
+ 				if (file_exists($new_filename)) unlink($new_filename);
+ 					if (rename($tmp_file, $new_filename)) {
+-						chmod($new_filename, 0644);
+
+ 						$feed->set([
+ 							'favicon_avg_color' => null,
+diff --color -Naur a/classes/rssutils.php b/classes/rssutils.php
+--- a/classes/rssutils.php	2022-02-18 13:44:03.000000000 +0000
++++ b/classes/rssutils.php	2022-02-19 15:37:40.393312123 +0000
+@@ -1728,7 +1728,6 @@
+
+ 		fwrite($fp, $contents);
+ 		fclose($fp);
+-		chmod($icon_file, 0644);
+ 		clearstatcache();
+
+ 		return $icon_file;

diff --git a/www-apps/tt-rss/files/ttrssd.initd-r4 b/www-apps/tt-rss/files/ttrssd.initd-r4
new file mode 100644
index 000000000000..9dbfa157ce43
--- /dev/null
+++ b/www-apps/tt-rss/files/ttrssd.initd-r4
@@ -0,0 +1,119 @@
+#!/sbin/openrc-run
+# Copyright 1999-2022 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+command="/usr/bin/php"
+
+depend() {
+	need net
+	after postgresql mysql
+}
+
+PID_DIR="/run/ttrssd"
+LOG_DIR=${LOG_DIR:-"/var/log/ttrssd"}
+TTRSSD_USER=${TTRSSD_USER:-"ttrssd"}
+
+list_instance_dirs() {
+	if [ -z "${INSTANCE_DIRS}" ]; then
+		cut -d" " -f4 /var/db/webapps/tt-rss/*/installs 2>/dev/null
+	else
+		printf "%s\n" ${INSTANCE_DIRS}
+	fi
+}
+
+instance_dir_to_name() {
+	local name
+
+	name=${1#/}
+	printf %s "${name}" | awk '{
+		gsub("/", "--");
+		print $0;
+	}'
+}
+
+start_pre() {
+	mkdir -p "${PID_DIR}" "${LOG_DIR}" || return 1
+	chown "${TTRSSD_USER}":ttrssd "${LOG_DIR}" || return 1
+}
+
+start() {
+	local instance_dir instance_name ret=1
+
+	IFS="
+"
+	for instance_dir in $(list_instance_dirs); do
+		if [ -d "${instance_dir}" ]; then
+			if [ ! -f "${instance_dir}"/update_daemon2.php ]; then
+				ewarn "TT-RSS instance in ${instance_dir} has no update_daemon2.php script"
+			elif [ ! -f "${instance_dir}"/config.php ]; then
+				eerror "TT-RSS instance in ${instance_dir} is not configured"
+			else
+				instance_name=$(instance_dir_to_name "${instance_dir}")
+				ebegin "Starting TT-RSS update daemon in ${instance_dir}"
+				start-stop-daemon --start --user "${TTRSSD_USER}":ttrssd \
+								  --background --wait 2000 \
+								  --stdout "${LOG_DIR}/${instance_name}.log" \
+								  --stderr "${LOG_DIR}/${instance_name}.log" \
+								  --make-pidfile --pidfile "${PID_DIR}/${instance_name}.pid" \
+								  --exec /usr/bin/php -- -f "${instance_dir}"/update_daemon2.php \
+								  -- ${TTRSSD_OPTS}
+				eend $? && ret=0
+			fi
+		else
+			eerror "TT-RSS instance in ${instance_dir} is missing"
+		fi
+	done
+	unset IFS
+
+	# Succeed if at least one started.
+	return ${ret}
+}
+
+stop() {
+	local instance_dir instance_name
+
+	IFS="
+"
+	for instance_dir in $(list_instance_dirs); do
+		instance_name=$(instance_dir_to_name "${instance_dir}")
+
+		[ -f "${PID_DIR}/${instance_name}.pid" ] ||
+			[ -f "${instance_dir}"/update_daemon2.php ] ||
+			continue
+
+		ebegin "Stopping TT-RSS update daemon in ${instance_dir}"
+		start-stop-daemon --stop --retry 5 --pidfile "${PID_DIR}/${instance_name}.pid" \
+						  --exec /usr/bin/php -- -f "${instance_dir}"/update_daemon2.php \
+						  -- ${TTRSSD_OPTS}
+		eend $?
+
+		rm -f "${instance_dir}"/lock/*.lock
+	done
+	unset IFS
+
+	# Always succeed.
+	return 0
+}
+
+status() {
+	local instance_dir instance_name pid
+
+	IFS="
+"
+	for instance_dir in $(list_instance_dirs); do
+		instance_name=$(instance_dir_to_name "${instance_dir}")
+
+		[ -f "${PID_DIR}/${instance_name}.pid" ] ||
+			[ -f "${instance_dir}"/update_daemon2.php ] ||
+			continue
+
+		if start-stop-daemon --signal 0 --pidfile "${PID_DIR}/${instance_name}.pid"; then
+			# At least one instance is running
+			return 0
+		fi
+	done
+	unset IFS
+
+	# No instances are running
+	return 3
+}

diff --git a/www-apps/tt-rss/tt-rss-20200922.ebuild b/www-apps/tt-rss/tt-rss-20200922.ebuild
index 86ea09cce5e4..e2117ac64f57 100644
--- a/www-apps/tt-rss/tt-rss-20200922.ebuild
+++ b/www-apps/tt-rss/tt-rss-20200922.ebuild
@@ -93,8 +93,3 @@ src_install() {
 
 	webapp_src_install
 }
-
-pkg_postinst() {
-	elog "You need to merge config.php-dist into config.php manually when upgrading."
-	webapp_pkg_postinst
-}

diff --git a/www-apps/tt-rss/tt-rss-20200922.ebuild b/www-apps/tt-rss/tt-rss-20220218.ebuild
similarity index 78%
copy from www-apps/tt-rss/tt-rss-20200922.ebuild
copy to www-apps/tt-rss/tt-rss-20220218.ebuild
index 86ea09cce5e4..2081b2a81759 100644
--- a/www-apps/tt-rss/tt-rss-20200922.ebuild
+++ b/www-apps/tt-rss/tt-rss-20220218.ebuild
@@ -1,9 +1,9 @@
 # Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
-inherit prefix webapp
+inherit webapp
 
 DESCRIPTION="Tiny Tiny RSS - A web-based news feed (RSS/Atom) aggregator using AJAX"
 HOMEPAGE="https://tt-rss.org/"
@@ -13,7 +13,7 @@ KEYWORDS="~amd64 ~arm ~mips ~x86"
 IUSE="+acl daemon gd +mysqli postgres"
 REQUIRED_USE="|| ( mysqli postgres )"
 
-PHP_SLOTS="7.4 7.3"
+PHP_SLOTS="8.0 7.4 7.3"
 PHP_USE="gd?,mysqli?,postgres?,curl,fileinfo,intl,json(+),pdo,unicode,xml"
 
 php_rdepend() {
@@ -52,14 +52,9 @@ need_httpd_cgi # From webapp.eclass
 
 S="${WORKDIR}/${PN}"
 
-src_configure() {
-	hprefixify config.php-dist
-
-	sed -i -r \
-		-e "/'DB_TYPE'/s:,.*:, '$(usex mysqli mysql pgsql)'); // mysql or pgsql:" \
-		-e "/'CHECK_FOR_UPDATES'/s/true/false/" \
-		config.php-dist || die
-}
+PATCHES=(
+	"${FILESDIR}"/${PN}-no-chmod.patch
+)
 
 src_install() {
 	webapp_src_preinst
@@ -77,10 +72,10 @@ src_install() {
 	done
 
 	if use daemon; then
-		webapp_hook_script "${FILESDIR}"/permissions
+		webapp_hook_script "${FILESDIR}"/permissions-r1
 		webapp_postinst_txt en "${FILESDIR}"/postinstall-en-with-daemon-r1.txt
 
-		newinitd "${FILESDIR}"/ttrssd.initd-r3 ttrssd
+		newinitd "${FILESDIR}"/ttrssd.initd-r4 ttrssd
 		newconfd "${FILESDIR}"/ttrssd.confd-r2 ttrssd
 
 		insinto /etc/logrotate.d
@@ -93,8 +88,3 @@ src_install() {
 
 	webapp_src_install
 }
-
-pkg_postinst() {
-	elog "You need to merge config.php-dist into config.php manually when upgrading."
-	webapp_pkg_postinst
-}

diff --git a/www-apps/tt-rss/tt-rss-99999999.ebuild b/www-apps/tt-rss/tt-rss-99999999.ebuild
index 25e4a31621d6..e91fad7a3c67 100644
--- a/www-apps/tt-rss/tt-rss-99999999.ebuild
+++ b/www-apps/tt-rss/tt-rss-99999999.ebuild
@@ -1,9 +1,9 @@
 # Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
-inherit git-r3 prefix webapp
+inherit git-r3 webapp
 
 DESCRIPTION="Tiny Tiny RSS - A web-based news feed (RSS/Atom) aggregator using AJAX"
 HOMEPAGE="https://tt-rss.org/"
@@ -50,13 +50,9 @@ DEPEND="
 
 need_httpd_cgi # From webapp.eclass
 
-src_configure() {
-	hprefixify config.php-dist
-
-	sed -i -r \
-		-e "/'DB_TYPE'/s:,.*:, '$(usex mysqli mysql pgsql)'); // mysql or pgsql:" \
-		config.php-dist || die
-}
+PATCHES=(
+	"${FILESDIR}"/${PN}-no-chmod.patch
+)
 
 src_install() {
 	webapp_src_preinst
@@ -74,10 +70,10 @@ src_install() {
 	done
 
 	if use daemon; then
-		webapp_hook_script "${FILESDIR}"/permissions
+		webapp_hook_script "${FILESDIR}"/permissions-r1
 		webapp_postinst_txt en "${FILESDIR}"/postinstall-en-with-daemon-r1.txt
 
-		newinitd "${FILESDIR}"/ttrssd.initd-r3 ttrssd
+		newinitd "${FILESDIR}"/ttrssd.initd-r4 ttrssd
 		newconfd "${FILESDIR}"/ttrssd.confd-r2 ttrssd
 
 		insinto /etc/logrotate.d
@@ -92,8 +88,6 @@ src_install() {
 }
 
 pkg_postinst() {
-	elog "You need to merge config.php-dist into config.php manually when upgrading."
-
 	if use vhosts && [[ -n ${REPLACING_VERSIONS} ]]; then
 		elog
 		elog "The live ebuild does not automatically upgrade your installations so"


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: www-apps/tt-rss/, www-apps/tt-rss/files/
@ 2022-03-20 23:03 James Le Cuirot
  0 siblings, 0 replies; 5+ messages in thread
From: James Le Cuirot @ 2022-03-20 23:03 UTC (permalink / raw
  To: gentoo-commits

commit:     0acc10157e16422a8f125b7d3a2bcea27e17cc14
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 20 23:03:06 2022 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Sun Mar 20 23:03:06 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0acc1015

www-apps/tt-rss: Drop old 20200922

Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>

 www-apps/tt-rss/Manifest               |  1 -
 www-apps/tt-rss/files/permissions      | 25 ---------
 www-apps/tt-rss/files/ttrssd.initd-r3  | 88 -------------------------------
 www-apps/tt-rss/tt-rss-20200922.ebuild | 95 ----------------------------------
 4 files changed, 209 deletions(-)

diff --git a/www-apps/tt-rss/Manifest b/www-apps/tt-rss/Manifest
index 5a6f1e2a2113..e407e317a278 100644
--- a/www-apps/tt-rss/Manifest
+++ b/www-apps/tt-rss/Manifest
@@ -1,2 +1 @@
-DIST tt-rss-20200922.tar.gz 3406007 BLAKE2B 7058253fbbba1c121d11eace8a3ef024b7ef83b05fd8b10b0ba0d017fa75d16b970e2c95c13091f760b21bcf092f609d81a5649de03672b0394113412f90beb0 SHA512 90387d07af76bc90bfb2e740dcfa0b2e13ed9af679a6c9258edd053511277bc36fca8edd4b3862c3f1957fa65a827b161abf3ed7fa603d4b84514fd456947a47
 DIST tt-rss-20220218.tar.gz 9916433 BLAKE2B 318969b6e5156842079bf68c4ea614e5e60e21d8caa46b1a78f2cef051904da30e5091838f6e10f6f610d8ee39c7922137aeb60b7cd5004cabc1d2cdf65edfa8 SHA512 38a81dd737462724bc52ca3915350c175abe548cd566a4f9a5e1d5efda9287d0666e9348e5b13dd20549360501de5b0bfb659292fb650f7a60fdab8b63cf8202

diff --git a/www-apps/tt-rss/files/permissions b/www-apps/tt-rss/files/permissions
deleted file mode 100644
index a26b87f4e715..000000000000
--- a/www-apps/tt-rss/files/permissions
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash -e
-
-cd "${MY_INSTALLDIR}"
-
-if [[ $1 = install ]]; then
-	# We need to lock down cache/ for the operations below to be
-	# safe. The permissions match the webapp-config defaults but these
-	# can be changed and existing installations may also differ.
-	chown root:root cache/
-	chmod 00755 cache/
-
-	chgrp --no-dereference ttrssd feed-icons/ lock/ cache/*/
-	chmod g+ws feed-icons/ lock/ cache/*/
-
-	# Files within lock/ are exclusively written by the update
-	# daemon. Files within feed-icons/ are always unlinked before
-	# modification. Only cache/ holds files that are modified in place
-	# by both processes and therefore ACLs are required to ensure that
-	# the files themselves are created as group writable.
-	if ! setfacl --modify d:g::rwX cache/*/; then
-		echo "WARNING: ACLs are not available on this filesystem. Either enable them or set TTRSSD_USER to your PHP user in /etc/conf.d/ttrssd to avoid permission issues."
-	elif [[ -n $(find cache/ -type f ! -name ".*" ! \( -group ttrssd -perm -020 \) -print -quit) ]]; then
-		echo "WARNING: Files that are not writable by the ttrssd group found within the cache directory. Either delete them or correct their permissions."
-	fi
-fi

diff --git a/www-apps/tt-rss/files/ttrssd.initd-r3 b/www-apps/tt-rss/files/ttrssd.initd-r3
deleted file mode 100644
index a6f3b8a78ef1..000000000000
--- a/www-apps/tt-rss/files/ttrssd.initd-r3
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-depend() {
-	need net
-	after postgresql mysql
-}
-
-PID_DIR="/run/ttrssd"
-LOG_DIR=${LOG_DIR:-"/var/log/ttrssd"}
-TTRSSD_USER=${TTRSSD_USER:-"ttrssd"}
-
-setup() {
-	mkdir -p "${PID_DIR}" "${LOG_DIR}" || return 1
-	chown "${TTRSSD_USER}":ttrssd "${LOG_DIR}" || return 1
-}
-
-list_instance_dirs() {
-	if [ -z "${INSTANCE_DIRS}" ]; then
-		cut -d" " -f4 /var/db/webapps/tt-rss/*/installs 2>/dev/null
-	else
-		printf "%s\n" ${INSTANCE_DIRS}
-	fi
-}
-
-instance_dir_to_name() {
-	local name=${1#/}
-	echo ${name//\//--}
-}
-
-start() {
-	setup || return 1
-	local instance_dir instance_name ret=1
-
-	IFS=$'\n'
-	for instance_dir in $(list_instance_dirs); do
-		if [ -d "${instance_dir}" ]; then
-			if [ ! -f "${instance_dir}"/update_daemon2.php ]; then
-				ewarn "TT-RSS instance in ${instance_dir} has no update_daemon2.php script"
-			elif [ ! -f "${instance_dir}"/config.php ]; then
-				eerror "TT-RSS instance in ${instance_dir} is not configured"
-			else
-				instance_name=$(instance_dir_to_name "${instance_dir}")
-				ebegin "Starting TT-RSS update daemon in ${instance_dir}"
-				start-stop-daemon --start --user "${TTRSSD_USER}":ttrssd \
-								  --background --wait 2000 \
-								  --stdout "${LOG_DIR}/${instance_name}.log" \
-								  --stderr "${LOG_DIR}/${instance_name}.log" \
-								  --make-pidfile --pidfile "${PID_DIR}/${instance_name}.pid" \
-								  --exec /usr/bin/php -- -f "${instance_dir}"/update_daemon2.php \
-								  -- ${TTRSSD_OPTS}
-				eend $? && ret=0
-			fi
-		else
-			eerror "TT-RSS instance in ${instance_dir} is missing"
-		fi
-	done
-	unset IFS
-
-	# Succeed if at least one started.
-	return ${ret}
-}
-
-stop() {
-	local instance_dir instance_name
-
-	IFS=$'\n'
-	for instance_dir in $(list_instance_dirs); do
-		instance_name=$(instance_dir_to_name "${instance_dir}")
-
-		[ -f "${PID_DIR}/${instance_name}.pid" ] ||
-			[ -f "${instance_dir}"/update_daemon2.php ] ||
-			continue
-
-		ebegin "Stopping TT-RSS update daemon in ${instance_dir}"
-		start-stop-daemon --stop --retry 5 --pidfile "${PID_DIR}/${instance_name}.pid" \
-						  --exec /usr/bin/php -- -f "${instance_dir}"/update_daemon2.php \
-						  -- ${TTRSSD_OPTS}
-		eend $?
-
-		rm -f "${instance_dir}"/lock/*.lock
-	done
-	unset IFS
-
-	# Always succeed.
-	return 0
-}

diff --git a/www-apps/tt-rss/tt-rss-20200922.ebuild b/www-apps/tt-rss/tt-rss-20200922.ebuild
deleted file mode 100644
index e2117ac64f57..000000000000
--- a/www-apps/tt-rss/tt-rss-20200922.ebuild
+++ /dev/null
@@ -1,95 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit prefix webapp
-
-DESCRIPTION="Tiny Tiny RSS - A web-based news feed (RSS/Atom) aggregator using AJAX"
-HOMEPAGE="https://tt-rss.org/"
-SRC_URI="https://dev.gentoo.org/~chewi/distfiles/${P}.tar.gz" # Upstream git frontend blocks wget?
-LICENSE="GPL-3"
-KEYWORDS="~amd64 ~arm ~mips ~x86"
-IUSE="+acl daemon gd +mysqli postgres"
-REQUIRED_USE="|| ( mysqli postgres )"
-
-PHP_SLOTS="7.4 7.3"
-PHP_USE="gd?,mysqli?,postgres?,curl,fileinfo,intl,json(+),pdo,unicode,xml"
-
-php_rdepend() {
-	local slot
-	echo "|| ("
-	for slot in ${PHP_SLOTS}; do
-		echo "(
-			virtual/httpd-php:${slot}
-			dev-lang/php:${slot}[$1]
-		)"
-	done
-	echo ")"
-}
-
-DEPEND="
-	daemon? ( acl? ( sys-apps/acl ) )
-"
-
-RDEPEND="
-	${DEPEND}
-	daemon? (
-		acct-user/ttrssd
-		acct-group/ttrssd
-		$(php_rdepend "${PHP_USE},cli,pcntl")
-	)
-	!daemon? (
-		$(php_rdepend "${PHP_USE}")
-	)
-"
-
-DEPEND="
-	!vhosts? ( ${DEPEND} )
-"
-
-need_httpd_cgi # From webapp.eclass
-
-S="${WORKDIR}/${PN}"
-
-src_configure() {
-	hprefixify config.php-dist
-
-	sed -i -r \
-		-e "/'DB_TYPE'/s:,.*:, '$(usex mysqli mysql pgsql)'); // mysql or pgsql:" \
-		-e "/'CHECK_FOR_UPDATES'/s/true/false/" \
-		config.php-dist || die
-}
-
-src_install() {
-	webapp_src_preinst
-
-	insinto "${MY_HTDOCSDIR}"
-	doins -r *
-
-	# When updating, grep the plugins directory for additional CACHE_DIR
-	# instances as they cannot be created later due to permissions.
-	dodir "${MY_HTDOCSDIR}"/cache/starred-images
-
-	local dir
-	for dir in "${ED}${MY_HTDOCSDIR}"/{cache/*,feed-icons,lock}/; do
-		webapp_serverowned "${dir#${ED}}"
-	done
-
-	if use daemon; then
-		webapp_hook_script "${FILESDIR}"/permissions
-		webapp_postinst_txt en "${FILESDIR}"/postinstall-en-with-daemon-r1.txt
-
-		newinitd "${FILESDIR}"/ttrssd.initd-r3 ttrssd
-		newconfd "${FILESDIR}"/ttrssd.confd-r2 ttrssd
-
-		insinto /etc/logrotate.d
-		newins "${FILESDIR}"/ttrssd.logrotated-r1 ttrssd
-
-		elog "After upgrading, please restart ttrssd."
-	else
-		webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt
-	fi
-
-	webapp_src_install
-}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: www-apps/tt-rss/, www-apps/tt-rss/files/
@ 2022-12-17 22:19 James Le Cuirot
  0 siblings, 0 replies; 5+ messages in thread
From: James Le Cuirot @ 2022-12-17 22:19 UTC (permalink / raw
  To: gentoo-commits

commit:     b6a7bc08c2d127e24a679bc7531a6aa604171312
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 17 22:19:08 2022 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Sat Dec 17 22:19:08 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b6a7bc08

www-apps/tt-rss: Drop chmod patch that no longer applies to live version

This no longer seems necessary. I need to retest the permissions around the
latest code, but for now, there's no point keeping a broken patch.

Closes: https://bugs.gentoo.org/886007
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>

 www-apps/tt-rss/files/tt-rss-no-chmod-r2.patch | 26 --------------------------
 www-apps/tt-rss/tt-rss-99999999.ebuild         |  4 ----
 2 files changed, 30 deletions(-)

diff --git a/www-apps/tt-rss/files/tt-rss-no-chmod-r2.patch b/www-apps/tt-rss/files/tt-rss-no-chmod-r2.patch
deleted file mode 100644
index 05de80b127c5..000000000000
--- a/www-apps/tt-rss/files/tt-rss-no-chmod-r2.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-These files may be written and then updated by the web interface user or the
-update daemon user, so they need to be group writeable. We enforce this with
-ACLs rather than chmod though.
-
-diff -Naur a/classes/pref/feeds.php b/classes/pref/feeds.php
---- a/classes/pref/feeds.php	2022-02-18 13:44:03.000000000 +0000
-+++ b/classes/pref/feeds.php	2022-02-19 15:37:55.000723992 +0000
-@@ -490,7 +490,6 @@
-
- 				if (file_exists($new_filename)) unlink($new_filename);
- 					if (rename($tmp_file, $new_filename)) {
--						chmod($new_filename, 0644);
-
- 						$feed->set([
- 							'favicon_avg_color' => null,
-diff -Naur a/classes/rssutils.php b/classes/rssutils.php
---- a/classes/rssutils.php	2022-06-20 09:37:43.205998915 +0000
-+++ b/classes/rssutils.php	2022-06-20 09:38:01.002279039 +0000
-@@ -1758,7 +1758,6 @@
- 
- 				fwrite($fp, $contents);
- 				fclose($fp);
--				chmod($icon_file, 0644);
- 				clearstatcache();
- 
- 				return $icon_file;

diff --git a/www-apps/tt-rss/tt-rss-99999999.ebuild b/www-apps/tt-rss/tt-rss-99999999.ebuild
index 28c0a77199a8..a821a1e6edb9 100644
--- a/www-apps/tt-rss/tt-rss-99999999.ebuild
+++ b/www-apps/tt-rss/tt-rss-99999999.ebuild
@@ -50,10 +50,6 @@ DEPEND="
 
 need_httpd_cgi # From webapp.eclass
 
-PATCHES=(
-	"${FILESDIR}"/${PN}-no-chmod-r2.patch
-)
-
 src_install() {
 	webapp_src_preinst
 


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-12-17 22:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-18 13:44 [gentoo-commits] repo/gentoo:master commit in: www-apps/tt-rss/, www-apps/tt-rss/files/ James Le Cuirot
  -- strict thread matches above, loose matches on Subject: below --
2022-12-17 22:19 James Le Cuirot
2022-03-20 23:03 James Le Cuirot
2022-02-19 16:00 James Le Cuirot
2018-01-18 13:44 James Le Cuirot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox