Changeset 1405

Show
Ignore:
Timestamp:
03/10/07 11:25:40 (2 years ago)
Author:
jm3
Message:

updated configuration setup script to also build our crontab file, so now there are like, ZERO passwords or paths coded anywhere

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • feedmelinks/_config

    • Property svn:ignore changed from
      domain.txt
      servers.xml
      to
      domain.txt
      servers.xml
      crontab.INSTALL_ME
  • feedmelinks/_config/.cvsignore

    r1323 r1405  
    11domain.txt 
    22servers.xml 
     3crontab.INSTALL_ME 
  • feedmelinks/_config/parse-config.xsl

    r1325 r1405  
    1313        <xsl:template match="/"> 
    1414 
     15                <!--  
     16 
     17                        each "mode" parses servers.xml and spits it out in a different native format,  
     18                        so we can quickly add new perl, php, sh, etc scripts that use the global config values  
     19                        without ever hard-coding passwords anywhere. cool. 
     20 
     21                --> 
    1522                <xsl:choose> 
     23 
    1624                        <xsl:when test="$mode = 'php'">&lt;% 
    1725function get_env() { 
     
    2533                                <xsl:call-template name="CRLF" /> 
    2634%&gt;</xsl:when> 
     35 
     36                        <xsl:when test="$mode = 'crontab'"> 
     37# This file is autogenerated by _config/parse-config.xsl 
     38# DO NOT EDIT! or your changes will be blown away the next time someone runs bin/configure.sh 
     39# instead, modify the configuration values in _config/server.xml 
     40 
     41PATH=/bin:/usr/bin:/usr/local/bin:<xsl:value-of select="/servers/server[@name=$server-name]/@webserver-root"/>/bin 
     42MAILTO=<xsl:value-of select="/servers/server[@name=$server-name]/@maintainer-email"/> 
     43ADMIN_USER=<xsl:value-of select="/servers/server[@name=$server-name]/@admin-user"/> 
     44ADMIN_PASSWORD=<xsl:value-of select="/servers/server[@name=$server-name]/@admin-user-password"/> 
     45WEBSERVER_ROOT=<xsl:value-of select="/servers/server[@name=$server-name]/@webserver-root"/> 
     46SITE=<xsl:value-of select="/servers/server[@name=$server-name]/@domain"/> 
     47 
     48        <xsl:call-template name="CRLF" /> 
     49        <xsl:call-template name="CRLF" /> 
     50</xsl:when> 
    2751 
    2852                        <xsl:when test="$mode = 'sh'"> 
  • feedmelinks/bin/backup-dump-tables.sh

    r1386 r1405  
    33. env.sh 
    44 
    5 # db auth: (from env
     5# db auth: (all read in from from env.sh
    66db_u=`get_database_user` 
    77db=`get_database_name` 
    88db_p=`get_database_password` 
     9 
     10root=`get_webserver_root` 
    911 
    1012# optional directory prefix, else drop the backup in ~: 
     
    1517if [ -n "$subdir" ] ; 
    1618then 
    17         startdir=$HOME/$subdir 
     19        startdir=$subdir 
    1820else 
    19         startdir=$HOME 
     21        startdir=$root/_backups 
    2022fi 
    2123 
     
    3739rm -rf $dumpdir 
    3840 
    39 gpg -r jm3 -f $dumpdir.tgz 
     41gpg -r jm3 --encrypt-files $dumpdir.tgz 
    4042rm $dumpdir.tgz 
    4143 
  • feedmelinks/bin/backup-site.sh

    r1386 r1405  
    1 #!/usr/local/bin/bash 
     1#!/bin/bash 
    22 
    33type=$1 
    4 root=/usr/home/hirokai/FML-BACKUPS/ 
     4. env.sh 
     5 
     6# all read in from from env.sh 
     7root=`get_webserver_root` 
    58 
    69if [ -z "$type" ]; 
    710then 
    8         echo "usage: fml-backup.sh (daily|weekly|monthly)" 
     11        echo "usage: $0 (daily|weekly|monthly)" 
    912        exit 1 
    1013fi 
    1114 
    12 dir=$HOME/$root/$type 
     15dir=$root/_backups/$type 
    1316echo $dir 
    1417 
     
    3740        #mv -f $dir/* /tmp &> /dev/null 
    3841else 
    39         echo "usage: fml-backup.sh (daily|weekly|monthly)" 
     42        echo "usage: $0 (daily|weekly|monthly)" 
    4043        exit 1 
    4144fi 
    4245 
    43 backup-dump-tables.sh $root/$type 
     46backup-dump-tables.sh $dir 
    4447 
  • feedmelinks/bin/configure.sh

    r1354 r1405  
    5454echo $domain > $root/_config/domain.txt 
    5555 
    56 echo "3. Saving your configurations in env.inc.php (for site application to read)" 
     56echo "3. Saving your configurations in env.inc.php (for the main application to read)" 
    5757xsltproc --$sp server-name $s --$sp mode php $xsl $xml > $root/modules/env.inc.php 
    5858 
     
    6060xsltproc --$sp server-name $s --$sp mode sh $xsl $xml > $root/bin/env.sh 
    6161 
    62 echo "5. ...and as a perl modules format (for other maintenance scripts to read)..." 
     62echo "5. ...and as a perl module (for things like the AIM bot and the add-link from email script)..." 
    6363cp $root/lib/FeedMeLinks/Environment-template.pm $root/lib/FeedMeLinks/Environment.pm 
    6464xsltproc --$sp server-name $s --$sp mode perl $xsl $xml >> $root/lib/FeedMeLinks/Environment.pm 
    6565 
    66 echo 6. FIXME: need to ALSO build a crontab file with the correct paths 
     66echo "6. ...and as a crontab so that all the background processes will run at the correct times with the correct permissions" 
     67crontab="$root/_config/crontab.INSTALL_ME" 
     68xsltproc --$sp server-name $s --$sp mode crontab $xsl $xml > $crontab 
     69echo >> $crontab 
     70echo "# to edit, change $root/_config/crontab-template.txt" >> $crontab 
     71cat $root/_config/crontab-template.txt >> $crontab 
     72 
     73echo "don't forget to install your new crontab in $crontab (copy, crontab -e, paste, save, done!)" 
    6774 
    6875exit 0 
  • feedmelinks/bin/rebuild-xulbars.sh

    r762 r1405  
    11#!/bin/sh  
    22 
    3 cd ~/feedmelinks.com/install/toolbar/_xul-root 
     3cd ~/public_html/install/toolbar/_xul-root 
    44 
    55m=manifest