6
0
Fork 0

Compare commits

..

No commits in common. "1173805f7d4dc35693c16f32ef9093efef5722f7" and "5b8e3203a6382998265371f810d41ba4e5f0a26c" have entirely different histories.

9 changed files with 7 additions and 44 deletions

View file

@ -21,13 +21,6 @@ config
Custom NGINX logic, templated within a standard `server` section with
`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
-------
Timothée Floure <timothee.floure@posteo.net>

View file

@ -23,22 +23,9 @@ else
domain="${__object_id:?}"
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.
__recycledcloud_nginx_vhost "301-to-https-$domain" \
--domain "$domain" --altdomains "$altdomains" --to-https
--domain "$domain" --to-https
# Obtaining TLS cert.
cert_ownership=$nginx_user
@ -47,12 +34,8 @@ if [ -f "${__object:?}/parameter/force-cert-ownership-to" ]; then
fi
__uacme_account
# shellcheck disable=SC2086
require="__recycledcloud_nginx_vhost/301-to-https-$domain __uacme_account" \
__uacme_obtain "$domain" \
--altdomains "$altdomains" \
$set_custom_uacme_hookscript \
--owner "$cert_ownership" \
__uacme_obtain "$domain" --owner $cert_ownership \
--install-key-to "$nginx_certdir/$domain/privkey.pem" \
--install-cert-to "/$nginx_certdir/$domain/fullchain.pem" \
--renew-hook "service nginx reload"
@ -69,8 +52,7 @@ if [ -f "${__object:?}/parameter/config" ]; then
cat "$nginx_logic" > "${__object:?}/files/config"
require="__uacme_obtain/$domain" __recycledcloud_nginx_vhost "$domain" \
--altdomains "$altdomains" --config "${__object:?}/files/config"
--config "${__object:?}/files/config"
else
require="__uacme_obtain/$domain" __recycledcloud_nginx_vhost "$domain" \
--altdomains "$altdomains"
require="__uacme_obtain/$domain" __recycledcloud_nginx_vhost "$domain"
fi

View file

@ -1,5 +1,3 @@
config
domain
altdomains
uacme-hookscript
force-cert-ownership-to

View file

@ -10,7 +10,7 @@ cat <<- EOF
EOF
# Name
echo "server_name ${DOMAIN:?} $ALTDOMAINS;"
echo "server_name ${DOMAIN:?};"
# ACME challenges.
cat << EOF

View file

@ -10,7 +10,7 @@ cat <<- EOF
EOF
# Name
echo "server_name ${DOMAIN:?} $ALTDOMAINS;"
echo "server_name ${DOMAIN:?};"
# ACME challenges.
cat << EOF

View file

@ -52,9 +52,6 @@ lport
The port to which we listen. If this is omitted, the defaults of `80` for
HTTP and `443` for HTTPS are used.
altdomains
Alternative domain names for this vhost.
BOOLEAN PARAMETERS
------------------

View file

@ -63,13 +63,6 @@ else
fi
export DOMAIN
ALTDOMAINS=
if [ -f "${__object:?}/parameter/altdomains" ];
then
ALTDOMAINS="$(cat "${__object:?}/parameter/altdomains")"
fi
export ALTDOMAINS
# Use TLS ?
if [ -f "${__object:?}/parameter/no-tls" ];
then

View file

@ -1,3 +1,3 @@
domain
lport
config
altdomains