mirror of https://github.com/mack-a/v2ray-agent
feat(脚本): 增加aliyun dns申请证书
parent
bd6e854b0f
commit
4c72bffba2
30
install.sh
30
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
|
||||
|
|
Loading…
Reference in New Issue