Create fallback certs only if fqdn is already set
This commit is contained in:
+4
-2
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user