2022-09-02 14:32:04 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-12-07 14:21:30 +00:00
|
|
|
set -eu
|
|
|
|
|
|
|
|
file_env() {
|
|
|
|
local var="$1"
|
|
|
|
local fileVar="${var}_FILE"
|
|
|
|
local def="${2:-}"
|
|
|
|
|
|
|
|
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
|
|
|
|
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
local val="$def"
|
|
|
|
if [ "${!var:-}" ]; then
|
|
|
|
val="${!var}"
|
|
|
|
elif [ "${!fileVar:-}" ]; then
|
|
|
|
val="$(< "${!fileVar}")"
|
|
|
|
fi
|
|
|
|
|
|
|
|
export "$var"="$val"
|
|
|
|
unset "$fileVar"
|
|
|
|
}
|
|
|
|
|
|
|
|
file_env "SMTP_PASSWORD"
|
|
|
|
|
2022-10-13 14:58:10 +00:00
|
|
|
echo "Giving the db container some time to come up"; sleep 20
|
|
|
|
# see this issue with postgres db https://github.com/nextcloud/docker/issues/1204
|
|
|
|
|
2022-09-02 14:32:04 +00:00
|
|
|
{{ if eq (env "X_FRAME_OPTIONS_ENABLED") "1" }}
|
|
|
|
if ! [[ $(grep {{ env "X_FRAME_OPTIONS_ALLOW_FROM" }} lib/public/AppFramework/Http/ContentSecurityPolicy.php) ]]; then
|
|
|
|
sed -i "91 a\\\t\t'{{ env "X_FRAME_OPTIONS_ALLOW_FROM" }}', " lib/public/AppFramework/Http/ContentSecurityPolicy.php
|
|
|
|
fi
|
|
|
|
{{ end }}
|
|
|
|
|
2022-12-07 14:21:30 +00:00
|
|
|
|
|
|
|
|
2022-09-02 14:32:04 +00:00
|
|
|
/entrypoint.sh php-fpm
|