|
|
|
@@ -22,14 +22,18 @@ Install the reverse proxy called nginx with a predefined configuration and with
|
|
|
|
%make_install
|
|
|
|
%make_install
|
|
|
|
|
|
|
|
|
|
|
|
%post
|
|
|
|
%post
|
|
|
|
|
|
|
|
if [ -z $SKIP_CERTBOT ]; then
|
|
|
|
|
|
|
|
if [ -z $OVH_ENDPOINT ]; then echo "Missing env var OVH_ENDPOINT!" 1>&2; exit 1; fi
|
|
|
|
|
|
|
|
if [ -z $OVH_APPLICATION_NAME ]; then echo "Missing env var OVH_APPLICATION_KEY!" 1>&2; exit 1; fi
|
|
|
|
|
|
|
|
if [ -z $OVH_APPLICATION_DESCRIPTION ]; then echo "Missing env var OVH_APPLICATION_DESCRIPTION!" 1>&2; exit 1; fi
|
|
|
|
|
|
|
|
if [ -z $OVH_APPLICATION_KEY ]; then echo "Missing env var OVH_APPLICATION_KEY!" 1>&2; exit 1; fi
|
|
|
|
|
|
|
|
if [ -z $OVH_APPLICATION_SECRET ]; then echo "Missing env var OVH_APPLICATION_SECRET!" 1>&2; exit 1; fi
|
|
|
|
|
|
|
|
if [ -z $OVH_CONSUMER_KEY ]; then echo "Missing env var OVH_CONSUMER_KEY!" 1>&2; exit 1; fi
|
|
|
|
|
|
|
|
|
|
|
|
# Replace secrets in ovh.ini
|
|
|
|
# Replace secrets in ovh.ini
|
|
|
|
envsubst < %{_sysconfdir}/certbot/ovh.ini > %{_sysconfdir}/certbot/.ovh.ini.new
|
|
|
|
envsubst < %{_sysconfdir}/certbot/ovh.ini > %{_sysconfdir}/certbot/.ovh.ini.new
|
|
|
|
if cmp --silent %{_sysconfdir}/certbot/.ovh.ini.new %{_sysconfdir}/certbot/ovh.ini; then
|
|
|
|
|
|
|
|
rm %{_sysconfdir}/certbot/.ovh.ini.new
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
mv %{_sysconfdir}/certbot/.ovh.ini.new %{_sysconfdir}/certbot/ovh.ini
|
|
|
|
mv %{_sysconfdir}/certbot/.ovh.ini.new %{_sysconfdir}/certbot/ovh.ini
|
|
|
|
chmod 600 %{_sysconfdir}/certbot/ovh.ini
|
|
|
|
chmod 600 %{_sysconfdir}/certbot/ovh.ini
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Create virtualenv with certot
|
|
|
|
# Create virtualenv with certot
|
|
|
|
if [ ! -d "/opt/certbot" ]; then
|
|
|
|
if [ ! -d "/opt/certbot" ]; then
|
|
|
|
@@ -47,6 +51,7 @@ fi
|
|
|
|
if [ ! -f "%{_sysconfdir}/letsencrypt/ssl-dhparams.pem" ]; then
|
|
|
|
if [ ! -f "%{_sysconfdir}/letsencrypt/ssl-dhparams.pem" ]; then
|
|
|
|
openssl dhparam -out %{_sysconfdir}/letsencrypt/ssl-dhparams.pem 2048
|
|
|
|
openssl dhparam -out %{_sysconfdir}/letsencrypt/ssl-dhparams.pem 2048
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Restart services
|
|
|
|
# Restart services
|
|
|
|
systemctl daemon-reload
|
|
|
|
systemctl daemon-reload
|
|
|
|
|