Skip to content

Latest commit

 

History

History
119 lines (95 loc) · 4.31 KB

README_EN.md

File metadata and controls

119 lines (95 loc) · 4.31 KB

中文 | EN

tgNetDisc

🤖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.

Docker One-click deployment (recommended 🏆)

  • 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 the fileAll.txt file) and reply to get. If the DOMAIN domain name parameter is configured, the complete URL will be returned. Otherwise, the file id (base64 encoding) will be returned. Pass Domain 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

The binary executable starts

./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

Page preview

image image

API request example

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

Nginx reverse proxy configuration

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; } 

Stargazers over time

Stargazers over time