From 2d6d8a7ea820856d3a1f914b81ae7460c4c5a1f3 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Thu, 5 Jan 2017 16:29:10 +0100 Subject: [PATCH] Create fallback certs only if fqdn is already set --- setup/start.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup/start.sh b/setup/start.sh index 8dd1974ba..39a757b34 100755 --- a/setup/start.sh +++ b/setup/start.sh @@ -194,8 +194,10 @@ if [[ -f "${DATA_DIR}/box/certs/host.cert" && -f "${DATA_DIR}/box/certs/host.key cp "${DATA_DIR}/box/certs/host.key" "${DATA_DIR}/nginx/cert/host.key" else if [[ -z "${arg_tls_cert}" || -z "${arg_tls_key}" ]]; then - echo "==> Creating fallback certs" - # openssl req -x509 -newkey rsa:2048 -keyout "${DATA_DIR}/nginx/cert/host.key" -out "${DATA_DIR}/nginx/cert/host.cert" -days 3650 -subj "/CN=${arg_fqdn}" -nodes + if [[ -n "${arg_fqdn}" ]]; then + echo "==> Creating fallback certs" + openssl req -x509 -newkey rsa:2048 -keyout "${DATA_DIR}/nginx/cert/host.key" -out "${DATA_DIR}/nginx/cert/host.cert" -days 3650 -subj "/CN=${arg_fqdn}" -nodes + fi else echo "${arg_tls_cert}" > "${DATA_DIR}/nginx/cert/host.cert" echo "${arg_tls_key}" > "${DATA_DIR}/nginx/cert/host.key"