diff --git a/examples/ghproxy-sites/README.md b/examples/ghproxy-sites/README.md new file mode 100644 index 0000000..301c059 --- /dev/null +++ b/examples/ghproxy-sites/README.md @@ -0,0 +1,153 @@ +# ghproxy 可用站点列表 + +收集可用于 github 附件代理下载的 `ghproxy` 站点列表,并每日自动更新可用性。 + +## 自建代理镜像 + +选择以下方案之一,参考其指引文档进行搭建。 + +- 基于 [hunshcn/gh-proxy](https://github.com/hunshcn/gh-proxy) +- 基于 [0-RTT/ghproxy-go](https://github.com/0-RTT/ghproxy-go) +- 基于 [moeyy01/gh-proxy-go](https://github.com/moeyy01/gh-proxy-go) + +## 声明 + +以下站点列表来源于网络收集,若有侵权请提 Issues 处理。 + +## 站点列表(129): + +| 状态 | 链接 | 标题 | 描述 | 更新时间 | +|:-:| :-:|:-:|:-:|:-:| +| ✅ | http://101.43.36.238:4080 | 43 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://119.28.4.250 | 119.28.4.250 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://124.156.158.242:4000 | 156 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://13.230.117.137:8008 | 13.230.117.137 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://130.162.130.196 | 130.162.130.196 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://138.2.123.193:8090 | 138.2.123.193 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://140.238.17.136:9980 | 238 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://140.238.33.157:3000 | 238 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://141.147.170.49 | 147 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://152.67.215.57:8081 | 67 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://152.67.219.235:8989 | 67 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://152.70.36.140:88 | 70 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://152.70.94.22:9080 | 152.70.94.22 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://155.248.180.127:3000 | 248 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://158.101.152.90:8123 | 101 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://158.180.92.175:8000 | 180 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://159.138.132.70:8080 | 159.138.132.70 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://212.50.233.214:8888 | 212.50.233.214 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://43.129.191.251:8088 | 43.129.191.251 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://43.132.131.30:9999 | 43.132.131.30 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://43.132.227.252:9090 | 43.132.227.252 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://43.133.162.210:9000 | 43.133.162.210 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://43.154.105.8:8888 | 43.154.105.8 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://43.154.123.246 | 43.154.123.246 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://43.159.61.252:9000 | 43.159.61.252 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://43.163.230.97:800 | 43.163.230.97 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://45.149.156.201:7080 | 149 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://47.236.114.62:18080 | 236 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://47.245.88.61 | 47.245.88.61 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://47.75.211.166:5080 | 47.75.211.166 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://51.195.241.253:8080 | 51.195.241.253 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://8.210.13.120 | 8.210.13.120 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://8.210.153.246:9000 | 8.210.153.246 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://8.210.207.225:8888 | 8.210.207.225 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://94.74.100.230:9010 | 74 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://a.whereisdoge.work | whereisdoge | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://admin.whereisdoge.work | whereisdoge | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://autodiscover.whereisdoge.work | whereisdoge | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://blog.whereisdoge.work | whereisdoge | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://c0b0109d9439de57fe3c.ljw.ink | ljw.ink | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://cccccccccccccccccccccccccccccccccccccccccccccccccccc.cc | cc | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://cdn.moran233.xyz | moran233 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://cloud.whereisdoge.work | whereisdoge | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://cpanel.whereisdoge.work | whereisdoge | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://cpcalendars.whereisdoge.work | whereisdoge | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://cpcontacts.whereisdoge.work | whereisdoge | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://g.blfrp.cn | blfrp | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://gh-proxy.com | com/ | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://gh.222322.xyz | 222322 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://gh.catmak.name | catmak | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://gh.chaoyi996.com | chaoyi996 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://gh.nxnow.top | nxnow | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://gh.pylas.xyz | pylas | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://gh.qninq.cn | qninq | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://gh.tt.ma | tt.ma | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://gh.xx9527.cn | xx9527 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://ghp.arslantu.xyz | arslantu | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://ghp.miaostay.com | miaostay | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://ghpr.cc | ghpr | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://ghproxy.cc | ghproxy.cc | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://ghproxy.cianogame.top | cianogame | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://ghproxy.cn | ghproxy.cn | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://ghproxy.lainbo.com | lainbo | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://ghproxy.net | ghproxy.net | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://git.19970301.xyz | 19970301 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://git.40609891.xyz | 40609891 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://git.669966.xyz | 669966 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://github.7boe.top | 7boe | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://github.chenc.dev | chenc | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://github.muou666.com | muou666 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://github.xxlab.tech | xxlab | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://github.yeqingg.cn | yeqingg | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://githubapi.jjchizha.com | jjchizha | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://m.whereisdoge.work | whereisdoge | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://mail.whereisdoge.work | whereisdoge | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://mtp.whereisdoge.work | whereisdoge | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://v.whereisdoge.work | whereisdoge | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://webdav.camus.xyz | camus | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://webdisk.whereisdoge.work | whereisdoge | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://www.ghpr.cc | ghpr | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://x.whereisdoge.work | whereisdoge | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://xxqg.168828.xyz:8088 | 168828 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://y.whereisdoge.work | whereisdoge | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | http://zipchannel.top:4000 | zipchannel.top | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | https://cf.ghproxy.cc | ghproxy.cc | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | https://gh.ddlc.top | ddlc | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | https://gh.idayer.com | idayer | GitHub文件代理加速 | 2024-09-09 14:44:52 | +| ✅ | https://gh.jasonzeng.dev | jasonzeng | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | https://gh.jiasu.in | jiasu | 基于 0-RTT/ghproxy-go 的镜像 | 2024-09-09 14:44:52 | +| ✅ | https://gh.llkk.cc | llkk | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | https://ghproxy.homeboyc.cn | homeboyc | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | https://ghproxy.kman.xyz | kman | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | https://ghps.cc | ghps | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | https://git.speed-ssr.tech | speed-ssr | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | https://github.moeyy.xyz | moeyy | 基于 moeyy01/gh-proxy-go 的镜像 | 2024-09-09 14:44:52 | +| ✅ | https://goppx.com | goppx | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | https://mirror.ghproxy.com | GitHub Proxy | 基于 hunshcn/gh-proxy 搭建 | 2024-09-09 14:44:52 | +| ✅ | https://ui.ghproxy.cc | ghproxy.cc | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ✅ | https://vercel.ghproxy.com | GitHub Proxy | 基于 hunshcn/gh-proxy 搭建 | 2024-09-09 14:44:52 | +| ❌ | http://101.32.202.184:10086 | 101.32.202.184 | `[error][-1]timeout` | 2024-09-09 14:44:52 | +| ❌ | http://111.229.117.180:2068 | 111.229.117.180 | `[error][-1]timeout` | 2024-09-09 14:44:52 | +| ❌ | http://111.229.21.57:12345 | 229 | `[error][-1]timeout` | 2024-09-09 14:44:52 | +| ❌ | http://124.156.150.245:10086 | 124.156.150.245 | `[error][-1]timeout` | 2024-09-09 14:44:52 | +| ❌ | http://124.223.88.224:12345 | 124.223.88.224 | `[error][-1]timeout` | 2024-09-09 14:44:52 | +| ❌ | http://136.243.215.211:12345 | 243 | `[error][-1]timeout` | 2024-09-09 14:44:52 | +| ❌ | http://138.2.54.229:12580 | 2 | `[error][-1]timeout` | 2024-09-09 14:44:52 | +| ❌ | http://138.2.69.119:30001 | 2 | `[error][-1]timeout` | 2024-09-09 14:44:52 | +| ❌ | http://139.196.123.118:12345 | 139.196.123.118 | `[error][-1]timeout` | 2024-09-09 14:44:52 | +| ❌ | http://150.138.79.19:12345 | 150.138.79.19 | `[error][-1]timeout` | 2024-09-09 14:44:52 | +| ❌ | http://152.32.215.216:888 | 152.32.215.216 | `[error][-1]timeout` | 2024-09-09 14:44:52 | +| ❌ | http://152.67.215.236:12345 | 67 | `[error][-1]timeout` | 2024-09-09 14:44:52 | +| ❌ | http://154.23.187.126 | 154.23.187.126 | `[error][-1]timeout` | 2024-09-09 14:44:52 | +| ❌ | http://154.23.247.72:12345 | 154.23.247.72 | `[error][-1]timeout` | 2024-09-09 14:44:52 | +| ❌ | http://16.163.43.131:880 | 16.163.43.131 | `[error][-1]timeout` | 2024-09-09 14:44:52 | +| ❌ | http://38.207.160.46:6699 | 207 | `[error][-1]timeout` | 2024-09-09 14:44:52 | +| ❌ | http://42.193.4.156:8880 | 193 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ❌ | http://43.154.99.97:1112 | 154 | `[error][-1]timeout` | 2024-09-09 14:44:52 | +| ❌ | http://47.109.58.212:8082 | 109 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ❌ | http://47.95.0.182:2333 | 47.95.0.182 | `[error][-1]timeout` | 2024-09-09 14:44:52 | +| ❌ | http://74.48.108.189:10088 | 48 | `[error][-1]timeout` | 2024-09-09 14:44:52 | +| ❌ | http://8.217.227.38:5566 | 8.217.227.38 | `[error][-1]timeout` | 2024-09-09 14:44:52 | +| ❌ | http://8.222.225.40:8888 | 222 | `[error][-1]connect ECONNREFUSED 8.222.225.40:8888` | 2024-09-09 14:44:52 | +| ❌ | http://82.157.146.148:9001 | 157 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ❌ | http://api2.qbot.xuanimage.top | qbot | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ❌ | http://free.cn.eu.org | cn | `[error][-1]read ECONNRESET` | 2024-09-09 14:44:52 | +| ❌ | http://gh.open1024.top | open1024 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ❌ | http://gp.zkitefly.eu.org | zkitefly | `[error][-1]read ECONNRESET` | 2024-09-09 14:44:52 | +| ❌ | http://ql.133.info | 133 | 基于 hunshcn/gh-proxy 的镜像站 | 2024-09-09 14:44:52 | +| ❌ | http://www.subook.link:88 | subook | `[error][-1]getaddrinfo ENOTFOUND www.subook.link` | 2024-09-09 14:44:52 | + +## License + +`ghproxy-sites` is released under the MIT license. diff --git a/examples/ghproxy-sites/package.json b/examples/ghproxy-sites/package.json new file mode 100644 index 0000000..c125ee1 --- /dev/null +++ b/examples/ghproxy-sites/package.json @@ -0,0 +1,13 @@ +{ + "name": "ghproxy", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "start": "tsx src/index.ts" + }, + "keywords": [], + "author": "", + "license": "ISC" +} diff --git a/examples/ghproxy-sites/site.json b/examples/ghproxy-sites/site.json new file mode 100644 index 0000000..4ab8614 --- /dev/null +++ b/examples/ghproxy-sites/site.json @@ -0,0 +1,730 @@ +{ + "siteInfo": { + "https://mirror.ghproxy.com": { + "title": "GitHub Proxy", + "desc": "基于 hunshcn/gh-proxy 搭建", + "errmsg": "", + "update": 1725864292363 + }, + "https://vercel.ghproxy.com": { + "title": "GitHub Proxy", + "desc": "基于 hunshcn/gh-proxy 搭建", + "errmsg": "", + "update": 1725864292363 + }, + "http://8.210.153.246:9000": { + "title": "8.210.153.246", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://47.95.0.182:2333": { + "title": "47.95.0.182", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "needVerify": 1, + "errmsg": "[error][-1]timeout", + "invalid": 1, + "update": 1725864292363 + }, + "http://43.132.131.30:9999": { + "title": "43.132.131.30", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://101.32.202.184:10086": { + "title": "101.32.202.184", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "needVerify": 1, + "errmsg": "[error][-1]timeout", + "invalid": 1, + "update": 1725864292363 + }, + "http://159.138.132.70:8080": { + "title": "159.138.132.70", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://154.23.247.72:12345": { + "title": "154.23.247.72", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "needVerify": 1, + "errmsg": "[error][-1]timeout", + "invalid": 1, + "update": 1725864292363 + }, + "http://154.23.187.126": { + "title": "154.23.187.126", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "needVerify": 1, + "errmsg": "[error][-1]timeout", + "invalid": 1, + "update": 1725864292363 + }, + "http://152.32.215.216:888": { + "title": "152.32.215.216", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "needVerify": 1, + "errmsg": "[error][-1]timeout", + "invalid": 1, + "update": 1725864292363 + }, + "http://43.132.227.252:9090": { + "title": "43.132.227.252", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://x.whereisdoge.work": { + "title": "whereisdoge", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://43.154.123.246": { + "title": "43.154.123.246", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://47.109.58.212:8082": { + "title": "109", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363, + "invalid": 1 + }, + "http://gh.tt.ma": { + "title": "tt.ma", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://43.154.105.8:8888": { + "title": "43.154.105.8", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://139.196.123.118:12345": { + "title": "139.196.123.118", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "needVerify": 1, + "errmsg": "[error][-1]timeout", + "invalid": 1, + "update": 1725864292363 + }, + "http://cdn.moran233.xyz": { + "title": "moran233", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://c0b0109d9439de57fe3c.ljw.ink": { + "title": "ljw.ink", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://43.129.191.251:8088": { + "title": "43.129.191.251", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://16.163.43.131:880": { + "title": "16.163.43.131", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "needVerify": 1, + "errmsg": "[error][-1]timeout", + "invalid": 1, + "update": 1725864292363 + }, + "http://124.156.150.245:10086": { + "title": "124.156.150.245", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "needVerify": 1, + "errmsg": "[error][-1]timeout", + "invalid": 1, + "update": 1725864292363 + }, + "http://42.193.4.156:8880": { + "title": "193", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363, + "invalid": 1 + }, + "http://47.75.211.166:5080": { + "title": "47.75.211.166", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://124.223.88.224:12345": { + "title": "124.223.88.224", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "needVerify": 1, + "errmsg": "[error][-1]timeout", + "invalid": 1, + "update": 1725864292363 + }, + "http://119.28.4.250": { + "title": "119.28.4.250", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://gh.open1024.top": { + "title": "open1024", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363, + "invalid": 1 + }, + "http://cccccccccccccccccccccccccccccccccccccccccccccccccccc.cc": { + "title": "cc", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://www.ghpr.cc": { + "title": "ghpr", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://ghpr.cc": { + "title": "ghpr", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://gh.chaoyi996.com": { + "title": "chaoyi996", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://38.207.160.46:6699": { + "title": "207", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "needVerify": 1, + "errmsg": "[error][-1]timeout", + "invalid": 1, + "update": 1725864292363 + }, + "http://8.210.207.225:8888": { + "title": "8.210.207.225", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://g.blfrp.cn": { + "title": "blfrp", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://111.229.117.180:2068": { + "title": "111.229.117.180", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "needVerify": 1, + "errmsg": "[error][-1]timeout", + "invalid": 1, + "update": 1725864292363 + }, + "http://8.210.13.120": { + "title": "8.210.13.120", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://111.229.21.57:12345": { + "title": "229", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "needVerify": 1, + "errmsg": "[error][-1]timeout", + "invalid": 1, + "update": 1725864292363 + }, + "http://124.156.158.242:4000": { + "title": "156", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://ghproxy.lainbo.com": { + "title": "lainbo", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://94.74.100.230:9010": { + "title": "74", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://8.217.227.38:5566": { + "title": "8.217.227.38", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "needVerify": 1, + "errmsg": "[error][-1]timeout", + "invalid": 1, + "update": 1725864292363 + }, + "http://150.138.79.19:12345": { + "title": "150.138.79.19", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "needVerify": 1, + "errmsg": "[error][-1]timeout", + "invalid": 1, + "update": 1725864292363 + }, + "http://101.43.36.238:4080": { + "title": "43", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://82.157.146.148:9001": { + "title": "157", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363, + "invalid": 1 + }, + "http://github.xxlab.tech": { + "title": "xxlab", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://ghp.arslantu.xyz": { + "title": "arslantu", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://gh.pylas.xyz": { + "title": "pylas", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://git.19970301.xyz": { + "title": "19970301", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://blog.whereisdoge.work": { + "title": "whereisdoge", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://y.whereisdoge.work": { + "title": "whereisdoge", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://admin.whereisdoge.work": { + "title": "whereisdoge", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://cloud.whereisdoge.work": { + "title": "whereisdoge", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://a.whereisdoge.work": { + "title": "whereisdoge", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://v.whereisdoge.work": { + "title": "whereisdoge", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://github.7boe.top": { + "title": "7boe", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://api2.qbot.xuanimage.top": { + "title": "qbot", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363, + "invalid": 1 + }, + "http://gh.nxnow.top": { + "title": "nxnow", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://ghproxy.cianogame.top": { + "title": "cianogame", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://43.154.99.97:1112": { + "title": "154", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "needVerify": 1, + "errmsg": "[error][-1]timeout", + "invalid": 1, + "update": 1725864292363 + }, + "http://ghp.miaostay.com": { + "title": "miaostay", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://cpcontacts.whereisdoge.work": { + "title": "whereisdoge", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://cpcalendars.whereisdoge.work": { + "title": "whereisdoge", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://autodiscover.whereisdoge.work": { + "title": "whereisdoge", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://webdisk.whereisdoge.work": { + "title": "whereisdoge", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://mtp.whereisdoge.work": { + "title": "whereisdoge", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://cpanel.whereisdoge.work": { + "title": "whereisdoge", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://m.whereisdoge.work": { + "title": "whereisdoge", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://free.cn.eu.org": { + "title": "cn", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "needVerify": 1, + "errmsg": "[error][-1]read ECONNRESET", + "invalid": 1, + "update": 1725864292363 + }, + "http://gp.zkitefly.eu.org": { + "title": "zkitefly", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "needVerify": 1, + "errmsg": "[error][-1]read ECONNRESET", + "invalid": 1, + "update": 1725864292363 + }, + "http://gh.qninq.cn": { + "title": "qninq", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://ghproxy.net": { + "title": "ghproxy.net", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://140.238.17.136:9980": { + "title": "238", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://webdav.camus.xyz": { + "title": "camus", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://152.70.94.22:9080": { + "title": "152.70.94.22", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://13.230.117.137:8008": { + "title": "13.230.117.137", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://45.149.156.201:7080": { + "title": "149", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://8.222.225.40:8888": { + "title": "222", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "needVerify": 1, + "errmsg": "[error][-1]connect ECONNREFUSED 8.222.225.40:8888", + "invalid": 1, + "update": 1725864292363 + }, + "http://gh.222322.xyz": { + "title": "222322", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://43.133.162.210:9000": { + "title": "43.133.162.210", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://43.163.230.97:800": { + "title": "43.163.230.97", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://47.236.114.62:18080": { + "title": "236", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://130.162.130.196": { + "title": "130.162.130.196", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://212.50.233.214:8888": { + "title": "212.50.233.214", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://zipchannel.top:4000": { + "title": "zipchannel.top", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://138.2.123.193:8090": { + "title": "138.2.123.193", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://152.67.215.57:8081": { + "title": "67", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://136.243.215.211:12345": { + "title": "243", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "needVerify": 1, + "errmsg": "[error][-1]timeout", + "invalid": 1, + "update": 1725864292363 + }, + "http://158.180.92.175:8000": { + "title": "180", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://152.67.219.235:8989": { + "title": "67", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://152.67.215.236:12345": { + "title": "67", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "needVerify": 1, + "errmsg": "[error][-1]timeout", + "invalid": 1, + "update": 1725864292363 + }, + "http://xxqg.168828.xyz:8088": { + "title": "168828", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://github.muou666.com": { + "title": "muou666", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://ql.133.info": { + "title": "133", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363, + "invalid": 1 + }, + "http://140.238.33.157:3000": { + "title": "238", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://gh.catmak.name": { + "title": "catmak", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://152.70.36.140:88": { + "title": "70", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://155.248.180.127:3000": { + "title": "248", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://138.2.54.229:12580": { + "title": "2", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "needVerify": 1, + "errmsg": "[error][-1]timeout", + "invalid": 1, + "update": 1725864292363 + }, + "http://141.147.170.49": { + "title": "147", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://158.101.152.90:8123": { + "title": "101", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://git.40609891.xyz": { + "title": "40609891", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://138.2.69.119:30001": { + "title": "2", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "needVerify": 1, + "errmsg": "[error][-1]timeout", + "invalid": 1, + "update": 1725864292363 + }, + "http://www.subook.link:88": { + "title": "subook", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "needVerify": 1, + "errmsg": "[error][-1]getaddrinfo ENOTFOUND www.subook.link", + "invalid": 1, + "update": 1725864292363 + }, + "http://51.195.241.253:8080": { + "title": "51.195.241.253", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://43.159.61.252:9000": { + "title": "43.159.61.252", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://47.245.88.61": { + "title": "47.245.88.61", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://git.669966.xyz": { + "title": "669966", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://github.chenc.dev": { + "title": "chenc", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://githubapi.jjchizha.com": { + "title": "jjchizha", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://mail.whereisdoge.work": { + "title": "whereisdoge", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://74.48.108.189:10088": { + "title": "48", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "needVerify": 1, + "errmsg": "[error][-1]timeout", + "invalid": 1, + "update": 1725864292363 + }, + "http://ghproxy.cc": { + "title": "ghproxy.cc", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "https://cf.ghproxy.cc": { + "title": "ghproxy.cc", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "https://ui.ghproxy.cc": { + "title": "ghproxy.cc", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://ghproxy.cn": { + "title": "ghproxy.cn", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://github.yeqingg.cn": { + "title": "yeqingg", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://gh-proxy.com": { + "title": "com/", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "http://gh.xx9527.cn": { + "title": "xx9527", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "https://gh.ddlc.top": { + "title": "ddlc", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "https://gh.llkk.cc": { + "title": "llkk", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "https://ghps.cc": { + "title": "ghps", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "https://git.speed-ssr.tech": { + "title": "speed-ssr", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "https://ghproxy.homeboyc.cn": { + "title": "homeboyc", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "https://gh.jasonzeng.dev": { + "title": "jasonzeng", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "https://ghproxy.kman.xyz": { + "title": "kman", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "https://goppx.com": { + "title": "goppx", + "desc": "基于 hunshcn/gh-proxy 的镜像站", + "update": 1725864292363 + }, + "https://gh.idayer.com": { + "title": "idayer", + "desc": "GitHub文件代理加速", + "update": 1725864292363 + + }, + "https://gh.jiasu.in": { + "title": "jiasu", + "desc": "基于 0-RTT/ghproxy-go 的镜像", + "update": 1725864292363 + }, + "https://github.moeyy.xyz": { + "title": "moeyy", + "desc": "基于 moeyy01/gh-proxy-go 的镜像", + "update": 1725864292363 + } + } +} diff --git a/examples/ghproxy-sites/src/config.ts b/examples/ghproxy-sites/src/config.ts new file mode 100644 index 0000000..fe04fcb --- /dev/null +++ b/examples/ghproxy-sites/src/config.ts @@ -0,0 +1,89 @@ +import { resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { readJsonFileSync } from '@lzwme/fe-utils'; +import { config as dConfig } from 'dotenv'; +import { writeFileSync } from 'node:fs'; +import { logger, ghReq, fixSiteUrl } from './utils.js'; + +type BoolLike = boolean | 0 | 1 | 9; + +export interface SiteInfo { + /** github 仓库 */ + repo?: string; + /** 推荐等级(1-3) */ + star?: number; + /** 需人工验证。-1 已确认,且无需程序检测;大于等于 3 则显示为 ? 状态 */ + needVerify?: number; + /** 已失效 */ + invalid?: BoolLike | string; + /** 不展示(失效超过30天等) */ + hide?: BoolLike; + title?: string; + /** 描述信息 */ + desc?: string; + /** 程序检测到的错误信息 */ + errmsg?: string; + /** 类别 */ + type?: string | string[]; + update?: number; +} + +const rootDir = resolve(fileURLToPath(import.meta.url), '../..'); + +export const config = { + rootDir, + ci: Boolean(process.env.CI || process.env.SYNC), + siteInfoFile: resolve(rootDir, 'site.json'), + debug: false, + isOnlyNew: false, + urlCheckMaxTry: 7, + gptDemoRepos: new Map([ + // [`lvwzhen/teach-anything`, {}], + // [`ddiu8081/chatgpt-demo`, {}], + // [`ourongxing/chatgpt-vercel`, {}], + // [`cogentapps/chat-with-gpt`, { needKey: true, needVPN: true }], + // [`Yidadaa/ChatGPT-Next-Web`, { needKey: 1, needPwd: 1 }], + // [`yesmore/QA`, {}], + ]), + /** github 仓库禁止列表: hide=1、[siteInfo].repoBlockList */ + repoBlockMap: new Map([]), + /** 站点禁止列表: hide=1 */ + siteBlockList: new Set([]) as Set, + /** 站点信息 */ + siteInfo: {} as { [url: string]: SiteInfo }, +}; + +export function initConfig(argv: Record) { + dConfig(); + config.debug = Boolean(argv.debug || process.env.DEBUG); + config.isOnlyNew = Boolean(argv.onlyNew); + + type T = Pick; + const info = readJsonFileSync(config.siteInfoFile); + Object.assign(config.siteInfo, info.siteInfo); + + for (const [url, info] of Object.entries(config.siteInfo)) { + let fixedUrl = fixSiteUrl(url); + if (fixedUrl !== url) { + delete config.siteInfo[url]; + config.siteInfo[fixedUrl] = info; + } + + if (info.hide) { + config.siteBlockList.add(url); + if (info.repo) config.repoBlockMap.set(info.repo, url); + } + } + + logger.updateOptions({ levelType: config.debug ? 'debug' : 'log' }); + logger.debug('config:', config); + + return config; +} + +export function saveConfig() { + const info = { + siteInfo: config.siteInfo, + }; + writeFileSync(config.siteInfoFile, JSON.stringify(info, null, 2), 'utf8'); +} diff --git a/examples/ghproxy-sites/src/index.ts b/examples/ghproxy-sites/src/index.ts new file mode 100644 index 0000000..6a2b90f --- /dev/null +++ b/examples/ghproxy-sites/src/index.ts @@ -0,0 +1,83 @@ +/* + * @Author: renxia + * @Date: 2023-04-06 13:25:28 + * @LastEditors: renxia + * @LastEditTime: 2024-09-09 14:57:06 + * @Description: + */ +import { readFileSync, writeFileSync } from 'node:fs'; +import { resolve } from 'node:path'; +import parser from 'yargs-parser'; +import { gitCommit, logger } from './utils.js'; +import { siteUrlVerify } from './siteUrlVerify.js'; +import { config, initConfig, saveConfig, type SiteInfo } from './config.js'; +import { dateFormat } from '@lzwme/fe-utils'; + +function formatSiteList() { + const list = Object.entries(config.siteInfo) + .filter(([_url, info]) => { + Object.entries(info).forEach(([key, value]) => { + if (value === 0 || value === false) delete info[key as keyof SiteInfo]; + }); + return !info.hide; + }) + .sort((a, b) => { + for (const key of ['invalid', 'needVerify'] as const) { + if ('needVerify' == key) { + if (a[1].needVerify! > 2 || b[1].needVerify! > 2) return a[1].needVerify! > 2 ? 1 : -1; + } else if (a[1][key] !== b[1][key]) return a[1][key] ? 1 : -1; + } + + if (a[1].star !== b[1].star) return (b[1].star || 1) - (a[1].star || 1); + + return a[0] > b[0] ? 1 : -1; + }); + + const mdContent = list + .map(([url, info]) => { + return [ + '', + info.invalid ? '❌' : (Number(info.needVerify) > 0 ? '⚠️' : '✅'), + url, info.title, + info.errmsg ? `\`${info.errmsg}\`` : info.desc, + dateFormat('yyyy-MM-dd hh:mm:ss', info.update || Date.now()), + '', + ].join(' | ').trim(); + }); + mdContent.unshift(`| 状态 | 链接 | 标题 | 描述 | 更新时间 |\n|:-:| :-:|:-:|:-:|:-:|`); + + return { list, mdContent: mdContent.join('\n') }; +} + +async function updateReadme() { + const rdFile = resolve(config.rootDir, 'README.md'); + const { list, mdContent } = formatSiteList(); + const content = readFileSync(rdFile, 'utf8'); + const updated = content.replace(/站点列表\([\s\S]+\n\n## /g, `站点列表(${list.length}):\n\n${mdContent}\n\n## `); + + if (updated !== content) writeFileSync(rdFile, updated, 'utf8'); + else logger.log('[UPDATE-READE] No Chagned'); + + return list.length; +} + +export async function start() { + const argv = parser(process.argv.slice(2)); + logger.debug('argv', argv); + initConfig(argv); + + if (argv.url) { + await siteUrlVerify(); + saveConfig(); + } + + const total = await updateReadme(); + if (config.ci || argv.ci || argv.commit) gitCommit(); + + return total; +} + +start().then(total => { + logger.info(`done! Total: ${total} / ${Object.keys(config.siteInfo).length}`); + process.nextTick(() => process.exit()); +}); diff --git a/examples/ghproxy-sites/src/siteUrlVerify.ts b/examples/ghproxy-sites/src/siteUrlVerify.ts new file mode 100644 index 0000000..017af8f --- /dev/null +++ b/examples/ghproxy-sites/src/siteUrlVerify.ts @@ -0,0 +1,125 @@ +import { concurrency, color, httpLinkChecker } from '@lzwme/fe-utils'; +import { config } from './config.js'; +import { logger } from './utils.js'; + +export function siteUrlVerify() { + const now = Date.now(); + const needVPNKeywords = ['vercel.app', 'openai.com', 'bing.com']; + const isGitHubCi = (process.env.GITHUB_CI || process.env.SYNC) != null; + + const tasks = Object.entries(config.siteInfo).map(([url, item], idx) => async () => { + if (Number(item.hide) === 1) return true; + + if (!isGitHubCi) { + // if (item.needVPN) return true; + if (needVPNKeywords.some(key => url.includes(key))) return true; + if (item.star! >= 3) return true; + } + + if (item.needVerify != null && item.needVerify < 0) return true; + + logger.debug(`[urlVerify][${idx}] start for`, color.green(url)); + const startTime = Date.now(); + + // 先做 gh-proxy 文件访问测试 + if (!item.hide && (item.needVerify || 0) < config.urlCheckMaxTry) { + const r = await checkGHProxy(url, idx); + + item.update = now; + if (r.code) { + item.invalid = 1; + } else { + (['errmsg', 'needVerify', 'invalid'] as const).forEach(k => item[k] && delete item[k]); + return r; + } + } + + const r = await httpLinkChecker(url, { + verify: body => //i.test(body), + reqOptions: { timeout: 10_000, rejectUnauthorized: false }, + }); + + if (r.code) { + // 30x 为正常 + if (r.redirected || String(r.code).startsWith('30')) r.code = 0; + + // ignore TSL error + if (r.errmsg.includes('network socket disconnected before secure TLS connection')) { + r.code = 0; + r.body = ''; + } + + if (String(r.errmsg).startsWith('