Nico Huber | d652872 | 2023-07-01 14:38:39 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | set -e |
| 4 | |
| 5 | { |
| 6 | domain=${SA_PUBLIC_DOMAIN_NAME:-miau.local} |
Nico Huber | 15edd77 | 2023-07-01 18:16:50 +0000 | [diff] [blame] | 7 | live=/etc/nginx/certs/live |
Nico Huber | d652872 | 2023-07-01 14:38:39 +0000 | [diff] [blame] | 8 | |
Nico Huber | 15edd77 | 2023-07-01 18:16:50 +0000 | [diff] [blame] | 9 | 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 Huber | d652872 | 2023-07-01 14:38:39 +0000 | [diff] [blame] | 17 | for f in /etc/nginx/conf.d/sa.conf; do |
| 18 | sed "s/miau.local/${domain}/" ${f}.template >${f} |
| 19 | done |
| 20 | } |
| 21 | |
Nico Huber | 8eca6b2 | 2023-07-25 17:03:53 +0000 | [diff] [blame^] | 22 | chmod -R a-w /etc/nginx/certs/ /etc/nginx/conf.d/sa.conf |
Nico Huber | d652872 | 2023-07-01 14:38:39 +0000 | [diff] [blame] | 23 | |
| 24 | exec /docker-entrypoint.sh "$@" |