File tree 3 files changed +17
-5
lines changed
3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,9 @@ service_create_container() {
149
149
150
150
dokku_log_verbose_quiet " Securing connection to database"
151
151
service_pause " $SERVICE " > /dev/null
152
- " $DOCKER_BIN " container run --rm -i -v " $SERVICE_HOST_ROOT /data:/var/lib/postgresql/data" " $PLUGIN_IMAGE :$PLUGIN_IMAGE_VERSION " bash -s < " $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) /scripts/enable_ssl.sh" & > /dev/null
152
+ " $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) /scripts/create_ssl_certs.sh" " $SERVICE_HOST_ROOT " & > /dev/null
153
+ " $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
154
+ rm -rf " $SERVICE_HOST_ROOT /certs"
153
155
154
156
suppress_output " $DOCKER_BIN " container start " $( cat " $SERVICE_ROOT /ID" ) "
155
157
service_port_reconcile_status " $SERVICE "
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ postgres_service_dir=" $1 "
4
+
5
+ cd " $postgres_service_dir "
6
+ mkdir certs && cd certs
7
+ openssl req -new -newkey rsa:4096 -x509 -days 365000 -nodes -out server.crt -keyout server.key -batch
Original file line number Diff line number Diff line change 1
- #! /bin/bash
2
- pushd /var/lib/postgresql/data > /dev/null
3
- openssl req -new -newkey rsa:4096 -x509 -days 365000 -nodes -out server.crt -keyout server.key -batch
1
+ #! /bin/sh
2
+
3
+ cd /var/lib/postgresql/data
4
+
5
+ cp ../certs/* .
6
+ chown postgres:postgres server.key
4
7
chmod 600 server.key
8
+
5
9
sed -i " s/^#ssl = off/ssl = on/" postgresql.conf
6
10
sed -i " s/^#ssl_ciphers =.*/ssl_ciphers = 'AES256+EECDH:AES256+EDH'/" postgresql.conf
7
- popd > /dev/null
You can’t perform that action at this time.
0 commit comments