README.md 2.55 KB
Newer Older
David Seaward's avatar
David Seaward committed
1 2
Services middleware
===================
3

4
[project] | [code] | [tracker] | *snippets*
5

David Seaward's avatar
David Seaward committed
6 7 8
A middleware application for managing private, account-based services,
including resource management and user-facing registration. Tailored for
*Purist services* offered by Purism SPC, but deployable anywhere.
9 10 11 12 13 14 15 16 17

Follows an opinionated installation process (specifically expecting
one-instance-per-server), but also includes a number of configuration
options.

[project]: https://plan.puri.st/module/middleware
[code]: https://code.puri.sm/purist/middleware
[tracker]: https://code.puri.sm/purist/middleware/issues
[snippets]: https://code.puri.sm/purist/snippets/src/master/middleware
18 19 20 21

Prerequisites
-------------

22 23
* Debian 9
* Python 3.5
24
* Django 1.11 (included in Python packages below)
25
* Nginx
David Seaward's avatar
David Seaward committed
26
* RabbitMQ server
27
    * Must be accessible at `amqp://guest:guest@localhost:5672//`
David Seaward's avatar
David Seaward committed
28
    * This can be achieved with just `apt install rabbitmq-server`
David Seaward's avatar
David Seaward committed
29
* Additional dependencies (Debian package names):
30 31 32 33
    * `libsasl2-dev`
    * `libldap2-dev`
    * `libssl-dev`
    * `python3-dev`
34
    * `supervisor`
David Seaward's avatar
David Seaward committed
35 36 37
    * `uwsgi`
    * `uwsgi-emperor`
    * `uwsgi-plugin-python3`
David Seaward's avatar
David Seaward committed
38 39
    * `virtualenv`
* Python/Django dependencies: see `requires/requirements.txt`
40 41
* External resources:
    * LDAP database
42 43 44 45 46
    * WooCommerce instance
      * [REST API enabled](https://docs.woocommerce.com/document/woocommerce-rest-api/)
      * [WooCommerce Subscriptions](https://woocommerce.com/products/woocommerce-subscriptions/)
      * [JWT Authentication for WP REST API](https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/)
        (pending)
David Seaward's avatar
David Seaward committed
47
    * SSH access to an OpenVPN server with `create_new_ovpn_config`
48
      * Typically, the Nginx user (`www-data`) will need SSH access
David Seaward's avatar
David Seaward committed
49
      * Test with `sudo -u www-data ssh -p PORT REMOTE_USER@HOSTNAME`
50 51
      * The user needing access can be changed in
        `purist_middleware_monitor.conf`
52

53
Other versions and alternatives may work but are untested.
54 55 56 57

Usage
-----

58 59
* Install by following the instructions [SETUP.md](SETUP.md) to install.
* Start Django site as a system service, or with `./manage.py runserver`
60 61
* Visit <https://example.com> and follow the login or registration
  links.
62

63
Sharing
64 65
-------

David Seaward's avatar
David Seaward committed
66 67
Services middleware <br />
<https://plan.puri.st/module/middleware> <br />
68
Copyright 2017 Purism SPC and contributors <br />
69
SPDX-License-Identifier: AGPL-3.0+
70

71 72
Shared under AGPLv3-or-later, see [COPYING.AGPL.md](COPYING.AGPL.md)
for details. Contributions under the same terms are welcome.
73

74 75
Contributions and license notices from other sources are listed in
[COPYING.md](COPYING.md)