Files
mtusi2026lab7/infra/postgres/entrypoint.sh
T
Vladislav Kunetskiy 1b6e96ccc0
Application / Go invariants and static checks (pull_request) Canceled after 0s
Application / Lab7 verified TLS and retained features (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s
lab7: безопасность, mTLS, OpenBao и PKI lifecycle
2026-11-10 14:39:57 +03:00

16 lines
571 B
Bash
Executable File

#!/bin/sh
set -eu
# PostgreSQL requires its private key to be owned by postgres and mode 0600.
# The role mount remains read-only; this copy is in the container's tmpfs.
umask 077
cp /run/identity/current/tls.key /tmp/postgres.key
chmod 600 /tmp/postgres.key
exec /usr/local/bin/docker-entrypoint.sh postgres \
-c ssl=on \
-c ssl_cert_file=/run/identity/current/tls.crt \
-c ssl_key_file=/tmp/postgres.key \
-c ssl_ca_file=/run/identity/current/ca.crt \
-c hba_file=/etc/postgresql/pg_hba.conf \
-c password_encryption=scram-sha-256 \
-c log_statement=none