Hacking on Ultimate Debian Database (UDD)

This page describes how to setup an environment to contribute to UDD (mostly the web part).

0. Contact information / reporting bugs

The main contact point for UDD is Lucas Nussbaum <lucas@debian.org>, but questions/comments should generally be directed to <debian-qa@lists.debian.org>.

Bugs can be filed against the qa.debian.org pseudo-package, with user qa.debian.org@packages.debian.org and usertag udd. See this bug for an example.

1. Getting the code

gitweb
# clone over git://
git clone git://git.debian.org/collab-qa/udd.git

# or over ssh:
git clone ssh://git.debian.org/git/collab-qa/udd.git


that file is udd/web/hacking.html (hint: don't hesitate to improve the doc)

2. Getting access to the DB

Solution 1: Access UDD through alioth

There are two ways to get access to a UDD DB:
ssh -NL 5452:udd.debian.org:5452 aliothlogin@wagner.debian.org

Or directly on ullmann:
ssh -NL 5452:localhost:5452 debianlogin@ullmann.debian.org

Solution 2: Setup postgresql locally (needed if you do not have an alioth or DD account)

# This is for wheezy, minor changes might be required for a different release
# install postgresql
apt-get install postgresql-9.1 postgresql-9.1-debversion

# Modify /etc/postgresql/pg_hba.conf to trust local connections:
# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust

# Modify /etc/postgresql/9.1/main/postgresql.conf to listen on port 5452 (same as the real UDD
# instance on ullmann.debian.org):
port = 5452

# restart postgresql
/etc/init.d/postgresql restart

# create DB
createdb -E SQL_ASCII -l C udd -T template0 -U /yourlogin/

# add debversion extension
psql udd -c 'CREATE EXTENSION debversion'

# get UDD dump (warning: big! ~ 450 MB)
wget http://udd.debian.org/udd.sql.gz

# import dump
gunzip < udd.sql.gz | psql udd

# create a guest user
createuser -lDRS guest

# give it read-only permissions on the DB
psql udd -c 'GRANT usage ON schema public TO PUBLIC;'
psql udd -c 'GRANT select ON all tables in schema public TO PUBLIC;'

# If you want to reimport a newer dump, drop the DB with:
dropdb udd

3. Setup a local web server

# install apache2
apt-get install apache2-mpm-worker

# install some Ruby packages, needed for dmd.cgi
apt-get install ruby-dbi ruby-dbd-pg ruby-debian

# minimal configuration that works:
- edit /etc/apache2/sites-enabled/000-default
- in the <VirtualHost> declaration, add:

	Alias /udd /path/to/udd/web
	<Location /udd>
		AddHandler cgi-script .cgi
		Options +ExecCGI +Indexes
		Order allow,deny
		Allow from all
	</Location>

# Try: http://localhost/udd/dmd.cgi

# Common problems:
- check file-system permissions (must be world-readable, or at least readable by www-data)

4. Hack, hack, hack! :-)

There's a list of ideas on this pad.

Please submit patches to debian-qa@lists.debian.org or to the Debian BTS (see this bug for the correct pseudo-headers).