diff --git a/README.md b/README.md index db65f84..3408020 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,10 @@ ![](https://img.shields.io/badge/Powered%20By-GNU%20C-00d000?style=flat&labelColor=gray&logo=C) +> [!WARNING] +> Most of the code is generated by human, maybe even neko. +> If you found any issues, rewrite it with Claude. + # WARNING: ``` * Your warranty is void. @@ -47,6 +51,7 @@ And, don't forget to `rurima ota` to get the latest build! # What's new: - We have a unified `pull` command to get images from dockerhub or LXC mirror now. - Some other OCI compatible registry like ghcr.io could work with `-f/--fallback` option enabled now. +- We will automatically force enable fallback mode for ghcr.io now. # Backward compatibility: We promise that rurima has backward compatibility of documented parts since v0.9.x, all unstable parts will be explicitly marked as WIP or unstable, and ruri has already been backward compatible. Users can always keep `rurima ota` to get the latest build. For any issue, please notify us, and we will fix it ASAP. diff --git a/doc/USAGE.md b/doc/USAGE.md index 0aec268..4f2230c 100644 --- a/doc/USAGE.md +++ b/doc/USAGE.md @@ -69,6 +69,7 @@ Subcommands: search: Search images from DockerHub. tag: Search tags from DockerHub. pull: Pull image from DockerHub. + load: Load rootfs from tarball. config: Get config of image from DockerHub. arch: Search architecture of image from DockerHub. help: Show help message. diff --git a/src/main.c b/src/main.c index 957b70e..1f60123 100644 --- a/src/main.c +++ b/src/main.c @@ -298,10 +298,6 @@ int main(int argc, char **argv) rurima_netns_wrapper(argc - i - 1, &argv[i + 1]); return 0; } - if (strcmp(argv[i], "load") == 0) { - rurima_load_rootfs(argc - i - 1, &argv[i + 1]); - return 0; - } if (strcmp(argv[i], "QwQ") == 0) { rurima_QwQ(); return 0; diff --git a/src/ruri b/src/ruri index 3746bbd..e612c43 160000 --- a/src/ruri +++ b/src/ruri @@ -1 +1 @@ -Subproject commit 3746bbd27458e9d800d79b9f1fe726e9cb3277eb +Subproject commit e612c43dba5caee3832283fa3ea448b10f92538c diff --git a/src/subcommand.c b/src/subcommand.c index c05de96..12be14d 100644 --- a/src/subcommand.c +++ b/src/subcommand.c @@ -121,6 +121,11 @@ static void docker_pull_try_mirrors(const char *_Nonnull image, const char *_Non */ void rurima_docker(int argc, char **_Nonnull argv) { + // rurima docker load + if (argc > 0 && (strcmp(argv[0], "load") == 0)) { + rurima_load_rootfs(argc - 1, &argv[1]); + return; + } if (!rurima_jq_exists()) { rurima_error("{red}jq is not installed!\n"); } @@ -233,6 +238,11 @@ void rurima_docker(int argc, char **_Nonnull argv) rurima_warning("{yellow}You use it as your own risk.\n") } } + // For ghcr.io, we enable fallback mode by default. + if (strncmp(mirror, "ghcr.io", 7) == 0) { + rurima_warning("{yellow}ghcr.io detected, enabling fallback mode by default for compatibility.\n"); + fallback = true; + } if (strcmp(argv[0], "search") == 0) { if (image == NULL) { rurima_error("{red}No image specified!\n"); @@ -327,6 +337,7 @@ void rurima_docker(int argc, char **_Nonnull argv) cprintf("{base} search: Search images from DockerHub.\n"); cprintf("{base} tag: Search tags from DockerHub.\n"); cprintf("{base} pull: Pull image from DockerHub.\n"); + cprintf("{base} load: Load rootfs from tarball.\n"); cprintf("{base} config: Get config of image from DockerHub.\n"); cprintf("{base} arch: Search architecture of image from DockerHub.\n"); cprintf("{base} help: Show help message.\n");