Skip to content

Added args for setting clientcert and image version #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM postgres:9.6
ARG DB_VERSION=9.6
FROM postgres:${DB_VERSION}
ENV CLIENT_CERT=1

COPY arcts-ssl-entrypoint.sh /usr/local/bin/

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ We are provisioning many short lived data services that require secure-by-defaul

- Configure SSL options via environment variables
- Allow certs to reside in a different directory (and configure via env)
- Support multiple versions of Postgres (Currently pinned to 9.6)
- Support multiple versions of Postgres (Currently pinned to 9.6) - Now defaults to 9.6 but can be built to any version by using the DB_VERSION arg at build time
- TravisCI integration / Auto push to Hub
2 changes: 1 addition & 1 deletion arcts-ssl-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ echo "Postgres initialized. Time to SSL.";
if [ ! -s "$PGDATA/postgresql.crt" ]; then
# Update HBA to require SSL and Client Cert auth
head -n -1 /var/lib/postgresql/data/pg_hba.conf > /tmp/pg_hba.conf
echo "hostssl all all all md5 clientcert=1" >> /tmp/pg_hba.conf
echo "hostssl all all all md5 clientcert=$CLIENT_CERT" >> /tmp/pg_hba.conf
mv /tmp/pg_hba.conf /var/lib/postgresql/data/pg_hba.conf

# Create SSL certs
Expand Down