Note: if you know how to setup venv go to step 4
-
Setup your virtualenv
python -m venv .venv
-
Next step activate it
-
On linux systems:
source .venv/bin/activate
-
On Windows:
.venv\Scripts\activate
-
Download required libs
pip install -r requirements.txt
-
Create .env file in
data\.env
with BOT_TOKEN -
Launch bot in
app.py
file -
Sample .service file
Path:
/etc/systemd/system/wireguard-bot.service
Code: (if you using python 3.10)[Unit] Description='Service for my new bot' After=network.target [Service] Type=idle Restart=on-failure User=root ExecStart=/bin/bash -c 'cd ~/wireguard-bot/ && source .venv/bin/activate && python3.10 app.py' [Install] WantedBy=multi-user.target
-
Enable service and start it
systemctl enable wireguard-bot.service systemctl start wireguard-bot.service
-
Install qrencode package for generating QR code for mobile configs
sudo apt install qrencode
pip-review --local --auto
- update all libs
WG_BOT_TOKEN = <str>
WG_SERVER_IP = <str>
WG_SERVER_PORT = <str>
WG_SERVER_PUBLIC_KEY = <str>
WG_SERVER_PRESHARED_KEY= <str>
WG_CFG_PATH = <str>
PAYMENTS_TOKEN = <str>
ADMINS_IDS = <list>
PAYMENT_CARD = <str>
DATABASE = <str>
DB_USER = <str>
DB_USER_PASSWORD = <str>
DB_HOST = <str>
DB_PORT = <str>