Nico Huber | 8cd50ee | 2023-06-24 15:35:16 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | set -e |
| 4 | |
Nico Huber | d652872 | 2023-07-01 14:38:39 +0000 | [diff] [blame] | 5 | { |
| 6 | domain=${SA_PUBLIC_DOMAIN_NAME:-miau.local} |
| 7 | ids=/var/db/simpleid |
| 8 | html=/var/www/html |
| 9 | |
| 10 | mkdir -p ${ids} |
| 11 | rm -rf ${html} |
| 12 | cp -a /var/www/simpleid ${html} |
| 13 | |
| 14 | for tmpl in /var/db/simpleid-templates/*.identity; do |
| 15 | id=$(basename ${tmpl}) |
| 16 | sed "s/miau.local/${domain}/" ${tmpl} >${ids}/${id} |
| 17 | done |
| 18 | |
| 19 | for f in /var/www/simpleid/config.php; do |
| 20 | sed "s/miau.local/${domain}/" ${f} >${html}/$(basename ${f}) |
| 21 | done |
| 22 | } |
| 23 | |
Nico Huber | 8cd50ee | 2023-06-24 15:35:16 +0000 | [diff] [blame] | 24 | chown -R www-data:www-data /var/cache/simpleid/ |
| 25 | chown -R www-data:www-data /var/lib/simpleid/ |
| 26 | chown -R www-data:www-data /var/log/ |
| 27 | |
Nico Huber | e509ccd | 2023-07-21 15:14:12 +0000 | [diff] [blame^] | 28 | chown -R root:root /var/db/simpleid/ |
| 29 | chown -R root:root /var/www/html/ |
| 30 | |
Nico Huber | d652872 | 2023-07-01 14:38:39 +0000 | [diff] [blame] | 31 | chmod -R a-w /var/db/simpleid/ /var/www/html/ |
| 32 | |
Nico Huber | 8cd50ee | 2023-06-24 15:35:16 +0000 | [diff] [blame] | 33 | exec docker-php-entrypoint php-fpm "$@" |