Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3d50d99368 | |||
| 3a9d39de4c | |||
| d7d87e0162 | |||
| 48792673dc |
@@ -72,7 +72,7 @@ Some commands to deploy the RPM package on server
|
|||||||
|
|
||||||
- Show available versions:
|
- Show available versions:
|
||||||
```shell
|
```shell
|
||||||
dnf --showduplicates netoik-rp
|
dnf search --showduplicates netoik-rp
|
||||||
```
|
```
|
||||||
|
|
||||||
- Create certbot ovh credentials here:
|
- Create certbot ovh credentials here:
|
||||||
@@ -98,6 +98,11 @@ Some commands to deploy the RPM package on server
|
|||||||
set +a
|
set +a
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- Install or upgrade without certbot (for testing environment)
|
||||||
|
```shell
|
||||||
|
SKIP_CERTBOT=true dnf --nogpgcheck --refresh --assumeyes --best install netoik-rp
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
# Security Notes
|
# Security Notes
|
||||||
|
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
Description=Renew certbot certificates
|
Description=Renew certbot certificates
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=certbot_renew
|
ExecStart=/usr/sbin/certbot_renew
|
||||||
|
|||||||
@@ -22,14 +22,19 @@ Install the reverse proxy called nginx with a predefined configuration and with
|
|||||||
%make_install
|
%make_install
|
||||||
|
|
||||||
%post
|
%post
|
||||||
|
if [ -z $SKIP_CERTBOT ]; then
|
||||||
|
# Check required OVH variables
|
||||||
|
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
|
||||||
@@ -48,6 +53,11 @@ 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