Friday, June 14, 2013

TTRSS - Synchronization for changes to config.php-dist

This procedure requires you first setup the TTRSS UTILS environment described in the post:  TTRSS  UTILS - Fedora Tiny Tiny RSS Utilities

If you are running the Update Script for the TTRSS Trunk version described in another post, you can ignore this.  The synchronization functionality is already built into that utility.

This posting is for those who don't wish to run the trunk version.  It doesn't stop or start any services.  It basically automatics the synchronization process, merging changes from the new config.php-dist and your existing config.php.  The change logic is as follows:
  1. config.php-dist is considered authoritative, which means all of those changes will be merged into your new config.php
  2. If the particular statement in config.php-dist has not been modified from the previous version, and it matches your config.php that line will be displayed in GREEN.  No action is required for that line.
  3. Changes made to your config.php will be preserved only if they are made to a define statement AND that define statement has not been changed in config.php-dist from the time it was originally cloned into your config.php.  If your config.php statement has been carried over to the new config.php that line will be displayed in YELLOW.  No further action is required for that line.
  4. If a define statement has been changed, it will replace whatever you had in your config.php - the assumption being that this is something which requires manual intervention.  This line will be displayed in RED.  You should use a program such as vim to examine both files and make the necessary changes, i.e. vim -d config.php config.php-dist
  5. If the define is completely new, it will included in your new config.php file and the line will be displayed in BLUE.  You should look at the comments for that define in the new config.php and determine if any changes are required.
  6. Your current config.php will be renamed and retained for 14 days
  7. A log will be created which shows actions that have occurred.  These actions are also displayed on your screen as the script is executing.
Run this utility BEFORE and AFTER the upgrade.  This will allow the utility to create a "before-upgrade" image of "config.php-dist" to use for comparison purposes.  If you have already upgraded, you won't be able to take advantage of this check for the first run - however, subsequent runs will be able to make this extra comparison.  DO NOT delete or change the "config.php-dist_cfg_ttrss" file this utility creates.

To run:
  1. cd $home
  2. cd ttrss_maint/ttrss_utils
  3. sudo ./cfg_ttrss

TTRSS UTILS - Fedora Tiny Tiny RSS Utilities

I've decided to standardize my group of utilities for TTRSS.  My original intent on posting all these updates in the blog was to help folks get config samples, utilities and installation/configuration information in an easy and straightforward manner.

The blog entries will continue, but I'm changing the way code samples and utilities are organized and distributed.

All files will now be hosted on bitbucket:

You would install them in your home directory by:
  1. cd $home
  2. mkdir ttrss_maint
  3. cd ttrss_maint
  4. git clone
Now, if you wish to get the latest copy of the utilities, it is simple as:
  1. cd $home/ttrss_maint/ttrss_utils
  2. git pull
Before you start using any of the utilities, you must configure a set of variables which are unique to your system.
  1. cd $home
  2. cd ttrss_maint
  3. cp  ttrss_utils/src_var_ttrss_dist src_var_ttrss
  4. vim src_var_ttrss
  5. ===> Edit the file ===<
  6. :wq
The $home/ttrss_maint directory will contain other subdirectories relating to different functions; i.e. the database backup utility files will be stored in $home/ttrss_maint/db_backup.  The src_var_ttrss script is the only non-directory file which will exist in this directory. 

The utilities are designed to be executed from the $home/ttrss_maint/ttrss_utils directory.  They will call src_var_ttrss to obtain their variables.

The other blog entries which describe the utilities and sample configurations will be updated to reflect these changes.

Thursday, June 6, 2013

Update Script for TTRSS Trunk Version - Fedora

This procedure requires you first setup the TTRSS UTILS environment described in the post:  TTRSS  UTILS - Fedora Tiny Tiny RSS Utilities

To run:
  1. cd $home
  2. cd ttrss_maint/ttrss_utils
  3. sudo ./git_ttrss
This procedure does the following:
  1. Stops your web server
  2. Stops your TTRSS Update service
  3. Stops the Sphinx Indexing Service - if activated in config.php
  4. Updates TTRSS
  5. Updates the TTRSS CONTRIB Plugins
  6. Starts the web server
  7. Starts your TTRSS Update service
  8. Starts the Sphinx Indexing service - if activated in config.php
  9. Notification of Database Schema change - which will also require you manually start your TTRSS Update and Sphinx Services
  10. Automatic config.php update if config.php_dist changes.  The previous copy of config.php will be retained for 14 days
  11. Creation of activity log file which will be deleted after 14 days
First you'll want to review:
How To Use Trunk Version?

You will need to have cloned TTRSS:
  1. cd $WEB_ROOT
  2. sudo git clone $TTRSS_DIR
 You will need to have cloned TTRSS_CONTRIB:
  1. cd $home
  2. cd ttrss_maint
  3. git clone ttrss_contrib
If a database schema change is detected you will receive a notification message that you will be prompted to make the update when you attempt to login to TTRSS.  After you complete the schema update you will need to:

Rebuild your Sphinx full-text index (if you are using Sphinx):
./bin/indexer --all

Then manually start your update and Sphinx services: 
systemctl start TTRSS_UPDATE_SERVICE.service
systemctl start SPHINX_SERVICE.service (If using Sphinx)