Admin scripts

IVLE has a number of admin scripts for uncommon configuration or other functionality not available in the web application.

Most of these scripts must be run as root.

ivle-addexercise

ivle-addexercise <EXERCISE>

Adds an XML encoded exercise to the IVLE database. This is primarily for importing exercises that pre-date the database storage system.

The exercise’s name will be set to the complete path specified on the command line – keep this in mind when choosing a working directory.

<EXERCISE>
The XML file containing the exercise to be uploaded.

ivle-adduser

ivle-adduser [OPTIONS] <LOGIN> <FULLNAME>

Creates a new user in the database. On-disk structures (jails and Subversion repositories) will be created upon first login.

Note

Admins may create users from the Users page of the web interface.

<LOGIN>
Login name of the new user
<FULLNAME>
Full name of the user
-p <PASSWORD>, --password <PASSWORD>
Cleartext password. If omitted, external authentication mechanisms will be tried.
-n <NICK>, --nick <NICK>
Display name (defaults to <FULLNAME>)
-e <EMAIL>, --email <EMAIL>
Email address
-s <SID>, --studentid <SID>
Student ID
--admin
Give the user global IVLE administrative privileges

ivle-buildjail

ivle-buildjail [OPTIONS]

Creates or updates the IVLE jail template.

-r, --recreate

Completely recreate the jail - don’t just update its IVLE code.

Warning

This may download hundreds of megabytes from the location specified by <MIRROR>.

-u, --upgrade
Apply any package updates in the jail.
-m <MIRROR>, --mirror <MIRROR>
Sets the APT mirror. May also be specified in the jail/mirror config key.

ivle-cloneworksheets

ivle-cloneworksheets <OLDSUBJECTCODE> <OLDYEAR> <OLDSEMESTER> <NEWSUBJECTCODE> <NEWYEAR> <NEWSEMESTER>

Populates the offering specified by <NEWSUBJECTCODE> <NEWYEAR> <NEWSEMESTER> with a copy of the worksheets from the offering specified by <OLDSUBJECTCODE> <OLDYEAR> <OLDSEMESTER>.

Note

Admins may also clone worksheets from the offering administration panel in the web interface.

ivle-config

ivle-config [ARG1] [ARG2] ...

Configures IVLE with machine-specific details, most notably various paths. Either prompts the administrator for these details or accepts them as command line arguments.

Command line arguments may be any of the configuration option used in ivle.conf. They are provided in the form of --section/subsection/property VALUE such as --urls/root ivle.org or --media/externals/jquery /usr/share/javascript/jquery.

Creates or updates /etc/ivle/ivle.conf with the selected values, and overwrites /etc/ivle/plugins.d/000default with the latest default plugin list.

ivle-createdatadirs

ivle-createdatadirs

Creates the IVLE data hierarchy (by default under /var/lib/ivle) if it does not already exist.

ivle-enrol

ivle-enrol <LOGIN> <SUBJECTCODE> <YEAR> <SEMESTER> [ROLE]

Enrols a user in an offering.

Note

Users may also be enrolled from the offering administration panel in the web interface.

<LOGIN>
Login of the user to enrol
<SUBJECTCODE>
Subject code
<YEAR>
Offering year
<SEMESTER>
Offering semester
[ROLE]
Role of the user. Should be one of ‘student’ (default), ‘tutor’ or ‘lecturer’.

ivle-enrolallusers

ivle-enrolallusers

Adds enrolments for all users on the system. Pulls from the configured subject pulldown module the subjects each student is enrolled in, and adds enrolments to the database. Does not remove any enrolments.

Note

Pulldown modules are consulted for each user each time they log in, so use of this script may not be required.

-u <LOGIN>, --user <LOGIN>
Just perform enrolment for user <LOGIN>
-v, --verbose
Print out the details of each enrolment.

ivle-fetchsubmissions

ivle-fetchsubmissions [OPTIONS] <SUBJECT> <PROJECT>

Retrieves all submissions for a given project. Places each submission in its own subdirectory of the current directory. Any errors are reported to stderr (otherwise is silent).

Note

Since this script accesses Subversion repositories through the filesystem, it must be run on the master server.

<SUBJECT>
Subject short (URL) name
<PROJECTNAME>
Project short (URL) name
-s <SEMESTER>, --semester <SEMESTER>
Semester of the offering (eg. 2009/1). Defaults to the currently active semester.
-d <PATH>, --dest <PATH>
Destination directory (defaults to the current directory) in which to place submissions. Will create subdirectories in this directory of the form subject/year/semester/project.
-z, --zip
Store each submission in a Zip file.
-v, --verbose
Print the name of each submission as it is extracted.
--no-txt
Disable writing a text file with metadata about each submission.

ivle-listusers

ivle-listusers [OPTIONS]

Lists all users in the IVLE database.

Note

Users may also be listed and administered through the web interface, from the Users item in the IVLE menu.

-n, --names
Print only each user’s login name

ivle-mountallusers

ivle-mountallusers

Attempts to mount the jails of all users.

Note

Administrators should not need to manually run this script for regular operation. IVLE will automatically mount users’ jails on demand.

-v, --verbose
Print a message for each mount or unmount.
-u, --unmount
Unmount jails instead of mounting them.

ivle-refreshfilesystem

ivle-refreshfilesystem

Refresh parts of the filesystem to match the database.

In particular:
  • all jails are rebuilt
  • missing user jails are created
  • missing user and group Subversion repositories are created
  • jails for missing users are removed
  • Subversion repositories for missing users or groups are removed
  • the Subversion password file is updated
  • the Subversion authorisation files are rewritten

Warning

Due to the full jail rebuilds, existing jail mounts may be broken after this script has run. To recover from this situation, use ivle-mountallusers to unmount all of the jails.

Note

Jails and Subversion repositories are not entirely removed. They can be found in a timestamped directory alongside their parent.

ivle-remakeuser

ivle-remakeuser [OPTIONS] <USER>

ivle-remakeuser [OPTIONS] -a

Rebuilds the jail of a single user or of all users in IVLE. This will retain all user data, but recreate the rest of the hierarchy and internal configuration files.

<USER>
Login of the user whose jail should be rebuilt
-a, --all
Rebuild the jail of every user
-v, --verbose
Print a message as each user’s jail is remade

ivle-showenrolment

ivle-showenrolment <USER>

Shows the enrolments of a user. Prints subject code, subject name, year, semester and the held role for each subject in which they are enrolled.

<USER>
Login of the user