blob: 34e10f114b5342f03ac2e90f8ee075bbf753ac2c [file] [log] [blame]
Nico Huberd6528722023-07-01 14:38:39 +00001#!/bin/sh
2
3set -e
4
5{
6 domain=${SA_PUBLIC_DOMAIN_NAME:-miau.local}
Nico Huber15edd772023-07-01 18:16:50 +00007 live=/etc/nginx/certs/live
Nico Huberd6528722023-07-01 14:38:39 +00008
Nico Huber15edd772023-07-01 18:16:50 +00009 if [ ! -f ${live}/${domain}/privkey.pem ]; then
10 mkdir -p ${live}/${domain}
11 cp /etc/ssl/private/sa-selfsigned.key ${live}/${domain}/privkey.pem
12 cp /etc/ssl/certs/sa-selfsigned.crt ${live}/${domain}/fullchain.pem
13 cp /etc/ssl/certs/sa-selfsigned.crt ${live}/${domain}/chain.pem
14 cp /etc/ssl/certs/sa-selfsigned.crt ${live}/${domain}/cert.pem
15 fi
16
Nico Huberd6528722023-07-01 14:38:39 +000017 for f in /etc/nginx/conf.d/sa.conf; do
18 sed "s/miau.local/${domain}/" ${f}.template >${f}
19 done
20}
21
Nico Huber8eca6b22023-07-25 17:03:53 +000022chmod -R a-w /etc/nginx/certs/ /etc/nginx/conf.d/sa.conf
Nico Huberd6528722023-07-01 14:38:39 +000023
24exec /docker-entrypoint.sh "$@"