Mythus commited on
Commit
0a2c9ce
·
1 Parent(s): f72c816

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +10 -159
README.md CHANGED
@@ -1,159 +1,10 @@
1
- <h1 align="center"> Fast Telegram Drive</h1>
2
-
3
- [![Discord](https://img.shields.io/discord/1142377485737148479?label=discord&logo=discord&style=flat-square&logoColor=white)](https://discord.gg/hfTUKGU2C6)
4
-
5
-
6
- <details open="open">
7
- <summary>Table of Contents</summary>
8
- <ol>
9
- <li>
10
- <a href="#how-to-make-your-own">How to make your own</a>
11
- <ul>
12
- <li><a href="#deploy-using-docker-compose">Deploy using docker-compose</a></li>
13
- <li><a href="#deploy-without-docker-compose">Deploy without docker-compose</a></li>
14
- </ul>
15
- </li>
16
- <li><a href="#setting-up-things">Setting up things</a></li>
17
- <ul>
18
- <li><a href="#mandatory-vars">Mandatory Vars</a></li>
19
- <li><a href="#optional-vars">Optional Vars</a></li>
20
- </ul>
21
- </ol>
22
- </details>
23
-
24
- ## Demo
25
-
26
- ![demo](./public/demo.png)
27
-
28
- [UI Repo ](https://github.com/divyam234/teldrive-ui)
29
-
30
- ### Deploy using docker-compose
31
- First clone the repository
32
- ```sh
33
- git clone https://github.com/divyam234/teldrive
34
- cd teldrive
35
- ```
36
-
37
-
38
- **Follow Below Steps**
39
-
40
- - Create the `.env` file with your variables and start your container.
41
-
42
- ```sh
43
- docker compose up -d
44
- ```
45
-
46
- - **Uploads from ui will be slower due to limitations of browser use [Teldrive Uploader](https://github.com/divyam234/teldrive-upload) for faster uploads.Make sure to use Multi Client mode if you are using uploader.**
47
-
48
- - **If you want to share download links with others make sure to use multi client mode with bots otherwise it will not work.**
49
-
50
- ### Deploy without docker-compose
51
- First clone the repository
52
- ```sh
53
- git clone https://github.com/divyam234/teldrive
54
-
55
- ```
56
- **Follow Below Steps**
57
-
58
- - Fork UI Repo given above and Deploy it to Vercel or just use https://teldrive.vercel.app.
59
- - Download release binary of teldrive from releases section.
60
- - .env file will be same as mentioned above and additionally set variables mentioned below.As vercel app is hosted on https so we need local server also on https so that cookies works.
61
- ```shell
62
- HTTPS=true
63
- COOKIE_SAME_SITE=false
64
- ```
65
- - Generate https cert and key for localhost using mkcert and put these in sslcerts directory where executable is present.
66
-
67
- - If you are using windows make sure to add cert as trusted using mkcert or manually.(You can see mkcert cli how to add that)
68
-
69
- - Rename generated cert and key as cert.pem and key.pem respectively.
70
-
71
- - Make sure to add database migrations directory where where executable is present.
72
-
73
- - Now run the teldrive executable from releases.
74
-
75
- - Finally change API URL from UI deployed on vercel to https://localhost:8080 in settings.
76
-
77
- ## Setting up things
78
-
79
- If you're locally or remotely hosting, create a file named `.env` in the root directory and add all the variables there.
80
- An example of `.env` file:
81
-
82
- ```sh
83
- APP_ID=1234
84
- APP_HASH=abc
85
- CHANNEL_ID=1234
86
- HTTPS=false
87
- COOKIE_SAME_SITE=true
88
- JWT_SECRET=abc
89
- DATABASE_URL=abc
90
- RATE_LIMIT=true
91
- TG_CLIENT_DEVICE_MODEL="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.1901.203" # Any valid browser user agent here
92
- TG_CLIENT_SYSTEM_VERSION=Win32
93
- TG_CLIENT_APP_VERSION=2.1.9 K
94
- TG_CLIENT_LANG_CODE=en
95
- TG_CLIENT_SYSTEM_LANG_CODE=en
96
- TG_CLIENT_LANG_PACK=webk
97
- MULTI_CLIENT=false
98
- MULTI_TOKEN1=55838383:yourfirstmulticlientbottokenhere
99
- MULTI_TOKEN2=55838383:yoursecondmulticlientbottokenhere
100
- MULTI_TOKEN3=55838383:yourthirdmulticlientbottokenhere
101
- ```
102
- According to [Telegram TOS](https://core.telegram.org/api/obtaining_api_id#using-the-api-id): *all accounts that sign up or log in using unofficial Telegram API clients are automatically put under observation to avoid violations of the Terms of Service.So you can use APP_ID and APP_HASH from official K Telegram webclient from [here](https://github.com/morethanwords/tweb/blob/464bc4e76ff6417c7d996cca50c430d89d5d8175/src/config/app.ts#L36)*
103
-
104
- **Use strong JWT secret instead of pure guessable string.You can use openssl to generate it.**
105
-
106
- ```bash
107
- $ openssl rand -base64 32
108
- ```
109
-
110
-
111
- **Multi Client Mode is recommended way to avoid flood errors and to enable max download speed if you are using downloaders like IDM and aria2c which use multiple connections to download files.**
112
- ### Mandatory Vars
113
- Before running the bot, you will need to set up the following mandatory variables:
114
-
115
- - `APP_ID` : Use official ones as mentioned above.
116
-
117
- - `APP_HASH` : Use official ones as mentioned above.
118
-
119
- - `JWT_SECRET` : Used for signing jwt tokens
120
-
121
- - `DATABASE_URL` : Connection String obtained from Postgres DB (you can use Neon db as free alternative fro postgres)
122
-
123
- - `CHANNEL_ID` : This is the channel ID for the log channel where app will store files . To obtain a channel ID, create a new telegram channel (public or private), post something in the channel, forward the message to [@missrose_bot](https://telegram.dog/MissRose_bot) and **reply the forwarded message** with the /id command. Copy the forwarded channel ID and paste it into the this field.
124
-
125
- ### Optional Vars
126
- In addition to the mandatory variables, you can also set the following optional variables:
127
- - `HTTPS` : Only needed when frontend is deployed on vercel.
128
-
129
- - `COOKIE_SAME_SITE` : Only needed when frontend is deployed on vercel.
130
- - `MULTI_CLIENT` : Enable or Disable Multi Token mode. If true you have pass atleast one Multi Token
131
- - `MULTI_TOKEN[1....]` : Recommended to add atleast 10-12 tokens
132
- ### For making use of Multi-Client support
133
-
134
- > **Note**
135
- > What it multi-client feature and what it does? <br>
136
- > This feature shares the Telegram API requests between other bots to avoid getting floodwaited (A kind of rate limiting that Telegram does in the backend to avoid flooding their servers) and to make the server handle more requests. <br>
137
-
138
- To enable multi-client, generate new bot tokens and add it as your environmental variables with the following key names.
139
-
140
- `MULTI_TOKEN1`: Add your first bot token here.
141
-
142
- `MULTI_TOKEN2`: Add your second bot token here.
143
-
144
- you may also add as many as bots you want. (max limit is not tested yet)
145
- `MULTI_TOKEN3`, `MULTI_TOKEN4`, etc.
146
-
147
- > **Warning**
148
- > Don't forget to add all these bots to the `CHANNEL_ID` as admin for the proper functioning
149
-
150
- ## FAQ
151
-
152
- - How to get Postgres DB url ?
153
- > You can spin up local postgres instance but its not recommended as there is lot of hassle in backup and transfering data.Recommended way is to use any free cloud postgres DB.I will recommend to use [Neon DB](https://neon.tech/).
154
-
155
- ## Contributing
156
-
157
- Feel free to contribute to this project if you have any further ideas.
158
-
159
-
 
1
+ ---
2
+ title: TelDrive
3
+ emoji: 🐨
4
+ colorFrom: green
5
+ colorTo: gray
6
+ sdk: docker
7
+ pinned: false
8
+ ---
9
+
10
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference