From 4c72bffba2c0a69a4edb46ed9ca8211dcae33550 Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Mon, 29 Apr 2024 11:40:26 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=84=9A=E6=9C=AC):=20=E5=A2=9E=E5=8A=A0a?= =?UTF-8?q?liyun=20dns=E7=94=B3=E8=AF=B7=E8=AF=81=E4=B9=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index eeff930..44aaf9a 100644 --- a/install.sh +++ b/install.sh @@ -1555,12 +1555,16 @@ switchDNSAPI() { if [[ "${dnsAPIStatus}" == "y" ]]; then echoContent red "\n==============================================================" echoContent yellow "1.cloudflare[默认]" + echoContent yellow "2.aliyun" echoContent red "==============================================================" read -r -p "请选择[回车]使用默认:" selectDNSAPIType case ${selectDNSAPIType} in 1) dnsAPIType="cloudflare" ;; + 2) + dnsAPIType="aliyun" + ;; *) dnsAPIType="cloudflare" ;; @@ -1587,6 +1591,24 @@ initDNSAPIConfig() { exit 0 fi fi + elif [[ "$1" == "aliyun" ]]; then + # echoContent yellow "\n CF_Token参考配置教程:https://www.v2ray-agent.com/archives/1701160377972\n" + read -r -p "请输入Ali Key:" aliKey + read -r -p "请输入Ali Secret:" aliSecret + if [[ -z "${aliKey}" || -z "${aliSecret}" ]]; then + echoContent red " ---> 输入为空,请重新输入" + initDNSAPIConfig "$1" + else + echo + if ! echo "${dnsTLSDomain}" | grep -q "\." || [[ -z $(echo "${dnsTLSDomain}" | awk -F "[.]" '{print $1}') ]]; then + echoContent green " ---> 不支持此域名申请通配符证书,建议使用此格式[xx.xx.xx]" + exit 0 + fi + read -r -p "是否使用*.${dnsTLSDomain}进行API申请通配符证书?[y/n]:" dnsAPIStatus + if [[ "${dnsAPIStatus}" != "y" ]]; then + exit 0 + fi + fi fi } # 选择ssl安装类型 @@ -1640,9 +1662,13 @@ selectAcmeInstallSSL() { # 安装SSL证书 acmeInstallSSL() { - if [[ -n "${dnsAPIType}" ]]; then + + if [[ "${dnsAPIType}" == "cloudflare" ]]; then echoContent green " ---> 生成通配符证书中" sudo CF_Token="${cfAPIToken}" "$HOME/.acme.sh/acme.sh" --issue -d "*.${dnsTLSDomain}" --dns dns_cf -k ec-256 --server "${sslType}" ${sslIPv6} 2>&1 | tee -a /etc/v2ray-agent/tls/acme.log >/dev/null + elif [[ "${dnsAPIType}" == "aliyun" ]]; then + echoContent green " ---> 生成通配符证书中" + sudo Ali_Key="${aliKey}" Ali_Secret="${aliSecret}" "$HOME/.acme.sh/acme.sh" --issue -d "*.${dnsTLSDomain}" --dns dns_ali -k ec-256 --server "${sslType}" ${sslIPv6} 2>&1 | tee -a /etc/v2ray-agent/tls/acme.log >/dev/null else echoContent green " ---> 生成证书中" sudo "$HOME/.acme.sh/acme.sh" --issue -d "${tlsDomain}" --standalone -k ec-256 --server "${sslType}" ${sslIPv6} 2>&1 | tee -a /etc/v2ray-agent/tls/acme.log >/dev/null @@ -9078,7 +9104,7 @@ menu() { cd "$HOME" || exit echoContent red "\n==============================================================" echoContent green "作者:mack-a" - echoContent green "当前版本:v3.2.45" + echoContent green "当前版本:v3.2.46" echoContent green "Github:https://github.com/mack-a/v2ray-agent" echoContent green "描述:八合一共存脚本\c" showInstallStatus