fix: 修复Gitee镜像加速仍从GitHub下载的问题
问题描述: - 虽然显示"使用Gitee镜像加速" - 但acme.sh安装脚本内部仍从GitHub下载tar.gz包 - 导致国内网络安装失败 根本原因: - 使用了 --install-online 参数 - acme.sh脚本会在线下载master.tar.gz - 默认还是从GitHub下载 修复方案: - 使用acme.sh官方推荐的方法 - 设置环境变量 ACME_USE_GITEE=1 - 让acme.sh内部也使用Gitee源 - 移除 --install-online 参数 官方文档: https://github.com/acmesh-official/acme.sh/wiki/Install-in-China 修复代码: # 国内网络 export ACME_USE_GITEE=1 curl https://gitee.com/neilpang/acme.sh/raw/master/acme.sh | sh 修复函数: - deploy_acme_letsencrypt - deploy_acme_zerossl - deploy_acme_buypass 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
97
install.sh
97
install.sh
@@ -1244,27 +1244,34 @@ deploy_acme_letsencrypt() {
|
||||
|
||||
# 检测是否在中国大陆,使用镜像加速
|
||||
if curl -s --connect-timeout 3 https://www.google.com > /dev/null 2>&1; then
|
||||
# 海外网络
|
||||
ACME_INSTALL_URL="https://get.acme.sh"
|
||||
# 海外网络 - 使用官方源
|
||||
if curl -fsSL https://get.acme.sh | sh; then
|
||||
source ~/.bashrc 2>/dev/null || source ~/.profile 2>/dev/null || true
|
||||
print_success "acme.sh 安装成功"
|
||||
else
|
||||
print_error "acme.sh 安装失败"
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
# 中国大陆,使用Gitee镜像
|
||||
# 中国大陆 - 使用Gitee镜像(官方方法)
|
||||
print_info "检测到国内网络,使用Gitee镜像加速..."
|
||||
ACME_INSTALL_URL="https://gitee.com/neilpang/acme.sh/raw/master/acme.sh"
|
||||
fi
|
||||
|
||||
if curl -fsSL "$ACME_INSTALL_URL" | sh -s -- --install-online; then
|
||||
# 重新加载环境变量
|
||||
source ~/.bashrc 2>/dev/null || source ~/.profile 2>/dev/null || true
|
||||
print_success "acme.sh 安装成功"
|
||||
else
|
||||
print_error "acme.sh 安装失败"
|
||||
echo ""
|
||||
print_warning "解决方案:"
|
||||
echo " 1. 检查网络连接"
|
||||
echo " 2. 尝试手动安装: curl https://get.acme.sh | sh"
|
||||
echo " 3. 或访问: https://github.com/acmesh-official/acme.sh/wiki/Install-in-China"
|
||||
echo ""
|
||||
return 1
|
||||
# 设置环境变量,让acme.sh使用Gitee源
|
||||
export ACME_USE_GITEE=1
|
||||
|
||||
if curl -fsSL https://gitee.com/neilpang/acme.sh/raw/master/acme.sh | sh; then
|
||||
source ~/.bashrc 2>/dev/null || source ~/.profile 2>/dev/null || true
|
||||
print_success "acme.sh 安装成功"
|
||||
else
|
||||
print_error "acme.sh 安装失败"
|
||||
echo ""
|
||||
print_warning "解决方案:"
|
||||
echo " 1. 检查网络连接"
|
||||
echo " 2. 尝试手动安装: export ACME_USE_GITEE=1 && curl https://gitee.com/neilpang/acme.sh/raw/master/acme.sh | sh"
|
||||
echo " 3. 或访问: https://github.com/acmesh-official/acme.sh/wiki/Install-in-China"
|
||||
echo ""
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1316,18 +1323,25 @@ deploy_acme_zerossl() {
|
||||
|
||||
# 检测网络环境
|
||||
if curl -s --connect-timeout 3 https://www.google.com > /dev/null 2>&1; then
|
||||
ACME_INSTALL_URL="https://get.acme.sh"
|
||||
# 海外网络
|
||||
if curl -fsSL https://get.acme.sh | sh; then
|
||||
source ~/.bashrc 2>/dev/null || source ~/.profile 2>/dev/null || true
|
||||
print_success "acme.sh 安装成功"
|
||||
else
|
||||
print_error "acme.sh 安装失败"
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
# 中国大陆 - 使用Gitee镜像
|
||||
print_info "检测到国内网络,使用Gitee镜像加速..."
|
||||
ACME_INSTALL_URL="https://gitee.com/neilpang/acme.sh/raw/master/acme.sh"
|
||||
fi
|
||||
|
||||
if curl -fsSL "$ACME_INSTALL_URL" | sh -s -- --install-online; then
|
||||
source ~/.bashrc 2>/dev/null || source ~/.profile 2>/dev/null || true
|
||||
print_success "acme.sh 安装成功"
|
||||
else
|
||||
print_error "acme.sh 安装失败"
|
||||
return 1
|
||||
export ACME_USE_GITEE=1
|
||||
if curl -fsSL https://gitee.com/neilpang/acme.sh/raw/master/acme.sh | sh; then
|
||||
source ~/.bashrc 2>/dev/null || source ~/.profile 2>/dev/null || true
|
||||
print_success "acme.sh 安装成功"
|
||||
else
|
||||
print_error "acme.sh 安装失败"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1373,18 +1387,25 @@ deploy_acme_buypass() {
|
||||
|
||||
# 检测网络环境
|
||||
if curl -s --connect-timeout 3 https://www.google.com > /dev/null 2>&1; then
|
||||
ACME_INSTALL_URL="https://get.acme.sh"
|
||||
# 海外网络
|
||||
if curl -fsSL https://get.acme.sh | sh; then
|
||||
source ~/.bashrc 2>/dev/null || source ~/.profile 2>/dev/null || true
|
||||
print_success "acme.sh 安装成功"
|
||||
else
|
||||
print_error "acme.sh 安装失败"
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
# 中国大陆 - 使用Gitee镜像
|
||||
print_info "检测到国内网络,使用Gitee镜像加速..."
|
||||
ACME_INSTALL_URL="https://gitee.com/neilpang/acme.sh/raw/master/acme.sh"
|
||||
fi
|
||||
|
||||
if curl -fsSL "$ACME_INSTALL_URL" | sh -s -- --install-online; then
|
||||
source ~/.bashrc 2>/dev/null || source ~/.profile 2>/dev/null || true
|
||||
print_success "acme.sh 安装成功"
|
||||
else
|
||||
print_error "acme.sh 安装失败"
|
||||
return 1
|
||||
export ACME_USE_GITEE=1
|
||||
if curl -fsSL https://gitee.com/neilpang/acme.sh/raw/master/acme.sh | sh; then
|
||||
source ~/.bashrc 2>/dev/null || source ~/.profile 2>/dev/null || true
|
||||
print_success "acme.sh 安装成功"
|
||||
else
|
||||
print_error "acme.sh 安装失败"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user