Skip to content

Commit

Permalink
Update docs for 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
orenlab committed Aug 23, 2024
1 parent 30fdf8b commit 01140eb
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 128 deletions.
47 changes: 23 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# pyTMbot

A simple Telegram bot to handle **Docker** `containers` and `images`, also providing basic information about the status of
A simple Telegram bot to handle **Docker** `containers` and `images`, also providing basic information about the status
of
**local** servers.
The bot operates synchronously. It does not use webhooks.

Expand All @@ -20,13 +21,18 @@ The bot was written using the [pyTelegramBotAPI](https://github.com/eternnoir/py
Use [psutil](https://github.com/giampaolo/psutil) and [docker-py](https://github.com/docker/docker-py) libraries for
gather information.

## 🐳 A large section on Docker
## 💡 Key Features

- Information about containers (even those that have finished work)
- The ability to view container logs
- Information about images
### 🐳 A large section on Docker

### 💡 Features
__Some of the features are protected by two-factor authentication, which is built into pyTMbot v.2__

- Container management (start, stop, restart, etc.)
- Key information about the current status of containers (even those that have finished work)
- Ability to access container logs
- Key information about images

### 🖥️ A large section on local servers

- Load average information
- Summary memory usage information (with swap)
Expand Down Expand Up @@ -60,24 +66,21 @@ in `setup_req.txt`

## 🛡 Secure

An authorization mechanism has been built into the pyTMbot management system.
To describe the principle of its operation in the most concise way, we can say the following:
There has been a significant architectural change in pyTMbot v.2, and in addition to this, several new security measures
have been implemented in the bot.

- At the initial stage of configuration, we set the unique identifiers of users who are allowed to access the
bot (`ALLOWED_USER_IDS`), regardless of which official method is used.
- With each new request for the bot, the middleware `AccessControl` is activated first. It checks whether the
variable `from_user.id` matches the values specified in the settings. If a match is found, the request is sent to the
appropriate handler.
- In all other cases, a mechanism is triggered that informs the user that they do not have access to the bot and stops
processing.
One of the main changes is the addition of a "superuser" role, which gives Docker container management rights. This
allows users to manage containers more securely and efficiently.

In the `alpine-dev` build (and the next release `0.1.2`), this mechanism has been expanded:
Another important new feature is native TOTP (Time-Based One-Time Password) two-factor authentication. This method uses
a unique code generated by a time-based algorithm to verify a user's identity, making it much more difficult for
unauthorized users to access critical functions of the bot. The lifetime of the session is also limited and controlled,
ensuring that sessions do not last indefinitely.

- The bot now reacts to incoming requests by reporting the lack of access twice, then completely stops processing
messages.
- All failed attempts to authorize are logged with an `DENIED` and `BLOCKED`flag.
Despite the introduction of these new measures, the basic protection mechanisms of the bot have not been abandoned. They
have been optimized to continue protecting the bot from unauthorized access.

For stable version, failed attempts to authorize are logged with an `ERROR`flag.
You can learn more about these changes and the benefits they provide in our blog [post](#).

## 💢 Supported commands

Expand All @@ -93,10 +96,6 @@ In addition to button navigation, the bot also supports commands. Below is a lis
| 6 | `/back` | 🔙 Back to main menu | Button available in the Docker section |
| 7 | `/check_bot_updates` | None | - |

## 🌲 Bot tree

- See [bot_tree.md](docs/bot_tree.md)

## 📈 Roadmap

- See [roadmap.md](docs/roadmap.md)
Expand Down
6 changes: 2 additions & 4 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@

| Version | Supported |
|---------|--------------------|
| 0.1.1 | :white_check_mark: |
| 0.1.0 | :white_check_mark: |
| 0.0.9 | :white_check_mark: |
| < 0.0.9 | :x: |
| 0.2.0 | :white_check_mark: |
| < 0.2.0 | :x: |

## Reporting a Vulnerability

Expand Down
94 changes: 0 additions & 94 deletions docs/bot_tree.md

This file was deleted.

15 changes: 10 additions & 5 deletions docs/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@ A simple Telegram bot to handle Docker containers and images, also providing bas
![Github last-commit](https://img.shields.io/github/last-commit/orenlab/pytmbot)
![GitHub Release](https://img.shields.io/github/v/release/orenlab/pytmbot)

## 🐳 A large section on Docker
## 💡 Key Features

- Information about containers (even those that have finished work)
- The ability to view container logs
- Information about images
### 🐳 A large section on Docker

### 💡 Features
__Some of the features are protected by two-factor authentication, which is built into pyTMbot v.2__

- Container management (start, stop, restart, etc.)
- Key information about the current status of containers (even those that have finished work)
- Ability to access container logs
- Key information about images

### 🖥️ A large section on local servers

- Load average information
- Summary memory usage information (with swap)
Expand Down
2 changes: 1 addition & 1 deletion docs/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
|----|-------------------------------------------------------------------------------|----------------|-----------------------|
| 1 | Tests | `in progress` | 4Q2024 |
| 2 | Background, regular statistics collection | `planned` | 4Q2024 |
| 3 | Check Docker image updates | `pending` | - |
| 3 | Check Docker image updates | `in progress` | 3Q2024 |
| 4 | Image Management | `in progress` | 3Q2024 |
| 5 | Container Management | `in progress` | 3Q2024 |
| 6 | Support for Fluentd | `planned` | 4Q2024 |
Expand Down

0 comments on commit 01140eb

Please sign in to comment.