{"id":13454806,"url":"https://github.com/Yohann0617/tgNetDisc","last_synced_at":"2025-03-24T07:32:09.225Z","repository":{"id":206249856,"uuid":"716191722","full_name":"Yohann0617/tgNetDisc","owner":"Yohann0617","description":"🤖基于Telegram API，无限容量，不限制文件格式，不限制文件内容😏，文件都存储在Telegram☁云端，轻巧方便。上传成功会生成HTML、Markdown、BBCode三种形式的外链🔗，可以用来当做图床、文件下载url。","archived":false,"fork":false,"pushed_at":"2024-09-11T11:29:55.000Z","size":28964,"stargazers_count":150,"open_issues_count":2,"forks_count":11,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-28T22:34:25.805Z","etag":null,"topics":["golang","netdisc","telegram","telegram-bot","telegram-bot-api"],"latest_commit_sha":null,"homepage":"https://tgnetdisc.yohann.us.kg","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Yohann0617.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-11-08T16:16:24.000Z","updated_at":"2024-10-21T15:05:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"f76e5669-4cca-4e66-a3e5-47bc4c3757d4","html_url":"https://github.com/Yohann0617/tgNetDisc","commit_stats":null,"previous_names":["yohann0617/tgnetdisc"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yohann0617%2FtgNetDisc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yohann0617%2FtgNetDisc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yohann0617%2FtgNetDisc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yohann0617%2FtgNetDisc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yohann0617","download_url":"https://codeload.github.com/Yohann0617/tgNetDisc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245227532,"owners_count":20580895,"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":["golang","netdisc","telegram","telegram-bot","telegram-bot-api"],"created_at":"2024-07-31T08:00:58.084Z","updated_at":"2025-03-24T07:32:08.856Z","avatar_url":"https://github.com/Yohann0617.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"[中文](https://github.com/Yohann0617/tgNetDisc/blob/master/README.md) | [EN](https://github.com/Yohann0617/tgNetDisc/blob/master/README_EN.md)\n# tgNetDisc\n\u003e🤖利用Telegram接口（需要一台国外VPS），♾️️无限容量，不限制文件格式，不限制文件内容😏，占用很少的内存和磁盘空间📁，轻巧方便。\n\u003e文件都存储在Telegram☁️端，拥有良好的安全性🔒和持久性。\n\u003e大文件会分片上传（速度不快），但不支持上传超大文件。\n\u003e上传成功会生成HTML、Markdown、BBCode三种形式的外链🔗，可以用来当做图床、文件下载url。\n\u003e测试地址：☞[tgNetDisc](https://tgnetdisc.yohann.us.kg)☜\n\u003e原作者地址：[https://github.com/csznet/tgState](https://github.com/csznet/tgState)，在此基础上进行了部分修改。\n\n## Docker一键部署（推荐🏆）\n- `TOKEN`是机器人token。\n- `DOMAIN`是域名，可以不用配置\n- `PASS`是密码，可以不用配置\n- `CHANNEL`可以是频道地址也可以是chatId（可以通过 [@getidsbot](https://t.me/getidsbot) 这个机器人获取）。如果是频道，需要将频道公开，并将机器人拉入频道，设置为管理员，频道地址格式如：`@yohannChannl`。引用文件（分片文件引用`fileAll.txt`文件）并回复`get`，如果配置了`DOMAIN`域名参数，会返回完整url，反之则会返回文件id（base64编码），通过`域名`+`/d/`+`文件id`可以直接下载该文件，如果是图片则可以直接查看。\n- 支持的系统架构：\n  - linux/amd64 \n  - linux/arm64\n  - linux/arm/v6\n  - linux/arm/v7\n  - linux/386\n  - linux/ppc64le\n  - linux/s390x\n  - linux/riscv64 \n\n拉取个人镜像仓库镜像并启动容器：\n\n```bash\ndocker run -d --restart=always \\\n--name netdisc \\\n-p 8088:8088 \\\n-e TOKEN=xxx \\\n-e CHANNEL=xxx \\\n-e MODE=pan \\\n-e PASS=yohann \\\n-e DOMAIN=https://hh.abc.com \\\nyohannfan/yohann-netdisc:latest\n```\n\n## 二进制可执行文件启动\n参考原作者，本人暂未测试过。\n```\n ./tgstate -token xxxx -channel @xxxx\n```\n其中的`xxxx`为bot token `@xxxx`为频道地址or个人id(个人ID只需要数字不需要@)\n\n如果需要自定义端口，可以带上-port参数，如\n\n```\n-port 8888\n```\n\n如果不需要首页，只需要API和图片展示页面，则带上-index参数，如\n\n```\n./tgstate -token xxxx -channel @xxxx -port 8888 -index\n```\n\n如果需要限制密码访问，只需要带上-pass参数即可，如设置密码为csznet：\n\n```\n./tgstate -token xxxx -channel @xxxx -port 8888 -pass csznet\n```\n\n如果需要网盘模式运行，请带上-mode pan，如\n\n```\n./tgstate -token xxxx -channel @xxxx -port 8888 -mode pan\n```\n\n## 页面预览\n![image](https://github.com/Yohann0617/tgNetDisc/assets/75626191/844a61aa-cfd2-40b3-b63c-bb9de0fb8438)\n![image](https://github.com/Yohann0617/tgNetDisc/assets/75626191/227b83af-7c83-4b22-ba89-9f21606e44e9)\n\n## API请求示例\n```bash\ncurl -X POST -F \"image=@/root/test/tgNetDisc;type=application/octet-stream\" https://hh.abc.com/api\n```\n如果设置了密码：\n```bash\ncurl -X POST -F \"image=@/root/test/tgNetDisc;type=application/octet-stream\" -b \"p=YOURPASSWORD\" https://hh.abc.com/api\n```\n\n## Nginx反向代理配置\n如不需要可忽略~\n\u003cdetails\u003e\n    \u003csummary\u003e ☜ 核心配置\u003c/summary\u003e\n\u003cbr\u003e\n常规反代核心配置：\n\n```bash\n        location / {\n            proxy_pass http://localhost:8088;\n            proxy_method $request_method;\n            proxy_set_header Host $host;\n            proxy_set_header X-Real-IP $remote_addr;\n            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n            proxy_set_header X-Forwarded-Proto $scheme;\n        }\n```\n\n自定义URL的反向代理核心配置:\n\n```bash\n        # 网盘\n        location /tgState {\n            proxy_pass http://localhost:8088;\n        }\n        location ~ ^/tgState/(d|pwd|api)(.*)$ {\n            limit_req zone=mylimit burst=20;\n            proxy_pass http://localhost:8088/$1$2;\n        }\n        location /pwd {\n            proxy_pass http://localhost:8088;\n        }\n```\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n## Stargazers over time\n\n[![Stargazers over time](https://starchart.cc/Yohann0617/tgNetDisc.svg)](https://starchart.cc/Yohann0617/tgNetDisc)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYohann0617%2FtgNetDisc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FYohann0617%2FtgNetDisc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYohann0617%2FtgNetDisc/lists"}