mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-04-19 21:42:24 +00:00
update - SSL Certificate Management
Get SSL Revoke Force Renew
This commit is contained in:
parent
783fa856c3
commit
f36034541e
1 changed files with 31 additions and 5 deletions
36
x-ui.sh
36
x-ui.sh
|
@ -517,7 +517,26 @@ install_acme() {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
#method for standalone mode
|
ssl_cert_issue_main() {
|
||||||
|
echo "1) Get SSL"
|
||||||
|
echo "2) Revoke"
|
||||||
|
echo "3) Force Renew"
|
||||||
|
read -p "Choose an option: " choice
|
||||||
|
case "$choice" in
|
||||||
|
1) ssl_cert_issue ;;
|
||||||
|
2)
|
||||||
|
local domain=""
|
||||||
|
read -p "Please enter your domain name to revoke the certificate: " domain
|
||||||
|
~/.acme.sh/acme.sh --revoke -d ${domain}
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
local domain=""
|
||||||
|
read -p "Please enter your domain name to forcefully renew an SSL certificate: " domain
|
||||||
|
~/.acme.sh/acme.sh --renew -d ${domain} --force ;;
|
||||||
|
*) echo "Invalid choice" ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
ssl_cert_issue() {
|
ssl_cert_issue() {
|
||||||
#check for acme.sh first
|
#check for acme.sh first
|
||||||
if ! command -v ~/.acme.sh/acme.sh &>/dev/null; then
|
if ! command -v ~/.acme.sh/acme.sh &>/dev/null; then
|
||||||
|
@ -547,11 +566,18 @@ ssl_cert_issue() {
|
||||||
LOGD "your domain is:${domain},check it..."
|
LOGD "your domain is:${domain},check it..."
|
||||||
#here we need to judge whether there exists cert already
|
#here we need to judge whether there exists cert already
|
||||||
local currentCert=$(~/.acme.sh/acme.sh --list | tail -1 | awk '{print $1}')
|
local currentCert=$(~/.acme.sh/acme.sh --list | tail -1 | awk '{print $1}')
|
||||||
|
|
||||||
if [ ${currentCert} == ${domain} ]; then
|
if [ ${currentCert} == ${domain} ]; then
|
||||||
local certInfo=$(~/.acme.sh/acme.sh --list)
|
local certInfo=$(~/.acme.sh/acme.sh --list)
|
||||||
LOGE "system already have certs here,can not issue again,current certs details:"
|
LOGE "system already has certs here,can not issue again,current certs details:"
|
||||||
LOGI "$certInfo"
|
LOGI "$certInfo"
|
||||||
exit 1
|
read -p "Do you want to revoke the existing certificate? (yes/no): " choice
|
||||||
|
if [ "$choice" == "yes" ]; then
|
||||||
|
~/.acme.sh/acme.sh --revoke -d ${domain}
|
||||||
|
LOGI "Certificate revoked"
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
LOGI "your domain is ready for issuing cert now..."
|
LOGI "your domain is ready for issuing cert now..."
|
||||||
fi
|
fi
|
||||||
|
@ -687,7 +713,7 @@ show_menu() {
|
||||||
${green}14.${plain} Disable x-ui On System Startup
|
${green}14.${plain} Disable x-ui On System Startup
|
||||||
————————————————
|
————————————————
|
||||||
${green}15.${plain} Enable BBR
|
${green}15.${plain} Enable BBR
|
||||||
${green}16.${plain} Apply for an SSL Certificate
|
${green}16.${plain} SSL Certificate Management
|
||||||
${green}17.${plain} Update Geo Files
|
${green}17.${plain} Update Geo Files
|
||||||
${green}18.${plain} Active Firewall and open ports
|
${green}18.${plain} Active Firewall and open ports
|
||||||
${green}19.${plain} Install WARP
|
${green}19.${plain} Install WARP
|
||||||
|
@ -746,7 +772,7 @@ show_menu() {
|
||||||
enable_bbr
|
enable_bbr
|
||||||
;;
|
;;
|
||||||
16)
|
16)
|
||||||
ssl_cert_issue
|
ssl_cert_issue_main
|
||||||
;;
|
;;
|
||||||
17)
|
17)
|
||||||
update_geo
|
update_geo
|
||||||
|
|
Loading…
Reference in a new issue