gpchelkin/scdlbot

View on GitHub
.env.sample

Summary

Maintainability
Test Coverage
# TODO generate heroku app.json from sample
# Telegram Bot API Token, obtain it here: https://t.me/BotFather. This is the only required configuration variable.
TG_BOT_TOKEN="166849652:AAEPCgHuDf3K6HvI2OkrJmDN2k9Rexample"
# TODO
#TG_BOT_API="https://api.telegram.org"
#TG_BOT_API="http://127.0.0.1:8081"
# Chat ID of bot owner for alerts and permissions
TG_BOT_OWNER_CHAT_ID="1265343"

# TODO
CHAT_STORAGE="/home/gpchelkin/scdlbot.pickle"
# (Absolute?) path to parent directory for downloads directories, default: /tmp/scdlbot
DL_DIR="/tmp/scdlbot"
# TODO
BIN_PATH=""
# TODO
WORKERS="2"
# Download timeout in seconds, stop downloading if it takes longer than allowed
DL_TIMEOUT="300"
# TODO
CHECK_URL_TIMEOUT="30"
# TODO
COMMON_CONNECTION_TIMEOUT="10"
# Telegram upload file size limit (in bytes). API limit is 50 MB, Local mode API limit is 2000 MB (so you can change it to 1900_000_000).
MAX_TG_FILE_SIZE="45_000_000"
# Bot will not try to split and send files bigger than this (in bytes)
MAX_CONVERT_FILE_SIZE="80_000_000"
# Comma-separated chat IDs with no replying and caption spam
NO_FLOOD_CHAT_IDS="-10018859218,-1011068201"
# HTTP or local path with cookies file for Instagram and/or Yandex.Music
COOKIES_FILE="https://example.com/cookies.txt"
# TODO
PROXIES="http://127.0.0.1:3187,http://127.0.0.1:3188,"
# TODO
SOURCE_IPS="9.21.18.2,9.21.16.9"
# A space separated list of domains which should be considered whitelisted - the bot will only process these domains. Example of domain: example.com if the domain has a subdomain this needs to be included: subdomain.example.com **NOTE** that if both whitelist and blacklist will be used, only the blacklist will be taken into consideration.
WHITELIST_DOMAINS="example.com,subdomain.example.com"
# A space separated list of domains which should be considered blacklisted - the bot will not process these domains. Example of domain: example.com if the domain has a subdomain this needs to be included: subdomain.example.com **NOTE** that if both whitelist and blacklist will be used, only the blacklist will be taken into consideration.
BLACKLIST_DOMAINS="example.com,subdomain.example.com"
#BLACKLIST_DOMAINS="invidious.tube,invidious.kavin.rocks,invidious.himiko.cloud,invidious.namazso.eu,dev.viewtube.io,tube.cadence.moe,piped.kavin.rocks"
# A space separated list of chat_ids which should be considered whitelisted - the bot will only join those chats **NOTE** that if both whitelist and blacklist will be used, only the blacklist will be taken into consideration.
WHITELIST_CHATS="-1795100,1795102"
# A space separated list of chat_ids which should be considered blacklisted - the bot will not join those chats. **NOTE** that if both whitelist and blacklist will be used, only the blacklist will be taken into consideration.
BLACKLIST_CHATS="-1795100,1795102"

### Webhook:
# Use webhook for bot updates: 1, use polling (default): 0, more info https://core.telegram.org/bots/api#getting-updates
WEBHOOK_ENABLE="0"
# Host and port for webhook to listen to; Heroku sets PORT automatically for web dynos, so you shouldn't set it for Heroku
HOST="0.0.0.0"
PORT="5000"
# Your host URL like https://scdlbot.herokuapp.com, required for webhook mode
WEBHOOK_APP_URL_ROOT="https://yourapp.heroku.com"
# Your URL path for webhook to listen
WEBHOOK_APP_URL_PATH="166849652AAEPCgHuDf3K6HvI2OkrJmDN2k9Rexample"
# TODO
WEBHOOK_SECRET_TOKEN="CHANGEME"
# These links should help. In NGINX use WEBHOOK_APP_URL_PATH (TG_BOT_TOKEN without ":"), and port in proxy_pass according to PORT environment variable.
# https://github.com/python-telegram-bot/python-telegram-bot/wiki/Webhooks#using-nginx-with-one-domainport-for-all-bots

### Monitoring and logging:
# Host and port for metrics in Prometheus OpenMetrics format:
METRICS_HOST="127.0.0.1"
METRICS_PORT="8000"
# Set to DEBUG to enable verbose debug logging
LOGLEVEL="INFO"
# Syslog server, for example: logsX.papertrailapp.com:55555
SYSLOG_ADDRESS="logs2.papertrailapp.com:51181"
# Hostname to show in Syslog messages. In most cases it is already set in environment, you may want to set it manually in Heroku.
HOSTNAME="prod-aws"