Administration interface

Venus comes with a basic administration interface, allowing you to manually run planet, do a refresh from cache, expunge the cache or blacklist individual entries from the planet.

Using the administration interface

The administration interface allows you to manage the everyday tasks related to your venus installation.

Installing the administration interface securely requires some knowledge of web server configuration.

The admin interface consists of two parts: the admin template file and the server callback script. Both must be correctly installed for the administration interface to work.

Installing the admin template

The admin page template is found in themes/common/admin.html.tmpl. This template needs to be added to your config file along with your other templates, and optionally customized. Make sure that action="admin_cb.py" found in several places in the file points to the URL (or relative URL) of the admin callback script below.

Installing the admin callback script

The admin callback script, admin_cb.py, needs to be copied to somewhere among your web server files. Depending on the details of your web server, your permissions, etc., this can be done in several different ways and in different places. There are three steps involved:

  1. Configuring the script
  2. Enabling CGI
  3. Secure access

Configuring the script

At the top of the script, there are four variables you must customize. The correct values of the first three variables can be found by analyzing how you normally run the planet.py script. If you typically run planet from within the working directory BASE_DIR, using a command like

python [VENUS_INSTALL]/planet.py [CONFIG_FILE]
you know all three values.

BASE_DIR
This variable must contain the directory from where you usually run the planet.py script, to ensure that relative file names in the config files work correctly.
VENUS_INSTALL
This variable must contain your venus installation directory, relative to BASE_DIR above.
CONFIG_FILE
This variable must contain your configuration file, relative to BASE_DIR above.
ADMIN_URL
This variable must contain the URL (or relative URL) of the administration page, relative to this script's URL.

Enabling CGI

You will need to ensure that it can be run as a CGI script. This is done differently on different web server platforms, but there are at least three common patterns

In all cases, it is necessary to make sure that the script is executed as the same user that owns the planet output files and the cache. Either the planet output is owned by the apache user (usually www-data), or Apache's suexec feature can be used to run the script as the right user.

Securing the admin interface

If you don't want every user to be able to administrate your planet, you must secure at least the admin_cb.py file, and preferrably the admin.html file as well. This can be done using your web server's regular access control features. See here for Apache documentation.