Revision 7 as of 2016-02-29 19:45:24

Clear message

Setting Up Hyperkitty for Development

This is cobbled together from http://wiki.list.org/display/DEV/A+5+minute+guide+to+get+the+Mailman+web+UI+running and https://hyperkitty.readthedocs.org/en/latest/development.html and testing things out!!

Get mailman 3 and postorius working

Here's the basic setup steps to get mailman and postorius working:

  1. Make a directory to store everything. I set up /home/duffy/Repositories.
  2. Make sure you have some necessary packages. I use Fedora 21 so I'll refer to Fedora stuff. You may need to adjust package names for your distro, and this list may not be exhaustive:
    •  sudo yum install python-setuptools python-devel python-virtualenv python3-devel git gcc nodejs-less postfix

      On Debian and Ubuntu, this may be something like:  sudo apt-get install python-setuptools python-dev python-virtualenv python3-dev git gcc node-less nodejs postfix

Note: If you get errors like  lessc: command not found  or  FilterError  while compiling bootstrap-custom.css it means either you don't have less-css compiler installed or its version is <1.5 (which is the minimum required for hyperkitty). Run the command below:

 sudo npm install -g less .

  1. Get all of the source code you need.
    • cd ~/Repositories
      git clone git@gitlab.com:mailman/mailman.git
      git clone git@gitlab.com:mailman/mailmanclient.git
      git clone git@gitlab.com:mailman/postorius.git
      git clone git@gitlab.com:mailman/postorius_standalone.git
      git clone git@gitlab.com:mailman/hyperkitty.git
      git clone git@gitlab.com:mailman/hyperkitty_standalone.git
      git clone git@gitlab.com:mailman/mailman-hyperkitty.git
  2. Make your virtual environments. Mailman needs Python 3.4+ but Postorius and HyperKitty still run on 2.7. The command names are different because Python 3 has the ability to create virtual environments built-in.

    • pyvenv-3.4 venv-3.4
      virtualenv venv-2.7
      source venv-2.7/bin/activate
  3. Set up mailman using the python executable from the 3.4 virtualenv. You should get a positive message at the end of this saying that mailman is essentially running.
    • cd mailman
      ../venv-3.4/bin/python setup.py install
      ../venv-3.4/bin/mailman start
      cd ..
  4. Set up everything else (it's a long slog but isn't that bad!). You will be prompted to enter details for a superuser account. Please enter an email address otherwise the database won't be setup correctly and you will run into errors later.
    • cd mailmanclient
      python setup.py develop
      cd ..
      cd postorius
      python setup.py develop
      cd ..
      cd postorius_standalone
      python manage.py migrate
      python manage.py createsuperuser
      cd ..
      cd hyperkitty
      python setup.py develop
      cd ..
  5. Start up the postorius web ui for mailman:
    • cd postorius_standalone
      python manage.py runserver

Get HyperKitty going

Okay, now you're got postorius up and running, but you'll need to do some other config to get HyperKitty going. Just follow the guide here: https://hyperkitty.readthedocs.org/en/latest/development.html. Since we also have Postorius running, you'll have to add "8002" to the last runserver command, because you need an available port:

django-admin.py runserver 8002 --pythonpath /home/duffy/Repositories/hyperkitty_standalone --settings settings &

Now you should be able to view the mailman management UI (postorius) at http://localhost:8000 and you should be able to view hyperkitty at http://localhost:8002.

If you want to tell Mailman to send the incoming emails to HyperKitty for archiving, you must install and setup the mailman-hyperkitty plugin.

cd mailman-hyperkitty
../venv-3.4/bin/python setup.py install
cd ../mailman
cat > mailman-hyperkitty.cfg << EOF
[general]
base_url: http://localhost:8002/
api_key: SecretArchiverAPIKey
EOF
cat >> mailman.cfg << EOF
[archiver.hyperkitty]
class: mailman_hyperkitty.Archiver
enable: yes
configuration: mailman-hyperkitty.cfg
EOF

And now restart Mailman using the new mailman.cfg configuration file:

../venv-3.4/bin/mailman stop
../venv-3.4/bin/mailman -C mailman.cfg start

(mizmo wrote this on 26 Sept 2013. If it doesn't work, she either goofed something or this is out-of-date.) (updated on 29 feb 2016)