Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/chsrc-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ chsrc_register_chefs_and_sauciers ()
// 该注释下一行的用户 ID 为 Gitee ID
chef_register_contributor ("@hezonglun", "HeZongLun", "[email protected]", NULL);
chef_register_contributor ("@Young-Lord", "LY", "[email protected]", NULL);
chef_register_contributor ("@MingriLingran", "MingriLingran", "[email protected]", NULL);
chef_register_contributor ("@LinRanAstra", "LinRanAstra", "[email protected]", NULL);
chef_register_contributor ("@usernameisnull", "MaBing", "[email protected]", NULL);
chef_register_contributor ("@AnonTokio", "Anon Tokio", "[email protected]", NULL);
chef_register_contributor ("@NewbieXvwu", "Mingzhe Jiang", "[email protected]", NULL);
Expand Down
2 changes: 1 addition & 1 deletion src/recipe/lang/Python/rawstr4c.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
! Config Type : rawstr4c (Markdown)
! Config Authors: @ccmywish
! | @happy-game
! | @MingriLingran
! | @LinRanAstra
! Contributors : Nil Null <[email protected]>
! Created On : <2025-07-14>
! Last Modified : <2025-12-29>
Expand Down
2 changes: 1 addition & 1 deletion src/recipe/lang/Python/uv/uv-pypi-index.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pl_uv_pypi_index_prepare (void)
chef_set_recipe_created_on (this, "2024-12-11");
chef_set_recipe_last_updated (this, "2026-08-19");

chef_set_chefs (this, 3, "@happy-game", "@MingriLingran", "@Mikachu2333");
chef_set_chefs (this, 3, "@happy-game", "@LinRanAstra", "@Mikachu2333");
chef_set_sauciers (this, 2, "@ccmywish", "@Kattos");

chef_set_scope_cap (this, ProjectScope, ScopeCap_Able_And_Implemented);
Expand Down
2 changes: 1 addition & 1 deletion src/recipe/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ chsrc_init_menu ()
add(Netease);
add(Sohu);

add(Api7); add(Fit2Cloud); add(DaoCloud);
add(Api7); add(Fit2Cloud); add(DaoCloud); add(OneMs);


/* ------------------------ 专用镜像站 ------------------------ */
Expand Down
28 changes: 25 additions & 3 deletions src/recipe/ware/Docker/Docker.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ Fit2Cloud =
IS_DedicatedMirrorSite,
"fit2cloud", "FIT2CLOUD", "杭州飞致云信息科技有限公司", "https://www.fit2cloud.com/",
{SKIP, ToFill, ToFill, NULL, ROUGH}
},

OneMs =
{
IS_DedicatedMirrorSite,
"1ms", "1ms", "毫秒镜像", "https://1ms.run/",
def_need_measure_info
};

def_dish(wr_docker, "docker/dockerhub");
Expand All @@ -27,10 +34,10 @@ wr_docker_prepare ()
chef_prep_this_dish (wr_docker, gs);

chef_set_recipe_created_on (this, "2024-06-08");
chef_set_recipe_last_updated (this, "2025-08-09");
chef_set_recipe_last_updated (this, "2026-11-30");

chef_set_chefs (this, 2, "@happy-game", "@ccmywish");
chef_set_sauciers (this, 0);
chef_set_sauciers (this, 1, "@LinRanAstra");

chef_set_scope_cap (this, ProjectScope, ScopeCap_Unable);
chef_set_scope_cap (this, UserScope, ScopeCap_Able_And_Implemented);
Expand All @@ -43,7 +50,8 @@ wr_docker_prepare ()
def_sources_begin()
{&UpstreamProvider, "https://hub.docker.com/", DelegateToUpstream},
{&DaoCloud, "https://docker.m.daocloud.io", DelegateToMirror},
{&Fit2Cloud, "https://docker.1panel.live", DelegateToMirror}
{&Fit2Cloud, "https://docker.1panel.live", DelegateToMirror},
{&OneMs, "https://docker.1ms.run", DelegateToMirror}
def_sources_end()
}

Expand Down Expand Up @@ -106,9 +114,23 @@ wr_docker_setsrc (char *option)
else
{
chsrc_alert2 ("未找到 jq 命令, 将使用 sed 换源");

/* sed 匹配的是字面量 "registry-mirrors":,如果配置文件中没有该键
(也就没有该字面量), sed 一行也不会匹配到, 却仍以退出码 0 结束,
从而错误地报告换源成功, 因此必须先确认该键存在 */
char *config = xy_file_read (WR_Docker_ConfigFile);
if (!strstr (config, "\"registry-mirrors\":"))
{
chsrc_error2 ("配置文件中未找到 \"registry-mirrors\": 键, 无法使用 sed 换源");
chsrc_note2 ("请确认该键存在、且冒号紧跟其后, 或手动添加以下内容后重试:");
println (to_add);
exit (Exit_UserCause);
}

char *cmd = xy_str_gsub (RAWSTR_wr_docker_sed_command, "@1@", source.url);
cmd = xy_str_gsub (cmd, "@2@", WR_Docker_ConfigFile);
chsrc_run (cmd, RunOpt_Default);
chsrc_succ2 ("源已替换");
}
}
else
Expand Down
2 changes: 1 addition & 1 deletion src/recipe/ware/Docker/rawstr4c.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ char RAWSTR_wr_docker_check_cmd[] = "\x6a\x71\x20\x27\x2e\x5b\x22\x72\x65\x67\x6

char RAWSTR_wr_docker_insert_cmd[] = "\x6a\x71\x20\x27\x2e\x5b\x22\x72\x65\x67\x69\x73\x74\x72\x79\x2d\x6d\x69\x72\x72\x6f\x72\x73\x22\x5d\x20\x7c\x3d\x20\x5b\x22\x40\x31\x40\x22\x5d\x20\x2b\x20\x2e\x27\x20\x40\x32\x40\x2e\x62\x61\x6b\x20\x3e\x20\x20\x40\x32\x40";

char RAWSTR_wr_docker_sed_command[] = "\x73\x65\x64\x20\x2d\x7a\x20\x2d\x69\x20\x27\x73\x2f\x22\x72\x65\x67\x69\x73\x74\x72\x79\x2d\x6d\x69\x72\x72\x6f\x72\x73\x22\x3a\x5b\x5e\x5d\x5d\x2a\x5d\x2f\x22\x72\x65\x67\x69\x73\x74\x72\x79\x2d\x6d\x69\x72\x72\x6f\x72\x73\x22\x3a\x5b\x22\x40\x31\x40\x22\x5d\x2f\x27\x20\x40\x32\x40";
char RAWSTR_wr_docker_sed_command[] = "\x73\x65\x64\x20\x2d\x7a\x20\x2d\x69\x20\x27\x73\x7c\x22\x72\x65\x67\x69\x73\x74\x72\x79\x2d\x6d\x69\x72\x72\x6f\x72\x73\x22\x3a\x5b\x5e\x5d\x5d\x2a\x5d\x7c\x22\x72\x65\x67\x69\x73\x74\x72\x79\x2d\x6d\x69\x72\x72\x6f\x72\x73\x22\x3a\x5b\x22\x40\x31\x40\x22\x5d\x7c\x27\x20\x40\x32\x40";

6 changes: 4 additions & 2 deletions src/recipe/ware/Docker/rawstr4c.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
! | happy game <[email protected]>
! Contributors : Nil Null <[email protected]>
! Created On : <2025-07-14>
! Last Modified : <2025-08-10>
! Last Modified : <2026-11-30>
! ---------------------------------------------------------- -->

# rawstr4c input
Expand Down Expand Up @@ -61,7 +61,9 @@ jq '.["registry-mirrors"] |= ["@1@"] + .' @[email protected] > @2@
没有 `jq` 时,用 `sed` 换源,写入到配置文件中

```sh
sed -z -i 's/"registry-mirrors":[^]]*]/"registry-mirrors":["@1@"]/' @2@
sed -z -i 's|"registry-mirrors":[^]]*]|"registry-mirrors":["@1@"]|' @2@
```

注释: `[^]]*` 即不是 `]` 的所有字符, 后面再跟一个 `]` 由于没有前面的 `[`,因此可被解析为普通字符 `]`,没有特殊含义

注释: 分隔符必须用 `|` 而不能用 `/`,因为换源链接本身就含有 `/`,会把 `s` 命令提前截断,sed 报 `unknown option to 's'`