Add usage documentation

This commit is contained in:
francesco 2019-03-27 14:49:51 +01:00
parent 28eb545b2f
commit 3686ef2f96
2 changed files with 55 additions and 0 deletions

View file

@ -3,6 +3,61 @@ A plugin-based [Matrix](https://matrix.org) bot system written in Python.
### [Wiki](https://github.com/maubot/maubot/wiki)
### Usage
In order to create a bot from a basic configuration, clone this repository.
Cloning is only required to reuse some necessary configuration files. It is not necessary to clone the repository
in order to install maubot.
This can be done via `pip install maubot`.
From now on we refer to the directory where this repository has been cloned to as `maubot`.
The new bot will have its own directory, which can be created anywhere on the local filesystem with
`mkdir <bot_dir>` where `<bot_dir>` is a name of your choice.
Copy `maubot/example-config.yaml` to `<bot_dir>`.
Keep file `example-config.yaml` and copy it to `<bot_dir>/config.yaml`. At this point `<bot_dir>` will contain
both `example-config.yaml` and `config.yaml`.
In the same directory `<bot_dir>` create three directories that will be used by the bot later. Type
```
cd <bot_dir>
mkdir logs plugins trash
```
Before running the bot, edit `config.yaml` in all its sections.
In particular in section `plugin_directories` make sure that the bot will use the directories created before (`./trash` and `./plugins`).
Section `server` is self explanatory in its default.
Make sure it looks like below
```
server:
# The IP and port to listen to.
hostname: 0.0.0.0
port: 29316
```
In any case, use the same `port` when you will point the browser later.
Section `admins` should be configured with the username and password that will login to the bot manager page.
If `username` needs to login with password `1234`, this section will look like below
```
admins:
username: "1234"
```
At this point launch the bot manager.
From directory `<bot_dir>` launch
```
python -m maubot
```
and point the browser to `http://localhost:29316/_matrix/maubot/#/login`
After login, it is possible to create a new bot instance (clicking the + Instances button) via the screen like the one below ![alt text](https://github.com/maubot/maubot/blob/master/maubot/img/screenshot_new_instance.png "New instance")
### [Management API spec](https://github.com/maubot/maubot/blob/master/maubot/management/api/spec.md)
## Discussion

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB