Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| abb193a03c | |||
| d26a6e5ec8 |
@@ -47,17 +47,17 @@ if [ -z $SKIP_CERTBOT ]; then
|
|||||||
if ! certbot certificates --cert-name netoik.io | grep --quiet netoik.io; then
|
if ! certbot certificates --cert-name netoik.io | grep --quiet netoik.io; then
|
||||||
certbot certonly --cert-name netoik.io --non-interactive --agree-tos --email samuel.campos@netoik.io --dns-ovh --dns-ovh-credentials %{_sysconfdir}/certbot/ovh.ini -d *.netoik.io -d *.samuel-campos.fr
|
certbot certonly --cert-name netoik.io --non-interactive --agree-tos --email samuel.campos@netoik.io --dns-ovh --dns-ovh-credentials %{_sysconfdir}/certbot/ovh.ini -d *.netoik.io -d *.samuel-campos.fr
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
# Skipping certbot, so create self-signed certificate
|
||||||
|
mkdir --parents /etc/letsencrypt/live/netoik.io
|
||||||
|
openssl req -newkey rsa:4096 -nodes -keyout /etc/letsencrypt/live/netoik.io/privkey.pem -x509 -days 365 -out /etc/letsencrypt/live/netoik.io/fullchain.pem -subj "/C=US/ST=State/L=City/O=Organization/OU=Department/CN=netoik.io"
|
||||||
|
fi
|
||||||
|
|
||||||
# Create ssl dh params if not already exists
|
# Create ssl dh params if not already exists
|
||||||
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
|
||||||
|
|
||||||
else
|
|
||||||
# Skipping certbot, so remove certificate entries in nginx conf
|
|
||||||
sed --in-place 's/^ssl_certificate/# ssl_certificate/g' %{_sysconfdir}/nginx/conf.d/0_security.conf
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Restart services
|
# Restart services
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl reenable nginx.service certbot-renew.timer
|
systemctl reenable nginx.service certbot-renew.timer
|
||||||
|
|||||||
Reference in New Issue
Block a user