This commit is contained in:
wsl-d4
2025-08-26 16:44:41 +08:00
parent 4c586c6cfc
commit 722e15b458
30 changed files with 3900 additions and 3889 deletions

View File

@@ -1,23 +1,28 @@
#!/bin/bash
# 定义变量
DOMAIN="registry.deepseak.icu" # 请替换为你的域名
DOMAIN="registry.deepseak.icu" # 域名
ADDITIONAL_DOMAINS=("active.deepseak.icu" "bbs.deepseak.icu" "image.deepseak.icu" "gitea.deepseak.icu") # 额外域名
EMAIL="hpuzhagnwei@163.com" # 请替换为你的邮箱地址
# 检查 Certbot 是否安装
if ! command -v certbot &> /dev/null
then
echo "Certbot 未安装,开始安装..."
sudo dnf install epel-release -y
sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
sudo dnf config-manager --set-enabled crb
sudo dnf update
sudo dnf install certbot python3-certbot-nginx -y
sudo apt update
sudo apt install -y certbot python3-certbot-nginx
fi
# 申请证书
echo "开始申请证书..."
sudo certbot certonly --nginx -d $DOMAIN --email $EMAIL --agree-tos --no-eff-email
# 构建域名参数
DOMAIN_ARGS="-d $DOMAIN"
for domain in "${ADDITIONAL_DOMAINS[@]}"; do
DOMAIN_ARGS="$DOMAIN_ARGS -d $domain"
done
sudo certbot certonly --nginx $DOMAIN_ARGS --email $EMAIL --agree-tos --no-eff-email
# 检查证书是否申请成功
if [ $? -eq 0 ]; then