Page 5 of 7

Re: Periodic releases are over

Posted: 10 Feb 2015, 20:02
by fox
>And here I thought you assume the users of your software know what they are doing.

lmao are you for real

>Did you make up your mind on monthly auto-tagging?

it's a definite no

Re: Periodic releases are over

Posted: 18 Feb 2015, 21:29
by came88
Hi, I've modified the script from cktt and scottjl in order to backup also the database before updating tt-rss.
This version does nothing if there is no need to update, otherwise it performs backups and restart the update daemon (but only if it was already running).
I didn't test the backup part on PostgreSQL (I'm using mysql), I hope there are no problems with it.
I'm using it under Debian without problems, maybe you need to modify something in your environment.
You may need to add other configuration changes in the sed section.

Code: Select all

#!/bin/bash

### CONFIGURATIONS ###

# Directory configuration
DIRGIT=/path/to/git/folder
DIRTT=/path/to/website
DIRBK=/path/to/backups

# Database configurations
DB_TYPE="MYDBTYPE" # pgsql or mysql
DB_HOST="MYDBHOST"
DB_USER="MYDBUSER"
DB_NAME="MYDBNAME"
DB_PASS="MYDBPASS"
DB_PORT="MYDBPORT"

# Other configurations
SELF_URL_PATH="http://MYWEBSITE/PATH/"
REG_NOTIFY_ADDRESS="MYNOTIFYADDRESS"
SMTP_FROM_ADDRESS="MYREPLYADDRESS"
FEED_CRYPT_KEY="MYCRYPTKEY"


### SCRIPT ###

DATE=$(date +%F)

# check if the daemon is running
if [ -f "$DIRTT/lock/update_daemon.lock" ] ; then
   STARTSTOPDAEMON="true"
else
   STARTSTOPDAEMON="false"
fi

cd $DIRGIT
git fetch origin
reslog=$(git log HEAD..origin/master --oneline)
if [[ "${reslog}" != "" ]] ; then
   # there are new changes: completing the pull
   git merge origin/master

   # shut down the update daemon if needed
   $($STARTSTOPDAEMON) && /sbin/start-stop-daemon -K -p $DIRTT/lock/update_daemon.lock

   cd $(dirname $DIRTT)
   # back up current install files...
   tar -czf $DIRBK/tt-rss-${DATE}.tar.gz $(basename $DIRTT)
   # ... and database...
   if [ "$DB_TYPE" == "mysql" ] ; then
      MYSQL_PWD="$DB_PASS"  mysqldump  -h $DB_HOST -P $DB_PORT -u $DB_USER $DB_NAME | gzip > $DIRBK/tt-rss-${DATE}.sql.gz
   else
      PGPASSWORD="$DB_PASS" pg_dump -w -h $DB_HOST -p $DB_PORT -U $DB_USER $DB_NAME | gzip > $DIRBK/tt-rss-${DATE}.sql.gz
   fi
   # ... and delete backups older than 2 weeks
   find $DIRBK -mtime +14 -exec rm {} \;

   # copy only modified files, except git related
   rsync -rvch --exclude=.git/ --exclude=.buildpath --exclude=.gitignore --exclude=.project $DIRGIT/ $DIRTT

   # always use new config file, maybe there are new parameters
   # change config file to personalized settings
   sed $DIRGIT/config.php-dist -f - <<-SED_SCRIPT > $DIRTT/config.php
      /DB_TYPE/               s/pgsql/$DB_TYPE/
      /DB_HOST/               s/localhost/$DB_HOST/
      /DB_USER/               s/fox/$DB_USER/
      /DB_NAME/               s/fox/$DB_NAME/
      /DB_PASS/               s/XXXXXX/$DB_PASS/
      /DB_PORT/               s/''/'$DB_PORT'/
      /SELF_URL_PATH/         s#http://example.org/tt-rss/#$SELF_URL_PATH#
      /REG_NOTIFY_ADDRESS/    s/[email protected]/$REG_NOTIFY_ADDRESS/
      /SMTP_FROM_ADDRESS/     s/[email protected]/$SMTP_FROM_ADDRESS/
      /FEED_CRYPT_KEY/        s/''/'$FEED_CRYPT_KEY'/
   SED_SCRIPT

   # start the update daemon if needed
   $($STARTSTOPDAEMON) && /sbin/start-stop-daemon -b -c www-data:www-data -S -x /usr/bin/php $DIRTT/update_daemon2.php -- --feeds --quiet
fi

Re: Periodic releases are over

Posted: 19 Feb 2015, 06:08
by scottjl
Hey, thanks!

Re: Periodic releases are over

Posted: 28 Feb 2015, 01:33
by ebell451
Latimer wrote:Additionally, for those missing tarballs, there is a big button on a github page that offers anyone to "Download the contents of gothfox/Tiny-Tiny-RSS as a zip file". Press it and make your own tarball whenever you feel like it.


For those interested in the process/steps needed to perform an update without git clones/pulls or can't/don't want it scripted, here are the steps that I used:

    1. Backup your database, I happen to use phpMyAdmin
    2. Click the "Download Zip" button on the GitHub (https://github.com/gothfox/Tiny-Tiny-RSS) website
    3. Rename/copy/backup your tt-rss folder (as a backup)
    4. Upload/extract the zip file to your tt-rss folder
    5. Copy the config.php file, feed-icons folder, and any custom or downloaded plugins (these had to be re-uploaded during the old process as well)
    6. You can either compare the config.php and config.php-dist files to see any changes or you can simply try logging in and see if you get any error messages that will lead you to what needs adding/changing
I am surprised to see the number of people that are intimidated by this process or don't want to put the effort into "the new way" for such a valuable application. If you can get it up in running in the first place, this should not be an issue. Just remember not to mess with the database, backup your existing setup and you should be fine. All told, the update process took less than 10 minutes.

Re: Periodic releases are over

Posted: 28 Feb 2015, 02:27
by jwhipp
I just wanted to clarify, the upgrade process is basically:

Code: Select all

git fetch --all
git pull


Log in as admin to handle database upgrades.

That all sound legit?

Re: Periodic releases are over

Posted: 28 Feb 2015, 05:33
by HunterZ
jwhipp wrote:I just wanted to clarify, the upgrade process is basically:

Code: Select all

git fetch --all
git pull


Log in as admin to handle database upgrades.

That all sound legit?

No, just git pull: http://stackoverflow.com/questions/2923 ... -git-fetch

Re: Periodic releases are over

Posted: 28 Feb 2015, 10:20
by fox
ebell451 wrote:
Latimer wrote:Additionally, for those missing tarballs, there is a big button on a github page that offers anyone to "Download the contents of gothfox/Tiny-Tiny-RSS as a zip file". Press it and make your own tarball whenever you feel like it.


For those interested in the process/steps needed to perform an update without git clones/pulls or can't/don't want it scripted, here are the steps that I used:

    1. Backup your database, I happen to use phpMyAdmin
    2. Click the "Download Zip" button on the GitHub (https://github.com/gothfox/Tiny-Tiny-RSS) website
    3. Rename/copy/backup your tt-rss folder (as a backup)
    4. Upload/extract the zip file to your tt-rss folder
    5. Copy the config.php file, feed-icons folder, and any custom or downloaded plugins (these had to be re-uploaded during the old process as well)
    6. You can either compare the config.php and config.php-dist files to see any changes or you can simply try logging in and see if you get any error messages that will lead you to what needs adding/changing
I am surprised to see the number of people that are intimidated by this process or don't want to put the effort into "the new way" for such a valuable application. If you can get it up in running in the first place, this should not be an issue. Just remember not to mess with the database, backup your existing setup and you should be fine. All told, the update process took less than 10 minutes.


why would you do all that instead of typing literally one command i just don't understand

Re: Periodic releases are over

Posted: 01 Mar 2015, 21:42
by ebell451
fox, fox, fox...why do you ask questions like this? Because some of use like to do things the hard way. I will tell you the truth, but the answer will probably not be desirable. My setup is on a shared hosting provider, so I was talking to "that group" of users. Yes, I'm one of those users.

Re: Periodic releases are over

Posted: 01 Mar 2015, 23:40
by fox
you would probably be better off git syncing someplace better equipped and rsyncing to your shit hosting.

Re: Periodic releases are over

Posted: 02 Mar 2015, 02:58
by HunterZ
ebell451 wrote:fox, fox, fox...why do you ask questions like this? Because some of use like to do things the hard way. I will tell you the truth, but the answer will probably not be desirable. My setup is on a shared hosting provider, so I was talking to "that group" of users. Yes, I'm one of those users.

My shared hosting provider provides git. Lucky me I guess.

Re: Periodic releases are over

Posted: 02 Mar 2015, 04:46
by ebell451
fox wrote:you would probably be better off git syncing someplace better equipped and rsyncing to your shit hosting.


thanks for the suggestion...yes, it may be shit hosting, but there are advantages to shared hosting sites [blasphemy on this site, I know] as well as some disadvantages

HunterZ wrote:My shared hosting provider provides git. Lucky me I guess.


I've since found out that my host provides git as well.

Re: Periodic releases are over

Posted: 02 Mar 2015, 23:39
by slooper
Its sad to see you're forcing users to use git to update your software. Probably i am one of a few users installing TT-RSS from Linux repositories provided by my distribution. This way provides me with a simple solution to keep up to date with my whole system (and its web applications) without having to jump from directory to directory running git commands.

Re: Periodic releases are over

Posted: 02 Mar 2015, 23:56
by sleeper_service
slooper wrote:Its sad to see you're forcing users to use git to update your software. Probably i am one of a few users installing TT-RSS from Linux repositories provided by my distribution. This way provides me with a simple solution to keep up to date with my whole system (and its web applications) without having to jump from directory to directory running git commands.


well, aren't you just the most precious thing?

in any event, if you're using the linux repositories, then go to them whenever something messes up, neither tarballs nor git are applicable to your misapplication.

shoo.

Re: Periodic releases are over

Posted: 03 Mar 2015, 01:52
by slooper
sleeper_service wrote:
well, aren't you just the most precious thing?

in any event, if you're using the linux repositories, then go to them whenever something messes up, neither tarballs nor git are applicable to your misapplication.

shoo.


I am not talking about the tarballs or anything else. It does not matter how you ship your software. The fact that there will be no more versions of this software makes it somewhat hard to keep it in Linux repositories.

Re: Periodic releases are over

Posted: 03 Mar 2015, 03:53
by JustAMacUser
slooper wrote:The fact that there will be no more versions of this software makes it somewhat hard to keep it in Linux repositories.


No, it doesn't. There are still builds based on the most recent Git commit.

Also, repository maintainers often affix their own version codes separate from the main code base so they can backport fixes or tweak other aspects of the code.

Again, folks, after the initial setup we are literally talking about entering TWO words into a shell and pressing return.