wildcard support
SSL Let's Encrypt Wildcard support.
This commit is contained in:
parent
cf38ef4b1c
commit
e1902acebe
|
@ -58,7 +58,9 @@ site_ssl_on() {
|
||||||
|
|
||||||
# Create new certificate
|
# Create new certificate
|
||||||
[[ $(conf_read debug) == "true" ]] && param="--test-cert" || param=""
|
[[ $(conf_read debug) == "true" ]] && param="--test-cert" || param=""
|
||||||
if [[ ! -a /etc/letsencrypt/live/$domain/fullchain.pem && $subdomflag == 0 ]]; then
|
if [[ ! -a /etc/letsencrypt/live/$domain/fullchain.pem && $cache == "-wildcard" ]]; then
|
||||||
|
sudo certbot certonly --manual --preferred-challenges=dns --no-eff-email --manual-public-ip-logging-ok --agree-tos --staple-ocsp --must-staple --email $cermail -d $domain -d *.$domain $param
|
||||||
|
elif [[ ! -a /etc/letsencrypt/live/$domain/fullchain.pem && $subdomflag == 0 ]]; then
|
||||||
sudo certbot certonly --webroot -w /var/www/$root/htdocs/ -d $domain -d www.$domain --email $cermail --no-eff-email --agree-tos --staple-ocsp --must-staple $param
|
sudo certbot certonly --webroot -w /var/www/$root/htdocs/ -d $domain -d www.$domain --email $cermail --no-eff-email --agree-tos --staple-ocsp --must-staple $param
|
||||||
elif [[ ! -a /etc/letsencrypt/live/$domain/fullchain.pem && $subdomflag == 1 ]]; then
|
elif [[ ! -a /etc/letsencrypt/live/$domain/fullchain.pem && $subdomflag == 1 ]]; then
|
||||||
sudo certbot certonly --webroot -w /var/www/$root/htdocs/ -d $domain --email $cermail --no-eff-email --agree-tos --staple-ocsp --must-staple $param
|
sudo certbot certonly --webroot -w /var/www/$root/htdocs/ -d $domain --email $cermail --no-eff-email --agree-tos --staple-ocsp --must-staple $param
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# Site Manager Plugin (Create, delete and de/activate)
|
# Site Manager Plugin (Create, delete and de/activate)
|
||||||
# Syntax: site <domain> <option> <argument>
|
# Syntax: site <domain> <option> <argument>
|
||||||
# Options: -html, -php, -mysql, -wp, -wpsubdir, -wpsubdom, -parked, -proxy, -on, -off, -delete, -delete-all, -list, -nocache, -cache, -ssl-on, ssl-off, -force-redirect
|
# Options: -html, -php, -mysql, -wp, -wpsubdir, -wpsubdom, -parked, -proxy, -on, -off, -delete, -delete-all, -list, -nocache, -cache, -ssl-on, ssl-off, -force-redirect
|
||||||
# Arguments: -cache, -root, -subdomain, -ignore-ssl
|
# Arguments: -cache, -root, -subdomain, -ignore-ssl, -wildcard
|
||||||
|
|
||||||
# shopt is necessary for this kind !(html|22222) of patterns
|
# shopt is necessary for this kind !(html|22222) of patterns
|
||||||
shopt -s extglob
|
shopt -s extglob
|
||||||
|
@ -24,7 +24,7 @@ if [[ ! $(conf_read nginx) == "true" ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if user entered arg before option and correct it.
|
# Check if user entered arg before option and correct it.
|
||||||
if [[ -n $cache && ($type == "-cache" || $type == "-ignore-ssl") ]]; then
|
if [[ -n $cache && ($type == "-cache" || $type == "-root" || $type == "-subdomain" || $type == "-ignore-ssl" || $type == "-wildcard") ]]; then
|
||||||
type="$3"
|
type="$3"
|
||||||
cache="$2"
|
cache="$2"
|
||||||
fi
|
fi
|
||||||
|
@ -111,7 +111,7 @@ fi
|
||||||
if [[ $cache == "-cache" && $wp == [045] ]]; then
|
if [[ $cache == "-cache" && $wp == [045] ]]; then
|
||||||
echo "${red} Site $domain is not a WP site! ${end}"
|
echo "${red} Site $domain is not a WP site! ${end}"
|
||||||
exit 1
|
exit 1
|
||||||
elif [[ -n $cache && ( $cache != "-cache" && $cache != "-root" && $cache != "-subdomain" && $cache != "-ignore-ssl" ) && $type != "-parked" ]]; then
|
elif [[ -n $cache && ( $cache != "-cache" && $cache != "-root" && $cache != "-subdomain" && $cache != "-ignore-ssl" && $cache != "-wildcard" ) && $type != "-parked" ]]; then
|
||||||
echo "${red} $cache is not a valid argument! ${end}"
|
echo "${red} $cache is not a valid argument! ${end}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue