From a19a5c63a7aaa940ad787b343b0887916a25af27 Mon Sep 17 00:00:00 2001 From: gyurix Date: Fri, 21 Oct 2022 13:22:12 +0000 Subject: [PATCH] Added GENERATE_CERTIFICATE variable and check and updated the proxy.json list also --- proxy.json | 13 +++++++++++++ scripts/nginx_config_create.sh | 4 +++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/proxy.json b/proxy.json index 4261dd8..696b56f 100644 --- a/proxy.json +++ b/proxy.json @@ -20,8 +20,21 @@ "COMMENT": "edeg3e98" }, "proxy_scheduler": { + "DOCKER_REGISTRY_URL": "registry.format.hu", + "CERT_DIR": "/keys", + "DOMAIN_DIR": "/domains", + "PROXY_SERVICE_FILE": "public-proxy.json", + "PROXY_CONFIG_DIR": "/proxy_config", + "PROXY_TYPE": "haproxy", + "TIMEOUT": "5", + "RESTART": "3", + "ROLE": "backend-proxy", + "SERVICE_NAME": "public-proxy" + }, + "proxy_scheduler_local": { "DOCKER_REGISTRY_URL": "registry.format.hu", "PROXY_TYPE": "", + "GENERATE_CERTIFICATE": "true", "LETSENCRYPT_URL": "letsencrypt.org", "LETSENCRYPT_SERVICE_NAME": "letsencrypt.json", "CERT_DIR": "/keys", diff --git a/scripts/nginx_config_create.sh b/scripts/nginx_config_create.sh index 60e20d5..4635f7b 100755 --- a/scripts/nginx_config_create.sh +++ b/scripts/nginx_config_create.sh @@ -1,5 +1,7 @@ #!/bin/sh +GENERATE_CERTIFICATE=$GENERATE_CERTIFICATE + cd /proxy_config DOMAIN=$1 @@ -25,7 +27,7 @@ ALLOWED_NETWORK=$(jq -r '.ALLOWED_NETWORK | select(.!="null") | join(" ")' $DOMA ALTERNATE_LOCATION_PATH=$(jq -r .ALTERNATE_LOCATION_PATH $DOMAIN_SOURCE) # check whether certificates exist or not -if [[ "$HTTPS_PORT" != "" ]]; then +if [[ "$HTTPS_PORT" != "" && "$GENERATE_CERTIFICATE" == "true" ]]; then /scripts/check_certificates.sh "$DOMAIN"; fi