Compare commits
No commits in common. "1173805f7d4dc35693c16f32ef9093efef5722f7" and "5b8e3203a6382998265371f810d41ba4e5f0a26c" have entirely different histories.
1173805f7d
...
5b8e3203a6
9 changed files with 7 additions and 44 deletions
|
@ -21,13 +21,6 @@ config
|
||||||
Custom NGINX logic, templated within a standard `server` section with
|
Custom NGINX logic, templated within a standard `server` section with
|
||||||
`server_name` and TLS parameters set. Defaults to simple static hosting.
|
`server_name` and TLS parameters set. Defaults to simple static hosting.
|
||||||
|
|
||||||
altdomains
|
|
||||||
Alternative domain names for this vhost and related TLS certificate.
|
|
||||||
|
|
||||||
uacme-hookscript
|
|
||||||
Custom hook passed to the __uacme_obtain type: useful to integrate the
|
|
||||||
dns-01 challenge with third-party DNS providers.
|
|
||||||
|
|
||||||
AUTHORS
|
AUTHORS
|
||||||
-------
|
-------
|
||||||
Timothée Floure <timothee.floure@posteo.net>
|
Timothée Floure <timothee.floure@posteo.net>
|
||||||
|
|
|
@ -23,22 +23,9 @@ else
|
||||||
domain="${__object_id:?}"
|
domain="${__object_id:?}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
altdomains=
|
|
||||||
if [ -f "${__object:?}/parameter/altdomains" ];
|
|
||||||
then
|
|
||||||
altdomains="$(cat "${__object:?}/parameter/altdomains")"
|
|
||||||
fi
|
|
||||||
|
|
||||||
set_custom_uacme_hookscript=
|
|
||||||
if [ -f "${__object:?}/parameter/uacme-hookscript" ];
|
|
||||||
then
|
|
||||||
uacme_hookscript="$(cat "${__object:?}/parameter/uacme-hookscript")"
|
|
||||||
set_custom_uacme_hookscript="--hookscript $uacme_hookscript"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Deploy simple HTTP vhost, allowing to serve ACME challenges.
|
# Deploy simple HTTP vhost, allowing to serve ACME challenges.
|
||||||
__recycledcloud_nginx_vhost "301-to-https-$domain" \
|
__recycledcloud_nginx_vhost "301-to-https-$domain" \
|
||||||
--domain "$domain" --altdomains "$altdomains" --to-https
|
--domain "$domain" --to-https
|
||||||
|
|
||||||
# Obtaining TLS cert.
|
# Obtaining TLS cert.
|
||||||
cert_ownership=$nginx_user
|
cert_ownership=$nginx_user
|
||||||
|
@ -47,12 +34,8 @@ if [ -f "${__object:?}/parameter/force-cert-ownership-to" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
__uacme_account
|
__uacme_account
|
||||||
# shellcheck disable=SC2086
|
|
||||||
require="__recycledcloud_nginx_vhost/301-to-https-$domain __uacme_account" \
|
require="__recycledcloud_nginx_vhost/301-to-https-$domain __uacme_account" \
|
||||||
__uacme_obtain "$domain" \
|
__uacme_obtain "$domain" --owner $cert_ownership \
|
||||||
--altdomains "$altdomains" \
|
|
||||||
$set_custom_uacme_hookscript \
|
|
||||||
--owner "$cert_ownership" \
|
|
||||||
--install-key-to "$nginx_certdir/$domain/privkey.pem" \
|
--install-key-to "$nginx_certdir/$domain/privkey.pem" \
|
||||||
--install-cert-to "/$nginx_certdir/$domain/fullchain.pem" \
|
--install-cert-to "/$nginx_certdir/$domain/fullchain.pem" \
|
||||||
--renew-hook "service nginx reload"
|
--renew-hook "service nginx reload"
|
||||||
|
@ -69,8 +52,7 @@ if [ -f "${__object:?}/parameter/config" ]; then
|
||||||
cat "$nginx_logic" > "${__object:?}/files/config"
|
cat "$nginx_logic" > "${__object:?}/files/config"
|
||||||
|
|
||||||
require="__uacme_obtain/$domain" __recycledcloud_nginx_vhost "$domain" \
|
require="__uacme_obtain/$domain" __recycledcloud_nginx_vhost "$domain" \
|
||||||
--altdomains "$altdomains" --config "${__object:?}/files/config"
|
--config "${__object:?}/files/config"
|
||||||
else
|
else
|
||||||
require="__uacme_obtain/$domain" __recycledcloud_nginx_vhost "$domain" \
|
require="__uacme_obtain/$domain" __recycledcloud_nginx_vhost "$domain"
|
||||||
--altdomains "$altdomains"
|
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
config
|
config
|
||||||
domain
|
domain
|
||||||
altdomains
|
|
||||||
uacme-hookscript
|
|
||||||
force-cert-ownership-to
|
force-cert-ownership-to
|
||||||
|
|
|
@ -10,7 +10,7 @@ cat <<- EOF
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Name
|
# Name
|
||||||
echo "server_name ${DOMAIN:?} $ALTDOMAINS;"
|
echo "server_name ${DOMAIN:?};"
|
||||||
|
|
||||||
# ACME challenges.
|
# ACME challenges.
|
||||||
cat << EOF
|
cat << EOF
|
||||||
|
|
|
@ -10,7 +10,7 @@ cat <<- EOF
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Name
|
# Name
|
||||||
echo "server_name ${DOMAIN:?} $ALTDOMAINS;"
|
echo "server_name ${DOMAIN:?};"
|
||||||
|
|
||||||
# ACME challenges.
|
# ACME challenges.
|
||||||
cat << EOF
|
cat << EOF
|
||||||
|
|
|
@ -52,9 +52,6 @@ lport
|
||||||
The port to which we listen. If this is omitted, the defaults of `80` for
|
The port to which we listen. If this is omitted, the defaults of `80` for
|
||||||
HTTP and `443` for HTTPS are used.
|
HTTP and `443` for HTTPS are used.
|
||||||
|
|
||||||
altdomains
|
|
||||||
Alternative domain names for this vhost.
|
|
||||||
|
|
||||||
BOOLEAN PARAMETERS
|
BOOLEAN PARAMETERS
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
|
|
@ -63,13 +63,6 @@ else
|
||||||
fi
|
fi
|
||||||
export DOMAIN
|
export DOMAIN
|
||||||
|
|
||||||
ALTDOMAINS=
|
|
||||||
if [ -f "${__object:?}/parameter/altdomains" ];
|
|
||||||
then
|
|
||||||
ALTDOMAINS="$(cat "${__object:?}/parameter/altdomains")"
|
|
||||||
fi
|
|
||||||
export ALTDOMAINS
|
|
||||||
|
|
||||||
# Use TLS ?
|
# Use TLS ?
|
||||||
if [ -f "${__object:?}/parameter/no-tls" ];
|
if [ -f "${__object:?}/parameter/no-tls" ];
|
||||||
then
|
then
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
domain
|
domain
|
||||||
|
lport
|
||||||
config
|
config
|
||||||
altdomains
|
|
||||||
|
|
Reference in a new issue