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} |
| 7 | html=/var/www/html |
| 8 | |
| 9 | rm -rf ${html} |
| 10 | cp -a /var/www/simpleid ${html} |
| 11 | |
| 12 | for tmpl in /var/db/simpleid-templates/*.identity; do |
| 13 | ref=$(dirname ${tmpl})/$(basename ${tmpl} .identity) |
| 14 | name=$(basename ${ref}) |
| 15 | sed "s/miau.local/${domain}/" ${ref} >${html}/${name} |
| 16 | done |
| 17 | |
| 18 | for f in /etc/nginx/conf.d/sa.conf; do |
| 19 | sed "s/miau.local/${domain}/" ${f}.template >${f} |
| 20 | done |
| 21 | } |
| 22 | |
| 23 | chown -R nginx:nginx /var/www/html/ |
| 24 | |
| 25 | chmod -R a-w /etc/nginx/conf.d/sa.conf /var/www/html/ |
| 26 | |
| 27 | exec /docker-entrypoint.sh "$@" |