Lab 7
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
2026-11-27 20:47:58 +03:00
parent 20afc2c790
commit d995f98446
97 changed files with 8638 additions and 56 deletions
+17
View File
@@ -0,0 +1,17 @@
#!/bin/sh
set -eu
# Copy the mounted TLS material into a private, postgres-owned directory with
# 0600 permissions: PostgreSQL refuses to load a key that group/other can read,
# and Docker secrets are mounted world-readable.
TLS_DIR=/var/lib/postgresql/tls
install -d -m 700 -o postgres -g postgres "$TLS_DIR"
install -m 600 -o postgres -g postgres /run/secrets/postgres.crt "$TLS_DIR/server.crt"
install -m 600 -o postgres -g postgres /run/secrets/postgres.key "$TLS_DIR/server.key"
install -m 600 -o postgres -g postgres /run/secrets/ca.crt "$TLS_DIR/ca.crt"
# Clients verify the server certificate (verify-full) against the project CA.
exec docker-entrypoint.sh postgres \
-c ssl=on \
-c ssl_cert_file="$TLS_DIR/server.crt" \
-c ssl_key_file="$TLS_DIR/server.key" \
-c ssl_ca_file="$TLS_DIR/ca.crt" \
-c ssl_min_protocol_version=TLSv1.2