nmhive.py: Return 400 errors for data-less POSTs
[nmhive.git] / README.rst
1 Nmhive is a webserver for nmbug_, allowing you to remotely query and
2 manage notmuch_ tags.  There is also a bookmarklet that provides a
3 convenient interface for managing tags while browsing Gmane_.
4
5 Dependencies
6 ============
7
8 * Flask_
9 * Flask-Cors_
10
11 The versions shouldn't matter too much, but I'm testing with Flask
12 0.10.1 and Flask-Cors 1.9.0.
13
14 Server setup
15 ============
16
17 Launch the server with something like::
18
19   $ nmhive.py -H 0.0.0.0 -p 5000
20    * Running on http://0.0.0.0:5000/
21   …
22
23 Use nmbug's usual ``NMBGIT`` and ``NMBPREFIX`` environment variables
24 to configure the nmbug repository used by nmhive.
25
26 You can kill the server whenever you like (e.g. via ``ctrl+c``)
27 without worrying about corrupting your local notmuch or nmbug
28 databases.
29
30 Then edit ``nmbug_server`` in ``nmbug.js`` to point at that interface.
31 Serve ``nmbug.js`` and ``index.html`` somewhere.  I serve them with
32 Nginx_, but you use whatever you like, including `Python's`__
33 `http.server`_ with something like::
34
35   $ python -m http.server 8000
36
37 __ Python_
38
39 Point your users to the served ``index.html`` so they can get the
40 bookmarklet and read the instructions for using it.
41
42
43 .. _nmbug: http://notmuchmail.org/nmbug/
44 .. _notmuch: http://notmuchmail.org/
45 .. _Gmane: http://gmane.org/
46 .. _Flask: http://flask.pocoo.org/
47 .. _Flask-Cors: https://pypi.python.org/pypi/Flask-Cors/
48 .. _Nginx: http://nginx.org/
49 .. _Python: https://www.python.org/
50 .. _http.server: https://docs.python.org/3/library/http.server.html