Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
Merge branch 'base' of github.com:mozilla/domesday into base
Browse files Browse the repository at this point in the history
  • Loading branch information
Gervase Markham committed May 23, 2011
2 parents de1e6b9 + 207e805 commit f26bb58
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 20 deletions.
57 changes: 46 additions & 11 deletions INSTALL
Expand Up @@ -6,7 +6,7 @@ resulting system anywhere Internet-facing!

1) Install necessary libraries

sudo apt-get install libmysqlclient-dev python-pip python-jinja2 python-mysqldb python-dev libsasl2-dev libldap2-dev libssl-dev
sudo apt-get install libmysqlclient-dev python-pip python-jinja2 python-mysqldb python-dev libsasl2-dev libldap2-dev libssl-dev mysql-server subversion

2) Get a copy of Domesday

Expand All @@ -20,13 +20,7 @@ resulting system anywhere Internet-facing!
cd phonebook
sudo pip install -r requirements/compiled.txt

4) Install python-ldap and django-ldapdb

pip install -I --install-option="--home=`pwd`/vendor-local" --src='vendor-local/src' python-ldap

sudo pip install -I --install-option="--home=`pwd`/vendor-local" --src='vendor-local/src' -e svn+https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk/#egg=django-ldapdb

5) Install a directory
4) Install a directory
The directory depends on Berkley DB utils, such as db4.2-util in Ubuntu 9.04 or db4.7-util in 10.04. This command should add that dependency automagically.

sudo apt-get install slapd ldap-utils
Expand All @@ -37,25 +31,44 @@ The command

should show the directory running. If not, start it.

6) Install schema files
5) Install schema files

sudo ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/cosine.ldif
sudo ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/nis.ldif
sudo ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/inetorgperson.ldif

sudo ldapadd -Y EXTERNAL -H ldapi:/// -f directory/domesday-schema.ldif

7) Set up directory structure and root DN access for Mozillians
6) Set up directory structure and root DN access for Mozillians

sudo ldapadd -Y EXTERNAL -H ldapi:/// -f directory/mozillians-config.ldif

8) Put test Mozillians data in directory
7) Put test Mozillians data in directory

cp directory/images/* /tmp
sudo ldapadd -x -D cn=admin,dc=mozillians,dc=org -W -f directory/mozillians-data.ldif

You will be asked for a password; it's the one in mozillians-config.ldif, which is "secret".

If this fails part-way through for any reason, you need the "-c" option when you re-run it.

8) Install a directory viewer (Apache Directory Studio)

Visit http://directory.apache.org/studio/download/download-linux.html and download the (100MB!) Apache Directory Studio. Unzip the tarball and run the file (requires Java).

Click "go to the workbench".
Click "New Connection" in the Connections window in the bottom left
Name: data
Hostname: localhost
<Next>
Bind DN or user: cn=admin,dc=mozillians,dc=org
Bind password: secret
Click "Finish"

Double-click on the resulting connection and you should see the test data.

The refresh button is F5.

9) Hack settings_local.py

Copy settings_local.py-dist to settings_local.py
Expand All @@ -65,6 +78,9 @@ Fill in the LDAP details if necessary (if your directory is local and you are us

./manage.py syncdb

It will ask you for superuser auth details. Enter something sensible (this
isn't used by us AFAIK).

11) Add some service definitions

XXX Copy in a test SQLite database? Or import some sort of dump? These aren't
Expand All @@ -74,7 +90,26 @@ required for testing but it makes the UI look and work better...

./manage.py runserver

13) See data

Visit http://localhost:8000/ and search for "gerv".

Starting Again
--------------

If you mess the directory up, you can remove the data (only) as follows:

sudo /etc/init.d/slapd stop
sudo rm -rf /var/lib/ldap/*
sudo /etc/init.d/slapd start

Then do the "install test data" step again.

The config is in /etc/ldap/slapd.d/ but I've not looked at whether it's safe
to just nuke it.

Open Questions
--------------

- What about virtualenvs?

18 changes: 9 additions & 9 deletions directory/mozillians-data.ldif
Expand Up @@ -22,9 +22,9 @@ ou: tags
########
dn: uid=1,ou=people,dc=mozillians,dc=org
objectClass: inetOrgPerson
objectClass: domesdayPerson
uid: 1
sn: Markham
givenName: Gervase
cn: Gervase Markham
displayName: Gervase Markham
userPassword: {SSHA}/Psb2o+/+Mke+n5yOQvG3puzFXwAzw6Z
Expand All @@ -33,14 +33,14 @@ l: London
description: I solve community problems for Mozilla.
jpegPhoto:< file:///tmp/gerv.jpg
title: Grease Gun
postalAddress: 22 Somewhere Street, Enfield
postalCode: SW1A 1AA
postalAddress: 22 Somewhere Street, Enfield, SW1A 1AA
domesdayNickName: Gerv

dn: uid=2,ou=people,dc=mozillians,dc=org
objectClass: inetOrgPerson
objectClass: domesdayPerson
uid: 2
sn: Boswell
givenName: David
cn: David Boswell
displayName: David Boswell
userPassword: {SSHA}wyNJo+bKFnsKykkmEI0oCurLy7Vu2eWC
Expand All @@ -53,9 +53,9 @@ telephoneNumber: +1 555 543 2100

dn: uid=3,ou=people,dc=mozillians,dc=org
objectClass: inetOrgPerson
objectClass: domesdayPerson
uid: 3
sn: Colvig
givenName: Mary
cn: Mary Colvig
displayName: Mary Colvig
userPassword: {SSHA}C+UrjDrWk77fv0TmcoTXIxhNjrfS+vNy
Expand All @@ -67,22 +67,23 @@ telephoneNumber: +1 555-654-3210

dn: uid=4,ou=people,dc=mozillians,dc=org
objectClass: inetOrgPerson
objectClass: domesdayPerson
uid: 4
sn: Duyck
givenName: William
cn: William Duyck
displayName: William Duyck
userPassword: {SSHA}e5PIx2LQ8ItRI3uhxRx3vKFpix/1BEY4
mail: fuzzyfox0@gmail.com
l: Lewes
description: The complete and utter Mozilla Fan Boy and self proclaimed web enthusiast. What more do I need to say?!
jpegPhoto:< file:///tmp/william.jpg
domesdayNickName: fuzzyfox

dn: uid=5,ou=people,dc=mozillians,dc=org
objectClass: inetOrgPerson
objectClass: domesdayPerson
uid: 5
sn: Surman
givenName: Mark
cn: Mark Surman
displayName: Mark Surman
userPassword: {SSHA}6v9NTMhqMFpUORpqpCynb5E05eme3UrJ
Expand All @@ -91,8 +92,7 @@ l: Toronto
description: I work on Mozilla Foundation-y things.
jpegPhoto:< file:///tmp/mark.jpg
title: Mozilla Foundation Executive Director
postalAddress: 720 Spadina Ave, Suite 218, Toronto, Ontario
postalCode: M5S 2T9
postalAddress: 720 Spadina Ave, Suite 218, Toronto, Ontario, M5S 2T9

######
# Tags
Expand Down

0 comments on commit f26bb58

Please sign in to comment.