🤖Use the Telegram interface (requires a VPS that can connect to the Internet), ♾️️ unlimited capacity, no limits on file formats, no limits on file content😏, takes up very little memory and disk space📁, lightweight and convenient. Files are stored on Telegram☁️ side, with good security🔒 and durability. Large files will be uploaded in parts (not fast), but uploading very large files is not supported. Successful upload will generate external links in the form of HTML, Markdown, and BBCode🔗, which can be used as image beds and file download URLs. Test address:☞tgNetDisc☜ Original Author's Address:https://github.com/csznet/tgState, On this basis, some modifications are made.
TOKEN
is the robot token.DOMAIN
is the domain name and does not need to be configured.PASS
is the password and does not need to be configured.CHANNEL
can be the channel address or chatId (can be obtained through the robot @getidsbot). If it is a channel, you need to make the channel public, pull the robot into the channel, and set it as an administrator. The channel address format is such as:@yohannChannl
. Reference the file (for fragmented files, reference thefileAll.txt
file) and reply toget
. If theDOMAIN
domain name parameter is configured, the complete URL will be returned. Otherwise, the file id (base64 encoding) will be returned. PassDomain name
+/d/
+File id
can directly download the file, and if it is a picture, it can be viewed directly.- Supported system architectures:
- linux/amd64
- linux/arm64
- linux/arm/v6
- linux/arm/v7
- linux/386
- linux/ppc64le
- linux/s390x
- linux/riscv64
Pull the personal registry image and start the container:
docker run -d --restart=always \
--name netdisc \
-p 8088:8088 \
-e TOKEN=xxx \
-e CHANNEL=xxx \
-e MODE=pan \
-e PASS=yohann \
-e DOMAIN=https://hh.abc.com \
yohannfan/yohann-netdisc:latest
./tgState -token xxxx -channel @xxxx
Replace xxxx with your bot token and @xxxx with the channel address or personal ID (for personal IDs, only use numbers without @).
To customize the port, use the -port parameter, for example:
-port 8888
If you don't need the homepage and only want the API and image display page, use the -index parameter, like this:
./tgState -token xxxx -channel @xxxx -port 8888 -index
To enable password protection, use the -pass parameter, for example, to set the password as csznet:
./tgState -token xxxx -channel @xxxx -port 8888 -pass csznet
For cloud storage mode, use the -mode pan parameter, like this:
./tgState -token xxxx -channel @xxxx -port 8888 -mode pan
curl -X POST -F "image=@/root/test/tgNetDisc;type=application/octet-stream" https://hh.abc.com/api
If a password is set:
curl -X POST -F "image=@/root/test/tgNetDisc;type=application/octet-stream" -b "p=YOURPASSWORD" https://hh.abc.com/api
If not needed, you can ignore~
☜ Core configuration
General reverse proxy core configuration:
location / {
proxy_pass http://localhost:8088;
proxy_method $request_method;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
Custom URL reverse proxy core configuration:
# Netdisk
location /tgState {
proxy_pass http://localhost:8088;
}
location ~ ^/tgState/(d|pwd|api)(.*)$ {
limit_req zone=mylimit burst=20; proxy_pass http://localhost:8088/$1$2; } location /pwd { proxy_pass http://localhost:8088; }