Skip to content

The bot monitors repository for new challenges, automatically informing developer chats about new rewards.

License

Notifications You must be signed in to change notification settings

nessshon/bounty-bridge-bot

Repository files navigation

🤖 Bounty Bridge Bot

TON Telegram Bot Python Versions License

image

Starlette FastAPI Telegram PHPMyAdmin MySQL Redis Certbot Nginx Docker

The bot monitors repository for new challenges, automatically informing developer chats about new rewards. It solicits opinions and participation, display relevant tags and include an interactive button for easy reward creation.

Features

Project Components:

  • MySQL - Database management system.
  • Nginx - Proxy server for routing and handling web requests.
  • Certbot - SSL certificate management and issuance.
  • phpMyAdmin - Web-based database administration tool.
  • Admin Panel - Custom web interface for administrative tasks.
  • Telegram Bot - Bot implementation for interacting on Telegram.
  • Redis - In-memory data structure store.

Launch and deployment:

Preparation

Clone this repo:

git clone https://github.com/nessshon/bounty-bridge-bot.git

Go to the project folder:

cd bounty-bridge-bot

Clone environment variables file:

cp .env.example .env

Configure environment variables variables file:

nano .env
Local launch

Install dependencies

pip install -r requirements.txt

Launch project:

python -m project
Deployment and launch

Change server_name on phpmyadmin.conf:

server_name pma.your-domain.com www.pma.your-domain.com;

Change server_name on project.conf :

server_name app.your-domain.com www.app.your-domain.com;

Install Docker and docker-compose:

apt install docker.io docker-compose -y

Deploy the project:

docker-compose up --build
  • The deployment script handles the creation of containers for MySQL and Redis.
  • Configures MySQL and Redis databases.
  • Configures Nginx as a proxy server for web requests.
  • Uses Certbot to generate and renew SSL certificates for secure communications.
  • Launches the admin panel, Telegram Bot and phpMyAdmin.

Before deploying the project, be sure to configure the virtual environment configurations.
Additional configuration parameters are located in .env.example.

Environment Variables Reference

Here is a reference guide for the environment variables used in the project:

Expand to view
Variable Type Description Example Local Example Prod
BOT_TOKEN str Bot token, obtained from @BotFather 123456:qweRTY 123456:qweRTY
BOT_USERNAME str The username of the bot same_bot same_bot
BOT_DEV_ID int User ID of the bot developer 123456789 123456789
BOT_ADMIN_ID int User ID of the bot administrator 123456789 123456789
GITHUB_TOKEN str GitHub token (you can obtain this from your GitHub account) ghp_BWC...ZzD ghp_BWC...ZzD
GITHUB_OWNER str GitHub owner (organization or user) where the repository is located ton-society ton-society
GITHUB_REPO str GitHub repository name grants-and-bounties grants-and-bounties
TONAPI_KEY str API key from tonconsole AE33EX..ASD32 AE33EX..ASD32
APP_URL str The domain of the webhook https://...ngrok.free.app https://example.com
APP_HOST str The host address where the app is running localhost 0.0.0.0
APP_PORT int The port number on which the app is listening 8000 8000
WEBHOOK_SECRET str Secret key for securing the webhook qwerty12345 qwerty12345
WEBHOOK_PATH str The path of the webhook /bot /bot
REDIS_HOST str The hostname or IP address of the Redis server localhost redis
REDIS_PORT int The port number on which the Redis server is running 6379 6379
REDIS_DB int The Redis database number 0 0
MYSQL_ROOT_PASSWORD str Root password for MySQL --skip-- root-password
MYSQL_HOST str The hostname or IP address of the database server localhost localhost
MYSQL_PORT int The port number on which the database server is running 3306 3306
MYSQL_USER str The username for accessing the database user user
MYSQL_PASSWORD str The password for accessing the database password password
MYSQL_DATABASE str The name of the database dbname dbname
CERTBOT_EMAIL str Email address for Certbot notifications --skip-- example@mail.com

Contribution

We welcome your contributions! If you have ideas for improvement or have identified a bug, please create an issue or submit a pull request.

Support

Supported by TON Society, Grants and Bounties program.

License

This repository is distributed under the MIT License.

About

The bot monitors repository for new challenges, automatically informing developer chats about new rewards.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published