Skip to content

Commit

Permalink
Merge pull request #71 from ba-st/use_SSL_postgreSQL
Browse files Browse the repository at this point in the history
Use SSL for testing against PostgreSQL backend
  • Loading branch information
gcotelli authored Dec 16, 2021
2 parents 92d9d93 + 9ae87ac commit 14652cc
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
7 changes: 5 additions & 2 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
version: '3.1'
services:
postgres:
image: postgres:12
restart: always
image: postgres:14
command: >
-c ssl=on
-c ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
-c ssl_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ports:
- 5432:5432
environment:
Expand Down
3 changes: 2 additions & 1 deletion docs/Getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ cd docker;
docker-compose up -d postgres
```

This will start the latest PostgreSQL 12 with an empty database called `test`,
This will start the latest PostgreSQL 14 with an empty database called `test`,
configured with the user `postgres` and password `secret`, listening in the
default port 5432.

Expand All @@ -103,6 +103,7 @@ RDBMSRepositoryProvider using: (
host: 'localhost';
port: 5432;
databaseName: 'test';
setSSL;
yourself)
```

Expand Down
3 changes: 2 additions & 1 deletion scripts/setup-MariaDB.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

readonly DOCKER_IMAGE_VERSION=$(echo "$RDBMS" | cut --complement -c -8)
DOCKER_IMAGE_VERSION=$(echo "$RDBMS" | cut --complement -c -8)
readonly DOCKER_IMAGE_VERSION
docker run -d -p 127.0.0.1:3306:3306 \
-e MYSQL_ROOT_PASSWORD=secret \
-e MYSQL_DATABASE=test \
Expand Down
3 changes: 2 additions & 1 deletion scripts/setup-MySQL.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

readonly DOCKER_IMAGE_VERSION=$(echo "$RDBMS" | cut --complement -c -6)
DOCKER_IMAGE_VERSION=$(echo "$RDBMS" | cut --complement -c -6)
readonly DOCKER_IMAGE_VERSION
docker run -d -p 127.0.0.1:3306:3306 \
-e MYSQL_ROOT_PASSWORD=secret \
-e MYSQL_ROOT_HOST=% \
Expand Down
8 changes: 6 additions & 2 deletions scripts/setup-PostgreSQL.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#!/usr/bin/env bash

readonly DOCKER_IMAGE_VERSION=$(echo "$RDBMS" | cut --complement -c -11)
DOCKER_IMAGE_VERSION=$(echo "$RDBMS" | cut --complement -c -11)
readonly DOCKER_IMAGE_VERSION
docker run -d -p 127.0.0.1:5432:5432 \
-e POSTGRES_PASSWORD=secret \
-e POSTGRES_USER=postgres \
-e POSTGRES_DB=test \
postgres:"$DOCKER_IMAGE_VERSION"
postgres:"$DOCKER_IMAGE_VERSION" \
-c ssl=on \
-c ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem \
-c ssl_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ SingleSessionRDMBSRepositoryTest class >> postgreSQLLogin [
host: 'localhost';
port: 5432;
databaseName: 'test';
setSSL;
yourself
]

Expand Down

0 comments on commit 14652cc

Please sign in to comment.