O3S

From QSOS wiki

Jump to: navigation, search

Contents

How to install the new O3S

Some changes are required to use the O3S backend which comes with QSOS 2.0 evaluations :

  • First, we're now using git and O3S needs it to work properly. It automatically adds uploaded, completed and validated evaluations to the incomming folder of the main QSOS git repository on savannah.
  • Then, you have to put a full clone of the QSOS git repository in a folder named qsos, placed in the same folder in which you've got other O3S files (php stuff...).
  • Finally, you have to be very careful about permissions. As git is very sensitive, make sure apache/cherokee/... has full access to the repository, including the hidden .git folder.

You should have something like that:

$ cd www
$ git clone git://git.savannah.nongnu.org/qsos.git
$ cd qsos
$ git checkout o3s-qsos-2.x
$ cd ..
$ cp -r qsos/apps/o3s/* .
$ vi upload.php
$ chown www -R *

How do I make it work ?

  • If you want to use a selected repository to add evaluation (could be any git repository), you need to uncomment the designated lines in the upload.php file and specify the correct path to put evaluations. This is also required if you want to make it work with the official savannah repository.
  • You have to give apache/cherokee/... a password-less (SSH-key) access to the git repository you want evaluations to be pushed to.
  • Finally, uncomment the lines related to validation once the XSD to validate QSOS 2.0 documents has been released.

Security ?

For safety reasons :

  • You should not allow users to access the qsos directory remotely!
  • Be aware that the upload.php script uses a lot of exec calls and could be vulnerable.

Internal Git/upload.php How To

What is the upload.php script doing ?

  • First, it goes to the qsos/repositories/incoming/ folder.
  • It resets the git repository to make sure we that we don't have other pending changes. Then it pulls changes from origin.
  • It moves the evaluation you've just uploaded to the current directory.
  • Then it does all the checking you want on the evaluation (XSD validation), and retrieve informations such as version, type...
  • It then moves the evaluation to it's final location ($lang/evaluations/$type/ folder).
  • Finally, git adds the evaluation and tries to push it to the origin repository (origin has to redirect to the repository you want evaluations to be pushed to!).

This may fail in some unlikely scenarios where someone pushed something between the moment we pulled and the moment we try to push, or if you make conflicting changes to the repository (highly unlikely). If this happens, you'll have to fix things manually on the server.

Personal tools