Plate-forme parlementaire d'échange de documents
Go to file
Benjamin Dauvergne 55e17ac3fc When applying an automatic forwarding rule, select the new sender among the original recipients who matched the rule 2011-11-23 10:29:37 +01:00
docbow_project When applying an automatic forwarding rule, select the new sender among the original recipients who matched the rule 2011-11-23 10:29:37 +01:00
.gitignore add a .gitignore file 2011-06-27 14:00:04 +02:00
Makefile complete the makefile with needed management commandś when updateing 2011-10-10 14:59:56 +02:00
README.rst factorize csv list to python list converter 2011-09-08 13:52:34 +02:00
dev-req.txt fix minimal Django version to 1.3.1 2011-09-26 11:50:54 +02:00
docbow.init extend request timeout to 3 hours 2011-11-18 17:03:18 +01:00
post-update.git-hook add post update script 2011-09-15 14:23:56 +02:00
postfix_filter.sh add the shell script to call the postfix filter 2011-11-18 13:57:08 +01:00
styles.txt Add a txt file listing style information extracted from parlement.wallonie.be stylesheet 2011-06-25 10:40:53 +02:00

README.rst

Document box for the Wallon Parliement
======================================

This software is a web application allowing group of people to send files to
each other and to list of them. It distributes and timestamps the sent
documents. The timestamp is a cryptographic timestamp obtained using the
RFC3161 protocol.

The application is pre-configured to run with a postgresql database named
docbow. The user running the application need access to this database. On most
Unix system it means creating a postgresql user with the same name as the Unix
user it the database server runs on the same host.

Installation
------------

 - Create a virtualenv::

     virtualenv --no-site-packages env/

 - Activate it::

     . ./env/bin/activate 

 - Install dependencies (some dependencies require to compile C code, like
   python-ldap, for them you will some developement package installed, on
   Debian, it means gcc, python-dev, libssl-dev, libldap-dev, libsasl2-dev,
   libpq-dev)::

     pip install -r dev-req.txt

 - Create user and database (you can replace $USER by www-data for a WSGI
   installation)::

     sudo -u postgres createuser $USER
     sudo -u postgres createdb -O $USER docbow

 - Create database schema and load initial data::

     ( cd docbow_project; python manage.py syncdb --migrate )
     ( cd docbow_project; python manage.py loaddata content filetype groups )

 - Compile UI strings translations::

     ( cd docbow_project; python manage.py compilemessages )

 - Load user list (you need to get a user list as a CSV files, see format later)::

     ( cd docbow_project; python manage.py load-users-csv users.csv )

Upgrading
---------

When you upgrade you must execute this from the root directory:

     ( cd docbow_project; python manage.py syncdb --migrate )

if you application run as another user (www-data for example if using WSGI)::

     ( cd docbow_project; sudo -u www-data python manage.py syncdb --migrate )

Installation on Debian with Apache2/mod_wsgi
--------------------------------------------

First install some development libraries::

     sudo apt-get install gcc libldap-dev libsasl2-dev python-dev libssl-dev libpq-dev swig gettext

Now you can follow the generic installation described before.

Collect all static content::

    (cd docbow_project; python manage.py collectstatic)

After that you must install apache2 and the mod_wsgi module. On Debian do::

     sudo apt-get install apache2 libapache2-mod-wsgi

You must configure the apache2 script to launch with an UTF-8 locale. On debian
you can add the following line to /etc/default/apache2 (supposing you have the
french locale with UTF-8 encoding compiled)::

     ENV="$ENV LANG=fr_FR.UTF-8 LC_ALL=fr_FR.UTF-8"

Then you must add a virtual host configuration which target the docbow wsgi
script. On debian you can put the following content in
/etc/apache2/sites-enabled/docbow.example.com, do not forget to replace
<docbow_src_dir> by the source directory where docbow is installed::

     <VirtualHost *:80>
     ServerName docbow.example.com
     
     Alias /static <docbow_src_dir>/static
     WSGIScriptAlias / <docbow_src_dir>/docbow.wsgi
     RedirectMatch 404 ^/favicon.ico$
     
     </VirtualHost>

Then you must activate it with the commands::

     a2ensite docbow.example.com
     /etc/init.d/apache2 reload

Installation on Debian using gunicorn and apache2
-------------------------------------------------

First install some development libraries::

     apt-get install gcc libldap-dev libsasl2-dev python-dev libssl-dev libpq-dev swig gettext

Now you can follow the generic installation described before.

Install gunicorn::

     ./env/bin/pip install gunicorn

Collect all static content::

    (cd docbow_project; python manage.py collectstatic)

After that you must install apache2 and the mod_wsgi module. On Debian do::

     sudo apt-get install apache2

Then you must add a virtual host configuration which target the gunicorn
application server. On debian you can put the following content in
/etc/apache2/sites-enabled/docbow.example.com, do not forget to replace
<docbow_src_dir> by the source directory where docbow is installed::

     <VirtualHost *:80>
     ServerName docbow.example.com
     
     DocumentRoot /var/www
     ProxyPass /static !
     ProxyPass / http://localhost:8000/
     ProxyPreserveHost on
     Alias /static <docbow_src_dir>/static
     <Proxy *>
     Order Deny,Allow
     Allow from all
     </Proxy>
     </VirtualHost>

Now run the gunicorn server (it must run as an user which has access to the
docbow postgresql database)::

     PYTHONPATH=. gunicorn_django -D ./docbow_project/