Proxy updated for auto renew letscrypt certificated

pull/508/head
OscarSotoSanchez 2020-06-29 16:37:26 +02:00
parent 45d3ba6078
commit 3b5668d828
7 changed files with 31 additions and 8 deletions

View File

@ -74,7 +74,7 @@ services:
- MAX_PORT=65535
nginx:
image: openvidu/openvidu-proxy:2.0.0
image: openvidu/openvidu-proxy:3.0.0-beta1
restart: on-failure
network_mode: host
volumes:

View File

@ -2,9 +2,9 @@ VERSION=$1
if [[ ! -z $VERSION ]]; then
cp ../utils/discover_my_public_ip.sh ./discover_my_public_ip.sh
docker build -t openvidu/openvidu-nginx:$VERSION .
docker build -t openvidu/openvidu-proxy:$VERSION .
rm ./discover_my_public_ip.sh
else
echo "Error: You need to specify a version as first argument"
fi
fi

View File

@ -94,4 +94,10 @@ server {
deny all;
proxy_pass http://openviduserver;
}
# letsencrypt
location /.well-known/acme-challenge {
root /var/www/certbot;
try_files $uri $uri/ =404;
}
}

View File

@ -94,4 +94,10 @@ server {
deny all;
proxy_pass http://openviduserver;
}
# letsencrypt
location /.well-known/acme-challenge {
root /var/www/certbot;
try_files $uri $uri/ =404;
}
}

View File

@ -156,4 +156,10 @@ server {
deny all;
proxy_pass http://openviduserver;
}
# letsencrypt
location /.well-known/acme-challenge {
root /var/www/certbot;
try_files $uri $uri/ =404;
}
}

View File

@ -166,4 +166,10 @@ server {
deny all;
proxy_pass http://openviduserver;
}
# letsencrypt
location /.well-known/acme-challenge {
root /var/www/certbot;
try_files $uri $uri/ =404;
}
}

View File

@ -127,8 +127,10 @@ case ${CERTIFICATE_TYPE} in
fi
;;
"letsencrypt")
echo "0 12 * * * certbot renew >> /var/log/nginx/cron-letsencrypt.log" | crontab - # Auto renew cert
"letsencrypt")
# Init cron
/usr/sbin/crond -f &
echo '0 */12 * * * certbot renew --post-hook "nginx -s reload" >> /var/log/cron-letsencrypt.log' | crontab - # Auto renew cert
if [[ ! -f "${CERTIFICATES_FOLDER:?}/${DOMAIN_OR_PUBLIC_IP}/privkey.pem" && \
! -f "${CERTIFICATES_FOLDER:?}/${DOMAIN_OR_PUBLIC_IP}/fullchain.pem" ]]; then
@ -337,8 +339,5 @@ printf "\n ======================================="
printf "\n\n"
nginx -s reload
# Init cron
/usr/sbin/crond -f &
# nginx logs
tail -f /var/log/nginx/*.log