Metadata-Version: 2.4
Name: alerk
Version: 0.1.2
Summary: alerk, if alert, reports on events.
Author-email: The220th <The220th@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/The220th/alerk
Project-URL: Issues, https://github.com/The220th/alerk/issues
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: alerk_pack
Requires-Dist: argparse
Requires-Dist: ksupk
Requires-Dist: numpy
Requires-Dist: requests
Requires-Dist: pyyaml
Requires-Dist: uvicorn
Requires-Dist: fastapi
Requires-Dist: cryptography
Requires-Dist: pydantic
Requires-Dist: pyTelegramBotAPI
Dynamic: license-file

# alerk

`alerk`, if **aler**t, reports on events.

![](imgs/intro.drawio.png)

> [!WARNING]
> This project has not been audited for security.

# Info

**READ THIS SECTION FIRST**

There are two entities:

- `alerk`: This is the server to which the `smalk`s broadcast.

- `smalk`: This is clients/notifiers, which trigger to some event and send it to `alerk`.

Known smalks:

- [smalk_disk_check](https://github.com/The220th/smalk_disk_check): disks and raids monitoring.

You can try to play with crypto module with using GUI: [krypto_gui_smalk](https://github.com/The220th/krypto_gui_smalk). 

## Current way to notify

- `Telegram`. 

Perhaps there will be other ways in the future.

## Why alerk/smalk

- Easy set up.

- Cryptography (RSA4096) is in the box. Messages are transmitted through a secure tunnel.

- There is a verification of the sender (signature). That is, only your `smalk` will be able to report events to your `alerk`.

- No need ssl.

- You can easily write your own [`smalk`](#writing-your-own-smalk).

# Installing

```bash
pip3 install alerk
```

# Setting up

## Create yaml setting file

Clone it from [`settings_template.yaml`](settings_template.yaml).

## Set up telegram bot

You can get `token` from `@BotFather` (it is telegram bot).
Input this `token` to yaml setting file.
Run script from `extra/warm_up_telebot.py`. Do `/start` from needed telegram users and remember their `telegram id`.
Input this `telegram id` to yaml setting file. Kill python instance of `extra/warm_up_telebot.py`.

## Set up keys

Generate keys of `alerk`:

```bash
alerk gen_keys
```

Put this keys to yaml setting file.

Do it for each `smalk`. Put their keys in their configuration files, as well as only their public keys in yaml setting file of alerk.

## Set up other settings

Read all yaml setting file and change needed fields.

# Run

```bash
alerk start /path/to/your/yaml/setting/file
```

# Writing your own smalk

Examine the files: [`extra/smalk_base.py`](extra/smalk_base.py) and [`extra/smalk_base_kommunicator.py`](extra/smalk_base_kommunicator.py).
