Plate-forme parlementaire d'échange de documents
Go to file
Benjamin Dauvergne 5a93ab71f0 Revert "Captures PFWB en remplacement des captures PW"
This reverts commit 08c7e6e1c3 which was
targeted for the pfwb branch.
2013-08-29 10:03:53 +02:00
docbow_project settings: do not send broken links emails 2013-06-24 14:47:58 +02:00
help/fr Revert "Captures PFWB en remplacement des captures PW" 2013-08-29 10:03:53 +02:00
tools Use LC_ALL to set the UTF-8 codeset in the init.d script file 2013-03-01 15:00:50 +01:00
.gitignore add a .gitignore file 2011-06-27 14:00:04 +02:00
COPYING add notices about distributed files not under the EO copyright 2012-02-10 15:54:43 +01:00
MANIFEST.in add a setup.py 2012-03-12 17:25:38 +01:00
Makefile fix syntax in Makefile 2012-01-12 15:25:41 +01:00
README.rst update README 2012-10-30 13:11:32 +01:00
jenkins.sh fix wrong manage.py path in jenkins.sh 2013-08-26 18:03:41 +02:00
requirements.txt fix requirements 2012-11-05 16:06:47 +01:00
setup.py add a setup.py 2012-03-12 17:25:38 +01: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 requirements.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)::

     LANG=C.UTF-8 PYTHONPATH=. gunicorn_django -D ./docbow_project/

You must set a charset to use as file are created with name recevied from user
agents which can contain any unicode character. The locale "C.UTF-8" works in
this case.