一款以Telegram作为储存的文件外链系统
可以作为telegram图床,也可以作为telegram网盘使用。
默认运行模式为图床模式,只允许.jpg .png .jpeg
文件上传且限制不超过20MB,网盘模式为不限制后缀和大小
如有疑惑,可以咨询TG @tgstate123
版本说明
- 1.2版本开始采用file_id形式留存外链,对以往版本外链不兼容,需要保留外链的谨慎更新
- 1.1版本开始只保留/d外链,对以往版本外链不兼容,需要保留外链的谨慎更新
特性
- 不限制上传文件大小(可选
- 支持访问密码限制
- 提供API
- 支持Vercel一键搭建
Demo
实时预览:https://tgstate.vercel.app
旧版本:https://tgtu.ikun123.com/
搭建在Vercel,大文件可能会上传失败
测试图片:
准备说明
部署前需要准备一个Telegram Bot(@botfather处申请)
如果是需要存储在频道,则需要将Bot拉入频道作为管理员,公开频道并自定义频道Link
token
填写你的bot tokenchannel
可以为频道(@xxxx),也可以为你的telegram id(@getmyid_bot获取)pass
填写访问密码,如不需要,直接填写none
即可mode
填写pan
,代表以网盘模式运行,只需要以图床模式运行的话就随便填
pull镜像
docker pull csznet/tgstate:latest
启动
docker run -d -p 8088:8088 --name tgstate -e TOKEN=aaa -e CHANNEL=@bbb csznet/tgstate:latest
请提前将aaa
和bbb
替换为你的bot token和频道地址or个人id
如果需要以网盘模式启动
docker run -d -p 8088:8088 --name tgstate -e TOKEN=aaa -e CHANNEL=@bbb -e MODE=pan csznet/tgstate:latest
下载Linux amd64环境的二进制文件
wget https://github.com/csznet/tgState/releases/latest/download/tgState.zip && unzip tgState.zip && rm tgState.zip
./tgState -token xxxx -channel @xxxx
其中的xxxx
为bot token @xxxx
为频道地址or个人id(个人ID只需要数字不需要@)
如果需要自定义端口,可以带上-port参数,如
-port 8888
如果不需要首页,只需要API和图片展示页面,则带上-index参数,如
./tgState -token xxxx -channel @xxxx -port 8888 -index
如果需要限制密码访问,只需要带上-pass参数即可,如设置密码为csznet:
./tgState -token xxxx -channel @xxxx -port 8888 -pass csznet
如果需要网盘模式运行,请带上-mode pan,如
./tgState -token xxxx -channel @xxxx -port 8888 -mode pan
直接将文件数据以二进制的方式发送给/api
路径