1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ttrss_ynh.git synced 2024-10-01 13:34:46 +02:00

update ttrss version, add update schema to install

Remove sources from git and install tt-rss from original source.
This commit is contained in:
Sebastian Gumprich 2017-02-19 13:54:21 +01:00
parent 67c28dff0d
commit ff561142fc
5 changed files with 66 additions and 35 deletions

View file

@ -1,4 +1,4 @@
<?php <?php
// ******************************************* // *******************************************
// *** Database configuration (important!) *** // *** Database configuration (important!) ***
// ******************************************* // *******************************************
@ -20,11 +20,16 @@ define('MYSQL_CHARSET', 'UTF8');
define('SELF_URL_PATH', 'yunopath'); define('SELF_URL_PATH', 'yunopath');
// Full URL of your tt-rss installation. This should be set to the // Full URL of your tt-rss installation. This should be set to the
// location of tt-rss directory, e.g. http://yourserver/tt-rss/ // location of tt-rss directory, e.g. http://example.org/tt-rss/
// You need to set this option correctly otherwise several features // You need to set this option correctly otherwise several features
// including PUSH, bookmarklets and browser integration will not work properly. // including PUSH, bookmarklets and browser integration will not work properly.
define('FEED_CRYPT_KEY', ''); define('FEED_CRYPT_KEY', '');
// WARNING: mcrypt is deprecated in php 7.1. This directive exists for backwards
// compatibility with existing installs, new passwords are NOT going to be encrypted.
// Use update.php --decrypt-feeds to decrypt existing passwords in the database while
// mcrypt is still available.
// Key used for encryption of passwords for password-protected feeds // Key used for encryption of passwords for password-protected feeds
// in the database. A string of 24 random characters. If left blank, encryption // in the database. A string of 24 random characters. If left blank, encryption
// is not used. Requires mcrypt functions. // is not used. Requires mcrypt functions.
@ -104,13 +109,9 @@ define('PUBSUBHUBBUB_ENABLED', false);
// Enable client PubSubHubbub support in tt-rss. When disabled, tt-rss // Enable client PubSubHubbub support in tt-rss. When disabled, tt-rss
// won't try to subscribe to PUSH feed updates. // won't try to subscribe to PUSH feed updates.
// ********************* // ****************************
// *** Sphinx search *** // *** Sphinx search plugin ***
// ********************* // ****************************
define('SPHINX_ENABLED', false);
// Enable fulltext search using Sphinx (http://www.sphinxsearch.com)
// Please see http://tt-rss.org/wiki/SphinxSearch for more information.
define('SPHINX_SERVER', 'localhost:9312'); define('SPHINX_SERVER', 'localhost:9312');
// Hostname:port combination for the Sphinx server. // Hostname:port combination for the Sphinx server.
@ -145,13 +146,6 @@ define('SESSION_COOKIE_LIFETIME', 86400);
// Default lifetime of a session (e.g. login) cookie. In seconds, // Default lifetime of a session (e.g. login) cookie. In seconds,
// 0 means cookie will be deleted when browser closes. // 0 means cookie will be deleted when browser closes.
define('SESSION_CHECK_ADDRESS', 1);
// Check client IP address when validating session:
// 0 - disable checking
// 1 - check first 3 octets of an address (recommended)
// 2 - check first 2 octets of an address
// 3 - check entire address
// ********************************* // *********************************
// *** Email and digest settings *** // *** Email and digest settings ***
// ********************************* // *********************************
@ -181,14 +175,8 @@ define('SMTP_SECURE', '');
// *** Other settings (less important) *** // *** Other settings (less important) ***
// *************************************** // ***************************************
define('CHECK_FOR_NEW_VERSION', true); define('CHECK_FOR_UPDATES', true);
// Check for new versions of tt-rss automatically. // Check for updates automatically if running Git version
define('DETECT_ARTICLE_LANGUAGE', false);
// Detect article language when updating feeds, presently this is only
// used for hyphenation. This may increase amount of CPU time used by
// update processes, disable if necessary (i.e. you are being billed
// for CPU time)
define('ENABLE_GZIP_OUTPUT', false); define('ENABLE_GZIP_OUTPUT', false);
// Selectively gzip output to improve wire performance. This requires // Selectively gzip output to improve wire performance. This requires
@ -197,7 +185,7 @@ define('ENABLE_GZIP_OUTPUT', false);
// if you experience weird errors and tt-rss failing to start, blank pages // if you experience weird errors and tt-rss failing to start, blank pages
// after login, or content encoding errors, disable it. // after login, or content encoding errors, disable it.
define('PLUGINS', 'auth_remote, auth_internal, note, updater'); define('PLUGINS', 'auth_remote, auth_internal, note');
// Comma-separated list of plugins to load automatically for all users. // Comma-separated list of plugins to load automatically for all users.
// System plugins have to be specified here. Please enable at least one // System plugins have to be specified here. Please enable at least one
// authentication plugin here (auth_*). // authentication plugin here (auth_*).
@ -217,4 +205,3 @@ define('CONFIG_VERSION', 26);
// if necessary (after migrating all new options from this file). // if necessary (after migrating all new options from this file).
// vim:ft=php // vim:ft=php
?>

View file

@ -10,6 +10,7 @@
"fr": "Un lecteur de flux en PHP et Ajax" "fr": "Un lecteur de flux en PHP et Ajax"
}, },
"url": "http://tt-rss.org", "url": "http://tt-rss.org",
"version": "17.1",
"maintainer": { "maintainer": {
"name": "titoko", "name": "titoko",
"email": "titoko@titoko.fr" "email": "titoko@titoko.fr"

32
scripts/_common.sh Normal file
View file

@ -0,0 +1,32 @@
#
# Common variables
#
APPNAME="ttrss"
# ttrss version
VERSION="16.8"
# Remote URL to fetch ttrss tarball
TTRSS_BINARY_URL="https://tt-rss.org/gitlab/fox/tt-rss/repository/archive.zip?ref=${VERSION}"
#
# Common helpers
#
# Download and extract ttrss binary to the given directory
# usage: extract_ttrss DESTDIR
extract_ttrss() {
local DESTDIR=$1
local TMPDIR=$(mktemp -d)
# retrieve and extract ttrss tarball
ttrss_tarball="/tmp/ttrss.zip"
rm -f "$ttrss_tarball"
wget -q -O "$ttrss_tarball" "$TTRSS_BINARY_URL" \
|| ynh_die "Unable to download ttrss tarball"
unzip -q "$ttrss_tarball" -d "$TMPDIR" \
|| ynh_die "Unable to extract ttrss tarball"
sudo rsync -a "$TMPDIR"/tt-rss.git/* "$DESTDIR"
rm -rf "$ttrss_tarball" "$TMPDIR"
}

View file

@ -3,6 +3,10 @@
# causes the shell to exit if any subcommand or pipeline returns a non-zero status # causes the shell to exit if any subcommand or pipeline returns a non-zero status
set -e set -e
# Load common variables
source ./_common.sh
# Retrieve arguments # Retrieve arguments
domain=$1 domain=$1
path=$2 path=$2
@ -18,22 +22,21 @@ fi
deskey=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za-z0-9' | sed -n 's/\(.\{24\}\).*/\1/p') deskey=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za-z0-9' | sed -n 's/\(.\{24\}\).*/\1/p')
db_pwd=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za-z0-9' | sed -n 's/\(.\{24\}\).*/\1/p') db_pwd=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za-z0-9' | sed -n 's/\(.\{24\}\).*/\1/p')
# Use 'ttrss' as database name and user
db_user=$app
# Initialize database and store mysql password for upgrade
sudo yunohost app initdb $db_user -p $db_pwd -s $(readlink -e ../source/schema/TTRSS_schema_mysql.sql)
sudo yunohost app setting $app mysqlpwd -v $db_pwd
# Copy files to the right place # Copy files to the right place
final_path=/var/www/$app final_path=/var/www/$app
sudo mkdir -p $final_path sudo mkdir -p $final_path
sudo cp -r ../source/* $final_path extract_ttrss $final_path
sudo cp ../conf/config.php $final_path/ sudo cp ../conf/config.php $final_path/
sudo cp ../conf/*.patch /tmp/ sudo cp ../conf/*.patch /tmp/
sudo patch -d $final_path -p0 < /tmp/update.patch sudo patch -d $final_path -p0 < /tmp/update.patch
sudo patch -d $final_path/plugins/auth_remote/ -p0 < /tmp/init.patch sudo patch -d $final_path/plugins/auth_remote/ -p0 < /tmp/init.patch
# Use 'ttrss' as database name and user
db_user=$app
# Initialize database and store mysql password for upgrade
sudo yunohost app initdb $db_user -p $db_pwd -s $(readlink -e $final_path/schema/ttrss_schema_mysql.sql)
sudo yunohost app setting $app mysqlpwd -v $db_pwd
# Change variables in ttrss configuration # Change variables in ttrss configuration
sudo sed -i "s/yunouser/$db_user/g" $final_path/config.php sudo sed -i "s/yunouser/$db_user/g" $final_path/config.php
@ -74,4 +77,8 @@ sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
# Reload Nginx and regenerate SSOwat conf # Reload Nginx and regenerate SSOwat conf
sudo service nginx reload sudo service nginx reload
# Update database schema
sudo sudo -u www-data php ${final_path}/update.php --update-schema
sudo yunohost app setting $app skipped_uris -v "/public.php,/api" sudo yunohost app setting $app skipped_uris -v "/public.php,/api"

View file

@ -3,6 +3,9 @@
# causes the shell to exit if any subcommand or pipeline returns a non-zero status # causes the shell to exit if any subcommand or pipeline returns a non-zero status
set -e set -e
# Load common variables
source ./_common.sh
app=${!#} app=${!#}
domain=$(sudo yunohost app setting $app domain) domain=$(sudo yunohost app setting $app domain)
@ -14,7 +17,8 @@ db_pwd=$(sudo yunohost app setting $app mysqlpwd)
final_path=/var/www/$app final_path=/var/www/$app
sudo mkdir -p $final_path sudo mkdir -p $final_path
sudo cp -a ../source/* $final_path extract_ttrss $final_path
sudo cp ../conf/config.php $final_path/ sudo cp ../conf/config.php $final_path/
sudo cp ../conf/*.patch /tmp/ sudo cp ../conf/*.patch /tmp/
sudo patch -d $final_path -p0 < /tmp/update.patch sudo patch -d $final_path -p0 < /tmp/update.patch