Redbrick Wiki:Maintenance

From Redbrick Wiki

I'm going to use this topic as a place to hold information about maintaining this wiki. Like Help:Contents it may split up into other smaller articles.

Future Work

Posting by Email

Just an idea I saw on the Mediawiki-l list. The idea is you forward the email to wiki@redbrick.dcu.ie and then using something like procmail, parse the email and create a new topic for it.

This is a php script for adding topics from a specially formatted text file. It would be trivial to write a script that grabs the email, puts it in a file and the peridocially run this script to add it. What do people think? (Direct respones to Redbrick Wiki Talk:Maintenance).

Sandbox

Created a duplicate of this sites setup here for playing around with extensions, modifications and everything else.

Creating Backups

If you login into Redbrick as the User Wiki you can execute a simple script I wrote called 'wiki_backup'. This dumps the SQL and tar.gz public_html and the wiki home directory and places it in /var/tmp for downloading using SFTP. The only reason the wiki home directory is tar.gz is that TWiki used to store some stuff there.

I've blanked the password out in the script example below.

#!/bin/sh

BKUPDIR=/var/tmp/wiki
BKUPNAME=`date +%Y-%m-%d`RedbrickWiki
BKUP=${BKUPDIR}/${BKUPNAME}
BKUPAC=${BKUPDIR}/${BKUPNAME}AC
BKUPWEB=${BKUPDIR}/${BKUPNAME}WEB
BKUPDB=${BKUPDIR}/${BKUPNAME}DB

BKUPIGNORE=/home/redbrick/wiki/tmp/bkup.ignore
BKUPIGNOREAC=${BKUPIGNORE}.ac
BKUPIGNOREWEB=${BKUPIGNORE}.web

##################################################

# Create ignore lists

rm -rf $BKUPIGNOREAC
# Do not recurse into public_html
echo "./public_html" >> $BKUPIGNOREAC
# Anything in tmp is unimportant
echo "./tmp" >> $BKUPIGNOREAC
# Do not need to backup email
echo "./Maildir" >> $BKUPIGNOREAC

rm -rf $BKUPIGNOREWEB
# Anything in test is unimportant
echo "./test" >> $BKUPIGNOREWEB

##################################################

# clean out backup directory first!
rm -rf $BKUPDIR
# make directory in /var/tmp to store tar
mkdir $BKUPDIR
chmod 700 $BKUPDIR

##################################################

# Make SQL backup
#echo Backing up SQL Database
mysqldump --add-drop-table -h mysql.internal --password=******** -u wiki --databases wiki > ${BKUPDB}.sql

##################################################
# Making tars

echo Backing Up Local Account
cd /home/redbrick/wiki
tar cfX "${BKUPAC}.tar" $BKUPIGNOREAC .

echo Backing Up Web Space
cd /webtree/w/wiki
tar cfX "${BKUPWEB}.tar" $BKUPIGNOREWEB .

echo All Backups Complete!

##################################################

echo Zipping...
gzip "${BKUPAC}.tar"
gzip "${BKUPWEB}.tar"
gzip "${BKUPDB}.sql"
echo Zip Complete.

##################################################

Upgrading MediaWiki (1.4.X)

One of the reasons for using MediaWiki is that it'll be easier for upgrading. MediaWiki is trival for upgrading as all the data is stored in an SQL database and the settings are stored in a file called 'LocalSettings.php'.

First, make a backup!

Then extract the contents of the mediawiki-1.4.X.tar.gz release your upgrading to. SFTP the files up to where MediaWiki is installed on Redbrick i.e. "/webtree/w/wiki/wiki/", overwriting the original files.

You must perform two modifications after uploading:

  • Add '#!/usr/local/bin/php' to the beginning of index.php
  • Add these lines of code to the execute function in Userlogin.php, found in includes/templates:
/* these lines added to enable pub cookie login! */
 header("Location: http://www.redbrick.dcu.ie/~wiki/wiki/custom/login1.php");
 exit;

Once thats done then login to deathray and go to the maintaince directory and run the update script:

php update.php

Now, go to the front page and attempt to modify an article to make sure everything is up and running.

Customisations such as Extenstions and Scripts

Some general notes on the customisations, extensions and scripts in use on this wiki. More technical than help though, if you want help using them: go to Help:Contents.

PubCookie authentication

This MediaWiki uses PubCookie as it's autenticator. It uses http://wiki.case.edu/CaseWiki:PubCookie_Login extension to do it but modified for MediaWiki 1.4.X.

(I'll put up modifications later)

MyRSS

MyRSS is a extension designed by myself for customising the RSS and ATOM output of a wiki. At some point I'll make the customisations avaliable publically, when I get around to it.

RSSFeed

RSSFeed is a MediaWiki extension that allows you to incorporate RSS feeds into a wiki page. It's used on the Main Page with a feed from Redbrick Planet.

GoogleSiteMaps

This wiki generates a Google Site Map using script http://wiki.case.edu/misc/googleSiteMap.phps but modified for MediaWiki 1.4.X.

You can see its output here.

(I'll put up modifications later)

Moving from TWiki to MediaWiki