format markdown
This commit is contained in:
parent
d9aa9601bf
commit
beed628a9b
4 changed files with 13 additions and 11 deletions
|
@ -9,7 +9,6 @@ See the
|
||||||
[Install the dependencies section of SETUP.md](SETUP.md#install-the-dependencies)
|
[Install the dependencies section of SETUP.md](SETUP.md#install-the-dependencies)
|
||||||
for help setting up a running environment for the bot.
|
for help setting up a running environment for the bot.
|
||||||
|
|
||||||
|
|
||||||
### Development dependencies
|
### Development dependencies
|
||||||
|
|
||||||
There are some python dependencies that are required for linting/testing etc.
|
There are some python dependencies that are required for linting/testing etc.
|
||||||
|
@ -43,6 +42,7 @@ pytest .
|
||||||
```
|
```
|
||||||
|
|
||||||
Code coverage can be generated with:
|
Code coverage can be generated with:
|
||||||
|
|
||||||
```
|
```
|
||||||
coverage run --source matrix_alertbot -p -m pytest
|
coverage run --source matrix_alertbot -p -m pytest
|
||||||
```
|
```
|
||||||
|
|
|
@ -20,18 +20,18 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for how to contribute to the project.
|
||||||
## Project structure
|
## Project structure
|
||||||
|
|
||||||
The majority of the code is kept inside of the `matrix_alertbot` folder, which
|
The majority of the code is kept inside of the `matrix_alertbot` folder, which
|
||||||
is in itself a [python package](https://docs.python.org/3/tutorial/modules.html),
|
is in itself a [python package](https://docs.python.org/3/tutorial/modules.html),
|
||||||
the `__init__.py` file inside declaring it as such.
|
the `__init__.py` file inside declaring it as such.
|
||||||
|
|
||||||
To run the bot, the `matrix-alertbot` script in the root of the codebase is
|
To run the bot, the `matrix-alertbot` script in the root of the codebase is
|
||||||
available. It will import the `main` function from the `main.py` file in the
|
available. It will import the `main` function from the `main.py` file in the
|
||||||
package and run it. To properly install this script into your python environment,
|
package and run it. To properly install this script into your python environment,
|
||||||
run `pip install -e .` in the project's root directory.
|
run `pip install -e .` in the project's root directory.
|
||||||
|
|
||||||
`setup.py` contains package information (for publishing the code to
|
`setup.py` contains package information (for publishing the code to
|
||||||
[PyPI](https://pypi.org)) and `setup.cfg` just contains some configuration
|
[PyPI](https://pypi.org)) and `setup.cfg` just contains some configuration
|
||||||
options for linting tools.
|
options for linting tools.
|
||||||
|
|
||||||
`config.sample.yaml` is a sample configuration file. You should copy this file to `config.yaml`, then edit it according to
|
`config.sample.yaml` is a sample configuration file. You should copy this file to `config.yaml` , then edit it according to
|
||||||
your needs. Be sure never to check the edited `config.yaml` into source control
|
your needs. Be sure never to check the edited `config.yaml` into source control
|
||||||
since it'll likely contain sensitive details such as passwords!
|
since it'll likely contain sensitive details such as passwords!
|
||||||
|
|
10
SETUP.md
10
SETUP.md
|
@ -19,7 +19,9 @@ After installation and ensuring the `docker-compose` command works, you need to:
|
||||||
|
|
||||||
2. Create a docker volume pointing to that directory:
|
2. Create a docker volume pointing to that directory:
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
|
```
|
||||||
docker volume create \
|
docker volume create \
|
||||||
--opt type=none \
|
--opt type=none \
|
||||||
--opt o=bind \
|
--opt o=bind \
|
||||||
|
@ -35,7 +37,7 @@ instruct you on how to install the dependencies natively:
|
||||||
|
|
||||||
#### Install libolm
|
#### Install libolm
|
||||||
|
|
||||||
You can install [libolm](https://gitlab.matrix.org/matrix-org/olm) from source,
|
You can install [libolm](https://gitlab.matrix.org/matrix-org/olm) from source,
|
||||||
or alternatively, check your system's package manager. Version `3.0.0` or
|
or alternatively, check your system's package manager. Version `3.0.0` or
|
||||||
greater is required.
|
greater is required.
|
||||||
|
|
||||||
|
@ -99,7 +101,7 @@ Then simply run the bot with:
|
||||||
matrix-alertbot
|
matrix-alertbot
|
||||||
```
|
```
|
||||||
|
|
||||||
By default, the bot will run with the config file at `./config.yaml`. However, an
|
By default, the bot will run with the config file at `./config.yaml` . However, an
|
||||||
alternative relative or absolute filepath can be specified after the command:
|
alternative relative or absolute filepath can be specified after the command:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -110,7 +112,7 @@ matrix-alertbot other-config.yaml
|
||||||
|
|
||||||
Invite the bot to a room and it should accept the invite and join.
|
Invite the bot to a room and it should accept the invite and join.
|
||||||
|
|
||||||
Matrix AlertBot will process any message starting with the prefix defined in the config. By default, this prefix is `!alert`. Let's test this now.
|
Matrix AlertBot will process any message starting with the prefix defined in the config. By default, this prefix is `!alert` . Let's test this now.
|
||||||
After the bot has successfully joined the room, try sending the following
|
After the bot has successfully joined the room, try sending the following
|
||||||
in a message:
|
in a message:
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ connection to a Postgres database backend is recommended.
|
||||||
### The `/data` volume
|
### The `/data` volume
|
||||||
|
|
||||||
The docker container expects the `config.yaml` file to exist at
|
The docker container expects the `config.yaml` file to exist at
|
||||||
`/data/config.yaml`. To easily configure this, it is recommended to create a
|
`/data/config.yaml` . To easily configure this, it is recommended to create a
|
||||||
directory on your filesystem, and mount it as `/data` inside the container:
|
directory on your filesystem, and mount it as `/data` inside the container:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -27,12 +27,12 @@ differences:
|
||||||
|
|
||||||
* The bot store directory should reside inside of the data directory so that it
|
* The bot store directory should reside inside of the data directory so that it
|
||||||
is not wiped on container restart. Change it from the default to
|
is not wiped on container restart. Change it from the default to
|
||||||
`/data/store`. There is no need to create this directory yourself, it will be
|
`/data/store` . There is no need to create this directory yourself, it will be
|
||||||
created on startup if it does not exist.
|
created on startup if it does not exist.
|
||||||
|
|
||||||
* The bot cache directory should reside inside of the data directory as well,
|
* The bot cache directory should reside inside of the data directory as well,
|
||||||
so that alerts and silences related informations are not wiped on container
|
so that alerts and silences related informations are not wiped on container
|
||||||
restart. Change it from the default to `/data/cache`.
|
restart. Change it from the default to `/data/cache` .
|
||||||
There is no need to create this directory yourself, it will be created on
|
There is no need to create this directory yourself, it will be created on
|
||||||
startup if it does not exist.
|
startup if it does not exist.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue