Compare commits

..

2 Commits

Author SHA1 Message Date
Super Manito
c84ed20dfa 更新文档 2025-11-01 02:13:19 +08:00
Super Manito
655c8cdabe 优化 2025-11-01 02:00:21 +08:00
12 changed files with 98 additions and 50 deletions

33
.github/CONTRIBUTING.md vendored Normal file
View File

@@ -0,0 +1,33 @@
# 参与共建
这篇指南会指导你如何为 LinuxMirrors 贡献自己的一份力量,请你在提 issue 或者 pull request 之前花几分钟来阅读一遍这篇指南。
## 行为准则
我们有一份 [行为准则](https://github.com/SuperManito/LinuxMirrors/blob/main/CODE_OF_CONDUCT.md),希望所有的贡献者都能遵守,请花时间阅读一遍全文以确保你能明白哪些是可以做的,哪些是不可以做的。
## 透明的开发
我们所有的工作都会放在 [GitHub](https://github.com/SuperManito/LinuxMirrors) 上。不管是核心团队的成员还是外部贡献者的 pull request 都需要经过同样流程的 review。
## Pull Request
请确保你的代码符合我们的编码规范,并且通过了所有的测试。提交前请务必在本地客户端进行测试,确保脚本的功能和性能符合预期,不会出现任何致命性的错误。
---
# Contributing to LinuxMirrors
The following is a set of guidelines for contributing to LinuxMirrors. Please spend several minutes reading these guidelines before you create an issue or pull request.
## Code of Conduct
We have adopted a [Code of Conduct](https://github.com/SuperManito/LinuxMirrors/blob/main/CODE_OF_CONDUCT.md) that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.
## Open Development
All work on LinuxMirrors happens directly on [GitHub](https://github.com/SuperManito/LinuxMirrors). Both core team members and external contributors send pull requests which go through the same review process.
## Pull Request
Please ensure that your code complies with our coding standards and passes all tests. Before submitting, be sure to test it on your local client to ensure that the script's functionality and performance meet expectations and that there are no fatal errors.

View File

@@ -1,6 +1,6 @@
#!/bin/bash
## Author: SuperManito
## Modified: 2025-10-20
## Modified: 2025-11-01
## License: MIT
## GitHub: https://github.com/SuperManito/LinuxMirrors
## Website: https://linuxmirrors.cn
@@ -163,12 +163,12 @@ SPONSOR_ADS=(
"1Panel · Linux 面板|极简运维 ➜ \033[3mhttps://1panel.cn\033[0m"
"多途云 · 智能化防护,每一次连接皆在安全之下 ➜ \033[3mhttps://www.duotuyun.com\033[0m"
"毫秒镜像 · 专为中国开发者提供Docker镜像加速下载服务 ➜ \033[3mhttps://1ms.run\033[0m"
"林枫云 · 专注独立IP高频VPSR9/i9系列定制 ➜ \033[3mhttps://www.dkdun.cn\033[0m"
"不死鸟CDN · 香港日本高防CDN免实名/免备案轻松阻断DDOS/CC攻击 ➜ \033[3mhttps://www.bsncdn.org\033[0m"
"青叶云 · 香港1T高防自助防火墙无视CC大带宽回国优化线路 ➜ \033[3mhttps://www.qingyeyun.com\033[0m"
"莱卡云 · 专业云计算服务器提供商 ➜ \033[3m https://www.lcayun.com\033[0m"
"云悠YUNYOO · 全球高性价比云服务器低至15.99元起 ➜ \033[3mhttps://yunyoo.cc\033[0m"
"速拓云 · 国内高防云28元/月香港云100M优化线路9元/月 ➜ \033[3mhttps://www.sutuoyun.com\033[0m"
"林枫云 · 专注独立IP高频VPSR9/i9系列定制 ➜ \033[3mhttps://www.dkdun.cn\033[0m"
"语鹿云盾 · 专业CDN加速、防御亚太百兆三网优化CDN低至9元起 ➜ \033[3mhttps://www.lucdn.cn\033[0m"
"不二云 · 国内外建站快响应服务器的不二之选 ➜ \033[3mhttps://cb2.cn\033[0m"
"HKGserver · 全球家宽双ISP住宅原生云服务器54元/月起 ➜ \033[3mhttps://www.hkgserver.com\033[0m"
@@ -1088,7 +1088,7 @@ function check_command_options() {
function choose_display_language() {
local result
if command_exists tput; then
local lang_key_labels=()
local -a lang_key_labels=()
local language_text
for ((i = 0; i < ${#MESSAGE_LANG_KEYS[@]}; i++)); do
language_text="${MESSAGE_LANG_DISPLAY[${MESSAGE_LANG_KEYS[$i]}]}"
@@ -1136,22 +1136,21 @@ function choose_mirrors() {
local text=$1
echo "${#text}"
}
local list_arr=()
local -a list_arr=()
local list_arr_sum="$(eval echo \${#$1[@]})"
for ((i = 0; i < $list_arr_sum; i++)); do
list_arr[$i]="$(eval echo \${$1[i]})"
done
local name_width=${2:-"30"}
local __labels=()
local -a list_labels=()
if [[ "${3}" ]]; then
eval "__labels=(\"\${${3}[@]}\")"
eval "list_labels=(\"\${${3}[@]}\")"
fi
if command_exists printf; then
local tmp_uchar_1 tmp_uchar_2 tmp_uchar_3 tmp_uchar_4 tmp_default_length tmp_length tmp_unicode_length tmp_spaces_nums tmp_max_length
for ((i = 0; i < ${#list_arr[@]}; i++)); do
if [[ "${__labels[$i]}" ]]; then
tmp_name="${__labels[$i]}"
if [[ "${list_labels[$i]}" ]]; then
tmp_name="${list_labels[$i]}"
else
tmp_name="${list_arr[i]}"
fi
@@ -1176,8 +1175,8 @@ function choose_mirrors() {
done
else
for ((i = 0; i < ${#list_arr[@]}; i++)); do
if [[ "${__labels[$i]}" ]]; then
tmp_name="${__labels[$i]}"
if [[ "${list_labels[$i]}" ]]; then
tmp_name="${list_labels[$i]}"
else
tmp_name="${list_arr[i]}"
fi
@@ -1248,7 +1247,7 @@ function choose_mirrors() {
mirror_list_label_msg_prefix="mirrors.default"
mirror_list_print_length=32
fi
local mirror_list_labels=()
local -a mirror_list_labels=()
local mirror_list_length=$(eval "echo \${#${mirror_list_name}[@]}")
local label_msg_index label_msg_content
for ((i = 0; i < ${mirror_list_length}; i++)); do
@@ -1611,7 +1610,7 @@ function remove_original_mirrors() {
mkdir -p "${Dir_YumRepos}"
return
fi
local repo_patterns=()
local -a repo_patterns=()
if [[ "${SYSTEM_JUDGMENT}" == "${SYSTEM_FEDORA}" ]]; then
repo_patterns=(
"fedora.repo"
@@ -1849,7 +1848,7 @@ function change_mirrors_main() {
print_diff
fi
## 更新软件源
local commands=()
local -a commands=()
case "${SYSTEM_FACTIONS}" in
"${SYSTEM_DEBIAN}" | "${SYSTEM_OPENKYLIN}")
commands+=("apt-get update")
@@ -1972,7 +1971,7 @@ function upgrade_software() {
esac
fi
fi
local commands=()
local -a commands=()
case "${SYSTEM_FACTIONS}" in
"${SYSTEM_DEBIAN}" | "${SYSTEM_OPENKYLIN}")
commands+=("apt-get upgrade -y")
@@ -2793,7 +2792,7 @@ function change_mirrors_openSUSE() {
## 修改源
cd $Dir_ZYppRepos
local opensuse_repo_files=()
local -a opensuse_repo_files=()
case "${SYSTEM_ID}" in
opensuse-leap)
case "${SYSTEM_VERSION_ID_MAJOR}" in
@@ -3071,8 +3070,8 @@ function get_package_manager() {
function interactive_select_list() {
_SELECT_RESULT=""
eval "local __values=(\"\${${1}[@]}\")"
local __labels=()
eval "local -a __values=(\"\${${1}[@]}\")"
local -a __labels=()
local message="${2}"
local selected=0
local start=0
@@ -3306,7 +3305,7 @@ function animate_exec() {
exit 130
}
function make_temp_file() {
local temp_dirs=("." "/tmp")
local -a temp_dirs=("." "/tmp")
local tmp_file=""
for dir in "${temp_dirs[@]}"; do
[[ ! -d "${dir}" || ! -w "${dir}" ]] && continue

View File

@@ -1,6 +1,6 @@
#!/bin/bash
## Author: SuperManito
## Modified: 2025-10-23
## Modified: 2025-11-01
## License: MIT
## GitHub: https://github.com/SuperManito/LinuxMirrors
## Website: https://linuxmirrors.cn
@@ -81,12 +81,12 @@ SPONSOR_ADS=(
"1Panel · Linux 面板|极简运维 ➜ \033[3mhttps://1panel.cn\033[0m"
"多途云 · 智能化防护,每一次连接皆在安全之下 ➜ \033[3mhttps://www.duotuyun.com\033[0m"
"毫秒镜像 · 专为中国开发者提供Docker镜像加速下载服务 ➜ \033[3mhttps://1ms.run\033[0m"
"林枫云 · 专注独立IP高频VPSR9/i9系列定制 ➜ \033[3mhttps://www.dkdun.cn\033[0m"
"不死鸟CDN · 香港日本高防CDN免实名/免备案轻松阻断DDOS/CC攻击 ➜ \033[3mhttps://www.bsncdn.org\033[0m"
"青叶云 · 香港1T高防自助防火墙无视CC大带宽回国优化线路 ➜ \033[3mhttps://www.qingyeyun.com\033[0m"
"莱卡云 · 专业云计算服务器提供商 ➜ \033[3m https://www.lcayun.com\033[0m"
"云悠YUNYOO · 全球高性价比云服务器低至15.99元起 ➜ \033[3mhttps://yunyoo.cc\033[0m"
"速拓云 · 国内高防云28元/月香港云100M优化线路9元/月 ➜ \033[3mhttps://www.sutuoyun.com\033[0m"
"林枫云 · 专注独立IP高频VPSR9/i9系列定制 ➜ \033[3mhttps://www.dkdun.cn\033[0m"
"语鹿云盾 · 专业CDN加速、防御亚太百兆三网优化CDN低至9元起 ➜ \033[3mhttps://www.lucdn.cn\033[0m"
"不二云 · 国内外建站快响应服务器的不二之选 ➜ \033[3mhttps://cb2.cn\033[0m"
"HKGserver · 全球家宽双ISP住宅原生云服务器54元/月起 ➜ \033[3mhttps://www.hkgserver.com\033[0m"
@@ -697,7 +697,7 @@ function collect_system_info() {
function choose_display_language() {
local result
if command_exists tput; then
local lang_key_labels=()
local -a lang_key_labels=()
local language_text
for ((i = 0; i < ${#MESSAGE_LANG_KEYS[@]}; i++)); do
language_text="${MESSAGE_LANG_DISPLAY[${MESSAGE_LANG_KEYS[$i]}]}"
@@ -744,14 +744,13 @@ function choose_mirrors() {
local text=$1
echo "${#text}"
}
local list_arr=()
local -a list_arr=()
local list_arr_sum="$(eval echo \${#$1[@]})"
for ((i = 0; i < $list_arr_sum; i++)); do
list_arr[$i]="$(eval echo \${$1[i]})"
done
local name_width=${2:-"30"}
local list_labels=()
local -a list_labels=()
if [[ "${3}" ]]; then
eval "list_labels=(\"\${${3}[@]}\")"
fi
@@ -837,7 +836,7 @@ function choose_mirrors() {
}
local mirror_list_name mirror_list_length
local mirror_list_labels=()
local -a mirror_list_labels=()
local label_msg_index label_msg_content
if [[ -z "${SOURCE}" ]] && [[ "${ONLY_REGISTRY}" != "true" ]]; then
mirror_list_name="mirror_list_docker_ce"
@@ -1087,7 +1086,7 @@ function install_dependency_packages() {
## 配置 Docker CE 源
function configure_docker_ce_mirror() {
local commands=()
local -a commands=()
case "${SYSTEM_FACTIONS}" in
"${SYSTEM_DEBIAN}")
## 处理 GPG 密钥
@@ -1277,7 +1276,7 @@ function install_docker_engine() {
function install_main() {
local target_docker_version
local pkgs=""
local commands=()
local -a commands=()
if [[ "${INSTALL_LATESTED_DOCKER}" == "true" ]]; then
pkgs="docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin"
else
@@ -1295,7 +1294,7 @@ function install_docker_engine() {
target_docker_version="${DESIGNATED_DOCKER_VERSION}"
else
if [[ "${CAN_USE_ADVANCED_INTERACTIVE_SELECTION}" == "true" ]]; then
local version_list=(
local -a version_list=(
$(cat $File_DockerVersionTmp | sort -t '.' -k1,1nr -k2,2nr -k3,3nr | tr '\n' ' ' | sed 's/ $//')
)
local mirror_list_name="version_list"
@@ -1526,7 +1525,7 @@ function only_change_docker_registry_mirror() {
if ! command_exists jq; then
## 更新软件源
local package_manager
local commands=()
local -a commands=()
case "${SYSTEM_FACTIONS}" in
"${SYSTEM_DEBIAN}")
package_manager="apt-get"
@@ -1582,7 +1581,6 @@ function only_change_docker_registry_mirror() {
function handleRegistryMirrorsValue() {
local content="$1"
local delimiter=","
local result=""
content="$(echo "${content}" | sed 's| ||g')"
local -a items=(${content//,/ })
@@ -1669,8 +1667,8 @@ function get_package_manager() {
function interactive_select_list() {
_SELECT_RESULT=""
eval "local __values=(\"\${${1}[@]}\")"
local __labels=()
eval "local -a __values=(\"\${${1}[@]}\")"
local -a __labels=()
local message="${2}"
local selected=0
local start=0
@@ -1904,7 +1902,7 @@ function animate_exec() {
exit 130
}
function make_temp_file() {
local temp_dirs=("." "/tmp")
local -a temp_dirs=("." "/tmp")
local tmp_file=""
for dir in "${temp_dirs[@]}"; do
[[ ! -d "${dir}" || ! -w "${dir}" ]] && continue

18
SECURITY.md Normal file
View File

@@ -0,0 +1,18 @@
# Security Policy
## Supported Versions
Use this section to tell people about which versions of your project are
currently being supported with security updates.
| Version | Supported |
| ------- | ------------------ |
| all | :white_check_mark: |
## Reporting a Vulnerability
Use this section to tell people how to report a vulnerability.
Tell them where to go, how often they can expect to get an update on a
reported vulnerability, what to expect if the vulnerability is accepted or
declined, etc.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -16,6 +16,10 @@
<img src="/assets/images/sponsor/1ms-light.svg#only-light" alt="毫秒镜像" style="width: 56% !important" />
<img src="/assets/images/sponsor/1ms-dark.svg#only-dark" alt="毫秒镜像" style="width: 56% !important" />
</a>
<a class="sponsor-item sponsor-item-flex" target="_blank" rel="noopener noreferrer" href="https://www.dkdun.cn/aff/VAWGETUL" title="专注独立IP高频VPSR9/i9系列定制">
<!-- 27 11 1 -->
<img src="/assets/images/sponsor/linfengyun.png" alt="林枫云" />
</a>
<a class="sponsor-item sponsor-item-flex" target="_blank" rel="noopener noreferrer" href="https://www.bsncdn.org" title="香港日本高防CDN免实名/免备案,轻松阻断 DDOS / CC 攻击">
<!-- 26 08 17 -->
<img src="/assets/images/sponsor/businiaocdn.png" alt="不死鸟CDN" />
@@ -43,11 +47,6 @@
<!-- 25 12 23 -->
<img src="/assets/images/sponsor/sutuoyun.svg" alt="速拓云" style="width: 58% !important" />
</a>
<a class="sponsor-item sponsor-item-flex" target="_blank" rel="noopener noreferrer" href="https://www.dkdun.cn/aff/VAWGETUL" title="专注独立IP高频VPSR9/i9系列定制">
<!-- 25 10 13 -->
<img src="/assets/images/sponsor/linfengyun-light.png#only-light" alt="林枫云" />
<img src="/assets/images/sponsor/linfengyun-dark.png#only-dark" alt="林枫云" />
</a>
<a class="sponsor-item sponsor-item-flex" target="_blank" rel="noopener noreferrer" href="https://arcadia.cool" title="一站式代码运维平台">
<img src="/assets/images/sponsor/arcadia-light.png#only-light" alt="Arcadia" style="width: 57% !important" />
<img src="/assets/images/sponsor/arcadia-dark.png#only-dark" alt="Arcadia" style="width: 57% !important" />

View File

@@ -18,15 +18,19 @@
<img src="/assets/images/sponsor/1panel.png" alt="1Panel" style="filter: grayscale(1) invert(0.6)" />
</a>
<a class="sponsor-item sponsor-item-toc" target="_blank" rel="noopener noreferrer" href="https://www.duotuyun.com" title="智能化防护,每一次连接皆在安全之下">
<img src="/assets/images/sponsor/duotuyun-light.svg#only-light" alt="多途云" style="filter: grayscale(1) invert(0.6)" />
<img src="/assets/images/sponsor/duotuyun-dark.svg#only-dark" alt="多途云" style="filter: grayscale(1) invert(0.4)" />
<img src="/assets/images/sponsor/duotuyun-light.svg#only-light" alt="多途云" style="filter: grayscale(1) invert(0.5)" />
<img src="/assets/images/sponsor/duotuyun-dark.svg#only-dark" alt="多途云" style="filter: grayscale(1) invert(0.5)" />
</a>
<a class="sponsor-item sponsor-item-toc" target="_blank" rel="noopener noreferrer" href="https://1ms.run?utm_source=linuxmirrors" title="专为中国开发者提供镜像极速下载服务,告别 Docker 镜像拉取慢!</br>支持 Docker Hub、gcr.io、registry.k8s.io 等主流镜像仓库。">
<img src="/assets/images/sponsor/1ms-light.svg#only-light" alt="毫秒镜像" style="filter: grayscale(1) invert(0.5)" />
<img src="/assets/images/sponsor/1ms-dark.svg#only-dark" alt="毫秒镜像" style="filter: grayscale(1) invert(0.4)" />
</a>
<a class="sponsor-item sponsor-item-toc" target="_blank" rel="noopener noreferrer" href="https://www.dkdun.cn/aff/VAWGETUL" title="专注独立IP高频VPSR9/i9系列定制">
<img src="/assets/images/sponsor/linfengyun.png#only-light" alt="林枫云" style="filter: grayscale(1) invert(0.7)" />
<img src="/assets/images/sponsor/linfengyun.png#only-dark" alt="林枫云" style="filter: grayscale(1) invert(0.5)" />
</a>
<a class="sponsor-item sponsor-item-toc" target="_blank" rel="noopener noreferrer" href="https://www.bsncdn.org" title="香港日本高防CDN免实名/免备案,轻松阻断 DDOS / CC 攻击">
<img src="/assets/images/sponsor/businiaocdn.png#only-light" alt="不死鸟CDN" style="filter: grayscale(1) brightness(1.1)" />
<img src="/assets/images/sponsor/businiaocdn.png#only-light" alt="不死鸟CDN" style="filter: grayscale(1) brightness(1)" />
<img src="/assets/images/sponsor/businiaocdn.png#only-dark" alt="不死鸟CDN" style="filter: grayscale(1) brightness(1.4)" />
</a>
<a class="sponsor-item sponsor-item-toc" target="_blank" rel="noopener noreferrer" href="https://www.qingyeyun.com" title="香港1T高防自助防火墙无视CC大带宽回国优化线路">
@@ -42,16 +46,13 @@
<img src="/assets/images/sponsor/laikayun-dark.png#only-dark" alt="莱卡云" style="filter: grayscale(1) invert(0.3)" />
</a>
<a class="sponsor-item sponsor-item-toc" target="_blank" rel="noopener noreferrer" href="https://yunyoo.cc/aff/KPTJHNWM" title="全球高性价比云服务器低至15.99元起">
<img src="/assets/images/sponsor/yunyoo.png" alt="云悠YUNYOO" />
<img src="/assets/images/sponsor/yunyoo.png#only-light" alt="云悠YUNYOO" style="filter: grayscale(1) brightness(1)" />
<img src="/assets/images/sponsor/yunyoo.png#only-dark" alt="云悠YUNYOO" style="filter: grayscale(1) brightness(1.1)" />
</a>
<a class="sponsor-item sponsor-item-toc" target="_blank" rel="noopener noreferrer" href="https://www.sutuoyun.com" title="国内高防云28元/月香港云100M优化线路9元/月">
<img src="/assets/images/sponsor/sutuoyun.svg#only-light" alt="速拓云" />
<img src="/assets/images/sponsor/sutuoyun.svg#only-dark" alt="速拓云" style="filter: grayscale(1) invert(0.6)" />
</a>
<a class="sponsor-item sponsor-item-toc" target="_blank" rel="noopener noreferrer" href="https://www.dkdun.cn/aff/VAWGETUL" title="专注独立IP高频VPSR9/i9系列定制">
<img src="/assets/images/sponsor/linfengyun-light.png#only-light" alt="林枫云" style="filter: grayscale(1) invert(0.5)" />
<img src="/assets/images/sponsor/linfengyun-dark.png#only-dark" alt="林枫云" style="filter: grayscale(1) invert(0.4)" />
</a>
<a class="sponsor-item sponsor-item-toc" target="_blank" rel="noopener noreferrer" href="https://arcadia.cool" title="一站式代码运维平台">
<img src="/assets/images/sponsor/arcadia-light.png#only-light" alt="Arcadia" style="padding: 0 2px; filter: grayscale(1) invert(0.5)" />
<img src="/assets/images/sponsor/arcadia-dark.png#only-dark" alt="Arcadia" style="padding: 0 2px; filter: grayscale(1) invert(0.4)" />

View File

@@ -444,7 +444,7 @@ hide:
- From Developer's Perspective
This project aims to develop a universal repository switching script from the perspective of an operations and maintenance tool, rather than a tool that specifically addresses software repository requirements. The script's default behavior should be suitable for the majority of users. As an operations and maintenance tool, it should have a clear functional positioning. As a script, its pros and cons should be carefully considered from multiple perspectives, including scalability, practicality, and portability. The choice of software repository should be fully vested in the user.
This project aims to develop a universal repository switching script from the perspective of an operations and maintenance tool, rather than a tool that specifically addresses software repository requirements. The script's default behavior should be suitable for the majority of users. As an operations and maintenance tool, it should have a clear functional positioning. As a script, its pros and cons should be carefully considered from multiple perspectives, including scalability,and practicality. The choice of software repository should be fully vested in the user.
---

View File

@@ -446,7 +446,7 @@ hide:
- 开发者角度
本项目站在运维工具的角度致力于开发一个通用的换源脚本,而不是一个解决软件源需求的具体化工具,要使脚本的默认行为适用于大多数用户群体。作为运维工具要有明确的功能定位,作为脚本要从扩展性、实用性、可移植性等多个方面去衡量利弊,软件源的选择权应该完全交给用户。
本项目站在运维工具的角度致力于开发一个通用的换源脚本,而不是一个解决软件源需求的具体化工具,要使脚本的默认行为适用于大多数用户群体。作为运维工具要有明确的功能定位,作为脚本要从扩展性、实用性等多个方面去衡量利弊,软件源的选择权应该完全交给用户。
---

View File

@@ -446,7 +446,7 @@ hide:
- 開發者角度
本專案站在維運工具的角度致力於開發一個通用的換源腳本,而不是一個解決軟體源需求的具體化工具,要使腳本的預設行為適用於大多數使用者群體。作為維運工具要有明確的功能定位,作為腳本要從擴展性、實用性、可移植性等多個方面去衡量利弊,軟體源的選擇權應該完全交給使用者。
本專案站在維運工具的角度致力於開發一個通用的換源腳本,而不是一個解決軟體源需求的具體化工具,要使腳本的預設行為適用於大多數使用者群體。作為維運工具要有明確的功能定位,作為腳本要從擴展性、實用性等多個方面去衡量利弊,軟體源的選擇權應該完全交給使用者。
---