Skip to content

Commit

Permalink
fix(service_create_container): using SERVICE_ROOT instead of SERVICE_…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
ProGM committed Aug 16, 2023
1 parent bfc0f18 commit 23c11bf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion functions
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 2 additions & 0 deletions scripts/create_ssl_certs.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

set -e

postgres_service_dir="$1"

cd "$postgres_service_dir"
Expand Down
2 changes: 2 additions & 0 deletions scripts/enable_ssl.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

set -e

cd /var/lib/postgresql/data

cp ../certs/* .
Expand Down

0 comments on commit 23c11bf

Please sign in to comment.