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
TeleEngineaccording 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:
telemanagerDB: contains information about users, they privileges, commands, etc.teleappDB (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
TeleManagerapplication 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,TeleEngineTeleDatabase
- 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)
