diff --git a/openvidu-server/deployments/ce/docker-compose/docker-compose.yml b/openvidu-server/deployments/ce/docker-compose/docker-compose.yml index 6ea8a6b557..4e1cbdaec8 100644 --- a/openvidu-server/deployments/ce/docker-compose/docker-compose.yml +++ b/openvidu-server/deployments/ce/docker-compose/docker-compose.yml @@ -74,7 +74,7 @@ services: - MAX_PORT=65535 nginx: - image: openvidu/openvidu-proxy:4.0.0-dev3 + image: openvidu/openvidu-proxy:4.0.0-dev4 restart: on-failure network_mode: host volumes: diff --git a/openvidu-server/docker/openvidu-proxy/entrypoint.sh b/openvidu-server/docker/openvidu-proxy/entrypoint.sh index 85681102e7..8df1314251 100755 --- a/openvidu-server/docker/openvidu-proxy/entrypoint.sh +++ b/openvidu-server/docker/openvidu-proxy/entrypoint.sh @@ -68,22 +68,23 @@ printf "\n =======================================" printf "\n" printf "\n Configure %s domain..." "${DOMAIN_OR_PUBLIC_IP}" -OLD_DOMAIN_OR_PUBLIC_IP=$(grep "${DOMAIN_OR_PUBLIC_IP}" "${CERTIFICATES_CONF}" | cut -f1 -d$'\t') -CERTIFICATED_OLD_CONFIG=$(grep "${DOMAIN_OR_PUBLIC_IP}" "${CERTIFICATES_CONF}" | cut -f2 -d$'\t') +OLD_DOMAIN_OR_PUBLIC_IP=$(head -n 1 "${CERTIFICATES_CONF}" | cut -f1 -d$'\t') +CERTIFICATED_OLD_CONFIG=$(head -n 1 "${CERTIFICATES_CONF}" | cut -f2 -d$'\t') -printf "\n - New configuration: %s" "${CERTIFICATE_TYPE}" +printf "\n - New configuration: %s %s" "${CERTIFICATE_TYPE}" "${DOMAIN_OR_PUBLIC_IP}" if [ -z "${CERTIFICATED_OLD_CONFIG}" ]; then printf "\n - Old configuration: none" else - printf "\n - Old configuration: %s" "${CERTIFICATED_OLD_CONFIG}" + printf "\n - Old configuration: %s %s" "${CERTIFICATED_OLD_CONFIG}" "${OLD_DOMAIN_OR_PUBLIC_IP}" if [ "${CERTIFICATED_OLD_CONFIG}" != "${CERTIFICATE_TYPE}" ] || \ [ "${OLD_DOMAIN_OR_PUBLIC_IP}" != "${DOMAIN_OR_PUBLIC_IP}" ]; then printf "\n - Restarting configuration... Removing old certificated..." + # Remove certificate folder safely + find "${CERTIFICATES_FOLDER:?}" -mindepth 1 -delete # Recreate certificates folder - rm -rf "${CERTIFICATES_FOLDER:?}" mkdir -p "${CERTIFICATES_LIVE_FOLDER}" touch "${CERTIFICATES_CONF}" fi