xppl/README.md

89 lines
2.0 KiB
Markdown
Raw Normal View History

# Varia's XPPL
2018-05-20 00:10:01 +02:00
The [XPUB] library living at [Varia].
2018-05-20 00:10:01 +02:00
> https://books.vvvvvvaria.org/
2018-07-20 13:53:37 +02:00
2018-11-18 11:14:52 +01:00
[XPUB]: http://xpub.nl/
[Varia]: https://varia.zone/
2018-07-20 13:53:37 +02:00
2018-11-18 19:37:16 +01:00
# Bork It
2018-05-20 00:10:01 +02:00
You'll need to run an [RQLite] database first:
2018-11-18 11:14:52 +01:00
```
$ apt update && apt install -y make
$ make install-rqlite
$ make rqlited
2018-11-18 11:14:52 +01:00
```
Then get [Pipenv] and run the development server with:
2018-05-20 00:10:01 +02:00
```bash
$ pipenv install --dev --three
$ pipenv run devserver
```
2018-05-20 00:10:01 +02:00
If you need to check the database contents, run:
```bash
$ make rqlite
```
And then run `.help` for which commands are available.
[Pipenv]: https://pipenv.readthedocs.io/en/latest/install/#pragmatic-installation-of-pipenv
2018-11-18 11:14:52 +01:00
[RQLite]: https://github.com/rqlite/rqlite
2018-05-20 00:10:01 +02:00
# Test It
```bash
$ pipenv run tox
```
Refer to the [tox.ini](tox.ini) for configuration options.
# Deploy It
2018-07-20 13:53:37 +02:00
See [ansible/README.md](ansible/README.md) for this.
2018-11-18 19:34:23 +01:00
# Maintain It
The XPPL is made up of a few parts:
* The [Flask] application and it's dependencies.
* The [RQLite] database.
* The [Syncthing] integration for uploads.
* The Nginx reverse proxy.
* The Let's Encrypt web certificates.
If you know [Ansible] (it's just YAML), you can just [read the entire configuration].
On the varia.zone machine, you can check the running services with:
```bash
$ sudo supervisorctl status all # check all services
$ sudo supervisorctl stop xppl:* # stop all XPPL services
$ sudo supervisorctl start xppl:* # start all XPPL services
```
2018-11-18 20:07:54 +01:00
You can also view the error logs with:
```bash
$ sudo supervisorctl tail xppl:xppl-flask stderr
$ sudo supervisorctl tail xppl:xppl-rqlite stderr
```
2018-11-18 19:34:23 +01:00
The `/var/xppl/xppl/uploads` folder is managed by the Varia [Syncthing UI].
The RQLite database is located at `/var/xppl/rqlite/node.1`. No cluster is configured.
No backups are configured right now.
[Flask]: http://flask.pocoo.org/
[RQLite]: https://github.com/rqlite/rqlite
[Syncthing]: https://docs.syncthing.net/
[Syncthing UI]: https://vvvvvvaria.org/st/
[read the entire configuration]: ansible/plays/main.yml
[Ansible]: https://www.ansible.com/overview/how-ansible-works