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.
The administration interface allows you to manage the everyday tasks related to your venus installation.
python planet.py config.ini
with no arguments. Note that, depending on the numer of feeds, this operation may take some time.python planet.py -o config.ini
.python planet.py -x config.ini
.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.
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.
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:
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
VENUS_INSTALL
CONFIG_FILE
ADMIN_URL
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
.htaccess
. If your server allows you to use .htaccess
files, you can simply add
Options +ExecCGI
AddHandler cgi-script .py
in an .htaccess file in the planet output directory to enable the server to run the script. In this case, the admin_cb.py file can be put alongside the rest of the planet output files.
.htaccess
. If your server does not allow you to add CGI handlers to .htaccess
files, you can add
Options +ExecCGI
AddHandler cgi-script .py
to the relevant part of the central apache configuration files.
admin_cb.py
file there, and make sure to update the action="admin_cb.py"
code in the template file admin.html.tmpl
, as well as the ADMIN_URL
in the callback script.
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.
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.