Personal fork from https://anonscm.debian.org/git/nm/nm2.git

Enrico Zini e6c774c725 Notify log entries to nm@debian.org %!s(int64=8) %!d(string=hai) anos
api ad40e6d60c Fix file coding across the site (utf8 -> utf-8) %!s(int64=8) %!d(string=hai) anos
apikeys ad40e6d60c Fix file coding across the site (utf8 -> utf-8) %!s(int64=8) %!d(string=hai) anos
backend 04224cbf76 Removed DACS support %!s(int64=8) %!d(string=hai) anos
contributors 61e2a320c6 change SubmitContributors %!s(int64=10) %!d(string=hai) anos
deblayout f24ef77dcb Revert "Added black ribbon to logo" %!s(int64=8) %!d(string=hai) anos
dm ad40e6d60c Fix file coding across the site (utf8 -> utf-8) %!s(int64=8) %!d(string=hai) anos
dsa 320fabbe72 Sync email_ldap from LDAP instead of email %!s(int64=8) %!d(string=hai) anos
fprs ad40e6d60c Fix file coding across the site (utf8 -> utf-8) %!s(int64=8) %!d(string=hai) anos
keyring 04224cbf76 Removed DACS support %!s(int64=8) %!d(string=hai) anos
locale 18c55ff72c Localisation bootstrapped only for (de,es,fr,it) using html5 modal %!s(int64=11) %!d(string=hai) anos
maintenance fabb965967 Migrate mm to dc %!s(int64=10) %!d(string=hai) anos
minechangelogs 64253f41ea Added missing import %!s(int64=8) %!d(string=hai) anos
nm2 04224cbf76 Removed DACS support %!s(int64=8) %!d(string=hai) anos
nmlayout 9d5cab21c8 Removed logout button %!s(int64=8) %!d(string=hai) anos
person ad40e6d60c Fix file coding across the site (utf8 -> utf-8) %!s(int64=8) %!d(string=hai) anos
process e6c774c725 Notify log entries to nm@debian.org %!s(int64=8) %!d(string=hai) anos
projectb e4b189b7a0 Added migrations and update key cleanup housekeeping task %!s(int64=8) %!d(string=hai) anos
public db258d20d2 Removed an old dacs login link %!s(int64=8) %!d(string=hai) anos
restricted 9d5cab21c8 Removed logout button %!s(int64=8) %!d(string=hai) anos
templates 81db8e3b6d Rewrite index page %!s(int64=8) %!d(string=hai) anos
test_data 0f5c6f51d4 Lookup email from debian-newmaint to prefill as signed statement %!s(int64=8) %!d(string=hai) anos
wizard 6137834ad6 Mention which page %!s(int64=8) %!d(string=hai) anos
.coveragerc 12355a93e8 Also exclude housekeeping from test coverage %!s(int64=8) %!d(string=hai) anos
.gitignore 90ac203c2b Added python-coverage configuration %!s(int64=8) %!d(string=hai) anos
LICENSE df9b7632f1 Added LICENSE file %!s(int64=9) %!d(string=hai) anos
README.md e036a34b3f Another bit of README %!s(int64=8) %!d(string=hai) anos
TODO 5bfd557812 Moved todo list to the wiki %!s(int64=11) %!d(string=hai) anos
archive-process-email 1be86c4093 Updated archive-process-email to deal with new-style processes %!s(int64=8) %!d(string=hai) anos
coverage.sh 04224cbf76 Removed DACS support %!s(int64=8) %!d(string=hai) anos
debsso 7d984521cb Added experimental script to connect to nm.d.o using keys in the browser %!s(int64=8) %!d(string=hai) anos
fabfile.py 1bd53b662f Officialize move to nm2/wsgi.py %!s(int64=10) %!d(string=hai) anos
manage.py 6ded816cce Ported to django 1.7 %!s(int64=10) %!d(string=hai) anos
test-archive-process-email ae2b19b36f Fixed tests %!s(int64=9) %!d(string=hai) anos
urls.py 04224cbf76 Removed DACS support %!s(int64=8) %!d(string=hai) anos

README.md

Debian NM Front Desk web application

Running this code on your own machine

Dependencies

apt-get install python-markdown python-ldap python-psycopg2 python-xapian \
 python-django python-django-south python-django-housekeeping \
 python-debian python-debiancontributors

django-housekeeping

The ‘python-django-housekeeping’ package is not available in Debian earlier than Debian Stretch. If you are deploying to a machine running Debian earlier than Stretch, use the following procedure:

# https://github.com/spanezz/django-housekeeping
git clone https://github.com/spanezz/django-housekeeping
  (you can either build the package from it or symlink the module directory
  into the contributors.debian.org sources)

# build the package
fakeroot debian/rules clean binary

# install the package
dpkg -i  ../python-django-housekeeping_0.1-1_all.deb

Configuration

mkdir data # required by default settings
cd nm2
ln -s local_settings.py.devel local_settings.py
edit local_settings.py as needed

First setup

./manage.py migrate

Fill in data

Visit https://nm.debian.org/am/db-export to download nm-mock.json; for privacy, sensitive information are replaced with mock strings.

If you cannot login to the site, you can ask any DD to download it for you. There is nothing secret in the file, but I am afraid of giving out convenient email databases to anyone.

./manage.py import nm-mock.json

If you are a Front Desk member or a DAM, you can use https://nm.debian.org/am/db-export?full for a full database export.

Sync keyrings

rsync -az --progress keyring.debian.org::keyrings/keyrings/  ./data/keyrings/

Run database maintenance

./manage.py housekeeping

Run the web server

./manage.py runserver

Periodic updates

You need to run periodic maintenance to check/regenerate the denormalised fields:

./manage.py housekeeping

Development

Development targets Django 1.8, although the codebase has been created with Django 1.2 and it still shows in some places. Feel free to cleanup.

Unusual things in the design:

  • backend/ has the core models. Note that backend.models.Process is the old-style workflow, and process.model.Process is the new style workflow.
  • there is a custom permission system with a class hierarchy that starts at backend.models.VisitorPermissions, and that generates a set of permission strings that get tested in views and templates with things like if "edit_bio" in visit_perms: ….
  • backend.mixins.VisitorMixin is the root of a class hierarchy of mixins used by most views in the site; those mixins implement the basis of resource instantiation and permission checking.