mirror of
https://github.com/enso-org/enso.git
synced 2024-12-30 03:34:11 +03:00
47 lines
899 B
Bash
47 lines
899 B
Bash
#!/bin/sh
|
|
|
|
pghostname=postgrestest.enso.org
|
|
pgipaddress=127.0.0.1
|
|
|
|
cat > csr.conf <<EOF
|
|
[ req ]
|
|
default_bits = 2048
|
|
prompt = no
|
|
default_md = sha256
|
|
req_extensions = req_ext
|
|
distinguished_name = dn
|
|
|
|
[ dn ]
|
|
C = UK
|
|
ST = London
|
|
L = London
|
|
O = Enso
|
|
OU = Enso Dev
|
|
CN = $pghostname
|
|
|
|
[ req_ext ]
|
|
subjectAltName = @alt_names
|
|
|
|
[ alt_names ]
|
|
DNS.1 = $pghostname
|
|
IP.1 = $pgipaddress
|
|
EOF
|
|
|
|
cat > cert.conf <<EOF
|
|
authorityKeyIdentifier=keyid,issuer
|
|
basicConstraints=CA:FALSE
|
|
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
|
|
subjectAltName = @alt_names
|
|
|
|
[alt_names]
|
|
DNS.1 = $pghostname
|
|
DNS.2 = $pgipaddress
|
|
EOF
|
|
|
|
docker build --build-arg host_name=${pghostname} -t postgres-ssl .
|
|
docker run -d --name postgres-ssl -p 5432:5432 -e POSTGRES_PASSWORD=$ENSO_POSTGRES_PASSWORD postgres-ssl
|
|
docker cp postgres-ssl:/openssl/rootCA.crt ../../data/transient/rootCA.crt
|
|
|
|
rm csr.conf
|
|
rm cert.conf
|