Postsai in action
apt-get install python-mysqldb
apt-get install cvs
<Directory /var/www/html>
AddHandler cgi-script .py
Options +ExecCGI
</Directory>
a2enmod cgi
and restart Apache
./install.py
and follow instructionsPostsai integrates with various hosted and local repositories:
A global issue tracker is supported as fallback by adding the following configuration to config.py
ui = {
"tracker" : "https://hiszilla.his.de/hiszilla/show_bug.cgi?id=$1",
}
Access to Postsai installations may be regulated using webserver authentication mechanisms.
On the simple level, access to the complete installation may be limited. But Postsai is also able to pick up authentication information provided by Apache or nginx to allow access on a per repository level.
There are two functions, which may be defined in config.py for this purpose. The following example allows read access to all repositories (.*), but limits write access to the regular expression set by the webserver as environment variable AUTHENTICATE_POSTSAI_WRITE_PATTERN. This variable may be the result of a LDAP query performed by the webserver authorization module, for example.
def get_read_permission_pattern(): """return a regular expression of repository names that may be read""" return ".*" def get_write_permission_pattern(): """return a regular expression of repository names that may be written to""" return os.environ.get("AUTHENTICATE_POSTSAI_WRITE_PATTERN", "^$")
For simplicity, it is also possible to do the authorization within those methods itself, for example by comparing REMOTE_USER to a hardcoded list.
Important: If you use HTTP Basic Authentication to grant read access by browsers, you will need to set "service_worker": False
in
config.py, section ui. (Chrome Bug,
Firefox Bug).
Hide email domain
By default the full email address of the author is displayed. This can be disabled:
ui = {
"trim_email" : True
}
Profile icons
Postsai can display Gravatar icons next to author names.
ui = {
"avatar" : "https://gravatar.com",
}
Please note that Gravatar is an external service that might log user activities.
Search criteria filter
Postsai can enforce filters on query parameters. For example it may be desirable to disallow queries on the changes of human beings but allow such queries for bot accounts.
This example limits queries on the who-column to the value "cvsscript".
filter = {
"who" : "^cvsscript$"
}
Please note that it is relatively easy to postprocess query results. Therefore the effect of such filter is limited.