Telegram bot application
- Receiving updates (messages) from Telegram API services on port 8443
- Passing this messages to
TeleEngine
- Listening on port 443 to proxying to TeleManager Django web APP
- Receiving Telegram updates from
NGINX
- Passing Telegram messages to
TeleBot
- Django Web App that allows:
- Manage TeleOps user's accounts
- Receiving Telegram messages from
TeleManager
- Perform authentication of users
- Sending task to
TeleEngine
according to arrived message - Receiving task results from
TeleEngine
- Sending messages back to Telegram Users
- Leveraging Python for logging, authentication and other control
- Receiving tasks from
TeleBot
- Sending results to
TeleEngine
PostgreSQL with two databases:
telemanager
DB: contains information about users, they privileges, commands, etc.teleapp
DB (optional): application data.
Django Web Framework Application that allows you to manage users and they privileges.
TeleManager
interacts with TeleDatabase
-
Choose platform for web server:
- CherryPy
- NGINX + gunicorn + Django
NGINX + gunicorn + Django was choosen as the web server platform due to:
- recommended production environment
-
Choose way of interaction of
TeleManager
application andTeleDatabase
:- Django ORM
- Python Class based
Django ORM has been choosen due to convenience.
-
Figure out distribution model:
- Docker Container:
- Single container with
TeleManager
,TeleBot
,TeleEngine
,TeleDatabase
- 2 Dedicated container:
TeleManager
,TeleBot
,TeleEngine
TeleDatabase
- Single container with
- Single application, which requires the user to install the database and application on the machine barely
2 Dedicated container was chosen as distribution model due to:
- Learning of Docker objectives
- Fast deployment
- Microsegmentation
- Docker Container:
-
Create template for NGINX config
-
Code
TeleManager
-
Code
TeleBot
-
Code
TeleEngine
-
Code distribution (images, docker-compose)