Version 3 (modified by Daniel Kahn Gillmor, 11 years ago) (diff)


Setting up a development environment for the Collaborative Democracy Workshop software

The collaborative democracy workshop uses a web application to facilitate its process. That web application is under regular development, and we welcome contributions and collaboration from interested developers. This page describes how to set up a development environment. It often assumes you're running a debian-derived variant of the GNU/Linux operating system. If you have another development environment you'd like to see documented, feel free to add instructions for that environment here.

setting up the dependencies

Make sure you have installed subversion, php5, sqlite, and a web server of your choice (most folks use apache, but there are lots of other ways to go). On a debian-derived system, you could do:

sudo aptitude install libapache2-mod-php5 php5-sqlite subversion apache2 sqlite3

check out a working copy of the software

This example puts the software in /srv/ir, but you can put it wherever makes sense to you (remember that the web server should be able to get to it).

sudo mkdir -p /srv/ir
sudo chown $(whoami) /srv/ir
svn co /srv/ir

(note that the subversion repository's TLS certificate is currently signed by the May First/People Link certificate authority, and has an SHA1 fingerprint of 1D:88:9F:17:15:A1:B1:B6:11:FD:A5:67:08:D9:89:68:BD:C8:D0:DD)

setting up a name-based virtual host

pick a virtual host name where this software will run, and bind it to a local loopback IP address that your web server is listening on. I've chosen the name ir.test, and i'm binding to

sh -c 'echo ir.test >> /etc/hosts'

Tell your web server to respond to that hostname based on the filesystem tree found at /srv/ir/web. For apache2 on debian, you can do this by putting the following file in /etc/apache2/sites-available/ir.test (in other distributions, you may need to insert this information elsewhere into the apache config):

<VirtualHost *:80>
	ServerName ir.test
	DocumentRoot /srv/ir/web
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	<Directory /srv/ir/web>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all

	ErrorLog /var/log/apache2/error.log

	# Possible values include: debug, info, notice, warn, error, crit,
	# alert, emerg.
	LogLevel info

	CustomLog /var/log/apache2/access.log combined

On debian systems, you would enable this virtual host with:

sudo a2ensite ir.test

Create the sqlite database

The sqlite database needs to be in a directory writable by the web server. Here's a way to do that with debian:

touch /srv/ir/db/db.sqlite
sudo chgrp -R www-data /srv/ir/db
chmod -R g+rwx /srv/ir/db

Setting up the configuration

Now you need to configure the web application:

cp /srv/ir/docs/conf.php.sample /srv/ir/conf.php

Edit the contents of /srv/ir/conf.php to point to the correct source directory, and the actual database you've set up. You'll need to set an end time for your workshop, and choose distinct group and monkey passwords for each room you've designated.

Testing it out

Point your web browser at http://ir.test/ and run with it!

Following the development

As changes get pushed into the repository, you'll want to keep up with them. You can bring your local working copy up-to-date with:

svn update /srv/ir

Committing changes

The above setup gives you the ability to follow the course of development and to make changes to your working copy. If you've made changes that you think should be part of the main development branch, you'll need a commit access to the svn repository. If you don't have that access already, open a ticket requesting access to the MF/PL SVN repo. You'll need an SSH key for this. Once you've been granted access, switch your local working copy over to access the repository via ssh instead of https:

cd /srv/ir
svn switch --relocate svn+ssh://

Now you can commit your changes like this:

cd /srv/ir
svn commit

svn will pop up an editor for you to write notes about the changes you're making. This helps everyone else (and yourself, two months from now!) understand the intent behind the changes.