.+?<\/div>/, "");
26 | header = header.replace(/
/g, "");
27 | header = header.replace(/
69 |
70 |
71 |
72 | }
73 |
--------------------------------------------------------------------------------
/docs/kali.md:
--------------------------------------------------------------------------------
1 | ---
2 | sidebar_label: Kali
3 | title: Kali Linux 软件仓库镜像使用帮助
4 | cname: 'kali'
5 | type: OS
6 | detection:
7 | checks:
8 | - type: os_release
9 | name: Kali GNU/Linux
10 | ---
11 |
12 | ## Kali 简介与软件管理
13 |
14 | Kali Linux 是一款开源的,基于 Debian 的 Linux 发行版。其目的在于为包括渗透测试,安全研究,逆向工程在内的多种信息安全工作提供强大的工具支持。
15 |
16 | Kali 使用软件包管理工具 `APT` 来管理 DEB 软件包。具体来说,Kali 通过修改 `/etc/apt/sources.list` 配置文件来管理系统软件源。一般情况下,用户可直接将该配置文件中的默认源地址 [http://http.kali.org/](http://http.kali.org/) 替换为本软件镜像站。
17 |
18 | ## Kali 软件源替换
19 |
20 | ### 一键换源
21 |
22 | :::caution
23 | 本方法仅适用于从官方源更换到本站源,如果您已经换过了源,请勿使用下列命令。
24 | :::
25 |
26 | 使用 `sed` 命令将软件源配置文件中的默认源地址 [http://http.kali.org/](http://http.kali.org/) 直接替换为当前镜像源站。
27 |
28 |
29 | ```yaml cli
30 | type: ReplaceIfExist
31 | required: true
32 | optional: false
33 | description: 替换Kali主仓库
34 | privileged: true
35 | files:
36 | - path: /etc/apt/sources.list
37 | match: 'https?://([^/]+)/kali'
38 | replace: '${_http}://${_domain}/kali'
39 | ```
40 |
41 | :::caution
42 | **为避免软件源配置文件替换后产生问题,请先将系统自带的软件源配置文件进行备份,然后进行下列操作。**
43 | :::
44 |
45 | :::caution
46 | 早期版本的 Kali Linux 不受本站支持。
47 | :::
48 |
49 | ### 1. 根据个人喜好做出选择,使用以下内容替换 `/etc/apt/sources.list`
50 |
51 | ```plaintext varcode
52 | [ ] (src) 启用源码镜像
53 | ---
54 | const SRC_PREFIX = src ? "" : "# ";
55 | ---
56 | # See https://w.kali.org/docs/general-use/kali-linux-sources-list-repositories/
57 | deb https://mirrors.hust.edu.cn/kali kali-rolling main contrib non-free non-free-firmware
58 | # Additional line for source packages
59 | ${SRC_PREFIX}deb-src https://mirrors.hust.edu.cn/kali kali-rolling main contrib non-free non-free-firmware
60 | ```
61 |
62 | ### 2. 通过如下命令更新软件。
63 |
64 | ```yaml cli
65 | type: Execute
66 | privileged: true
67 | interpreter: shell
68 | exec: |
69 | #{USE_IN_DOCS/}
70 | apt-get update
71 | #{/USE_IN_DOCS}
72 | ```
73 |
74 |
75 |
76 | ## 注意事项
77 |
78 | - Kali 默认使用 HTTP 源。如果您选择使用 HTTPS 源后遇到无法拉取 HTTPS 源的情况,请使用 HTTP 源安装如下软件。
79 |
80 | ```shell varcode
81 | [ ] (root) 是否为 root 用户
82 | ---
83 | const SUDO = !root ? 'sudo ' : '';
84 | ---
85 | ${SUDO}apt install apt-transport-https ca-certificates
86 | ${SUDO}apt update
87 | ```
88 |
89 | ## Kali CD 镜像和虚拟机镜像 {#iso}
90 |
91 | 本站提供 Kali Linux 的 CD 镜像和虚拟机镜像下载服务。
92 |
93 | - [点此链接](/release?release=Kali%20Linux),选择需要的版本和架构下载所需的 Kali Linux 安装镜像。
94 |
--------------------------------------------------------------------------------
/i18n/en/docusaurus-plugin-content-docs/current/archlinux.md:
--------------------------------------------------------------------------------
1 | ---
2 | sidebar_label: Arch Linux
3 | title: Arch Linux
4 | cname: 'archlinux'
5 | ---
6 |
7 | ## Introduction to Arch Linux and Software Management
8 |
9 | Arch Linux is an independently developed, x86-64 general-purpose Linux distribution that aims to provide the latest stable software versions through a rolling release model. The default installation of Arch Linux is a minimal base system, and users can install the software they need (such as desktop software and development tools) and configure it to create their ideal system.
10 |
11 | Arch Linux uses its unique package manager, Pacman, for installing, updating, and uninstalling software packages. Pacman prioritizes servers in the `mirrorlist` based on their order, allowing users to add their preferred mirrors to the top of the `/etc/pacman.d/mirrorlist` file while commenting out others. For more detailed information on using Arch Linux software repository mirrors, please refer to the [official documentation](https://wiki.archlinux.org/title/Mirrors) .
12 |
13 | ## Replacing Arch Linux Software Sources
14 |
15 | :::caution
16 | **To avoid problems when replacing software source configuration files, please make a backup of the system's default software source configuration files before proceeding.**
17 | :::
18 | 1. Edit `/etc/pacman.d/mirrorlist` and add the following line to the top of the file:
19 |
20 | ```bash varcode
21 | Server = ${_http}://${_domain}/archlinux/$repo/os/$arch
22 | ```
23 |
24 |
25 | 1. Update the package cache:
26 |
27 | ```bash varcode
28 | [ ] (root) Are you the root user?
29 | ---
30 | const SUDO = !root ? 'sudo ' : '';
31 | ---
32 | ${SUDO}pacman -Syyu
33 | ```
34 |
35 | The `yy` in the command helps prevent issues when switching from **broken** mirrors to **healthy** mirrors.
36 |
37 | If you want to switch from a newer mirror to an older mirror, you can execute the following command to downgrade some packages and avoid partial updates to the system:
38 |
39 | ```bash varcode
40 | [ ] (root) Are you the root user?
41 | ---
42 | const SUDO = !root ? 'sudo ' : '';
43 | ---
44 | ${SUDO}pacman -Syyuu
45 | ```
46 |
47 |
48 | ## References
49 |
50 | [^1] [ZMirror](https://mirrors.cernet.edu.cn/about)
51 | [^2] [Help Repository](https://github.com/mirrorz-org/mirrorz-help)
52 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "hust-mirror",
3 | "version": "0.0.0",
4 | "private": true,
5 | "scripts": {
6 | "build-preview": "wget https://mirrors.hust.edu.cn/status.json -P ./static/ && wget https://mirrors.hust.edu.cn/releases.json -P ./static/ && docusaurus build",
7 | "docusaurus": "docusaurus",
8 | "start": "docusaurus start",
9 | "build": "docusaurus build",
10 | "swizzle": "docusaurus swizzle",
11 | "deploy": "docusaurus deploy",
12 | "clear": "docusaurus clear",
13 | "serve": "docusaurus serve",
14 | "write-translations": "docusaurus write-translations",
15 | "write-heading-ids": "docusaurus write-heading-ids",
16 | "typecheck": "tsc",
17 | "gen-mirrorz": "node scripts/mirrorz.js generate",
18 | "update-mirrorz": "node scripts/mirrorz.js update"
19 | },
20 | "dependencies": {
21 | "@docusaurus/core": "^3.8.1",
22 | "@docusaurus/preset-classic": "^3.8.1",
23 | "@docusaurus/types": "^3.8.1",
24 | "@mdx-js/react": "^3.0.1",
25 | "@types/react": "^18.2.8",
26 | "clsx": "^1.2.1",
27 | "copy-to-clipboard": "^3.3.3",
28 | "js-yaml": "^4.1.0",
29 | "mdast-util-from-markdown": "^2.0.2",
30 | "mdast-util-mdx": "^3.0.0",
31 | "micromark-extension-mdxjs": "^3.0.0",
32 | "nanoid": "^3.3.8",
33 | "prism-react-renderer": "^1.3.5",
34 | "react": "^18.3.1",
35 | "react-dom": "^18.3.1",
36 | "react-select": "^5.7.3",
37 | "timeago.js": "^4.0.2",
38 | "uglify-js": "^3.17.4",
39 | "unified": "^10.1.2",
40 | "unist-util-modify-children": "^2.0.0",
41 | "unist-util-visit-parents": "^6.0.1"
42 | },
43 | "devDependencies": {
44 | "@docusaurus/module-type-aliases": "^3.5.2",
45 | "@tsconfig/docusaurus": "^2.0.3",
46 | "@types/jsdom": "^21.1.7",
47 | "acorn": "^8.11.3",
48 | "acorn-jsx": "^5.3.2",
49 | "jsdom": "^24.1.1",
50 | "typescript": "^4.7.4"
51 | },
52 | "browserslist": {
53 | "production": [
54 | ">0.5%",
55 | "not dead",
56 | "not op_mini all"
57 | ],
58 | "development": [
59 | "last 1 chrome version",
60 | "last 1 firefox version",
61 | "last 1 safari version"
62 | ]
63 | },
64 | "engines": {
65 | "node": ">=16.14"
66 | },
67 | "resolutions": {
68 | "webpack-dev-server": "^5.2.1"
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/docs/golang.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Golang 安装文件使用帮助
3 | sidebar_label: Golang
4 | ---
5 |
6 | ## Golang 简介
7 | Golang 是一个开源项目,旨在提高程序员的工作效率。
8 |
9 | Go 富有表现力、简洁、干净且高效。它的并发机制使编写能够充分利用多核和联网机器的程序变得容易,
10 | 而其新颖的类型系统可以实现灵活和模块化的程序构建。
11 |
12 | Go 可以快速编译为机器代码,同时还具有垃圾收集的便利性和运行时反射的强大功能。
13 | 它是一种快速、静态类型的编译语言,感觉就像一种动态类型的解释语言。
14 |
15 | ## Golang 安装
16 |
17 | :::info
18 | 镜像站提供 Golang 在 Linux/Windows/Mac/FreeBSD 四个平台上的安装包,请根据自己使用的系统下载对应系统的安装包。
19 | :::
20 |
21 | ### Linux/FreeBSD 安装
22 | 1. 首先在[下载页面](/release/?release=Golang)下载对应系统和架构的安装包,或使用如下命令下载:
23 | ```shell varcode
24 | # use wget
25 | wget ${_http}://${_domain}/golang/
.linux-.tar.gz
26 | # use curl
27 | curl -O ${_http}://${_domain}/golang/go.linux-.tar.gz
28 | ```
29 |
30 | 2. 下载完成后,如果之前安装过 Golang,则需要执行以下命令移除:
31 | ```shell varcode
32 | [ ] (root) 是否为 root 用户
33 | ---
34 | const SUDO = !root ? 'sudo ' : '';
35 | ---
36 | ${SUDO}rm -rf /usr/local/go
37 | ```
38 |
39 | 3. 移除之后,执行如下命令将二进制文件解压到系统路径中:
40 | ```shell varcode
41 | [ ] (root) 是否为 root 用户
42 | ---
43 | const SUDO = !root ? 'sudo ' : '';
44 | ---
45 | ${SUDO}tar -C /usr/local -xzf go.linux-.tar.gz
46 | ```
47 |
48 | 4. 将 Golang 可执行文件所在路径添加到环境变量 `PATH` 中:
49 | ```shell varcode
50 | # 仅对当前终端有效
51 | export PATH=$PATH:/usr/local/go/bin
52 | # 长期生效
53 | echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.zshrc # 如果使用 zsh
54 | echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc # 如果使用 bash
55 | ```
56 |
57 | 5. 验证安装,打开一个新的终端,输入:
58 | ```shell
59 | go version
60 | ```
61 |
62 | 打印出下载的 Golang 版本则代表 Golang 安装成功。
63 |
64 | ### Windows 安装
65 | 1. 首先在[下载页面](/release/?release=Golang)下载对应系统和架构的安装包,建议下载 MSI 包。
66 |
67 | 2. 打开下载的 MSI 文件并按照提示安装 Golang。
68 |
69 | :::caution
70 | 安装完成后,如果有开启的终端或命令提示符,需要重新打开才能使用 `go` 命令。
71 | :::
72 |
73 | 3. 验证安装,打开终端或命令行提示符,输入:
74 | ```shell
75 | go version
76 | ```
77 |
78 | 打印出下载的 Golang 版本则代表 Golang 安装成功。
79 |
80 | ### Mac 安装
81 | 1. 首先在[下载页面](/release/?release=Golang)下载对应系统和架构的安装包,建议下载 pkg 包。
82 |
83 | 2. 打开下载的 pkg 文件并安装提示安装 Golang,安装包将会将 Golang 安装到 `usr/local/go` 目录,并将该目录加入环境变量 `PATH` 中。
84 |
85 | 3. 验证安装,打开终端或命令行提示符,输入:
86 | ```shell
87 | go version
88 | ```
89 | 打印出下载的 Golang 版本则代表 Golang 安装成功。
90 |
91 | ## 引用
92 | 1. [Golang 官方文档](https://go.dev/doc/install)
93 |
--------------------------------------------------------------------------------
/docs/CPAN.md:
--------------------------------------------------------------------------------
1 | ---
2 | sidebar_label: CPAN
3 | title: Perl语言软件包仓库使用帮助
4 | type: repo
5 | ---
6 |
7 | [CPAN](https://www.cpan.org/) (The Comprehensive Perl Archive Network) 镜像源的配置文件为 `MyConfig.pm`(一般位于 `~/.cpan/CPAN/MyConfig.pm`),可使用包管理脚本 `cpan` 进行修改。
8 |
9 | ## 初次使用
10 |
11 | 对于 Perl 5.36(或 CPAN 2.29)及以上,使用如下命令自动生成 MyConfig.pm
12 | ```bash varcode
13 | PERL_MM_USE_DEFAULT=1 perl -MCPAN -e 'CPAN::HandleConfig->edit("pushy_https", 0); CPAN::HandleConfig->edit("urllist", "unshift", "${_http}://${_domain}/CPAN/"); mkmyconfig'
14 | ```
15 |
16 | 对于较久版本,使用如下命令自动生成
17 | ```bash varcode
18 | PERL_MM_USE_DEFAULT=1 perl -MCPAN -e 'CPAN::HandleConfig->edit("urllist", "unshift", "${_http}://${_domain}/CPAN/"); mkmyconfig'
19 | ```
20 |
21 | 或不使用默认配置,手动确认各个配置选项
22 | ```bash varcode
23 | perl -MCPAN -e 'mkmyconfig'
24 | ```
25 |
26 | ## 已有配置
27 |
28 | ### 在 CPAN Shell 中手动设置镜像
29 |
30 | 在命令行中执行 `cpan` 进入 cpan shell:
31 |
32 | ```shell varcode
33 | cpan shell -- CPAN exploration and modules installation
34 | Enter 'h' for help.
35 |
36 | # 列出当前的镜像设置
37 | cpan[1]> o conf urllist
38 |
39 | # 将本站镜像加入镜像列表首位
40 | # 注:若已在列表中则可跳过本步直接退出,修改列表不会执行自动去重
41 | cpan[2]> o conf urllist unshift ${_http}://${_domain}/CPAN/
42 |
43 | # 或将本站镜像加入镜像列表末尾
44 | # 注:本命令和上面的命令执行一个即可,修改列表不会执行自动去重
45 | cpan[3]> o conf urllist push ${_http}://${_domain}/CPAN/
46 |
47 | # 或清空镜像列表,仅保留本站
48 | cpan[4]> o conf urllist ${_http}://${_domain}/CPAN/
49 |
50 | # Perl 5.36 及以上用户需要关闭 pushy_https 以使用镜像站
51 | cpan[5]> o conf pushy_https 0
52 |
53 | # 保存修改后的配置至 MyConfig.pm
54 | cpan[6]> o conf commit
55 |
56 | # 退出 cpan shell
57 | cpan[7]> quit
58 | ```
59 |
60 | ### 在命令行中使用脚本设置
61 |
62 | 在命令行中执行:
63 |
64 | ```bash varcode
65 | # 若本站不在镜像列表中则将其加入列表首位
66 | if ! (
67 | perl -MCPAN -e 'CPAN::HandleConfig->load();' \\
68 | -e 'CPAN::HandleConfig->prettyprint("urllist")' |
69 | grep -qF '${_http}://${_domain}/CPAN/'
70 | ); then
71 | perl -MCPAN -e 'CPAN::HandleConfig->load();' \\
72 | -e 'CPAN::HandleConfig->edit("urllist", "unshift", "${_http}://${_domain}/CPAN/");' \\
73 | -e 'CPAN::HandleConfig->commit()'
74 | fi
75 |
76 | # Perl 5.36 及以上用户还需要关闭 pushy_https
77 | perl -MCPAN -e 'CPAN::HandleConfig->load();' \\
78 | -e 'CPAN::HandleConfig->edit("pushy_https", 0);' \\
79 | -e 'CPAN::HandleConfig->commit()'
80 | ```
81 |
82 |
83 | ## 引用
84 | 1. [Tuna 镜像源使用帮助](https://mirrors.tuna.tsinghua.edu.cn/help/CPAN/)
85 |
--------------------------------------------------------------------------------
/i18n/en/docusaurus-plugin-content-docs/current/buildroot.md:
--------------------------------------------------------------------------------
1 | ---
2 | sidebar_label: Buildroot
3 | title: Buildroot Warehouse Image Usage Help
4 | ---
5 |
6 | ## Buildroot Introduction
7 |
8 | Buildroot is a framework for creating embedded Linux systems. It is written using the KBuild framework, consisting of Makefiles and KConfig files, and allows one to conveniently modify configurations using menuconfig, similar to compiling the kernel, to create Linux root filesystems and cross-compilation toolchains for embedded devices of various architectures.
9 |
10 | ## Buildroot Download
11 |
12 | If the official site is slow to connect, go directly to the [download page] of this mirror site.(/release?release=Buildroot).
13 | Select buildroot and choose the required version to download.
14 |
15 | Then use the tar tool locally to extract it.
16 |
17 | ## Buildroot Change source
18 |
19 | Buildroot needs to use sources such as kernel, GNU, CPAN, etc. during the build process.
20 |
21 | Other source packages will be downloaded from the upstream repository or its backup server [http://sources.buildroot.net/](http://sources.buildroot.net/)
22 |
23 | This mirror site has mirrored GNU, CPAN, and the kernel, and you can modify these source addresses in the Buildroot configuration file.
24 |
25 | ### Method 1: Manual Modification
26 |
27 | First, back up your config file and manually modify the configuration information. (You can use menuconfig, nconfig, or even directly edit the file to make changes)
28 |
29 | ```raw varcode
30 | BR2_KERNEL_MIRROR="${_http}://${_domain}/kernel.org"
31 | BR2_GNU_MIRROR="${_http}://${_domain}/gnu"
32 | BR2_CPAN_MIRROR="${_http}://${_domain}/CPAN"
33 | ```
34 |
35 | ### Method 2: Use a script to replace
36 |
37 | :::info
38 | Before using the script to replace, make sure that the `.config` file already exists. You can use `make defconfig` to generate the default configuration file.
39 | :::
40 |
41 | Run the following replacement script in the buildroot root directory (the directory that contains the `.config` file):
42 |
43 | ```bash varcode
44 | sed -i.old \\
45 | -e '/BR2_KERNEL_MIRROR/c\\BR2_KERNEL_MIRROR="${_http}://${_domain}/kernel.org"' \\
46 | -e '/BR2_GNU_MIRROR/c\\BR2_GNU_MIRROR="${_http}://${_domain}/gnu"' \\
47 | -e '/BR2_CPAN_MIRROR/c\\BR2_CPAN_MIRROR="${_http}://${_domain}/CPAN"' \\
48 | .config
49 |
50 | ```
51 |
52 | Then run `make` to start the build.
53 |
--------------------------------------------------------------------------------
/i18n/en/docusaurus-plugin-content-docs/current/alpine.md:
--------------------------------------------------------------------------------
1 | ---
2 | sidebar_label: Alpine Linux
3 | title: Alpine Linux Software Repository Image Usage Help
4 | cname: AplineLinux
5 | ---
6 | ## Alpine Linux Profile and Software Manage
7 | Alpine Linux is a independent, non-commercial, general-purpose Linux distribution that based on musl libc and BusyBox, designed to provide a small, simple, safe and efficient basic system. The design concept of Alpine Linux is "Keep It Simple", and due to its lightweight and efficient characteristics, it is so popular in container environments such as Docker and Kubernetes.
8 |
9 | The package management system of Alpine Linux is apk(Alpine Package Keeper). apk is a package management tool for Alpine Linux, which can be used to install new software packages, upgrade or delete existing software packages, update the software package index and so on.
10 |
11 | ## Alpine Linux Software Source Replacement
12 |
13 | :::caution
14 | **To avoid problems when replacing software source configuration files, please make a backup of the system's default software source configuration files before proceeding.**
15 | :::
16 |
17 | 1. Edit `/etc/apk/repositories`, and replace the original content with the following
18 |
19 | ```bash varcode
20 | [ ] (version) { v3.16:v3.16, v3.17:v3.17, v3.18:v3.18, v3.19:v3.19 } Alpine edition
21 | ---
22 | ---
23 | ${_http}://${_domain}/alpine/${version}/main
24 | ${_http}://${_domain}/alpine/${version}/community
25 | ```
26 |
27 | 2. Update the software package cache
28 |
29 | ```shell varcode
30 | [ ] (root) Are you the root user?
31 | ---
32 | const SUDO = !root ? 'sudo ' : '';
33 | ---
34 | ${SUDO}apk update
35 | ```
36 |
37 | ## One-click Source Replacement
38 |
39 | :::caution
40 | This way only apply to change from the official source to this site source. If you have already changed the source, please don't use the following orders.
41 | :::
42 |
43 | Use the `sed` command to directly replace the default source address [http://dl-cdn.alpinelinux.org](http://dl-cdn.alpinelinux.org) in the software source configuration file with the current mirror source site:
44 |
45 | ```shell varcode
46 | [ ] (root) whether the root user or not
47 | ---
48 | const SUDO = !root ? 'sudo ' : '';
49 | ---
50 | ${SUDO}sed -i 's/dl-cdn.alpinelinux.org/${_domain}/g' /etc/apk/repositories
51 | ```
52 |
53 | ## Quote
54 | 1. [Tuna Mirror Source Usage Guide](https://mirrors.tuna.tsinghua.edu.cn/help/alpine/)
--------------------------------------------------------------------------------
/src/components/CodeBlockWithVariables/index.tsx:
--------------------------------------------------------------------------------
1 | import React, { useContext, useMemo, useState } from 'react'
2 | import CodeBlock from '@theme/CodeBlock'
3 | import { Props as CBProps } from '@theme/CodeBlock'
4 | import { SelectItem } from '../Select';
5 | import Select from '../Select';
6 | import Switch from '../Switch';
7 | import SharedContext from '@site/src/utils/SharedContext';
8 | import styles from './index.module.css'
9 |
10 |
11 | type DefaultValue = boolean | string | number;
12 |
13 | type OptionType = 'switch' | 'select';
14 |
15 | type Option = {
16 | key: string,
17 | label: string,
18 | type: OptionType,
19 | items?: SelectItem[],
20 | default?: DefaultValue
21 | }
22 |
23 | type Variables = {
24 | [key: string]: any
25 | }
26 |
27 | type Props = {
28 | code: (vars: Variables) => string,
29 | options: Option[],
30 | blockProps?: CBProps
31 | }
32 |
33 | export default function CodeBlockWithVariables({ code, options, blockProps }: Props) {
34 | const states: {
35 | [key: string]: [any, React.Dispatch]
36 | } = {};
37 |
38 | for (const option of options) {
39 | let def: DefaultValue = "";
40 | if (option.default)
41 | def = option.default;
42 | else if (option.type == 'switch')
43 | def = false;
44 | else if (option.type == 'select') {
45 | def = option.items?.[0].value;
46 | }
47 | states[option.key] = useState(def);
48 | }
49 |
50 | const vars: Variables = {};
51 |
52 | const ctx = useContext(SharedContext);
53 |
54 | for (const key in states) {
55 | if (states.hasOwnProperty(key)) {
56 | const element = states[key][0];
57 | vars[key] = element;
58 | }
59 | }
60 |
61 | vars['_http'] = ctx.https ? "https" : "http";
62 | vars['_domain'] = ctx.domain;
63 |
64 | return (
65 |
66 | {options && !!options.length &&
67 | {
68 | options.map(u => {
69 | if (u.type == 'switch')
70 | return
71 | else if (u.type == 'select')
72 | return
73 | })
74 | }
75 |
}
76 |
77 |
78 | {code(vars)}
79 |
80 |
81 | )
82 |
83 | }
84 |
--------------------------------------------------------------------------------
/docs/rustup.md:
--------------------------------------------------------------------------------
1 | ---
2 | sidebar_label: Rustup
3 | title: Rustup工具链安装器使用帮助
4 | ---
5 |
6 | :::warning 注意事项
7 | 镜像站只保留最新的 stable,beta 和 nightly,如果需要使用 rustup 安装旧版工具链,请使用官方源。
8 | :::
9 |
10 | ## Windows 用户
11 |
12 | ### 初次安装 Rust 工具链
13 |
14 | 要使用 Rust(MSVC)之前,可能需要安装 MSVC 编译工具链(Microsoft C++ 生成工具)。
15 |
16 | 使用 powershell 运行下面的脚本。(下载 exe 过程中,Windows 反恶意软件服务会进行文件扫描,可能需要等待大约半分钟。)
17 |
18 | ```powershell varcode
19 | [] (abi) { msvc: MSVC, gnu: GNU } 选择后端
20 | [] (arch) { x86_64: x64, i386: x86 } 选择架构
21 | ---
22 | let name = arch == 'i386' ? 'i686-pc-windows-': 'x86_64-pc-windows-';
23 | name += abi;
24 | ---
25 | Invoke-WebRequest -OutFile \${env:TEMP}/rustup-init.exe ${_http}://${_domain}/rustup/rustup/dist/${name}/rustup-init.exe
26 | \$env:RUSTUP_DIST_SERVER = "${_http}://${_domain}/rustup"
27 | \$env:RUSTUP_UPDATE_ROOT = "${_http}://${_domain}/rustup/rustup"
28 | & "\${env:TEMP}\\rustup-init.exe"
29 |
30 | ```
31 |
32 | :::info 关于Windows上的Rust编译器后端
33 | 如果你不知道如何选择,请使用 MSVC 版本。
34 | :::
35 |
36 | :::caution
37 | 上面的安装脚本仅在安装时启用镜像源,下次更新又会恢复官方源,如果你需要长期启用镜像源,
38 | 请参考下一小节的内容。
39 | :::
40 |
41 | ### 长期启用 rustup 工具链的镜像源
42 |
43 | export function VarValue(props) {
44 | const appendix = props.appendix || "";
45 | return
46 | {`${http}://${domain}/rustup${appendix}`}} />
47 | }
48 |
49 | **方法一:**在 “系统-高级系统设置-环境变量” 中增加环境变量。
50 |
51 | - 变量名为 `RUSTUP_DIST_SERVER`,值为。
52 | - 变量名为 `RUSTUP_UPDATE_ROOT`,值为。
53 |
54 | **方法二(推荐):**直接执行下面的 Powershell 脚本:
55 |
56 | ```powershell varcode
57 | [System.Environment]::SetEnvironmentVariable("RUSTUP_DIST_SERVER", "${_http}://${_domain}/rustup", "User")
58 | [System.Environment]::SetEnvironmentVariable("RUSTUP_UPDATE_ROOT", "${_http}://${_domain}/rustup/rustup", "User")
59 | ```
60 |
61 |
62 | ## *nix 用户
63 |
64 | ### 初次安装 Rust 工具链
65 |
66 | 考虑到官方网站提供的 [https://sh.rustup.rs](https://sh.rustup.rs) 脚本网络环境可能不稳定,我们已经镜像了该脚本。
67 |
68 | 直接执行下面的命令即可完成 rust 工具链的安装。
69 |
70 | ```bash varcode
71 | [x] (shMirror) 使用安装脚本镜像
72 | ---
73 | const shellUrl = shMirror ? `${_http}://${_domain}/rustup/rustup.sh` : "https://sh.rustup.rs";
74 | ---
75 | RUSTUP_DIST_SERVER="${_http}://${_domain}/rustup" \\
76 | RUSTUP_UPDATE_ROOT="${_http}://${_domain}/rustup/rustup" \\
77 | curl -sSf ${shellUrl} | sh
78 | ```
79 |
80 | ### 长期使用
81 |
82 | 将下面的内容添加到你的 `.bashrc`,`.zshrc` 或者其他 profile 文件中。
83 | ```bash varcode
84 | export RUSTUP_DIST_SERVER="${_http}://${_domain}/rustup"
85 | export RUSTUP_UPDATE_ROOT="${_http}://${_domain}/rustup/rustup"
86 | ```
87 |
--------------------------------------------------------------------------------
/.github/workflows/lint.yaml:
--------------------------------------------------------------------------------
1 | name: Lint
2 |
3 | on:
4 | pull_request:
5 | paths:
6 | - '**/*.md'
7 |
8 | jobs:
9 | markdownlint:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - name: Checkout code
13 | uses: actions/checkout@v5
14 | with:
15 | fetch-depth: 0
16 |
17 | - name: Get changed files
18 | id: changed-files
19 | uses: tj-actions/changed-files@v45
20 | with:
21 | files: '**/*.md'
22 |
23 | - name: Lint Markdown files
24 | uses: DavidAnson/markdownlint-cli2-action@v20
25 | if: steps.changed-files.outputs.any_changed == 'true'
26 | with:
27 | globs: ${{ steps.changed-files.outputs.all_changed_files }}
28 | separator: ","
29 |
30 | zhlint:
31 | runs-on: ubuntu-latest
32 | steps:
33 | - name: Checkout code
34 | uses: actions/checkout@v4
35 |
36 | - name: Install zhlint
37 | run: yarn global add zhlint
38 |
39 | - name: Get changed files
40 | id: changed-files
41 | uses: tj-actions/changed-files@v45
42 | with:
43 | files: '**/*.md'
44 |
45 | - name: Lint Markdown files
46 | env:
47 | ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
48 | run: |
49 | mkdir -p linted_output
50 | file_list="linted_output/file_list.txt"
51 | linted_failed=0
52 | for file in ${{ env.ALL_CHANGED_FILES }}; do
53 | set +e
54 | zhlint --config "$GITHUB_WORKSPACE"/ci/.zhlintrc "$file"
55 | if [ $? -ne 0 ]; then
56 | linted_failed=1
57 | echo "$file" >> "$file_list"
58 | output_file="linted_output/report_and_suggested_fixes/$file"
59 | mkdir -p "$(dirname "$output_file")"
60 | zhlint --config "$GITHUB_WORKSPACE"/ci/.zhlintrc "$file" --output="$output_file" > "$output_file.log" 2>&1
61 | fi
62 | set -e
63 | done
64 | echo "linted_failed=$linted_failed" >> "$GITHUB_ENV"
65 |
66 | - name: Upload Linted Markdown
67 | uses: actions/upload-artifact@v4
68 | with:
69 | name: linted-markdown
70 | path: linted_output/
71 |
72 | - name: Check lint errors
73 | run: |
74 | set -e
75 | if [ "${{ env.linted_failed }}" -ne 0 ]; then
76 | echo "Linting errors found. Please check the reports and suggested fixes in uploaded artifact."
77 | cat "$output_file"
78 | exit 1
79 | fi
80 |
--------------------------------------------------------------------------------
/src/theme/DocItem/Layout/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import clsx from 'clsx';
3 | import {useWindowSize} from '@docusaurus/theme-common';
4 | import {useDoc} from '@docusaurus/plugin-content-docs/client';
5 | import DocItemPaginator from '@theme/DocItem/Paginator';
6 | import DocVersionBanner from '@theme/DocVersionBanner';
7 | import DocVersionBadge from '@theme/DocVersionBadge';
8 | import DocItemFooter from '@theme/DocItem/Footer';
9 | import DocItemTOCMobile from '@theme/DocItem/TOC/Mobile';
10 | import DocItemTOCDesktop from '@theme/DocItem/TOC/Desktop';
11 | import DocItemContent from '@theme/DocItem/Content';
12 | import DocBreadcrumbs from '@theme/DocBreadcrumbs';
13 | import ContentVisibility from '@theme/ContentVisibility';
14 | import type {Props} from '@theme/DocItem/Layout';
15 |
16 | import styles from './styles.module.css';
17 | import GlobalOptions from '@site/src/components/DocGlobalOptions';
18 |
19 | /**
20 | * Decide if the toc should be rendered, on mobile or desktop viewports
21 | */
22 | function useDocTOC() {
23 | const {frontMatter, toc} = useDoc();
24 | const windowSize = useWindowSize();
25 |
26 | const hidden = frontMatter.hide_table_of_contents;
27 | const canRender = !hidden && toc.length > 0;
28 |
29 | const mobile = canRender ? : undefined;
30 |
31 | const desktop =
32 | canRender && (windowSize === 'desktop' || windowSize === 'ssr') ? (
33 |
34 | ) : undefined;
35 |
36 | return {
37 | hidden,
38 | mobile,
39 | desktop,
40 | };
41 | }
42 |
43 | export default function DocItemLayout({children}: Props): JSX.Element {
44 | const docTOC = useDocTOC();
45 | const {metadata} = useDoc();
46 | const windowSize = useWindowSize();
47 | return (
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | {docTOC.mobile}
57 | {windowSize == 'mobile' && }
58 | {children}
59 |
60 |
61 |
62 |
63 |
64 | {docTOC.desktop &&
65 |
66 | {docTOC.desktop}
67 |
}
68 |
69 | );
70 | }
71 |
--------------------------------------------------------------------------------
/docs/msys2.md:
--------------------------------------------------------------------------------
1 | ---
2 | sidebar_label: MSYS2
3 | title: MSYS2 软件仓库镜像使用帮助
4 | cname: 'MSYS2'
5 | ---
6 |
7 | ## MSYS2 简介与使用场景
8 |
9 | MSYS2 是一个用于 Windows 的软件发行版,提供了一个类似于 Unix 的环境。它基于现代的 Cygwin 和 MinGW-w64 项目,旨在为开发人员提供一个强大的构建和开发平台。MSYS2 使用 `pacman` 包管理器(与 Arch Linux 相同),可以方便地安装、更新和管理软件包。它提供了与 Unix 系统类似的环境,使得在 Windows 上进行跨平台开发变得更加容易。MSYS2 包含了大量的预编译软件包,包括编译器、库和工具等。
10 |
11 | ## 收录架构
12 |
13 | - MinGW: i686, x86_64, ucrt64, clang64
14 | - MSYS: i686, x86_64
15 |
16 | ## MSYS2 的下载与安装
17 |
18 | 请访问镜像目录下的 distrib/ 目录:
19 |
20 | ### x86_64
21 |
22 |
23 |
24 |
25 |
26 | ### i686
27 |
28 |
29 |
30 |
31 |
32 |
33 | ### 使用细节
34 |
35 | 找到名为 `msys2-<架构>-<日期>.exe` 的文件(如 `msys2-x86_64-20141113.exe`),下载安装即可。
36 |
37 | ## MSYS2 内的 pacman 配置
38 |
39 | :::caution
40 | **为避免软件源配置文件替换后产生问题,请先将系统自带的软件源配置文件进行备份,然后进行下列操作。**
41 | :::
42 |
43 | ## 手动换源
44 |
45 | 1. **编辑 `/etc/pacman.d/mirrorlist.mingw32` 文件**:
46 | 在文件开头添加以下内容:
47 |
48 | ```bash varcode
49 | Server = ${_http}://${_domain}/msys2/mingw/i686
50 | ```
51 |
52 | 2. **编辑 `/etc/pacman.d/mirrorlist.mingw64` 文件**:
53 | 在文件开头添加以下内容:
54 |
55 | ```bash varcode
56 | Server = ${_http}://${_domain}/msys2/mingw/x86_64
57 | ```
58 |
59 | 3. **编辑 `/etc/pacman.d/mirrorlist.msys` 文件**:
60 | 在文件开头添加以下内容:
61 |
62 | ```bash varcode
63 | Server = ${_http}://${_domain}/msys2/msys/$arch
64 | ```
65 |
66 | 4. **编辑 `/etc/pacman.d/mirrorlist.ucrt64` 文件**:
67 | 在文件开头添加以下内容:
68 |
69 | ```bash varcode
70 | Server = ${_http}://${_domain}/msys2/mingw/ucrt64
71 | ```
72 |
73 | 5. **刷新软件包数据库**:
74 |
75 | ```shell varcode
76 | [ ] (root) 是否为 root 用户
77 | ---
78 | const SUDO = !root ? 'sudo ' : '';
79 | ---
80 | ${SUDO}pacman -Sy
81 | ```
82 |
83 | 通过这些步骤,你可以将 MSYS2 的镜像源更改为华中科技大学的镜像站,从而加速软件包的下载和更新。
84 |
85 | ## 一键换源
86 |
87 | :::caution
88 | 本方法仅适用于从官方源更换到本站源,如果您已经换过了源,请勿使用下列命令。
89 | :::
90 |
91 | 你可以使用以下命令一键更换 MSYS2 的镜像源为华中科技大学的镜像站:
92 |
93 | ```shell varcode
94 | [ ] (root) 是否为 root 用户
95 | ---
96 | const SUDO = !root ? 'sudo ' : '';
97 | ---
98 | ${SUDO}sed -i "s#https\\?://mirror.msys2.org/#${_http}://${_domain}/msys2/#g" /etc/pacman.d/mirrorlist*
99 |
100 | ```
101 |
102 | ## 引用
103 |
104 | 1. [MSYS2 镜像站使用帮助 | 阿里云开源镜像站](https://developer.aliyun.com/mirror/msys2)
105 | 2. [MSYS2 镜像站使用帮助 | 清华大学开源软件镜像站](https://mirrors.tuna.tsinghua.edu.cn/help/msys2/)
106 |
--------------------------------------------------------------------------------
/i18n/en/docusaurus-plugin-content-blog/2024/02-08-mirrorz.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Integration of MirrorZ Documentation
3 | authors: chengzi
4 | ---
5 |
6 | Currently, our mirror site is lacking some documentation. In addition, as we synchronize more mirror sources in the future and these mirror sources are constantly updated, we will have to spend a great deal of time maintaining the documentation.
7 | We hope to integrate the documentation of some less popular mirror sources on our site with that of MirrorZ, so as to provide better services for our users.
8 | After the integration, we expect to utilize the more frequently updated and newer documentation of MirrorZ to help users make better use of our mirror site.
9 |
10 |
11 |
12 | ## Integration Methods
13 |
14 | According to the Readme of MirrorZ, we can integrate MirrorZ's documentation in the following ways:
15 |
16 | - link in the mirror frontend e.g., ISCAS, SJTUG and SDU
17 | - link in the mirror help e.g., NWAFU
18 | - Fork/Rebase and Transpile mdx to local markdown e.g., TUNA/BFSU
19 | - Self-host e.g., xtom.help
20 | - Reverse proxy e.g., NJU
21 |
22 | We have taken the following points into consideration:
23 | 1. We hope that when users browse our mirror site, they can directly access the documentation of MirrorZ without having to jump to other sites.
24 | 2. We hope that when users read the documentation of MirrorZ, they can have an experience similar to that of the documentation we maintain.
25 | 3. We hope to make some customized modifications to the documentation of MirrorZ, such as modifying the addresses of hyperlinks to adapt to our site.
26 | Based on the above requirements, we have decided to integrate the documentation of MirrorZ using the third method
27 |
28 | ## Scheme
29 |
30 | The script we write will follow these steps to integrate the documentation of MirrorZ:
31 |
32 | 1. Download the documentation of MirrorZ.
33 | 2. Convert the documentation of MirrorZ to the format of our site.
34 | 3. Replace the addresses of hyperlinks.
35 | 4. Replace the metadata in the front matter part of markdown.
36 | 5. Add a source tip and the original link.
37 |
38 | In addition, we also need to write an update script to assist in the synchronization with the upstream documentation later.
39 |
40 | ## Implementation
41 |
42 | We have implemented two scripts, one for downloading and generating the documentation of MirrorZ, and the other for updating the documentation of MirrorZ. The specific implementation can be referred to the scripts directory in the site directory. The usage can be referred to the Readme.
43 | In the future, we will consider using tools similar to Github Actions to automate the update process, so that the documentation can be updated regularly and kept in sync with the upstream.
44 |
--------------------------------------------------------------------------------
/plugin/cgit.js:
--------------------------------------------------------------------------------
1 | // @ts-check
2 | const fs = require('fs/promises')
3 | const { JSDOM } = require('jsdom');
4 | var crypto = require('crypto');
5 | var uglify = require("uglify-js");
6 |
7 | function getFileName(scriptStr, ext = ".js") {
8 | var hash = crypto.createHash('md5').update(scriptStr).digest('hex').substring(0, 8);
9 | return "cgit." + hash + ext;
10 | }
11 |
12 | /** @type {import('@docusaurus/types').Plugin} */
13 | const fancyindexPlugin = {
14 | name: 'cgit-processor',
15 | postBuild: async (props) => {
16 | const dir = props.outDir + '/cgit';
17 | const inputFile = dir + '/index.html';
18 |
19 | const srcDir = `${props.siteDir}/src/pages/cgit`;
20 | const srcClientJsFile = `${srcDir}/_client.js`;
21 | const srcHeadHtmlFile = `${srcDir}/_head.html`;
22 | const srcCgitCssFile = `${srcDir}/_cgit.css`;
23 |
24 | const outputHeadFile = dir + '/head.html';
25 | const outputHeaderFile = dir + '/header.html';
26 | const outputFooterFile = dir + '/footer.html';
27 |
28 | let outputHead = "", outputHeader = "", outputFooter = "";
29 |
30 |
31 | const dom = await JSDOM.fromFile(inputFile);
32 | const document = dom.window.document;
33 |
34 | outputHead += await fs.readFile(srcHeadHtmlFile, 'utf-8');
35 |
36 | // get link to stylesheet in head
37 | document.head.querySelectorAll('link[rel="stylesheet"]').forEach((el) => {
38 | outputHead += el.outerHTML;
39 | });
40 |
41 | const cssCode = await fs.readFile(srcCgitCssFile, 'utf-8');
42 | const cssFile = getFileName(cssCode, ".css");
43 | outputHead += ``;
44 |
45 | const nav = document.body.querySelector("nav");
46 | nav.querySelector(".navbar__item.dropdown.dropdown--hoverable.dropdown--right").remove();
47 | if (nav) {
48 | outputHeader += nav.outerHTML;
49 | }
50 |
51 | const footer = document.body.querySelector("footer");
52 | if (footer) {
53 | outputFooter += footer.outerHTML;
54 | }
55 |
56 | const jsCode = uglify.minify(await fs.readFile(srcClientJsFile, 'utf-8')).code;
57 | const jsFileName = getFileName(jsCode);
58 |
59 | const bodyScript = document.body.querySelector('script');
60 |
61 | if (bodyScript) {
62 | outputFooter += bodyScript.outerHTML;
63 | }
64 |
65 | outputFooter += ``;
66 |
67 | await fs.writeFile(`${dir}/${jsFileName}`, jsCode);
68 | await fs.writeFile(`${dir}/${cssFile}`, cssCode);
69 | await fs.writeFile(outputHeadFile, outputHead);
70 | await fs.writeFile(outputHeaderFile, outputHeader);
71 | await fs.writeFile(outputFooterFile, outputFooter);
72 | await fs.rm(inputFile);
73 | },
74 | }
75 |
76 | module.exports = () => fancyindexPlugin;
77 |
--------------------------------------------------------------------------------
/ci/gen-releases.py:
--------------------------------------------------------------------------------
1 | #!/bin/env python3
2 | # Usage: gen-releases.py ...
3 |
4 | from configparser import ConfigParser
5 | from glob import glob
6 | import re, sys, os, json
7 |
8 | config = ConfigParser()
9 |
10 | script_path = os.path.dirname(os.path.realpath(__file__))
11 | config.read(script_path + "/releases.conf", encoding="utf-8")
12 | mirror_dirs = sys.argv[1:-1]
13 | output_file = sys.argv[-1]
14 |
15 | result = []
16 |
17 |
18 | def get_compare_file_key(f: str):
19 | for mirror_dir in mirror_dirs:
20 | _f = os.path.join(mirror_dir, f)
21 | f = _f if os.path.exists(_f) else f
22 | if not os.path.exists(f):
23 | return 0
24 | return os.path.getmtime(f)
25 |
26 |
27 | for sec in config.sections():
28 | release_sec = config[sec]["name"] if "name" in config[sec] else sec
29 | exp = config[sec]["exp"]
30 | release_pos = int(config[sec]["release"]) if "release" in config[sec] else -1
31 | version_pos = int(config[sec]["version"]) if "version" in config[sec] else -1
32 | variant_pos = int(config[sec]["variant"]) if "variant" in config[sec] else -1
33 | take_count = int(config[sec]["take"]) if "take" in config[sec] else -1
34 | description = config[sec]["description"] if "description" in config[sec] else None
35 |
36 | print("Generating " + release_sec + " with " + exp, file=sys.stderr)
37 |
38 | # get all directories and files under mirror_dir
39 | # and filter out the ones that match the regex
40 | files = []
41 | for mirror_dir in mirror_dirs:
42 | files.extend(
43 | list(glob(config[sec]["path"], root_dir=mirror_dir, recursive=True))
44 | )
45 |
46 | if take_count != -1:
47 | # order files by date
48 | files.sort(key=get_compare_file_key, reverse=True)
49 |
50 | count = 0
51 | for file in files:
52 | release = release_sec
53 | version = ""
54 | variant = ""
55 | matches = re.match(exp, file)
56 | if matches:
57 | release = matches.group(release_pos) if release_pos != -1 else release_sec
58 | version = matches.group(version_pos) if version_pos != -1 else None
59 | variant = matches.group(variant_pos) if variant_pos != -1 else None
60 | d = {
61 | "release": release,
62 | "version": version,
63 | "variant": variant,
64 | "path": file,
65 | "description": description,
66 | }
67 | d = {k: v for k, v in d.items() if v is not None}
68 | result.append(d)
69 | count += 1
70 | if take_count != -1 and count >= take_count:
71 | break
72 |
73 | with open(output_file, "w") as f:
74 | f.write(json.dumps(result))
75 |
--------------------------------------------------------------------------------
/i18n/en/docusaurus-plugin-content-docs/current/ubuntukylin.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Ubuntu Kylin Mirror Usage Guide
3 | sidebar_label: UbuntuKylin
4 | ---
5 |
6 | ## About Ubuntu Kylin and Software Management
7 |
8 | Ubuntu Kylin is a Linux distribution based on Ubuntu, led by Kylin Software Co., Ltd., and is one of the official Ubuntu derivatives.
9 | It focuses on developing a "user-friendly, simple and easy-to-use" desktop environment, committed to providing a smarter user experience for global users.
10 |
11 | Ubuntu Kylin uses the `APT` package management tool to manage DEB packages.
12 | Its software sources consist of two parts:
13 | - One part is the Ubuntu software repository.
14 | - The other part is the Ubuntu Kylin software repository.
15 |
16 | ## Ubuntu Official Software Source Replacement
17 |
18 | :::info
19 | Apart from Ubuntu Kylin's software sources, Ubuntu Kylin shares the same software sources with Ubuntu. Please directly refer to the [Ubuntu documentation](./ubuntu).
20 |
21 | :::
22 |
23 | :::caution
24 | Note that Ubuntu Kylin may have pre-replaced Ubuntu sources with Alibaba Cloud during installation. Please do not refer to the "One-click Source Replacement" section in the Ubuntu documentation.
25 | :::
26 |
27 | Click [here](./ubuntu) to view the Ubuntu software source replacement method.
28 |
29 | ## Ubuntu Kylin Official Software Source Replacement
30 |
31 | :::caution
32 | **To avoid issues after replacing the software source configuration files, please back up the system's original software source configuration files before proceeding with the following operations.**
33 | :::
34 |
35 | 1. Adjust the following options according to your situation, and use the following software source configuration to replace the original content in `/etc/apt/sources.list.d/ukui.list` and
36 | `/etc/apt/sources.list.d/software.list`:
37 |
38 | ```bash varcode title=/etc/apt/sources.list.d/ukui.list
39 | [ ] (version) { jammy:22.04 LTS, groovy:20.10, focal:20.04 LTS } Ubuntu Kylin Version
40 | ---
41 | deb ${_http}://${_domain}/ubuntukylin/ ${version} main
42 | ```
43 |
44 | ```bash varcode title=/etc/apt/sources.list.d/software.list
45 | [ ] (version) { jammy:22.04 LTS, groovy:20.10, focal:20.04 LTS } Ubuntu Kylin Version
46 | ---
47 | deb ${_http}://${_domain}/ubuntukylin/ ${version}-partner main
48 | ```
49 |
50 | 2. Update software using the following command:
51 |
52 | ```shell varcode
53 | [ ] (root) Is root user?
54 | ---
55 | const SUDO = !root ? 'sudo ' : '';
56 | ---
57 | ${SUDO}apt update
58 | ```
59 |
60 | ## Image Download {#image}
61 |
62 | This mirror site synchronizes Ubuntu Kylin installation images.
63 |
64 | Please click the button below, then select the appropriate version to download and install.
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/docs/termux.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Termux 软件仓库镜像使用帮助
3 | sidebar_label: Termux
4 | cname: termux
5 | ---
6 |
7 |
8 | ## Termux 是什么
9 |
10 | Termux 是运行在 Android 上的 terminal。不需要 root,运行于内部存储(不在 SD 卡上)。
11 |
12 | 自带了一个包管理器,可以安装许多现代化的开发和系统维护工具。比如:
13 |
14 | * neovim
15 | * tmux
16 | * zsh
17 | * clang
18 | * gcc
19 | * weechat
20 | * irssi
21 | * ...
22 |
23 | ## 如何使用 Termux 镜像
24 |
25 |
26 | ### 图形界面(TUI)替换
27 |
28 | 在较新版的 Termux 中,官方提供了图形界面(TUI)来半自动替换镜像,推荐使用该种方式以规避其他风险。
29 | * 需要先把 termux-tools 更新到 1.42.1 版本。
30 | 在 Termux 中执行如下命令
31 |
32 | ```bash
33 | apt update && apt upgrade termux-tools
34 | termux-change-repo
35 | ```
36 |
37 | 在图形界面引导下,使用自带方向键可上下移动。
38 | 第一步使用空格选择 Single Mirror,之后在第二步选择 mirrors.hust.edu.cn 镜像源。确认无误后回车,镜像源会自动完成更换。
39 |
40 | ### 命令行替换
41 |
42 |
43 | 使用如下命令行替换官方源为镜像源。
44 |
45 | ```bash varcode
46 | ---
47 | ---
48 | sed -i 's@^\\(deb.*stable main\\)$@#\\1\\ndeb ${_http}://${_domain}/termux/apt/termux-main stable main@' $PREFIX/etc/apt/sources.list
49 | apt update && apt upgrade
50 | ```
51 |
52 | 使用如下命令行替换社区源 x11-repo 为镜像源(如果已经启用)。
53 |
54 | ```bash varcode
55 | ---
56 | ---
57 | sed -i 's@^\\(deb.*x11 main\\)$@#\\1\\ndeb ${_http}://${_domain}/termux/apt/termux-x11 x11 main @' $PREFIX/etc/apt/sources.list.d/x11.list
58 | apt update && apt upgrade
59 | ```
60 | 使用如下命令行替换社区源 root-repo 为镜像源(如果已经启用)。
61 |
62 | ```bash varcode
63 | ---
64 | ---
65 | sed -i 's@^\\(deb.*root main\\)$@#\\1\\ndeb ${_http}://${_domain}/termux/apt/termux-root root main @' $PREFIX/etc/apt/sources.list.d/root.list
66 | apt update && apt upgrade
67 | ```
68 |
69 | ### 手动修改
70 |
71 | 替换官方源为镜像源,需要编辑 `$PREFIX/etc/apt/sources.list` 修改为如下内容
72 |
73 | ```properties varcode title="$PREFIX/etc/apt/sources.list"
74 | ---
75 | ---
76 | # The termux repository mirror
77 | deb ${_http}://${_domain}/termux/apt/termux-main stable main
78 | ```
79 |
80 | 替换社区源 x11-repo 为镜像源,需要编辑 `$PREFIX/etc/apt/sources.list.d/x11.list` 修改为如下内容
81 |
82 | ```properties varcode title="$PREFIX/etc/apt/sources.list.d/x11.list"
83 | ---
84 | ---
85 | # The termux repository mirror
86 | deb ${_http}://${_domain}/termux/apt/termux-x11 x11 main
87 | ```
88 |
89 | 替换社区源 root-repo 为镜像源,需要编辑 `$PREFIX/etc/apt/sources.list.d/root.list` 修改为如下内容
90 |
91 |
92 | ```properties varcode title="$PREFIX/etc/apt/sources.list.d/root.list.d/root.list"
93 | ---
94 | ---
95 | # The termux repository mirror
96 | deb ${_http}://${_domain}/termux/apt/termux-root root stable
97 | ```
98 |
99 | 请使用内置或安装在 Termux 里的文本编辑器,例如 `vi` / `vim` / `nano` 等,**不要使用 RE 管理器等其他具有 ROOT 权限的外部 APP** 来修改 Termux 的文件
100 |
101 | 注:Termux 会自动将环境变量 `$PREFIX` 设定为 `/data/data/com.termux/files/usr`
102 |
103 | ### 警告
104 |
105 | * 镜像仅适用于 Android 7.0 (API 24) 及以上版本,旧版本系统使用本镜像可能导致程序错误。
106 | * Google Play 上的 Termux 已被弃用,如安装会产生兼容性问题。请通过 GitHub 或 F-Droid 来安装 Termux。
107 |
--------------------------------------------------------------------------------
/static/icons/settings.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/i18n/en/docusaurus-plugin-content-docs/current/blackarch.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Black Arch
3 | sidebar_label: BlackArch
4 | cname: 'blackarch'
5 | ---
6 |
7 | ## Introduction to BlackArch and Software Management
8 | BlackArch Linux is an Arch Linux-based penetration testing distribution for penetration testers and security researchers. The repository contains over 3000 tools that can be installed individually or in groups.
9 | BlackArch Linux is compatible with existing Arch Linux installations and allows software installation from BlackArch repository using pacman.
10 |
11 | ## Replacing BlackArch Software Sources
12 |
13 | :::caution
14 | **To avoid problems when replacing software source configuration files, please make a backup of the system's default software source configuration files before proceeding.**
15 | :::
16 |
17 | 1. Edit `/etc/pacman.d/mirrorlist` and add the following lines to the end of the file:
18 |
19 | ```ini varcode
20 | ---
21 | ---
22 | [blackarch]
23 | Server = ${_http}://${_domain}/blackarch/$repo/os/$arch
24 | ```
25 |
26 | :::caution
27 | Some software depends on 32-bit libraries. You need to uncomment `multilib` in `/etc/pacman.conf`. For details, see https://wiki.archlinux.org/index.php/Official_repositories#Enabling_multilib
28 | :::
29 |
30 | 2. Install the `blackarch-keyring` package to import the GPG key.
31 |
32 | ```shell varcode
33 | [ ] (root) Are you the root user?
34 | ---
35 | const SUDO = !root ? 'sudo ' : '';
36 | ---
37 | ${SUDO}pacman -Sy blackarch-keyring
38 | ```
39 |
40 | 3. Update the package cache with the following command:
41 |
42 | ```shell varcode
43 | [ ] (root) Are you the root user?
44 | ---
45 | const SUDO = !root ? 'sudo ' : '';
46 | ---
47 | ${SUDO}pacman -Syyu
48 | ```
49 |
50 | The `yy` in the command helps prevent issues when switching from **broken** mirrors to **healthy** mirrors.
51 |
52 | If you want to switch from a newer mirror to an older mirror, you can execute the following command to downgrade some packages and avoid partial updates to the system:
53 |
54 | ```shell varcode
55 | [ ] (root) Are you the root user?
56 | ---
57 | const SUDO = !root ? 'sudo ' : '';
58 | ---
59 | ${SUDO}pacman -Syyuu
60 | ```
61 |
62 | ## One-Click Source Replacement
63 |
64 | :::caution
65 | This method is only applicable when switching from official sources to the mirror sources on this site. If you have already switched sources, please do not use the following commands.
66 | :::
67 |
68 | Use the `echo` command to add the current mirror source in one step:
69 | ```shell varcode
70 | [ ] (root) Are you the root user?
71 | ---
72 | const SUDO = !root ? 'sudo ' : '';
73 | ---
74 | ${SUDO}echo "[blackarch]
75 | Server = ${_http}://${_domain}/blackarch/$repo/os/$arch" >> /etc/pacman.conf
76 | ```
77 |
78 | Note: The BlackArch software source only contains tools and other software packaged by it. If you need to replace the software source for the Arch Linux system, please refer to [Arch Linux Help](/docs/archlinux/).
79 |
80 | ## References
81 |
82 | 1. [BlackArch Wikipedia](https://en.wikipedia.org/wiki/BlackArch)
83 |
--------------------------------------------------------------------------------
/i18n/en/docusaurus-plugin-content-docs/current/pypi.md:
--------------------------------------------------------------------------------
1 | ---
2 | sidebar_label: PyPI
3 | title: PyPI
4 | ---
5 |
6 | ## Introduction to PyPI
7 |
8 | PyPI (The Python Package Index), code-hosted at [https://pypi.org/](https://pypi.org/), is the official third-party software repository for the Python programming language.
9 |
10 | ## Switching pip Package Mirror
11 |
12 | :::caution
13 | The pip tool only supports https by default, please do not use http.
14 | :::
15 |
16 | :::info About externally-managed-environment Error
17 | Python 3.11 had implemented PEP 668, which is a significant proposal enhancing the Python packages to specify whether they can be installed in the global interpreter context by default.
18 | Encountering such kind of issue, you could try creating a virtual environment using venv, or use other virtual-environment-based package managers.
19 | :::
20 |
21 | ### Temporary Usage
22 |
23 | ```bash varcode
24 | pip install -i https://${_domain}/pypi/web/simple
25 | ```
26 |
27 | ### Set as Default
28 |
29 | ```bash varcode
30 | pip config set global.index-url https://${_domain}/pypi/web/simple
31 | ```
32 |
33 | :::caution
34 | Please upgrade pip to version 10 or above before configuring.
35 | :::
36 |
37 | If the pip version is low, you can use the following command to upgrade pip
38 | ```bash varcode
39 | python -m pip install -i https://${_domain}/pypi/web/simple --upgrade pip
40 | ```
41 |
42 | ## Switching PDM Package Mirror
43 |
44 | PDM supports configuring the package mirror using the `pdm config` command or environment variables. For long-term use, it is recommended to configure it through `pdm config`.
45 |
46 | Config the package mirror using the `pdm config` command:
47 | ```bash varcode
48 | pdm config pypi.url https://${_domain}/pypi/web/simple
49 | ```
50 |
51 | Or config the PDM package mirror using environment variables:
52 | ```bash varcode
53 | export PDM_PYPI_URL=https://${_domain}/pypi/web/simple
54 | ```
55 |
56 | ## Switching Poetry Package Mirror
57 |
58 | :::caution
59 | Poetry only supports project-specific configuration, instead of configuring a global mirror.
60 | :::
61 |
62 | Poetry supports configuring the current project's package mirror using the `poetry source` command or by modifying `pyproject.toml`.
63 |
64 | Config the package mirror using the `poetry source` command:
65 | ```bash varcode
66 | poetry source add --priority=primary mirrors https://${_domain}/pypi/web/simple
67 | ```
68 |
69 | Or modify `pyproject.toml` to config the package mirror, add the following content to the `pyproject.toml` file:
70 | ```toml varcode
71 | [[tool.poetry.source]]
72 | name = "mirrors"
73 | url = "https://${_domain}/pypi/web/simple"
74 | priority = "primary"
75 | ```
76 |
77 | ## Switching pipx Package Mirror
78 |
79 | pipx uses the same mirror as pip by default, so the method of configuring the package mirror is the same as pip.
80 |
81 | ## Switching Back to Default Mirror
82 |
83 | If you want to use the official default mirror, change the mirror url in the above commands to `https://pypi.org/simple` and configure it in the same way.
84 |
--------------------------------------------------------------------------------
/src/pages/index.module.css:
--------------------------------------------------------------------------------
1 | /**
2 | * CSS files with the .module.css suffix will be treated as CSS modules
3 | * and scoped locally.
4 | */
5 |
6 | .heroBanner {
7 | padding: 2rem 0;
8 | text-align: center;
9 | position: relative;
10 | }
11 |
12 | @media screen and (max-width: 996px) {
13 | .heroBanner {
14 | padding: 4px;
15 | }
16 | }
17 |
18 | .buttons {
19 | display: flex;
20 | align-items: center;
21 | justify-content: center;
22 | position: absolute;
23 | bottom: 0;
24 | right: 0;
25 | }
26 |
27 | .list-container {
28 | display: flex;
29 | justify-content: center;
30 | align-items: flex-start;
31 | }
32 |
33 | .table-container {
34 | margin: 32px;
35 | flex: 1 0;
36 | max-width: 1034px;
37 | display: flex;
38 | justify-content: center;
39 | }
40 |
41 | .sidebar-container {
42 | margin: 32px 32px 32px 0;
43 | width: 400px;
44 | }
45 |
46 | .header-container {
47 | display: flex;
48 | margin: 0 auto;
49 | justify-content: center;
50 | width: 100%;
51 | max-width: 1530px;
52 | }
53 |
54 | .header-container .main-part {
55 | margin: 32px;
56 | flex: 1 1 0;
57 | display: flex;
58 | flex-direction: column;
59 | justify-content: space-between;
60 | }
61 |
62 | .header-container .cli-ad-container {
63 | margin: 32px;
64 | flex: 1 1 0;
65 | min-width: 0;
66 | position: relative;
67 | }
68 |
69 |
70 | .header-container .left {
71 | text-align: left;
72 | }
73 |
74 | .search {
75 | display: block;
76 | font-size: 1.5em;
77 | padding: 16px;
78 | background: transparent;
79 | border: var(--ifm-hero-text-color) solid 2px;
80 | border-radius: 8px;
81 | transition: all 0.3s;
82 | outline: none;
83 | caret-color: var(--ifm-hero-text-color);
84 | color: var(--ifm-color-black);
85 | max-width: 480px;
86 | }
87 |
88 | .search::placeholder {
89 | color: var(--ifm-hero-text-color)
90 | }
91 |
92 | .search:not(:placeholder-shown) {
93 | background: var(--ifm-hero-text-color);
94 | caret-color: var(--ifm-color-black);
95 | }
96 |
97 | .search:focus {
98 | background: var(--ifm-hero-text-color);
99 | caret-color: var(--ifm-color-black);
100 | }
101 |
102 |
103 | @media screen and (max-width:1200px) {
104 | .sidebar-container {
105 | width: 300px;
106 | }
107 | }
108 |
109 | @media screen and (max-width:996px) {
110 | .sidebar-container {
111 | margin: 16px;
112 | }
113 |
114 | .list-container {
115 | flex-wrap: wrap;
116 | }
117 |
118 | .table-container {
119 | margin: 0;
120 | }
121 |
122 | .header-container {
123 | flex-direction: column-reverse;
124 | }
125 |
126 | .header-container .main-part,
127 | .header-container .cli-ad-container {
128 | margin: 16px;
129 | }
130 | }
131 |
132 | @media screen and (max-width:800px) {
133 | .sidebar-container {
134 | width: 100%;
135 | }
136 | }
137 |
138 | /* @media screen and (min-width:800px) and (min-height: 800px) { */
139 | /* .sidebar-container { */
140 | /* position: sticky; */
141 | /* top: 92px; */
142 | /* } */
143 | /* } */
144 |
--------------------------------------------------------------------------------
/docs/linuxmint.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Linux Mint 镜像使用帮助
3 | sidebar_label: Linux Mint
4 | cname: LinuxMint
5 | type: OS
6 | detection:
7 | checks:
8 | - type: os_release
9 | name: Linux Mint
10 | ---
11 |
12 | ## Linux Mint 简介与软件管理
13 | Linux Mint 是一种基于 Ubuntu 的 Linux 发行版,Linux Mint 的宗旨是提供一个免费开源、现代、优雅、功能强大却也易于使用的作业系统
14 | Linux Mint 也采用 apt 作为包管理器,与 Ubuntu 和 Debian 类似,你需要编辑 `/etc/apt/sources.list` 和 `/etc/apt/sources.list.d/*` 中的路径。
15 |
16 |
17 | ## Ubuntu / Debian 软件源替换
18 |
19 | 对于来自 Ubuntu 与 Debian 的部分源,可以参考 [Ubuntu 帮助](./ubuntu)与 [Debian 帮助](./debian)进行修改。
20 |
21 | ## Linux Mint 软件源替换
22 |
23 | ### 一键换源
24 |
25 | :::caution
26 | 本方法仅适用于从官方源更换到本站源,如果您已经换过了源,请勿使用下列命令。
27 | :::
28 |
29 | 使用 `sed` 命令将软件源配置文件中的默认源地址 [http://packages.linuxmint.com](http://packages.linuxmint.com) 直接替换为当前镜像源站
30 |
31 | ```yaml cli
32 | type: ReplaceIfExist
33 | required: true
34 | optional: false
35 | description: 替换Linux Mint主仓库
36 | privileged: true
37 | files:
38 | - path: /etc/apt/offical-package-repositories.list
39 | match: 'http://packages.linuxmint.com'
40 | replace: '${_http}://${_domain}/linuxmint'
41 | - path: /etc/apt/offical-package-repositories.list
42 | match: 'http://archive.ubuntu.com'
43 | replace: '${_http}://${_domain}'
44 | display_policy:
45 | kind: All
46 | ```
47 |
48 | :::caution
49 | **为避免软件源配置文件替换后产生问题,请先将系统自带的软件源配置文件进行备份,然后进行下列操作。**
50 | :::
51 |
52 | ### 1. 修改 `/etc/apt/sources.list.d/official-package-repositories.list`,把 `packages.linuxmint.com` 替换为镜像源
53 |
54 | ```list varcode
55 | [] (release) { zara:22.2, xia:22.1, wilma:22, virginia:21.3, victoria:21.2, vera:21.1, vanessa:21, una:20.3, uma:20.2, ulyssa:20.1 } Linux Mint 版本
56 | ---
57 | deb ${_http}://${_domain}/linuxmint ${release} main upstream import backport
58 | ```
59 |
60 | ### 2. 通过如下命令更新软件。
61 |
62 | ```yaml cli
63 | type: Execute
64 | privileged: true
65 | interpreter: shell
66 | exec: |
67 | #{USE_IN_DOCS/}
68 | apt-get update
69 | #{/USE_IN_DOCS}
70 | ```
71 |
72 | :::caution
73 | 完成后请不要再使用 mintsources(自带的图形化软件源设置工具)进行任何操作,因为在操作后,无论是否有按 “确定”,mintsources 均会复写 `/etc/apt/sources.list.d/official-package-repositories.list`
74 | :::
75 |
76 | ## Linux Mint Security 源替换
77 |
78 | 由于 Linux Mint 的 Security 源采用的是和 Ubuntu 相同的源,因此可直接使用 Ubuntu 的 Security 源。但两者配置文件目录不同,不可直接使用 Ubuntu 文档中的换源命令。
79 |
80 | 修改 `/etc/apt/sources.list.d/official-package-repositories.list`,把 `security.ubuntu.com` 替换为镜像源
81 |
82 | ```list varcode
83 | [] (release) { noble:22, jammy:21 } Linux Mint 版本
84 | ---
85 | deb ${_http}://${_domain}/ubuntu ${release}-security main restricted universe multiverse
86 | ```
87 |
88 | ## Linux Mint 安装镜像 {#cd}
89 | Linux Mint 安装镜像提供 cinnamon,mate 和 xfce 三种桌面环境,分别对应了三个版本的安装镜像。如果需
90 | 要下载这两个版本的安装镜像,点击下面的按钮选择对应的版本和种类进行下载。
91 |
92 | - cinnamon:Linux Mint 的默认桌面环境,基于 GNOME 3 开发。
93 | - mate:基于 GNOME 2 开发的桌面环境。
94 | - xfce:轻量级桌面环境,适合配置较低的计算机。
95 |
96 |
97 |
98 |
99 |
100 | ## 引用
101 | 1. [Tuna 镜像源使用帮助](https://mirrors.tuna.tsinghua.edu.cn/help/linuxmint/)
102 |
--------------------------------------------------------------------------------
/ci/test/test-releases-rsync.py:
--------------------------------------------------------------------------------
1 | #!/bin/env python3
2 | # Usage:
3 | # test-releases-rsync.py --section --rsync [--prefix ] [--strip ] [--follow-link]
4 | # Example:
5 | # python3 ./test-releases-rsync.py --section msys2 --rsync rsync://mirrors.tuna.tsinghua.edu.cn/msys2 --prefix msys2/
6 |
7 | import argparse
8 | import fnmatch
9 | import os
10 | import re
11 | import time
12 | from configparser import ConfigParser
13 | from subprocess import PIPE, Popen, DEVNULL
14 |
15 | config = ConfigParser()
16 |
17 | script_path = os.path.dirname(os.path.realpath(__file__))
18 | config.read(script_path + "/../releases.conf", encoding="utf-8")
19 |
20 | parser = argparse.ArgumentParser()
21 | parser.add_argument("--section", required=True)
22 | parser.add_argument("--rsync", required=True)
23 | parser.add_argument("--prefix", default="")
24 | parser.add_argument("--strip", type=int, default=0)
25 | parser.add_argument(
26 | "--follow-link", action=argparse.BooleanOptionalAction, default=True
27 | )
28 |
29 |
30 | args = parser.parse_args()
31 | sec = args.section
32 | rsync_url = args.rsync
33 | prefix = args.prefix
34 | strip = args.strip
35 | follow_link = args.follow_link
36 |
37 |
38 | release_sec = config[sec]["name"] if "name" in config[sec] else sec
39 | exp = config[sec]["exp"]
40 | release_pos = int(config[sec]["release"]) if "release" in config[sec] else -1
41 | version_pos = int(config[sec]["version"]) if "version" in config[sec] else -1
42 | variant_pos = int(config[sec]["variant"]) if "variant" in config[sec] else -1
43 | take_count = int(config[sec]["take"]) if "take" in config[sec] else -1
44 | description = config[sec]["description"] if "description" in config[sec] else None
45 | glob_pattern = config[sec]["path"]
46 |
47 |
48 | def get_files():
49 | args = ["rsync", "--no-motd", "--list-only", "--recursive", rsync_url]
50 | if follow_link:
51 | args.insert(1, "--copy-links")
52 | p = Popen(args, stdout=PIPE, stderr=DEVNULL)
53 | if p.stdout is None:
54 | return
55 | while p.poll() is None:
56 | line = p.stdout.readline().decode("utf-8").strip()
57 | parts = re.split(r"\s+", line)
58 | if len(parts) < 5:
59 | continue
60 | path = prefix + "/".join(parts[4].split("/")[strip:])
61 | yield {
62 | "mode": parts[0],
63 | "size": parts[1],
64 | "time": time.strptime(parts[2] + " " + parts[3], "%Y/%m/%d %H:%M:%S"),
65 | "path": path,
66 | }
67 |
68 |
69 | def filter_files_in_glob(files):
70 | for file in files:
71 | if fnmatch.fnmatch(file["path"], glob_pattern):
72 | yield file
73 |
74 |
75 | count = 0
76 | for f in filter_files_in_glob(get_files()):
77 | file = f["path"]
78 | release = release_sec
79 | version = ""
80 | variant = ""
81 | matches = re.match(exp, file)
82 | if matches:
83 | release = matches.group(release_pos) if release_pos != -1 else release_sec
84 | version = matches.group(version_pos) if version_pos != -1 else ""
85 | variant = matches.group(variant_pos) if variant_pos != -1 else ""
86 | print("{:10}\t{:10}\t{:25}\t{}".format(release, version, variant, file))
87 |
--------------------------------------------------------------------------------
/i18n/en/docusaurus-plugin-content-docs/current/openkylin.md:
--------------------------------------------------------------------------------
1 | ---
2 | sidebar_label: openKylin
3 | title: openKylin
4 | cname: 'openkylin'
5 | ---
6 |
7 | ## Introduction to openKylin and Software Management
8 |
9 | The openKylin community is an open-source community founded by basic software and hardware companies, non-profit organizations, community organizations, universities, research institutions, and individual developers. Its goal is to create a top-level desktop operating system community through the core principles of "collaboration" and "open-source convergence, co-creation of the future." It operates on the basis of open-source, voluntary participation, equality, and collaboration. The community collaborates with enterprises through open and open-source means to build a partner ecosystem and jointly create a top-level desktop operating system community, promoting the prosperity of Linux open-source technology and its hardware and software ecosystem.
10 |
11 | openKylin uses the APT package management tool to manage DEB software packages. Specifically, openKylin manages system software sources by modifying the `/etc/apt/sources.list` configuration file. In general, users can replace the default source address in this configuration file (i.e., `http://archive.build.openkylin.top/`) with the mirror source provided by this software mirror site.
12 | ## Replacing openKylin Software Sources
13 |
14 | :::caution
15 | **To avoid problems when replacing software source configuration files, please make a backup of the system's default software source configuration files before proceeding.**
16 | :::
17 | 1. Based on your preference, copy the following software source configuration content to `/etc/apt/sources.list` and save it.
18 |
19 | ```shell varcode
20 | [ ] (version) { yangtze:1.0 } openKylin version
21 | ---
22 | deb ${_http}://${_domain}/openkylin ${version} main
23 | ```
24 |
25 |
26 | 1. Update the software using the following command:
27 |
28 | ```shell varcode
29 | [ ] (root) Are you the root user?
30 | ---
31 | const SUDO = !root ? 'sudo ' : '';
32 | ---
33 | ${SUDO}apt update
34 | ```
35 |
36 |
37 | ## One-Click Source Replacement
38 |
39 | :::caution
40 | This method is only applicable when switching from official sources to the mirror sources on this site. If you have already switched sources, please do not use the following commands.
41 | :::
42 |
43 | Use the `sed` command to directly replace the default source address [http://archive.build.openkylin.top/](http://archive.build.openkylin.top/) in the software source configuration file with the current mirror source site.
44 |
45 | ```shell varcode
46 | [ ] (root) Are you the root user?
47 | ---
48 | const SUDO = !root ? 'sudo ' : '';
49 | ---
50 | ${SUDO}sed -i.bak 's|https?://([^/]+)/openkylin|${_http}://${_domain}/openkylin|' /etc/apt/sources.list
51 | ```
52 |
53 |
54 | ## Important Notes
55 | - openKylin does not use HTTPS sources by default. If you choose to use HTTPS sources and encounter issues fetching HTTPS sources, you can install the following software using HTTP sources:
56 |
57 | ```shell varcode
58 | [ ] (root) Are you the root user?
59 | ---
60 | const SUDO = !root ? 'sudo ' : '';
61 | ---
62 | ${SUDO}apt install apt-transport-https ca-certificates
63 | ${SUDO}apt update
64 | ```
65 |
--------------------------------------------------------------------------------
/i18n/en/docusaurus-plugin-content-docs/current/archlinuxcn.md:
--------------------------------------------------------------------------------
1 | ---
2 | sidebar_label: Arch Linux CN
3 | title: Arch Linux CN Software Repository Mirror Usage Guide
4 | cname: 'archlinuxcn'
5 | ---
6 |
7 | ## Introduction to Arch Linux CN and Software Management
8 |
9 | The Arch Linux Chinese Community Repository, an unofficial software repository driven by the Arch Linux Chinese Community, includes many additional packages not provided by the official repositories, as well as git versions and other variants of existing software. Some of the packaging scripts for these packages originate from the AUR (Arch User Repository), but there are also many packages that differ from those in the AUR.
10 |
11 | ## Arch Linux CN Software Source Replacement
12 |
13 | :::caution
14 | **To avoid problems when replacing software source configuration files, please make a backup of the system's default software source configuration files before proceeding.**
15 | :::
16 |
17 | 1. Edit the `/etc/pacman.conf` add the following line to the top of the file:
18 |
19 | ```bash varcode
20 | [archlinuxcn]
21 | Server = ${_http}://${_domain}/archlinuxcn/$arch
22 | ```
23 |
24 | 2. Install the archlinuxcn-keyring:
25 | ```shell varcode
26 | [ ] (root) Are you the root user?
27 | ---
28 | const SUDO = !root ? 'sudo ' : '';
29 | ---
30 | ${SUDO}pacman -S archlinuxcn-keyring
31 | ```
32 |
33 | :::caution
34 | If you encounter the following error during the installation process:
35 | ```shell
36 | error: archlinuxcn-keyring: Signature from "Jiachen YANG (Arch Linux Packager Signing Key) " is marginal trust
37 | ```
38 | This issue occurs because the developer has retired, which leaves the GPG key for farseerfc with a limited trust status in new installations. You can address this by executing the following command:
39 | ```shell varcode
40 | sudo pacman-key --lsign-key "farseerfc@archlinux.org"
41 | ```
42 | :::
43 |
44 | 3. Update the package cache:
45 |
46 | ```shell varcode
47 | [ ] (root) Are you the root user?
48 | ---
49 | const SUDO = !root ? 'sudo ' : '';
50 | ---
51 | ${SUDO}pacman -Syyu
52 | ```
53 |
54 | The `yy` in the command helps prevent issues when switching from **broken** mirrors to **healthy** mirrors.
55 |
56 | If you want to switch from a newer mirror to an older mirror, you can execute the following command to downgrade some packages and avoid partial updates to the system:
57 |
58 |
59 | ```shell varcode
60 | [ ] (root) Are you the root user?
61 | ---
62 | const SUDO = !root ? 'sudo ' : '';
63 | ---
64 | ${SUDO}pacman -Syyuu
65 | ```
66 |
67 | ## One-click source switching
68 |
69 | :::caution
70 | This method is only applicable for switching from the official source to our site's source. If you have already switched sources, please do not use the following commands.
71 | :::
72 |
73 | Use the `echo` command to add the URL of the current mirror to the end of the configuration file:
74 |
75 | ```shell varcode
76 | [ ] (root) Are you the root user?
77 | ---
78 | const SUDO = !root ? 'sudo ' : '';
79 | ---
80 | ${SUDO}echo -e "[archlinuxcn]\nServer = ${_http}://${_domain}/archlinuxcn/\$arch" >> /etc/pacman.conf
81 | ```
82 |
83 | ## References
84 |
85 | 1. [ZMirror](https://mirrors.cernet.edu.cn/about)
86 | 2. [Help Repository](https://github.com/mirrorz-org/mirrorz-help)
87 |
--------------------------------------------------------------------------------