wildcard support

SSL Let's Encrypt Wildcard support.
This commit is contained in:
Cristhian Martínez Ochoa 2018-08-31 20:36:06 -06:00
parent cf38ef4b1c
commit e1902acebe
2 changed files with 6 additions and 4 deletions

View file

@ -58,7 +58,9 @@ site_ssl_on() {
# Create new certificate
[[ $(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
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

View file

@ -3,7 +3,7 @@
# Site Manager Plugin (Create, delete and de/activate)
# 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
# Arguments: -cache, -root, -subdomain, -ignore-ssl
# Arguments: -cache, -root, -subdomain, -ignore-ssl, -wildcard
# shopt is necessary for this kind !(html|22222) of patterns
shopt -s extglob
@ -24,7 +24,7 @@ if [[ ! $(conf_read nginx) == "true" ]]; then
fi
# 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"
cache="$2"
fi
@ -111,7 +111,7 @@ fi
if [[ $cache == "-cache" && $wp == [045] ]]; then
echo "${red} Site $domain is not a WP site! ${end}"
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}"
exit 1
fi