Skip to content

Commit 6e2b332

Browse files
committed
Add provider type
1 parent 1c27e32 commit 6e2b332

File tree

12 files changed

+58
-1
lines changed

12 files changed

+58
-1
lines changed

src/framework/mirror.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@
2828
*/
2929
MirrorSite_t MirrorZ =
3030
{
31+
IS_GeneralMirrorSite,
3132
"mirrorz", "MirrorZ", "校园网联合镜像站(MirrorZ)", "https://mirrors.cernet.edu.cn/",
3233
{SKIP, "功能特殊无法测速,跳过", "SKIP because of its special function", NULL, ROUGH}
3334
},
3435

3536
Tuna =
3637
{
38+
IS_GeneralMirrorSite,
3739
"tuna", "TUNA", "清华大学开源软件镜像站", "https://mirrors.tuna.tsinghua.edu.cn/",
3840
{NotSkip, NA, NA, "https://mirrors.tuna.tsinghua.edu.cn/speedtest/1000mb.bin", ROUGH}
3941
},
@@ -45,66 +47,77 @@ Tuna =
4547

4648
Sjtug_Zhiyuan =
4749
{
50+
IS_GeneralMirrorSite,
4851
"sjtu-zy", "SJTUG-zhiyuan", "上海交通大学致远镜像站", "https://mirrors.sjtug.sjtu.edu.cn/",
4952
{NotSkip, NA, NA, "https://mirrors.sjtug.sjtu.edu.cn/ctan" Big_File_ctan, ROUGH}
5053
},
5154

5255
Sjtug_Siyuan =
5356
{
57+
IS_GeneralMirrorSite,
5458
"sjtu-sy", "SJTUG-siyuan", "上海交通大学思源镜像站", "https://mirror.sjtu.edu.cn/",
5559
{NotSkip, NA, NA, "https://mirror.sjtu.edu.cn/ctan" Big_File_ctan, ROUGH}
5660
},
5761

5862
Zju =
5963
{
64+
IS_GeneralMirrorSite,
6065
"zju", "ZJU", "浙江大学开源软件镜像站", "https://mirrors.zju.edu.cn/",
6166
{NotSkip, NA, NA, "https://mirrors.zju.edu.cn/ubuntu-releases" Big_File_ubuntu, ROUGH}
6267
},
6368

6469
Lzuoss =
6570
{
71+
IS_GeneralMirrorSite,
6672
"lzu", "LZUOSS", "兰州大学开源社区镜像站", "https://mirror.lzu.edu.cn/",
6773
{NotSkip, NA, NA, "https://mirror.lzu.edu.cn/CTAN" Big_File_ctan, ROUGH}
6874
},
6975

7076
Jlu =
7177
{
78+
IS_GeneralMirrorSite,
7279
"jlu", "JLU", "吉林大学开源镜像站", "https://mirrors.jlu.edu.cn/",
7380
{NotSkip, NA, NA, "https://mirrors.jlu.edu.cn/_static/speedtest.bin", ROUGH}
7481
},
7582

7683
Bfsu =
7784
{
85+
IS_GeneralMirrorSite,
7886
"bfsu", "BFSU", "北京外国语大学开源软件镜像站", "https://mirrors.bfsu.edu.cn/",
7987
{NotSkip, NA, NA, "https://mirrors.bfsu.edu.cn/speedtest/1000mb.bin", ROUGH}
8088
},
8189

8290
Pku =
8391
{
92+
IS_GeneralMirrorSite,
8493
"pku", "PKU", "北京大学开源镜像站", "https://mirrors.pku.edu.cn/",
8594
{NotSkip, NA, NA, "https://mirrors.pku.edu.cn/ubuntu-releases" Big_File_ubuntu, ROUGH}
8695
},
8796

8897
Bjtu =
8998
{
99+
IS_GeneralMirrorSite,
90100
"bjtu", "BJTU", "北京交通大学自由与开源软件镜像站", "https://mirror.bjtu.edu.cn/",
91101
{NotSkip, NA, NA, "https://mirror.bjtu.edu.cn/archlinux" Big_File_archlinux, ROUGH}
92102
},
93103

94104
Sustech =
95105
{
106+
IS_GeneralMirrorSite,
96107
"sustech", "SUSTech", "南方科技大学开源软件镜像站", "https://mirrors.sustech.edu.cn/",
97108
{NotSkip, NA, NA, "https://mirrors.sustech.edu.cn/site/speedtest/1000mb.bin", ROUGH}
98109
},
99110

100111
Ustc =
101112
{
113+
IS_GeneralMirrorSite,
102114
"ustc", "USTC", "中国科学技术大学开源镜像站", "https://mirrors.ustc.edu.cn/",
103115
{NotSkip, NA, NA, "https://mirrors.ustc.edu.cn/ubuntu-releases" Big_File_ubuntu, ROUGH}
104116
},
105117

106118
Hust =
107119
{
120+
IS_GeneralMirrorSite,
108121
"hust", "HUST", "华中科技大学开源镜像站", "https://mirrors.hust.edu.cn/",
109122
{NotSkip, NA, NA, "https://mirrors.hust.edu.cn/ubuntu-releases" Big_File_ubuntu, ROUGH}
110123
},
@@ -113,42 +126,49 @@ Hust =
113126

114127
Iscas =
115128
{
129+
IS_GeneralMirrorSite,
116130
"iscas", "ISCAS", "中科院软件所智能软件研究中心开源镜像站", "https://mirror.iscas.ac.cn/",
117131
{NotSkip, NA, NA, "https://mirror.iscas.ac.cn/ubuntu-releases" Big_File_ubuntu, ROUGH}
118132
},
119133

120134
Scau =
121135
{
136+
IS_GeneralMirrorSite,
122137
"scau", "SCAU", "华南农业大学开源软件镜像站", "https://mirrors.scau.edu.cn/",
123138
{NotSkip, NA, NA, "https://mirrors.scau.edu.cn/ubuntu-releases" Big_File_ubuntu, ROUGH}
124139
},
125140

126141
NJTech =
127142
{
143+
IS_GeneralMirrorSite,
128144
"njtech", "NJTech", "南京工业大学开源软件镜像站", "https://mirrors.njtech.edu.cn/",
129145
{NotSkip, NA, NA, "https://mirrors.njtech.edu.cn/ubuntu-releases" Big_File_ubuntu, ROUGH}
130146
},
131147

132148
Nyist =
133149
{
150+
IS_GeneralMirrorSite,
134151
"nyist", "NYIST", "南阳理工学院开源软件镜像站", "https://mirror.nyist.edu.cn/",
135152
{NotSkip, NA, NA, "https://mirror.nyist.edu.cn/ubuntu-releases" Big_File_ubuntu, ROUGH}
136153
},
137154

138155
Sdu =
139156
{
157+
IS_GeneralMirrorSite,
140158
"sdu", "SDU", "山东大学镜像站", "https://mirrors.sdu.edu.cn/",
141159
{NotSkip, NA, NA, "https://mirrors.sdu.edu.cn/ubuntu-releases" Big_File_ubuntu, ROUGH}
142160
},
143161

144162
Cqupt =
145163
{
164+
IS_GeneralMirrorSite,
146165
"cqupt", "CQUPT", "重庆邮电大学开源镜像站", "https://mirrors.cqupt.edu.cn/",
147166
{NotSkip, NA, NA, "https://mirrors.cqupt.edu.cn/ubuntu-releases" Big_File_ubuntu, ROUGH}
148167
},
149168

150169
Nju =
151170
{
171+
IS_GeneralMirrorSite,
152172
"nju", "NJU", "南京大学开源镜像站", "https://mirrors.nju.edu.cn/",
153173
{NotSkip, NA, NA, "https://mirrors.nju.edu.cn/archlinux" Big_File_archlinux, ROUGH}
154174
},
@@ -158,6 +178,7 @@ Nju =
158178
*/
159179
Cqu =
160180
{
181+
IS_GeneralMirrorSite,
161182
"cqu", "CQU", "重庆大学开源软件镜像站", "https://mirrors.cqu.edu.cn/",
162183
{NotSkip, NA, NA, "https://mirrors.cqu.edu.cn/ubuntu-releases" Big_File_ubuntu, ROUGH}
163184
};
@@ -167,52 +188,60 @@ Cqu =
167188
*/
168189
MirrorSite_t Ali =
169190
{
191+
IS_GeneralMirrorSite,
170192
"ali", "Ali OPSX Public", "阿里巴巴开源镜像站(公网)", "https://developer.aliyun.com/mirror/",
171193
{NotSkip, NA, NA, "https://mirrors.aliyun.com/ubuntu/ls-lR.gz", ROUGH} // 31MB左右
172194
},
173195
/*
174196
// https://mirrors.cloud.aliyuncs.com/
175197
Ali_ECS_VPC =
176198
{
199+
IS_GeneralMirrorSite,
177200
"ali-ECS-VPC", "Ali OPSX ECS VPC", "阿里巴巴开源镜像站(ECS VPC网络)", "https://developer.aliyun.com/mirror/",
178201
{NotSkip, NA, NA, "https://mirrors.cloud.aliyuncs.com/deepin-cd" Big_File_deepin, ROUGH}
179202
},
180203
181204
// https://mirrors.aliyuncs.com/
182205
Ali_ECS_classic =
183206
{
207+
IS_GeneralMirrorSite,
184208
"ali-ECS", "Ali OPSX ECS", "阿里巴巴开源镜像站(ECS 经典网络)", "https://developer.aliyun.com/mirror/",
185209
{NotSkip, NA, NA, "https://mirrors.aliyuncs.com/deepin-cd" Big_File_deepin, ROUGH}
186210
},
187211
*/
188212

189213
Tencent =
190214
{
215+
IS_GeneralMirrorSite,
191216
"tencent", "Tencent Public", "腾讯软件源(公网)", "https://mirrors.tencent.com/",
192217
{NotSkip, NA, NA, "https://mirrors.cloud.tencent.com/mariadb/mariadb-12.1.0/winx64-packages/mariadb-12.1.0-winx64-debugsymbols.zip", ROUGH} // 110MB左右
193218
},
194219
/*
195220
Tencent_Intra =
196221
{
222+
IS_GeneralMirrorSite,
197223
"tencent-intra", "Tencent Intranet", "腾讯软件源(内网)", "https://mirrors.tencent.com/",
198224
{NotSkip, NA, NA, "https://mirrors.cloud.tencentyun.com/ubuntu-releases" Big_File_ubuntu, ROUGH}
199225
},
200226
*/
201227

202228
Huawei =
203229
{
230+
IS_GeneralMirrorSite,
204231
"huawei", "Huawei Cloud", "华为开源镜像站", "https://mirrors.huaweicloud.com/",
205232
{NotSkip, NA, NA, "https://mirrors.huaweicloud.com/ubuntu-releases" Big_File_ubuntu, ROUGH}
206233
},
207234

208235
Volcengine =
209236
{
237+
IS_GeneralMirrorSite,
210238
"volc", "Volcengine", "火山引擎开源软件镜像站(公网)", "https://developer.volcengine.com/mirror/",
211239
{NotSkip, NA, NA, "https://mirrors.volces.com/ubuntu-releases" Big_File_ubuntu, ROUGH}
212240
},
213241
/*
214242
Volceengine_Intra =
215243
{
244+
IS_GeneralMirrorSite,
216245
"volc-intra", "Volcengine Intranet", "火山引擎开源软件镜像站(内网)",
217246
"https://developer.volcengine.com/mirror/",
218247
"https://mirrors.ivolces.com/ubuntu-releases" Big_File_ubuntu, ROUGH},
@@ -224,6 +253,7 @@ Volceengine_Intra =
224253
*/
225254
Netease =
226255
{
256+
IS_GeneralMirrorSite,
227257
"netease", "Netease", "网易开源镜像站", "https://mirrors.163.com/",
228258
{NotSkip, NA, NA, "https://mirrors.163.com/deepin-cd" Big_File_deepin, ROUGH}
229259
},
@@ -233,6 +263,7 @@ Netease =
233263
*/
234264
Sohu =
235265
{
266+
IS_GeneralMirrorSite,
236267
"sohu", "SOHU", "搜狐开源镜像站", "https://mirrors.sohu.com/",
237268
{NotSkip, NA, NA, "https://mirrors.sohu.com/deepin-cd" Big_File_deepin, ROUGH}
238269
};

src/framework/struct.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,18 @@ ProviderSpeedMeasureInfo_t;
3030
#define ACCURATE true
3131
#define ROUGH false
3232

33+
typedef enum ProviderType_t
34+
{
35+
IS_GeneralMirrorSite, /* 通用镜像站 */
36+
IS_DedicatedMirrorSite, /* 专用镜像站 */
37+
IS_UpstreamProvider, /* 上游默认源 */
38+
IS_VirtualProvider, /* 用户提供 */
39+
}
40+
ProviderType_t;
41+
3342
typedef struct SourceProvider_t
3443
{
44+
const ProviderType_t type; /* 类型 */
3545
const char *code; /* 用于用户指定某一 Provider */
3646
const char *abbr; /* 需要使用 Provider 的英文名时,用这个代替,因为大部分 Provider 没有提供正式的英文名 */
3747
const char *name; /* Provider 中文名 */
@@ -44,17 +54,19 @@ typedef SourceProvider_t MirrorSite_t;
4454

4555
SourceProvider_t UpstreamProvider =
4656
{
57+
IS_UpstreamProvider,
4758
/* 引入新的上游默认源时,请使下面第一行的前三个字段保持不变,只添加第四个字段,可使用 def_upstream 宏 */
4859
"upstream", "Upstream", "上游默认源", NULL,
4960
/* 引入新的上游默认源时,请完全修改下面这个结构体,可使用 def_need_measure_info 宏 */
5061
{SKIP, "URL未知,邀您参与贡献!", "URL unknown, welcome to contribute!", NULL, ACCURATE}
5162
};
5263

53-
#define def_upstream "upstream", "Upstream", "上游默认源"
64+
#define def_upstream IS_UpstreamProvider, "upstream", "Upstream", "上游默认源"
5465
#define def_need_measure_info {SKIP, "缺乏较大的测速对象,邀您参与贡献!", "Lack of large object URL, welcome to contribute!", NULL, ACCURATE}
5566

5667
SourceProvider_t UserDefinedProvider =
5768
{
69+
IS_VirtualProvider,
5870
"user", "用户自定义", "用户自定义", NULL,
5971
{SKIP, "用户自定义源不测速", "SKIP for user-defined source", NULL, ACCURATE}
6072
};

src/recipe/lang/Dart/common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
static MirrorSite_t FlutterCN =
1313
{
14+
IS_DedicatedMirrorSite,
1415
"cfug", "CFUG", "Flutter 社区", "https://flutter.cn/",
1516
{NotSkip, NA, NA, "https://storage.flutter-io.cn/flutter_infra_release/releases/stable/linux/flutter_linux_v1.0.0-stable.tar.xz", ACCURATE} // 231 MB
1617
};

src/recipe/lang/Go.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ static SourceProvider_t pl_go_upstream =
1717

1818
static MirrorSite_t GoProxyCN =
1919
{
20+
IS_DedicatedMirrorSite,
2021
"goproxy.cn", "Goproxy.cn", "Goproxy.cn (七牛云)", "https://goproxy.cn/",
2122
{NotSkip, NA, NA, "https://goproxy.cn/github.com/aws/aws-sdk-go/@v/v1.45.2.zip", ACCURATE} // 30 MB
2223
},
2324

2425
GoProxyIO =
2526
{
27+
IS_DedicatedMirrorSite,
2628
"goproxy.io", "GOPROXY.IO", "GOPROXY.IO", "https://goproxy.io/",
2729
{NotSkip, NA, NA, "https://goproxy.io/github.com/aws/aws-sdk-go/@v/v1.45.2.zip", ACCURATE} // 30 MB
2830
};

src/recipe/lang/Lua.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
static MirrorSite_t Api7 =
1111
{
12+
IS_DedicatedMirrorSite,
1213
"api7", "api7.ai", "深圳支流科技有限公司", "https://www.apiseven.com/",
1314
{SKIP, ToFill, ToFill, NULL, ROUGH}
1415
};

src/recipe/lang/Node.js/common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ static SourceProvider_t pl_nodejs_npm_upstream =
1717

1818
static MirrorSite_t NpmMirror =
1919
{
20+
IS_DedicatedMirrorSite,
2021
"npmmirror", "npmmirror", "npmmirror (阿里云赞助)", "https://npmmirror.com/",
2122
// 注意,下面这个是跳转后的地址,不确定未来会不会改变
2223
{NotSkip, NA, NA, "https://cdn.npmmirror.com/packages/%40tensorflow/tfjs/4.22.0/tfjs-4.22.0.tgz", ACCURATE} // 29MB

src/recipe/lang/NuGet.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
static MirrorSite_t NugetOrg =
1111
{
12+
IS_UpstreamProvider,
1213
"nuget.org", "NuGet Org", "Nuget Organization", "https://www.nuget.org/",
1314
{SKIP, ToFill, ToFill, NULL, ROUGH}
1415
};

src/recipe/lang/Ruby.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ static SourceProvider_t pl_ruby_upstream =
1616

1717
static MirrorSite_t RubyChina =
1818
{
19+
IS_DedicatedMirrorSite,
1920
"rubychina", "RubyChina", "Ruby China 社区", "https://gems.ruby-china.com/",
2021
{NotSkip, NA, NA, "https://gems.ruby-china.com/rubygems/gems/nokogiri-1.15.0-java.gem", ACCURATE} // 9.9 MB
2122
};

src/recipe/lang/Rust/common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
static MirrorSite_t RsProxyCN =
1111
{
12+
IS_DedicatedMirrorSite,
1213
"rsproxycn", "RsProxy.cn", "字节跳动基础架构Dev Infra", "https://rsproxy.cn/",
1314
{NotSkip, NA, NA, "https://rsproxy.cn/api/v1/crates/windows/0.58.0/download", ACCURATE}
1415
};

src/recipe/ware/Docker-Hub.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,22 @@
1111

1212
static MirrorSite_t DaoCloud =
1313
{
14+
IS_DedicatedMirrorSite,
1415
"daocloud", "DaoCloud","上海道客网络科技有限公司", "https://www.daocloud.io/",
1516
// 没有找到 DaoCloud 合适的下载链接,先随便给一个,以规避 chsrc 自动测速时所有 dockerhub 镜像站都没有测速链接带来的 bug
1617
{NotSkip, NA, NA, "https://qiniu-download-public.daocloud.io/DaoCloud_Enterprise/dce5/offline-community-v0.18.0-amd64.tar", ACCURATE}
1718
},
1819

1920
Fit2Cloud =
2021
{
22+
IS_DedicatedMirrorSite,
2123
"fit2cloud", "FIT2CLOUD", "杭州飞致云信息科技有限公司", "https://www.fit2cloud.com/",
2224
{SKIP, ToFill, ToFill, NULL, ROUGH}
2325
},
2426

2527
Huecker =
2628
{
29+
IS_DedicatedMirrorSite,
2730
"huecker", "(Russia) Huecker", "俄罗斯 Huecker.io", "https://huecker.io/",
2831
// 同 DaoCloud,没有合适的下载链接,先随便给一个,以避免 bug
2932
{NotSkip, NA, NA, "https://huecker.io/en/use.html", ROUGH}

0 commit comments

Comments
 (0)