Unlimited private cloud storage solution using Telegram's API
Telegram Drive is a Python-based application that uses Telegram’s APIs to provide a secure and scalable cloud storage solution designed for multiple users. By utilizing a single valid Telegram account, you can create an unlimited and secure cloud storage system where each participant is assigned unique username and password credentials.
- Unlimited Storage Capacity: Utilize Telegram's storage infrastructure to store files of any size.
- Data Security and Protection: Ensure data integrity and security through Telegram's end-to-end encryption.
- Multi-User Accessibility: Allow multiple users to access the drive with unique credentials.
- Quart: Asynchronous python web framework for handling HTTPS requests.
- PyMongo: Official MongoDB driver for Python.
- Telethon: Python library for interacting with Telegram's API.
- MongoDB: Used to store file metadata and manage user information, minimizing direct interactions with Telegram's API.
Telegram-Drive/
├── api/
│ ├── discord/ # Modules for Discord integration (not yet implemented)
│ ├── mongodb/ # Modules for MongoDB integration
│ └── telegram/ # Abstraction layers for Telegram API interactions
├── server/ # HTTPS server implementation using Quart
├── format/ # Modules for formatting media objects (files, images, audio)
├── userManagement/ # User management module (register / changePw / etc...)
├── utils/ # Utility modules for reusable and maintainable code functions
├── README.md
└── LICENSE
-
Clone the Repository:
git clone https://github.com/AbissoHub/Telegram-Drive cd Telegram-Drive
-
Install Dependencies: Ensure you have python then install the required Python packages:
pip install -r requirements.txt
-
Set Up Environment Variables: Create a
.env
file in the root directory and configure environment variables as outlined in the Configuration section. -
Register Users Using module
user_management.py
register user you want in storage (you can do this later, but you won't be able to access the drive properly) -
Run the Server:
python main.py
Create a .env
file in the root directory with the following variables:
API_ID
: Your Telegram API ID. Check hereAPI_HASH
: Your Telegram API Hash. Check herePHONE
: The phone number associated with your Telegram account in international format (e.g., +1234567890).MONGO_URL
: MongoDB connection string. Check hereSERVER_PORT
: Port number for the Quart server. If you leave blank will be select default portDISCORD_TOKEN_URL
: Param for discord login, you can leave blankDISCORD_AUTH_URL
: Param for discord login, you can leave blankSECRET_KEY
: A secret key generated by the script in.utils/
folder. DO NOT SHARE ITNAME_CLUSTER
: Cluster name in mongo DB to storage metadata
example:
API_ID=your_api_id
API_HASH=your_api_hash
PHONE="+1234567890"
MONGO_URL="your_mongodb_connection_string"
DISCORD_TOKEN_URL=""
DISCORD_AUTH_URL=""
SECRET_KEY="your_secret_key"
PORT=5000
NAME_CLUSTER="Telegramdrive"
Ensure all required environment variables are properly set before deploying the service.
Before working with Telegram’s API, you need to get your own API ID and hash:
- Log in to your Telegram account with the phone number of the developer account you intend to use.
- Go to API Development tools.
- A Create new application window will appear. Fill in your application details. There is no need to enter any URL, and only the first two fields (App title and Short name) can currently be changed later.
- Click on Create application at the end.
Note
Remember that your API hash is secret, and Telegram won’t let you revoke it. Don’t share it publicly!
After configuring the .env file, registering users, and launching main.py, follow the terminal instructions to properly set up your Telegram account. Typically, the interface should appear as shown below:
[INFO] Starting server on ***.***.*.**:5000
* Serving Quart app 'server.server'
* Debug mode: False
* Please use an ASGI server (e.g. Hypercorn) directly in production
* Running on http://***.***.*.**:5000 (CTRL + C to quit)
[INFO] Connected to MongoDB
Please enter the code you received:
You will receive an OTP message from telegram, remember to enter it and do not share it.
At the end of this process the clusters for each registered user should be created automatically, and you can use the service correctly. If this step was performed before registering the users there is no problem, but you will have to restart the server
Enjoy :)
The database is structured with two main types of root folders: shared and private.
- Shared: This folder is accessible to ALL users registered to the service.
- Private: This folder is exclusive to the individual user. For syntactic reasons, including integration with Telegram, private and shared files are stored in separate logical spaces to ensure the highest possible syntactic privacy. Additionally, it is not possible to move files between private and shared folders, or vice versa, to maintain this privacy.
There is a trash folder where all items are initially moved when deleted. A second deletion from the trash folder results in the PERMANENT removal of the object.
Current Version: 0.1.0
Limitations:
- File Size Upload: Restrictions on the maximum file size that can be uploaded due to Telegram API limitations.
- Chunked Uploads: Currently does not support chunked uploads, limiting the ability to upload very large files seamlessly.
Note
Being the first version, the presence of bugs is likely, crashes should be well managed but total uptime is not guaranteed. Thanks for your understanding
Planned Improvements:
- Implement chunked upload functionality.
- Optimize system performance to handle increased data loads.
Abisso Drive offers a user-friendly GUI developed with React, allowing users to manage their files, upload/download content, and navigate through their storage effortlessly. The GUI communicates with the backend server through predefined endpoints, enabling customization and integration into various workflows.
The documentation for Telegram-Drive can be found here. available soon
This project is licensed under the MIT License. You are free to use, modify, and distribute the software as per the terms of this license.