Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tt-rss: upgrade 20221230 => 20230828 #5862

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0e3493d
tt-rss: upgrade 20221230 => 20230828
smaarn Aug 30, 2023
c3f01d8
Fixed wizard templates directory name
smaarn Aug 31, 2023
c3a18a8
Fix escaping
smaarn Sep 3, 2023
b990463
Fix layout of upgrade dialog
smaarn Sep 17, 2023
75d63d0
Fix missing tt-rss service user declaration (for DSM 6)
smaarn Nov 11, 2023
0682a5b
Fix broken escaping for DSM 6 step
smaarn Nov 11, 2023
98e6185
Remove outdated (and invalid) mysql call
smaarn Nov 11, 2023
0949313
Dynamically load PHP extensions list from `src/conf/resource`
smaarn Nov 11, 2023
1a2f7f5
Fix virtual-php to use exec
smaarn Nov 11, 2023
b975651
Formatting fix (non breakable space :( )
smaarn Nov 11, 2023
c7ee796
Fix backup of DB which should be made in pre_uninst for DSM 7
smaarn Nov 11, 2023
a24c7db
DSM 6: Appropriately enforce DSM 6 configuration logics
smaarn Nov 11, 2023
474cd3f
Fix french display ("'" characters are escaped by mustache...)
smaarn Nov 11, 2023
d12237e
Remove unnecessary wording and only indicate that an update of the DB…
smaarn Nov 11, 2023
d9b7511
Add missing icon to webservice portal declaration
smaarn Nov 12, 2023
c4edeb6
Remove the need for specialized `update-schema` binary
smaarn Nov 12, 2023
88f1f15
DSM7 (settings): Remove unnecessary functions
smaarn Nov 12, 2023
73e2d51
DSM6 (settings): Make the daemon run explicitly as http (only when ru…
smaarn Nov 12, 2023
9f5c98b
DSM6 (settings): Enforce the `EFF_USER` to be http when running in DSM 6
smaarn Nov 12, 2023
b5fc9da
Revert "Remove unnecessary wording and only indicate that an update o…
smaarn Nov 12, 2023
65f38e3
Revert "DSM 6: Appropriately enforce DSM 6 configuration logics"
smaarn Nov 12, 2023
397c7a1
Enforce usage of PHP 7.4
smaarn Nov 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cross/tt-rss/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
PKG_NAME = tt-rss
PKG_VERS = c30b24d09f
PKG_VERS = afd04d141c
PKG_EXT = tar.gz
PKG_DOWNLOAD_METHOD = git
PKG_GIT_HASH = c30b24d09f4096e612965af658540595262f6848
PKG_GIT_HASH = afd04d141c7bd8a1d6732a2a6a4c91c0a9b4cd6b
PKG_DIST_SITE = https://git.tt-rss.org/fox/tt-rss.git
PKG_DIST_FILE = $(PKG_NAME)-git$(PKG_GIT_HASH).$(PKG_EXT)
PKG_DIR = $(PKG_NAME)-git$(PKG_GIT_HASH)
Expand Down
6 changes: 3 additions & 3 deletions cross/tt-rss/digests
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
tt-rss-gitc30b24d09f4096e612965af658540595262f6848.tar.gz SHA1 f86076fd142d872d41cdbce8427a89d03ecf158d
tt-rss-gitc30b24d09f4096e612965af658540595262f6848.tar.gz SHA256 3752aa5eaf540c5b8d12f6d538237df88388069079bce81bf54d604f024d7b5a
tt-rss-gitc30b24d09f4096e612965af658540595262f6848.tar.gz MD5 8f6ca72dd3d30d1b795a1a887b1f41d0
tt-rss-gitafd04d141c7bd8a1d6732a2a6a4c91c0a9b4cd6b.tar.gz SHA1 24897a2bea4fa3f07a9cb426c9d316b624a3cbda
tt-rss-gitafd04d141c7bd8a1d6732a2a6a4c91c0a9b4cd6b.tar.gz SHA256 3ef5c221b1505b9d0e071ee531be7ca63e3a619408fa553f0e3fd93e433fb46e
tt-rss-gitafd04d141c7bd8a1d6732a2a6a4c91c0a9b4cd6b.tar.gz MD5 2567238d32d10abf0ac13c31f5016783
19 changes: 8 additions & 11 deletions spk/tt-rss/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SPK_NAME = tt-rss
SPK_VERS = 20221230
SPK_REV = 16
SPK_VERS = 20230828
SPK_REV = 17
SPK_ICON = src/tt-rss.png
DSM_UI_DIR = app

Expand All @@ -11,34 +11,32 @@ DESCRIPTION = Tiny Tiny RSS is an open source web-based news feed \(RSS/Atom\) r
DESCRIPTION_FRE = Tiny Tiny RSS est un agrégateur et lecteur web de flux RSS et Atom open source conçu pour vous permettre de lire des nouvelles de n\'importe quel endroit, tout en se sentant aussi proche d\'une application de bureau que possible.
ADMIN_URL = /tt-rss/
DISPLAY_NAME = Tiny Tiny RSS
CHANGELOG = "1. Update Tiny Tiny RSS to Git revision c30b24d09f (20221230) <br /> 2. Fixed broken DSM 7 initial installation procedure. <br /> 3. Upgrade PHP version to 7.4"
CHANGELOG = "Update Tiny Tiny RSS to Git revision afd04d141c (20230828)"

HOMEPAGE = https://tt-rss.org/
LICENSE = GPL

WIZARDS_DIR = src/wizard/
WIZARDS_TEMPLATES_DIR = src/wizard_templates
CONF_DIR = src/conf/

SERVICE_SETUP = src/service-setup.sh
mreid-tt marked this conversation as resolved.
Show resolved Hide resolved
SYSTEM_GROUP = http

INSTALL_DEP_SERVICES = apache-web mysql
START_DEP_SERVICES = apache-web mysql

SERVICE_COMMAND = $(INSTALL_PREFIX)/bin/tt-rss-daemon

POST_STRIP_TARGET = tt-rss_extra_install

PHP_EXTENSIONS = curl gd intl mysqli pdo_mysql posix
PHP_EXTENSIONS := $(shell jq -r '.webservice.services[0].php.extensions[]' src/conf/resource)

override ARCH=

# Due to not obvious WebStation handling requirements
REQUIRED_MIN_DSM = 6.0
INSTUNINST_RESTART_SERVICES = apache-web

SPK_DEPENDS = "WebStation:PHP7.4:MariaDB10:Apache2.4"

SERVICE_USER = auto

include ../../mk/spksrc.spk.mk

$(STAGING_DIR)/etc/php/conf.d/com.synocommunity.tt-rss.ini:
Expand All @@ -53,10 +51,9 @@ tt-rss_extra_install: $(STAGING_DIR)/etc/php/conf.d/com.synocommunity.tt-rss.ini
install -m 644 src/app/config $(STAGING_DIR)/app/config
install -m 755 src/bin/tt-rss-daemon $(STAGING_DIR)/bin/tt-rss-daemon
install -m 755 src/bin/virtual-php $(STAGING_DIR)/bin/virtual-php
install -m 755 src/bin/update-schema $(STAGING_DIR)/bin/update-schema
ifeq ($(call version_ge, ${TCVERSION}, 7.0),1)
install -m 644 src/bin/7.0/settings.sh $(STAGING_DIR)/bin/settings.sh
install -m 755 src/bin/7.0/update-schema $(STAGING_DIR)/bin/update-schema
else
install -m 644 src/bin/settings.sh $(STAGING_DIR)/bin/settings.sh
install -m 755 src/bin/update-schema $(STAGING_DIR)/bin/update-schema
endif
19 changes: 3 additions & 16 deletions spk/tt-rss/src/bin/7.0/settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ then
chmod 770 "${LOG_FILE}"
fi

PHP=/usr/local/bin/php74

php_options()
{
for line in $(cat ${INSTALL_DIR}/etc/php/conf.d/com.synocommunity.tt-rss.ini)
Expand All @@ -41,21 +43,6 @@ php_options()
done
}

# Computes the name of the PHP profile currently being used by the WebStation
guess_php_profile_name()
{
echo -n "tt-rss"
}

# Computes the PHP fpm binary executable
# Examples:
# - guess_php_fpm_bin
# - guess_php_fpm_bin <profile_name>
guess_php_fpm_bin()
{
echo -n "/usr/local/bin/php74-fpm"
}

# Computes the PHP cli configuration file which should be used when running php code
guess_php_configuration_file()
{
Expand All @@ -68,5 +55,5 @@ guess_php_configuration_file()
# - guess_php
guess_php()
{
echo -n "/usr/local/bin/php74 -c $(guess_php_configuration_file)"
echo -n "${PHP} -c $(guess_php_configuration_file)"
}
6 changes: 0 additions & 6 deletions spk/tt-rss/src/bin/7.0/update-schema

This file was deleted.

109 changes: 8 additions & 101 deletions spk/tt-rss/src/bin/settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ then
chmod 770 "${LOG_FILE}"
fi

PHP_ID=php74
PHP="/usr/local/bin/${PHP_ID}"

php_options()
{
for line in $(cat ${INSTALL_DIR}/etc/php/conf.d/com.synocommunity.tt-rss.ini)
Expand All @@ -41,92 +44,19 @@ php_options()
done
}

# Computes the name of the PHP profile currently being used by the WebStation
guess_php_profile_name()
{
local profile_name
profile_name=$(jq -r .default.php "${WEB_STATION_HOME_DIR}/etc/WebStation.json" 2>>"${LOG_FILE}")
if [ $? -ne 0 ]
then
echo "Failed identifying php profile name." >>"${LOG_FILE}"
return 1
fi

if [ -z "${profile_name}" ]
then
echo "Invalid empty profile name found" >>"${LOG_FILE}"
return 2
fi

echo -n "${profile_name}"
}

# Computes the PHP fpm binary executable
# Examples:
# - guess_php_fpm_bin
# - guess_php_fpm_bin <profile_name>
guess_php_fpm_bin()
{
local profile_name
local profile_path
local fpm_configuration_file
local php_fpm
if [ $# -eq 0 ]
then
profile_name=$(guess_php_profile_name)
else
profile_name=$1
fi
profile_path="${WEB_STATION_HOME_DIR}/etc/php_profile/${profile_name}"
fpm_configuration_file="${profile_path}/fpm.conf"

if [ -f "${fpm_configuration_file}" ]
then
php_fpm=$(php -r 'print(parse_ini_file($argv[1], true)["global"]["syslog.ident"]);' "${fpm_configuration_file}" 2>>"${LOG_FILE}")
if [ $? -ne 0 ]
then
echo "Failed computing php fpm path." >>"${LOG_FILE}"
return 1
fi
else
echo "No fpm configuration file can be found under ${fpm_configuration_file}" >>"${LOG_FILE}"
return 1
fi

echo -n "${php_fpm}"
}

# Computes the PHP cli configuration file which should be used when running php code
# Examples:
# - guess_php_configuration_file
# - guess_php_configuration_file php56
# - guess_php_configuration_file php74
guess_php_configuration_file()
{
local php_bin
local web_station_configuration_file
local php_fpm
if [ $# -eq 0 ]
then
php_fpm="$(guess_php_fpm_bin)"
if [ -z "${php_fpm}" ]
then
echo -n "/etc/php/php.ini"
return 0
fi
php_bin="$(echo ${php_fpm} | sed 's/-fpm//g')"
else
php_bin=$1
fi
web_station_configuration_file="${WEB_STATION_HOME_DIR}/etc/${php_bin}/php.ini"
web_station_configuration_file="${WEB_STATION_HOME_DIR}/etc/${PHP_ID}/php.ini"
if [ -f "${web_station_configuration_file}" ]
then
echo -n "${web_station_configuration_file}"
elif [ -f "/usr/local/etc/${php_bin}/cli/php.ini" ]
elif [ -f "/usr/local/etc/${PHP_ID}/cli/php.ini" ]
then
echo -n "/usr/local/etc/${php_bin}/cli/php.ini"
echo -n "/usr/local/etc/${PHP_ID}/cli/php.ini"
else
echo -n "/usr/local/etc/${php_bin}/php.ini"
echo -n "/usr/local/etc/${PHP_ID}/php.ini"
fi
}

Expand All @@ -136,28 +66,5 @@ guess_php_configuration_file()
# - guess_php <profile_name>
guess_php()
{
local profile_name
local php_fpm
local php
if [ $# -eq 0 ]
then
profile_name=$(guess_php_profile_name)
if [ $? -ne 0 ]
then
echo "Failed computing PHP profile name" >>"${LOG_FILE}"
return 1
fi
else
profile_name=$1
fi


php_fpm="$(guess_php_fpm_bin ${profile_name})"
if [ -z "${php_fpm}" ]
then
echo -n "php -c /etc/php/php.ini"
else
php="$(echo ${php_fpm} | sed 's/-fpm//g')"
echo -n "${php} -c $(guess_php_configuration_file ${php})"
fi
echo -n "${PHP} -c $(guess_php_configuration_file)"
}
8 changes: 7 additions & 1 deletion spk/tt-rss/src/bin/tt-rss-daemon
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,10 @@ source "${SCRIPT_DIR}/settings.sh"

TTRSS="${WEB_DIR}/${PACKAGE}/update.php"

exec $(guess_php) $(php_options) ${TTRSS} --daemon >>"${LOGS_DIR}/daemon.log" 2>&1
if [ "$(whoami)" == "root" ]
then
# tt rss should always be running as http user in pre-DSM 7 context
exec sudo -u http exec $(guess_php) $(php_options) ${TTRSS} --daemon >>"${LOGS_DIR}/daemon.log" 2>&1
else
exec $(guess_php) $(php_options) ${TTRSS} --daemon >>"${LOGS_DIR}/daemon.log" 2>&1
fi
2 changes: 1 addition & 1 deletion spk/tt-rss/src/bin/update-schema
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_DIR=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)
source ${SCRIPT_DIR}/settings.sh
source "${SCRIPT_DIR}/settings.sh"

if [ "$(whoami)" == "root" ]
then
Expand Down
2 changes: 1 addition & 1 deletion spk/tt-rss/src/bin/virtual-php
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
SCRIPT_DIR=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)
source "${SCRIPT_DIR}/settings.sh"

$(guess_php) $(php_options) $*
exec $(guess_php) $(php_options) $*
1 change: 1 addition & 0 deletions spk/tt-rss/src/conf/resource
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"webservice": {
"services": [{
"service": "tt-rss",
"icon": "app/images/tt-rss-{0}.png",
"display_name": "Tiny Tiny RSS",
"type": "apache_php",
"root": "tt-rss",
Expand Down
20 changes: 13 additions & 7 deletions spk/tt-rss/src/service-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ VERSION_FILE_DIRECTORY="var"
VERSION_FILE="${VERSION_FILE_DIRECTORY}/version.txt"

USER=http
if [ "${SYNOPKG_DSM_VERSION_MAJOR}" -lt 7 ]; then
EFF_USER=http
fi

PHP="${SYNOPKG_PKGDEST}/bin/virtual-php"
MARIADB_10_INSTALL_DIRECTORY="/var/packages/MariaDB10"
MARIADB_10_BIN_DIRECTORY="${MARIADB_10_INSTALL_DIRECTORY}/target/usr/local/mariadb10/bin"
Expand All @@ -35,9 +39,8 @@ service_postinst ()

mkdir "-p" "${LOGS_DIR}"

# Setup database and configuration file
# Setup database and configuration file
if [ "${SYNOPKG_PKG_STATUS}" == "INSTALL" ]; then
"${MYSQL}" -u "${MYSQL_USER}" -p"${wizard_mysql_password_root}" "${MYSQL_DATABASE}" < "${WEB_DIR}/${PACKAGE}/schema/ttrss_schema_mysql.sql"
single_user_mode=$([ "${wizard_single_user}" == "true" ] && echo "true" || echo "false")
${CP} "${WEB_DIR}/${PACKAGE}/config.php-dist" "${WEB_DIR}/${PACKAGE}/config.php"
{
Expand Down Expand Up @@ -88,16 +91,19 @@ validate_preuninst ()
fi
}

service_postuninst ()
service_preuninst ()
{
# Export and remove database
# Export database
if [ "${SYNOPKG_PKG_STATUS}" == "UNINSTALL" ]; then
if [ -n "${wizard_dbexport_path}" ]; then
${MKDIR} ${wizard_dbexport_path}
${MYSQLDUMP} -u root -p"${wizard_mysql_password_root}" ${MYSQL_DATABASE} > ${wizard_dbexport_path}/${MYSQL_DATABASE}.sql
${MKDIR} -p "${wizard_dbexport_path}"
${MYSQLDUMP} -u root -p"${wizard_mysql_password_root}" "${MYSQL_DATABASE}" > "${wizard_dbexport_path}/${MYSQL_DATABASE}.sql"
fi
fi
fi
}

service_postuninst ()
{
if [ "${SYNOPKG_DSM_VERSION_MAJOR}" -lt 7 ]; then
# Remove the web interface
${RM} ${WEB_DIR}/${PACKAGE}
Expand Down
53 changes: 0 additions & 53 deletions spk/tt-rss/src/wizard/7.0/install_uifile

This file was deleted.

Loading