Skip to topic | Skip to bottom
Home
Search:

Local
Local.UkMirCvsWorkflowHOWTOr1.20 - 25 Dec 2005 - 22:23 - WietsEtopic end
You are here: Local > ImcUk > ImcUkTech > UkMirCvsWorkflowHOWTO

Start of topic | Skip to actions
Back to Imc UK | Back to UK Tech | back to UkMovingToMir

Content maintenance: using the web admin interface and CVS

This page is in dire need of updating! Many things on the page are simply wrong! See UkDevMirSites for more recent info.

The uk MIR is set up on two different servers: one is being used as 'production server' where the pages are being assembled; these pages are then sent as flat html to the webserver at ahimsa from where viewers download the pages. It is important to understand that any changes will need to be 'produced' in an admin interface on the 'production server'.

The admin interface on http://publish.indymedia.org.uk/uk/servlet/Mir is the main area where content maintainers of the nationwide and local UK IMC's will work with (see other documentation). To access it get your own personalised login account, the generic uk account has been taken off for security reasions. All local groups have a liason who's having access to add new users.

Changing code: using CVS and ssh

To change MIR's underlying code, designers and tech maintainers will need to change files of the code itself (to see details for the regional pages please check UkMirRegionalPagesSetupHOWTO ). To do this you will need to use what is called a Concurrent Version System (CVS) - this is a great tool to keep track of a common code for developers, and it is great to stay up to date with released improvements without having to install thousand patches avery month yourself. For more info read on at http://cvsbook.red-bean.com/ and http://www.cvshome.org/docs/manual/.

In short, it's like a central library. If someone takes a file out of CVS or 'checks it out', the library keeps track who has it, and if the file is brought back in again and has been changed, or has been 'comitted', the library will give it a new version number. A file which was version 1.1.1.1 will after a change be version 1.2, then 1.3 etc. The nifty thing is that any change can be reverted, so if things went wrong you can easily go back to a working version. All imcuk template used for MIR are browsable on codecoop http://cvs.codecoop.org/cgi-bin/cvsweb.cgi/setup_uk/etc/?cvsroot=imc-uk The instrustion below were first put togetaher for direct access on live site and have yet to be fully update to work with codecoop, ask in irc for help.

Micro$oft Windoz systems

This is a bit of a nightmare but...

Get win CVS (you can get it from http://www.wincvs.org/download.html)

Get Python (try from http://www.python.org/ - down when I looked so I used http://www.activestate.com/Products/ActivePython/)

Get .ssh secure shell protocol (try from ftp://ftp.ssh.com/pub/ssh/)

Unzip .ssh to some directory (eg c:/program files/shh); unzip WinCVS? to some temporary directory then run setup.exe, install Python (run Python-2.2.3.exe)

In Windows NT/2000/XP right click on My Computer select Properties. Click on the tab Advanced, then click Environment Variables. Under System variables change Path to include the directory where you extracted ssh-1_2_14-win32bin.zip (probably C:\SSH, so type ;C:\SSH).

Next, under User variables add the variable HOME and set its value to %USERPROFILE%.

*In Windows 95/98/ME choose a directory where you store your private files, add these lines to your Autoexec.bat:

SET HOME=C:\HOME SET PATH=%PATH%;C:\SSH

Where HOME is the directory you chose and SSH is the directory you extracted ssh-1_2_14-win32bin.zip to.

Test .ssh by doing this: Open a command prompt (either Start> Programs> Accessories> Comand Prompt, or Start> Run then type cmd and press Return) and type:

ssh -l username cvs-hostname

.ssh will then generate a hostfile and random seed file, and then ask you for a password. Enter the password you have (NOTE: u cant fuck up then press delete - it will not accept this). After it logs in type: exit

Next we generate a keypair (your username and password files). Still in the command prompt type:

cd %HOME%/.ssh

then:

ssh-keygen -C username@domainSTOPSPAM.com -f identity

WHEN YOU ARE ASKED FOR A PASSPHRASE JUST PRESS . DO NOT ENTER A PASSPHRASE.

This bit below no longer applies with move to using codecoop, add key via your personal web interface on codecoop ( https://codecoop.org/account/editsshkeys.php )

Next we register the keypair with the server by typing:

scp identity.pub username@cvs-server-host:~/.ssh/authorized_keys

so:

scp identity.pub uk@kosmos.indymediaSTOPSPAM.org:~/.ssh/authorized_keys

then we must secure the keyring by first logging in:

ssh -l uk kosmos.indymedia.org

then secureing it:

chmod go-rwx ~/.ssh/authorized_keys

NOTE: if you get asked for a password here go here and look at step 9)

Next run WinCVS?. When the Preferences window opens, change Authentication to ssh and type this into the CVSROOT: box

uk@kosmos.indymediaSTOPSPAM.org:/var/lib/cvs

Then click the 'Settings' button next to the Authentication box. When the 'SSH Options' window pops up click the little box next to 'RSA private key file (identity):' The diectory should be right.

That's it! Follow the instructions on

http://docs.indymedia.org/view/Local/UkMirRegionalPagesSetupHOWTO

etc

Mac Instructions

Mac CVS on OS 8.1

Get Mac CVS version 32b12.Carbon (1.9 MB download). Get as well Macpython (12MB download), and Apple's Carbonlib version 1.03 (1 MB download). Watch out you need to first install Carbonlib, then Macpython and then alias the 'Python Core Carbon' file in your Python folder into your Mac CVS folder. Only then run Mac CVS.

Mac CVS on OS 8.6-9.22

Get Mac CVS client version 32b12.Carbon (1.9 MB download). Get as well Macpython (12MB download), and Apple's Carbonlib version 1.6 (2.9 MB download). Watch out you need to first install Carbonlib, then Macpython and then alias the 'Python Core Carbon' file in your Python folder into your Mac CVS folder. Only then run Mac CVS.

Mac CVS on OS X

I have tried all available beta and alpha versions for OSX but none has genuinely worked. The newest version even warns that it won't work until Mac Python 2.2.3 is released. I've found two preview releases; one is alpha and states explicitely that it won't work with Mac CVS. But there's a Beta release with which I've managed to run version 32b12 in Classic. You can of course always compile the source yourself - but then you will be a proper Mac OS X hacker and you will update this page straight away with a better documentation than I do i hope... But if you're one of us mortals and still want it to work on OS X then download the Mac Python-OSX-2.3b1 installer on Jack's Mac Python Page, or click in your contextual menu on 'download' when clicking on this link. You as well need Mac CVS version 32b12.Carbon (1.9 MB download), copy it to your Classic Applications Folder but don't run it before you haven't installed Mac Python.

As soon as I see that Mac Python 2.3.3 proper is out I'll update these pages.

Configuring Mac CVS 3.2 on all mentioned Mac OS's

When you have slavishly followed the above instructions you should be able to run Mac CVS now. At launch tyou will be prompted for settings, fill the following in:

   Authentication: ssh
   Path:           /var/lib/cvs
   Host address:   kosmos.indymedia.de
   User name:      uk

Go to the "Create" menu and select "Checkout Module". You will be prompted for a location to save the files to - choose one. Then you will be prompted for a 'Module name and path on the server', fill in there 'setup_uk'. Then you will be prompted if you trust and accept a key - answer 'yes'. You then will be asked for the password (to get one please see your local Imcistas or send your gpg/pgp key to the uk-tech list). To round the process up, click in the "File" menu on "New Browser" and select the location you have chosen on your Hard Disk. There you are!

Now you can make changes. To upload them to the server, select the file and click on "Commit" in the "Modify" menu. If you haven't had contact with the server for a while it obviously is a giood idea to first update your local copy by selecting "Update" in the "Modify" menu before you start making changes - someone else might have been working on things and you don't want to spend all these hours only to realise that the repository won't accept your work because it conflicts with someone's changes made earlier. Tough... if that happens you will have to start again...

After you have commited a file to CVS, you will have to make it active for the UK test site by checking it out into the directories where the uktest files live, and then compile it to make it active to be used. It sounds scarier than it is - you just use a secure telnet client as Nifty Telnet and ssh to kosmos.indymedia.org as user 'uk', same password as in CVS. For details of what to do, check further down in An example of a workflow.

Linux Instructions

These Linux instructions assume that you are using the shell and are happy using a command line interface smile

Setting up your environment

If you are on a Linux machine then you will, probably, have all the tools you need already installed, but first you need to set a couple of environment variables, the easiest way to do this is in your ~/.bash_profile file, add these lines:

  CVSROOT=":ext:uk@kosmos.indymedia.de:/var/lib/cvs"
  CVS_RSH="ssh"

And then you also need to add CVSROOT and CVS_RSH to the export line:

  export CVSROOT CVS_RSH

Alternatively if you just want to set these variables for your current shell just do this:

  export CVSROOT=":ext:uk@kosmos.indymedia.de:/var/lib/cvs"
  export CVS_RSH="ssh"

You can check that these variables are set by doing printenv | grep CVS.

One other env var that you might want to set is EDITOR -- this will be the editor that is fired up for adding a message with each commit. Personally I have EDOTOR=vim but if you are not used to vi then you might want to se this to an editor with a GUI.

Checking a working copy

To check out the templates use this command:

  setup_uk  cvs -z3 -d:pserver:anonymous@cvs.codecoop.org:/cvsroot/imc-uk co setup_uk

This will checkout the templates into a directory called setup_uk.

Adding files

To add a non-binary file do this:

  cvs add file_name.html

To add a binary file, such as an image, do this:

  cvs add -kb file_name.png

Committing your changes

After you have edited stuff you can commit your changed with this command (this will commit everything in the current directory and all sub-directories):

  cvs ci

Updating after adding or removing files

If you have removed files or added directories a cvs up won't pick up all the updates, you need to do:

  cvs up -dP

The d is for directories and the P for prune.

An example of a workflow

Let's say you want a different logo to link to, called logo.gif. As that logo is being used all the time when producing pages it should live in site/img

In your CVS client you need first to add it as binary (not as txt!), and then commit it - it will now show up in CVS under the version name 1.1.1.1.

OK, now that it's in CVS you need to run cvs update on the server to get the new version into the source code in the directory /mir/ . make sure you run the command in a directory above that directory, thus type

      cd /var/www/uktest.indymedia.de/setup_uk
and then
      cvs update 
which should prompt you with this:
      cvs update: Updating .
      cvs update: Updating etc
      cvs update: Updating etc/bundles
      cvs update: Updating etc/extrasource
      cvs update: Updating etc/open
      cvs update: Updating etc/producer
      cvs update: Updating etc/producer/images
      cvs update: Updating site
      cvs update: Updating site/css
      cvs update: Updating site/img
      U site/img/logo.gif
      cvs update: Updating site/includes
      cvs update: Updating site/static

now you need to compile and copy to the /Mir/ directory by invoking the 'ant' command. To do this you need to be in the /mir/ directory, thus type:

      cd /var/www/uktest.indymedia.de/mir
and then
      ant
which should prompt you with this:
      Buildfile: build.xml
      
      prepare:
          [copy] Copying 1 file to 
          /var/www/uktest.indymedia.de/Mir/WEB-INF/etc
      
      compile:
      
      testtomcat:
      
      BUILD SUCCESSFUL
      
      Total time: 7 seconds

As last step use the advanced admin page and enqueue the changed file.

For passwords please see your local Imcistas or send me your pgp key

Trouble shooting

A couple of tips from IRC:

00:29 <@Zapata> you should take a look at 
                mir/bin/mir/WEB-INF/log/producer.log if you have 
                trouble with producers...
00:29 < chris> ok, cheers
00:29 <@Zapata> and mir/bin/mir/WEB-INF/log/localizer.log for 
                producers.xml errors

-- AndiE - 07 Apr 2003

Added link to UkMovingToMir -- IonNec - 10 Apr 2003

Added Linux stuff, changed all references to telnet to ssh -- ChrisCroome - 12 Apr 2003

Changed URL for output server (ahimsa) - AndiE - 17 Apr 2003

Added Troubleshooting -- ChrisCroome - 18 Apr 2003

Added cvs up -dP and a Table of Contents -- ChrisCroome - 24 Apr 2003

Added a commandline interface warning for the Linux instructions -- ChrisCroome - 12 May 2003

Changed ~/bash_profile to ~/.bash_profile with a dot. --Main.AnarchoBabe --13 Jun 2003

Updated details for Mac CVS, changed url's of admin and added that the generic uk login will be taken off. -- AndiE - 20 Jun 2003

Back to Imc UK | Back to UK Tech
to top


You are here: Local > ImcUk > ImcUkTech > UkMirCvsWorkflowHOWTO

to top

Copyright © 1999-2008 by the contributing authors.
All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding this tool? Send feedback (in English, Francais, Deutsch or Dutch).