├── README.md
├── index.html
├── nginx.conf
└── vercel.json
/README.md:
--------------------------------------------------------------------------------
1 | > [!IMPORTANT]
2 | > 由于Telegraph官方不再支持上传图片,故此项目不再维护,感谢各位的支持。
3 | >
4 |
Telegraph-Image
5 | 一个基于Vercel或Nginx搭建的Telegraph图床。
6 |
7 |
8 | ## 这是什么?
9 | [Telegraph](https://telegra.ph)是一个内容发布工具,其中可以上传图片,因此可以拿来“白嫖”用作图床,本项目就是为此而生,有Vercel、Nginx两种搭建方式,你也可以尝试前辈基于CloudFlare Pages的[cf-pages/Telegraph-Image](https://github.com/cf-pages/Telegraph-Image)项目。
10 |
11 | ## 部署
12 | ### Vercel
13 | Vercel的优点是几乎0成本部署,缺点是每个月只有100G流量。
14 | - 方式一:Fork本仓库,然后在Vercel新建项目,选择Fork后的仓库即可。
15 | - 方式二:直接点击该按钮部署:[](https://vercel.com/new/clone?repository-url=https://github.com/rong6/Telegraph-Image&project-name=Telegraph-Image&repository-name=Telegraph-Image)
16 | > 由于Vercel分配的域名已被墙,部署后记得绑定自己的域名。
17 |
18 | ### Nginx
19 | Nginx的有点是灵活、可控性高,缺点是必须需要一台服务器。
20 | 请确保服务器以安装Nginx,然后将[nginx.conf](https://github.com/rong6/Telegraph-Image/blob/main/nginx.conf)的配置粘贴至配置文件即可。
21 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Telegraph图床
8 |
9 |
12 |
13 |
14 |
15 |
16 |
Telegraph图床
17 |
18 |
21 |
22 |
点击、拖拽或粘贴图片上传。
23 |
24 |
25 |
26 |
上传列表
27 |
28 |
29 | -
30 |
31 |
![预览]()
32 |
33 |
34 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
51 |
56 |
57 |
58 |
59 |
60 |
上传结果
61 |
64 |
65 |
66 |
67 | -
68 |
69 |
![预览]()
70 |
72 |
73 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
205 |
206 |
207 |
--------------------------------------------------------------------------------
/nginx.conf:
--------------------------------------------------------------------------------
1 | server {
2 | listen 443 ssl http2;
3 | server_name example.com; # 替换为您的域名
4 |
5 | ssl_certificate /path/to/your/fullchain.pem; # SSL证书路径
6 | ssl_certificate_key /path/to/your/privkey.pem; # SSL私钥路径
7 |
8 | ssl_protocols TLSv1.2 TLSv1.3;
9 | ssl_prefer_server_ciphers on;
10 | ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
11 | ssl_session_cache shared:SSL:10m;
12 | ssl_session_timeout 10m;
13 |
14 | root /www/wwwroot/example.com; # 网站根目录
15 | index index.html;
16 |
17 | location / {
18 | try_files $uri $uri/ =404;
19 | }
20 |
21 | location /upload {
22 | proxy_pass https://telegra.ph/upload;
23 | proxy_set_header Host $host;
24 | proxy_set_header X-Real-IP $remote_addr;
25 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
26 | proxy_set_header X-Forwarded-Proto $scheme;
27 | }
28 |
29 | location /file/ {
30 | proxy_pass https://telegra.ph/file/;
31 | proxy_set_header Host $host;
32 | proxy_set_header X-Real-IP $remote_addr;
33 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
34 | proxy_set_header X-Forwarded-Proto $scheme;
35 | }
36 | }
--------------------------------------------------------------------------------
/vercel.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 2,
3 | "routes": [
4 | {"src": "/","dest": "/index.html"},
5 | {"src": "/upload","dest": "https://telegra.ph/upload"},
6 | {"src": "/file/(.*)","dest": "https://telegra.ph/file/$1"}
7 | ]
8 | }
--------------------------------------------------------------------------------