diff --git a/INSTALL b/INSTALL new file mode 100644 index 00000000..420ab6b5 --- /dev/null +++ b/INSTALL @@ -0,0 +1,61 @@ +This document contains installation instructions for Domesday on Ubuntu. +Application to other systems is currently an exercise for the reader :-) + +1) Install necessary libraries + +sudo apt-get install libmysqlclient-dev python-pip python-jinja2 python-mysqldb python-dev libsasl2-dev + +2) Get a copy of Domesday + +git clone --recursive git://github.com/mozilla/domesday.git phonebook + +(Apparently things will go wrong if you call the directory you keep it in +'domesday' as well, so it is called 'phonebook' above.) + +3) Install requirements + +cd domesday +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 + +sudo apt-get install slapd ldap-utils db4.2-util + +ps aux | grep slap +should show the directory running. If not, start it. + +6) 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 + +sudo ldapadd -Y EXTERNAL -H ldapi:/// -f directory/mozillians-config.ldif + +8) Put test Mozillians data in directory + +sudo ldapadd -x -D cn=admin,dc=mozillians,dc=org -W -f directory/mozillians-data.ldif + +9) Hack settings_local.py + +Copy settings_local.py-dist to settings_local.py +Fill in the LDAP details if necessary (if your directory is local and you are using the supplied LDIF, it should be the same). + +10) Start the test server + +./manage.py runserver + +Open Questions +-------------- + +- What about virtualenvs? diff --git a/directory/domesday-schema.ldif b/directory/domesday-schema.ldif new file mode 100644 index 00000000..17818f12 --- /dev/null +++ b/directory/domesday-schema.ldif @@ -0,0 +1,26 @@ +# Schema for additional Domesday attributes +# OIDs currently used are from experimental arc 1.3.6.1.3.x +# (see http://tools.ietf.org/html/draft-ietf-ldapbis-iana-06) +# and two runs of 'rand'. + +attributetype ( 1.3.6.1.3.18840.1 NAME 'domesdayNickName' + SUP name + SINGLE-VALUE ) + +attributetype ( 1.3.6.1.3.18840.2 NAME 'domesdayStartYear' + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{5} + SINGLE-VALUE ) + +attributetype ( 1.3.6.1.3.18840.3 NAME 'domesdayTShirtSize' + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{6} + SINGLE-VALUE ) + +objectclass ( 1.3.6.1.3.21131.1 NAME 'domesdayPerson' + DESC 'Additional attributes for Domesday user' + SUP top AUXILIARY + MAY ( domesdayNickName $ labeledURI $ friendlyCountryName $ + telephoneNumber $ domesdayStartYear $ domesdayTShirtSize ) ) diff --git a/directory/mozillians-config.ldif b/directory/mozillians-config.ldif new file mode 100644 index 00000000..013f1842 --- /dev/null +++ b/directory/mozillians-config.ldif @@ -0,0 +1,36 @@ +# Load dynamic backend modules +dn: cn=module,cn=config +objectClass: olcModuleList +cn: module +olcModulePath: /usr/lib/ldap +olcModuleLoad: back_hdb + +# Database settings +dn: olcDatabase=hdb,cn=config +objectClass: olcDatabaseConfig +objectClass: olcHdbConfig +olcDatabase: {1}hdb +olcDbDirectory: /var/lib/ldap +olcDbConfig: set_cachesize 0 2097152 0 +olcDbConfig: set_lk_max_objects 1500 +olcDbConfig: set_lk_max_locks 1500 +olcDbConfig: set_lk_max_lockers 1500 +olcDbIndex: objectClass eq +olcLastMod: TRUE +olcDbCheckpoint: 512 30 +olcSuffix: dc=mozillians,dc=org +olcRootDN: cn=admin,dc=mozillians,dc=org +olcRootPW: secret +olcAccess: to attrs=userPassword + by dn="cn=admin,dc=mozillians,dc=org" write + by anonymous auth + by self write + by * none +olcAccess: to attrs=shadowLastChange + by self write + by * read +olcAccess: to dn.base="" + by * read +olcAccess: to * + by dn="cn=admin,dc=example,dc=com" write + by * read diff --git a/directory/mozillians-data.ldif b/directory/mozillians-data.ldif new file mode 100644 index 00000000..03312326 --- /dev/null +++ b/directory/mozillians-data.ldif @@ -0,0 +1,124 @@ +########### +# Structure +########### + +dn: dc=mozillians,dc=org +objectClass: top +objectClass: dcObject +objectclass: organization +dc: mozillians +o: Mozillians + +dn: ou=people,dc=mozillians,dc=org +objectClass: organizationalUnit +ou: people + +dn: ou=tags,dc=mozillians,dc=org +objectClass: organizationalUnit +ou: tags + +######## +# People +######## +dn: uid=1,ou=people,dc=mozillians,dc=org +objectClass: inetOrgPerson +uid: 1 +sn: Markham +givenName: Gervase +cn: Gervase Markham +displayName: Gervase Markham +userPassword: {SSHA}/Psb2o+/+Mke+n5yOQvG3puzFXwAzw6Z +mail: gerv@mozilla.org +l: London +description: I solve community problems for Mozilla. +jpegPhoto:< file:///home/gerv/docs/hacking/domesday/gerv.jpg +title: Grease Gun +postalAddress: 11 Chestbrook Court, 1 Forsyth Place, Enfield +postalCode: EN1 2EE + +dn: uid=2,ou=people,dc=mozillians,dc=org +objectClass: inetOrgPerson +uid: 2 +sn: Boswell +givenName: David +cn: David Boswell +displayName: David Boswell +userPassword: {SSHA}wyNJo+bKFnsKykkmEI0oCurLy7Vu2eWC +mail: david@mozillafoundation.org +l: Berkeley +description: I work on www.mozilla.org and other stuff. +jpegPhoto:< file:///home/gerv/docs/hacking/domesday/david.jpg +title: Tour Guide +telephoneNumber: +1 510 501 7724 + +dn: uid=3,ou=people,dc=mozillians,dc=org +objectClass: inetOrgPerson +uid: 3 +sn: Colvig +givenName: Mary +cn: Mary Colvig +displayName: Mary Colvig +userPassword: {SSHA}C+UrjDrWk77fv0TmcoTXIxhNjrfS+vNy +mail: mary@mozilla.com +l: Mountain View +jpegPhoto:< file:///home/gerv/docs/hacking/domesday/mary.jpg +title: Director of Contributor Engagement +telephoneNumber: +1 415-336-5938 + +dn: uid=4,ou=people,dc=mozillians,dc=org +objectClass: inetOrgPerson +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:///home/gerv/docs/hacking/domesday/william.jpg + +dn: uid=5,ou=people,dc=mozillians,dc=org +objectClass: inetOrgPerson +uid: 5 +sn: Surman +givenName: Mark +cn: Mark Surman +displayName: Mark Surman +userPassword: {SSHA}6v9NTMhqMFpUORpqpCynb5E05eme3UrJ +mail: mark@mozillafoundation.org +l: Toronto +description: I work on Mozilla Foundation-y things. +jpegPhoto:< file:///home/gerv/docs/hacking/domesday/mark.jpg +title: Mozilla Foundation Executive Director +postalAddress: 720 Spadina Ave, Suite 218, Toronto, Ontario +postalCode: M5S 2T9 + +###### +# Tags +###### + +dn: cn=mofo,ou=tags,dc=mozillians,dc=org +objectClass: groupOfNames +cn: mofo +member: uid=1,ou=people,dc=mozillians,dc=org +member: uid=2,ou=people,dc=mozillians,dc=org +member: uid=5,ou=people,dc=mozillians,dc=org + +dn: cn=moco,ou=tags,dc=mozillians,dc=org +objectClass: groupOfNames +cn: moco +member: uid=3,ou=people,dc=mozillians,dc=org + +dn: cn=domesday-team,ou=tags,dc=mozillians,dc=org +objectClass: groupOfNames +cn: domesday-team +member: uid=1,ou=people,dc=mozillians,dc=org +member: uid=2,ou=people,dc=mozillians,dc=org +member: uid=3,ou=people,dc=mozillians,dc=org + +dn: cn=brit,ou=tags,dc=mozillians,dc=org +objectClass: groupOfNames +cn: brit +member: uid=1,ou=people,dc=mozillians,dc=org +member: uid=4,ou=people,dc=mozillians,dc=org