From 23c11bfdddfc8a373ea0788aa56a1c2c5e99fb86 Mon Sep 17 00:00:00 2001 From: Piero Dotti Date: Wed, 16 Aug 2023 14:16:58 +0200 Subject: [PATCH] fix(service_create_container): using SERVICE_ROOT instead of SERVICE_HOST_ROOT when creating the ssl certs Since the script create_ssl_certs.sh is executed from inside the container, the directory is not the host one, but the container one. --- functions | 2 +- scripts/create_ssl_certs.sh | 2 ++ scripts/enable_ssl.sh | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/functions b/functions index 1006998..a09b4c8 100755 --- a/functions +++ b/functions @@ -149,7 +149,7 @@ service_create_container() { dokku_log_verbose_quiet "Securing connection to database" service_pause "$SERVICE" >/dev/null - "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/scripts/create_ssl_certs.sh" "$SERVICE_HOST_ROOT" &>/dev/null + "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/scripts/create_ssl_certs.sh" "$SERVICE_ROOT" &>/dev/null "$DOCKER_BIN" container run --rm -i -v "$SERVICE_HOST_ROOT/data:/var/lib/postgresql/data" -v "$SERVICE_HOST_ROOT/certs:/var/lib/postgresql/certs" "$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION" bash -s <"$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/scripts/enable_ssl.sh" &>/dev/null rm -rf "$SERVICE_HOST_ROOT/certs" diff --git a/scripts/create_ssl_certs.sh b/scripts/create_ssl_certs.sh index 46fe4d1..ecca025 100755 --- a/scripts/create_ssl_certs.sh +++ b/scripts/create_ssl_certs.sh @@ -1,5 +1,7 @@ #!/bin/sh +set -e + postgres_service_dir="$1" cd "$postgres_service_dir" diff --git a/scripts/enable_ssl.sh b/scripts/enable_ssl.sh index 35b27f7..d8ccfd5 100755 --- a/scripts/enable_ssl.sh +++ b/scripts/enable_ssl.sh @@ -1,5 +1,7 @@ #!/bin/sh +set -e + cd /var/lib/postgresql/data cp ../certs/* .