Giter Club home page Giter Club logo

tgstate's Introduction

tgState

English

一款以Telegram作为储存的文件外链系统

可以作为telegram图床,也可以作为telegram网盘使用。

搭配CLoudFlare使用:https://www.csz.net/proj/tgstate/

默认运行模式为图床模式,只允许.jpg .png .jpeg文件上传且限制不超过20MB,网盘模式为不限制后缀和大小

如有疑惑,可以咨询TG @tgstate123

版本说明

  • 1.2版本开始采用file_id形式留存外链,对以往版本外链不兼容,需要保留外链的谨慎更新
  • 1.1版本开始只保留/d外链,对以往版本外链不兼容,需要保留外链的谨慎更新

特性

  • 不限制上传文件大小(可选
  • 支持访问密码限制
  • 提供API
  • 支持Vercel一键搭建

Demo

实时预览:https://tgstate.vercel.app / https://tgstate.ikun123.com/

旧版本:https://tgtu.ikun123.com/
搭建在Vercel,大于5MB的文件不支持

测试图片:

https://tg-state-kappa.vercel.app/d/28.jpg

准备说明 部署前需要准备一个Telegram Bot(@botfather处申请)
如果是需要存储在频道,则需要将Bot拉入频道作为管理员,公开频道并自定义频道Link

后台管理

后台管理计划是全Telegram管理,Vercel目前不支持,目前实现的有:

获取FileID

对bot聊天中的文件引用并回复get可以获取FileID,搭建地址+/d/+FileID即可访问资源

Vercel部署

点我传送至Vercel配置页面

  1. token填写你的bot token
  2. channel可以为频道(@xxxx),也可以为你的telegram id(@getmyid_bot获取)
  3. pass填写访问密码,如不需要,直接填写none即可
  4. mode填写pan,代表以网盘模式运行,只需要以图床模式运行的话就随便填

Docker部署

pull镜像

docker pull csznet/tgstate:latest

启动

docker run -d -p 8088:8088 --name tgstate -e TOKEN=aaa -e CHANNEL=@bbb --net=host csznet/tgstate:latest

请提前将aaabbb替换为你的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

Linux arm64一键脚本:

wget https://github.com/csznet/tgState/releases/latest/download/tgState_arm64.zip && unzip tgState_arm64.zip && rm tgState_arm64.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

直接将文件数据以二进制的方式发送给/api路径

tgstate's People

Contributors

csznet avatar vikiboss avatar molezz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.