Skip to content

Simple telegram bot that allows upload, download and delete files on S3-compatible storage like AWS S3 and DigitalOcean Spaces.

Notifications You must be signed in to change notification settings

chiggimps/s3-bucket-manager-telegram-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

S3 Bucket Manager Telegram Bot

Simple telegram bot that allows upload, download and delete files on S3-compatible storage like AWS S3 and DigitalOcean Spaces.

Built on top of python-telegram-bot.

Configuration

Minimal sample .env file:

TELEGRAM_API_TOKEN=0000000000:AAFBxO9f3HELPkYvaiww0LiNcj6DB-R2d2Q
TELEGRAM_USERNAME=durov
AWS_SERVER_PUBLIC_KEY=AKIAQWERTY4BLSCYBT36
AWS_SERVER_SECRET_KEY=7b79ipOp8sDqycbY4dVSd28TQyaNzyT99PpLJrGO
AWS_REGION=us-east-1
BUCKET_NAME=myuploads

Minimal sample .env file:

TELEGRAM_API_TOKEN=0000000000:AAFBxO9f3HELPkYvaiww0LiNcj6DB-R2d2Q
TELEGRAM_USERNAME=durov
AWS_SERVER_PUBLIC_KEY=DTDINKIYJMAKAUTOEIWV
AWS_SERVER_SECRET_KEY=LBa9U+XUtg7fngBBQuOWXpSgOLULJTk0iaXERS+mlYA
AWS_REGION=ams3
ENDPOINT_URL=https://ams3.digitaloceanspaces.com
CUSTOM_ENDPOINT_URL=https://cdn.example.com
BUCKET_NAME=myuploads

Usage

Follow instructions to obtain a token, then paste token to .env file in form of TELEGRAM_API_TOKEN=XXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.

docker-compose up -d --build

TODO

  • Upload single file up tp 20MB
  • Delete single file
  • Change access level (make file private or public)
  • List files by pattern

Development notes

Update python-telegram-bot (pipenv)

cd s3_bucket_bot
pipenv update python-telegram-bot

or

cd s3_bucket_bot
/usr/local/opt/pipenv/bin/pipenv update python-telegram-bot

Update virtual env (pip)

cd s3_bucket_bot
pip install python-telegram-bot --upgrade

Lock requirements


/usr/local/opt/pipenv/bin/pipenv lock --requirements > requirements.txt

About

Simple telegram bot that allows upload, download and delete files on S3-compatible storage like AWS S3 and DigitalOcean Spaces.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Python 97.2%
  • Dockerfile 2.8%