{"id":13453322,"url":"https://github.com/csznet/tgState","last_synced_at":"2025-03-24T01:31:21.476Z","repository":{"id":197936693,"uuid":"699221013","full_name":"csznet/tgState","owner":"csznet","description":"使用Telegram作为存储的文件外链系统，不限制文件大小和格式。","archived":false,"fork":false,"pushed_at":"2024-04-18T01:26:52.000Z","size":116,"stargazers_count":943,"open_issues_count":10,"forks_count":159,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-19T03:33:59.272Z","etag":null,"topics":["file","file-sharing","file-upload","filesystem","go","golang","images","imageserver","img","storage","storage-api","storage-service","telegram","telegram-api","telegram-bot","telegram-bot-api","telegrambot","vercel"],"latest_commit_sha":null,"homepage":"https://www.csz.net","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csznet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-02T07:33:11.000Z","updated_at":"2025-03-18T12:16:12.000Z","dependencies_parsed_at":"2023-11-17T19:42:03.219Z","dependency_job_id":"e45eb83a-5649-4d06-836a-e6e6e05ada40","html_url":"https://github.com/csznet/tgState","commit_stats":{"total_commits":123,"total_committers":3,"mean_commits":41.0,"dds":"0.22764227642276424","last_synced_commit":"b41260b2fa67dae56efcdc151c284da0ab74ffd6"},"previous_names":["csznet/tgstate"],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csznet%2FtgState","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csznet%2FtgState/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csznet%2FtgState/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csznet%2FtgState/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csznet","download_url":"https://codeload.github.com/csznet/tgState/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245194211,"owners_count":20575725,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["file","file-sharing","file-upload","filesystem","go","golang","images","imageserver","img","storage","storage-api","storage-service","telegram","telegram-api","telegram-bot","telegram-bot-api","telegrambot","vercel"],"created_at":"2024-07-31T08:00:38.042Z","updated_at":"2025-03-24T01:31:20.936Z","avatar_url":"https://github.com/csznet.png","language":"Go","readme":"tgState\n==\n\n[English](https://github.com/csznet/tgState/blob/main/README_en.md) \n\n一款以Telegram作为储存的文件外链系统\n\n不限制文件大小和格式\n\n可以作为telegram图床，也可以作为telegram网盘使用。\n\n支持web上传文件和telegram直接上传\n\n搭配CLoudFlare使用：https://github.com/csznet/tgState/blob/main/CloudFlare.md\n\n如有疑惑，可以咨询TG @tgstate123  \n\n# 演示\n\nhttps://tgstate.vercel.app / https://tgstate.ikun123.com/\n\n搭建在vercel，资源限制，大于5MB的文件不支持\n\n不限制大小demo（临时） http://tgstate-cdn.ikun123.com/\n\n演示图片：\n\n![tgState](https://tgstate.vercel.app/d/BQACAgUAAx0EcyK3ugACByxlOR-Nfl4esavoO4zdaYIP_k1KYQACDAsAAkf4yFVpf_awaEkS8jAE)  \n\n# 参数说明\n\n必填参数\n\n - target\n - token\n\n可选参数\n\n - pass\n - mode\n - url\n - port\n\n## target\n\n目标可为频道、群组、个人\n\n当目标为频道时，需要将Bot拉入频道作为管理员，公开频道并自定义频道Link，target值填写Link，如@xxxx\n\n当目标为群组时，需要将Bot拉入群组，公开群组并自定义群组Link，target值填写Link，如@xxxx\n\n当目标为个人时，则为telegram id(@getmyid_bot获取)\n\n## token\n\n填写你的bot token\n\n## pass\n\n填写访问密码，如不需要，直接填写```none```即可\n\n## mode\n\n - ```p``` 代表网盘模式运行，不限制上传后缀\n - ```m``` 在p模式的基础上关闭网页上传，可私聊进行上传（如果target是个人，则只支持指定用户进行私聊上传\n\n## url\n\nbot获取FileID的前置域名地址自动补充及api返回完整url的补充\n\n## port\n\n自定义运行端口\n\n# 管理\n\n## 获取FIleID\n\n对bot聊天中的文件引用并回复```get```可以获取FileID，搭建地址+获取的path即可访问资源\n\n如果配置了url参数，会直接返回完整的地址\n\n![image](https://github.com/csznet/tgState/assets/127601663/5b1fd6c0-652c-41de-bb63-e2f20b257022)\n\n# 部署\n\n## 二进制\n\nLinux amd64下载\n\n```\nwget https://github.com/csznet/tgState/releases/latest/download/tgState.zip \u0026\u0026 unzip tgState.zip \u0026\u0026 rm tgState.zip\n```\n\nLinux arm64下载\n\n```\nwget https://github.com/csznet/tgState/releases/latest/download/tgState_arm64.zip \u0026\u0026 unzip tgState_arm64.zip \u0026\u0026 rm tgState_arm64.zip\n```\n\nLinux 一键脚本\n\n```\nbash -c \"$(curl -fsSL https://raw.githubusercontent.com/csznet/tgState/main/get.sh)\"\n```\n\n\n**使用方法**\n\n```\n ./tgState 参数\n```\n\n**例子**\n```\n ./tgState -token xxxx -target @xxxx\n```\n\n**后台运行**\n\n```\nnohup ./tgState 参数 \u0026\n```\n\n## Docker\n\npull镜像\n```\ndocker pull csznet/tgstate:latest\n```\n\n启动\n```\ndocker run -d -p 8088:8088 --name tgstate 参数 --net=host csznet/tgstate:latest\n```\n其中docker的参数需要设置为环境变量\n\n开机自启需要加上\n```\n--restart always\n```\n\n\n**例子**\n```\ndocker run -d -p 8088:8088 --name tgstate -e token=token -e target=@target -e mode=p --net=host csznet/tgstate:latest\n```\n\n## Vercel\n\n不支持大于5mb文件，不支持tg获取文件路径\n\n [点我传送至Vercel配置页面](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fcsznet%2FtgState\u0026env=token\u0026env=target\u0026env=pass\u0026env=mode\u0026env=url\u0026project-name=tgState\u0026repository-name=tgState)  \n\n# API说明\n\nPOST方法到路径```/api```\n\n表单传输，字段名为image，内容为二进制数据  \n\n当设置访问密码时，直接将密码加入url参数pass中，如密码为123：\n\n```\n/api?pass=123\n```\n\n返回示例:  \n\n```json\n{\"code\": 1, \"message\": \"/d/xxx\",\"url\":\"xxx\"}\n```\n\njson格式的`url`默认返回tgState的`url`参数+访问路径，如果只得到了路径则需要自行设置`url`参数\n\npicgo-plugin-web-uploader填写说明：  \n\nPOST参数名：`image`  \n\nJSON路径：`url`\n\n![image](https://github.com/csznet/tgState/assets/127601663/d70e6a42-1f21-4cbb-8ba5-1e9f7d9660a4)\n\n\n","funding_links":[],"categories":["Go","🖼️ 图床与媒体处理","Bildhosting"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsznet%2FtgState","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsznet%2FtgState","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsznet%2FtgState/lists"}