J-Rios / TLG_JoinCaptchaBot

Telegram Bot to verify if users joining a group are human. The Bot sends an image captcha for each new user and kicks any of them who can't solve the captcha in a specified time.
GNU General Public License v3.0
516 stars 217 forks source link

fix docker image & sed command #87

Closed zufardhiyaulhaq closed 3 years ago

zufardhiyaulhaq commented 3 years ago
  1. python:3-slim-buster image currently using python 3.9 that doesn't support by Pillow 7.1.2. https://pillow.readthedocs.io/en/stable/installation.html
  2. Default configuration is in settings.py. Fix seeding directly to the settings.py
  3. Add docs to enable the user to add an additional environment variable

Signed-off-by: zufardhiyaulhaq zufardhiyaulhaq@gmail.com

zufardhiyaulhaq commented 3 years ago

@J-Rios can you check & review? thanks

zufardhiyaulhaq commented 3 years ago

also, I want to ask something, why we don't directly use an environment variable for telegram bot token and bot language, hardcode in the code seems to make deployment hard since we need to upload the image in a private registry. If we use an environment variable, we can use a single image and deploy to multiple environments like docker, compose, or even kubernetes.

J-Rios commented 3 years ago

Please take a look into last commits. Docker build was revisited: some fixes, simplified and removed unnecessary Bot Token and language setup...

https://github.com/J-Rios/TLG_JoinCaptchaBot/commit/38257eed0a50ac918096eefdb428ceac96774e8e

So now, you can setup any environment variable like you specify, including Bot token with something like:

sudo docker run -d --name captcha-bot --env CAPTCHABOT_TOKEN="XXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" captcha-bot

Note that I don't have too much knowledge regarding Docker, and making deployments are not something that I commonly do, so I'm not really familiar to all of this, if you see something that can be modified for a better approach, feel free to comment it opening an issue or pull request :)

Best Regards.