From cb3918f57f455778be02218b7116350ead505add Mon Sep 17 00:00:00 2001 From: Leonhardt Wille Date: Sun, 24 Apr 2016 20:44:21 +0200 Subject: [PATCH 1/2] feat(config): evaluate extra WORDPRESS_ADDITIONAL_CONFIG env var Contents of WORDPRESS_ADDITIONAL_CONFIG will be directly injected to wp-config.php. --- docker-entrypoint.sh | 5 +++-- php5.6/fpm/docker-entrypoint.sh | 5 +++-- php7.0/fpm/docker-entrypoint.sh | 5 +++-- php7.1/fpm/docker-entrypoint.sh | 5 +++-- php7.2/fpm/docker-entrypoint.sh | 5 +++-- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index a91cd2dc7f..82c98fdcea 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -128,14 +128,15 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then sed -ri -e 's/\r$//' wp-config* if [ ! -e wp-config.php ]; then - awk '/^\/\*.*stop editing.*\*\/$/ && c == 0 { c = 1; system("cat") } { print }' wp-config-sample.php > wp-config.php <<'EOPHP' + awk '/^\/\*.*stop editing.*\*\/$/ && c == 0 { c = 1; system("cat") } { print }' wp-config-sample.php > wp-config.php <<'EOPHP' < wp-config.php <<'EOPHP' + awk '/^\/\*.*stop editing.*\*\/$/ && c == 0 { c = 1; system("cat") } { print }' wp-config-sample.php > wp-config.php <<'EOPHP' < wp-config.php <<'EOPHP' + awk '/^\/\*.*stop editing.*\*\/$/ && c == 0 { c = 1; system("cat") } { print }' wp-config-sample.php > wp-config.php <<'EOPHP' < wp-config.php <<'EOPHP' + awk '/^\/\*.*stop editing.*\*\/$/ && c == 0 { c = 1; system("cat") } { print }' wp-config-sample.php > wp-config.php <<'EOPHP' < wp-config.php <<'EOPHP' + awk '/^\/\*.*stop editing.*\*\/$/ && c == 0 { c = 1; system("cat") } { print }' wp-config-sample.php > wp-config.php <<'EOPHP' < Date: Mon, 30 Jul 2018 13:51:37 -0700 Subject: [PATCH 2/2] Adjust "awk" and update variable name to "WORDPRESS_CONFIG_EXTRA" --- docker-entrypoint.sh | 16 +++++++++++++--- php5.6/apache/docker-entrypoint.sh | 13 ++++++++++++- php5.6/fpm-alpine/docker-entrypoint.sh | 13 ++++++++++++- php5.6/fpm/docker-entrypoint.sh | 16 +++++++++++++--- php7.0/apache/docker-entrypoint.sh | 13 ++++++++++++- php7.0/fpm-alpine/docker-entrypoint.sh | 13 ++++++++++++- php7.0/fpm/docker-entrypoint.sh | 16 +++++++++++++--- php7.1/apache/docker-entrypoint.sh | 13 ++++++++++++- php7.1/fpm-alpine/docker-entrypoint.sh | 13 ++++++++++++- php7.1/fpm/docker-entrypoint.sh | 16 +++++++++++++--- php7.2/apache/docker-entrypoint.sh | 13 ++++++++++++- php7.2/fpm-alpine/docker-entrypoint.sh | 13 ++++++++++++- php7.2/fpm/docker-entrypoint.sh | 16 +++++++++++++--- 13 files changed, 161 insertions(+), 23 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 82c98fdcea..66726a0ea2 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -93,6 +93,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then "${uniqueEnvs[@]/#/WORDPRESS_}" WORDPRESS_TABLE_PREFIX WORDPRESS_DEBUG + WORDPRESS_CONFIG_EXTRA ) haveConfig= for e in "${envs[@]}"; do @@ -128,15 +129,24 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then sed -ri -e 's/\r$//' wp-config* if [ ! -e wp-config.php ]; then - awk '/^\/\*.*stop editing.*\*\/$/ && c == 0 { c = 1; system("cat") } { print }' wp-config-sample.php > wp-config.php <<'EOPHP' < wp-config.php <<'EOPHP' // If we're behind a proxy server and using HTTPS, we need to alert Wordpress of that fact // see also http://codex.wordpress.org/Administration_Over_SSL#Using_a_Reverse_Proxy if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') { $_SERVER['HTTPS'] = 'on'; } + EOPHP -${WORDPRESS_ADDITIONAL_CONFIG:-} -EOBASH chown "$user:$group" wp-config.php fi diff --git a/php5.6/apache/docker-entrypoint.sh b/php5.6/apache/docker-entrypoint.sh index a91cd2dc7f..66726a0ea2 100755 --- a/php5.6/apache/docker-entrypoint.sh +++ b/php5.6/apache/docker-entrypoint.sh @@ -93,6 +93,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then "${uniqueEnvs[@]/#/WORDPRESS_}" WORDPRESS_TABLE_PREFIX WORDPRESS_DEBUG + WORDPRESS_CONFIG_EXTRA ) haveConfig= for e in "${envs[@]}"; do @@ -128,7 +129,17 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then sed -ri -e 's/\r$//' wp-config* if [ ! -e wp-config.php ]; then - awk '/^\/\*.*stop editing.*\*\/$/ && c == 0 { c = 1; system("cat") } { print }' wp-config-sample.php > wp-config.php <<'EOPHP' + awk ' + /^\/\*.*stop editing.*\*\/$/ && c == 0 { + c = 1 + system("cat") + if (ENVIRON["WORDPRESS_CONFIG_EXTRA"]) { + print "// WORDPRESS_CONFIG_EXTRA" + print ENVIRON["WORDPRESS_CONFIG_EXTRA"] "\n" + } + } + { print } + ' wp-config-sample.php > wp-config.php <<'EOPHP' // If we're behind a proxy server and using HTTPS, we need to alert Wordpress of that fact // see also http://codex.wordpress.org/Administration_Over_SSL#Using_a_Reverse_Proxy if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') { diff --git a/php5.6/fpm-alpine/docker-entrypoint.sh b/php5.6/fpm-alpine/docker-entrypoint.sh index a91cd2dc7f..66726a0ea2 100755 --- a/php5.6/fpm-alpine/docker-entrypoint.sh +++ b/php5.6/fpm-alpine/docker-entrypoint.sh @@ -93,6 +93,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then "${uniqueEnvs[@]/#/WORDPRESS_}" WORDPRESS_TABLE_PREFIX WORDPRESS_DEBUG + WORDPRESS_CONFIG_EXTRA ) haveConfig= for e in "${envs[@]}"; do @@ -128,7 +129,17 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then sed -ri -e 's/\r$//' wp-config* if [ ! -e wp-config.php ]; then - awk '/^\/\*.*stop editing.*\*\/$/ && c == 0 { c = 1; system("cat") } { print }' wp-config-sample.php > wp-config.php <<'EOPHP' + awk ' + /^\/\*.*stop editing.*\*\/$/ && c == 0 { + c = 1 + system("cat") + if (ENVIRON["WORDPRESS_CONFIG_EXTRA"]) { + print "// WORDPRESS_CONFIG_EXTRA" + print ENVIRON["WORDPRESS_CONFIG_EXTRA"] "\n" + } + } + { print } + ' wp-config-sample.php > wp-config.php <<'EOPHP' // If we're behind a proxy server and using HTTPS, we need to alert Wordpress of that fact // see also http://codex.wordpress.org/Administration_Over_SSL#Using_a_Reverse_Proxy if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') { diff --git a/php5.6/fpm/docker-entrypoint.sh b/php5.6/fpm/docker-entrypoint.sh index 82c98fdcea..66726a0ea2 100755 --- a/php5.6/fpm/docker-entrypoint.sh +++ b/php5.6/fpm/docker-entrypoint.sh @@ -93,6 +93,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then "${uniqueEnvs[@]/#/WORDPRESS_}" WORDPRESS_TABLE_PREFIX WORDPRESS_DEBUG + WORDPRESS_CONFIG_EXTRA ) haveConfig= for e in "${envs[@]}"; do @@ -128,15 +129,24 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then sed -ri -e 's/\r$//' wp-config* if [ ! -e wp-config.php ]; then - awk '/^\/\*.*stop editing.*\*\/$/ && c == 0 { c = 1; system("cat") } { print }' wp-config-sample.php > wp-config.php <<'EOPHP' < wp-config.php <<'EOPHP' // If we're behind a proxy server and using HTTPS, we need to alert Wordpress of that fact // see also http://codex.wordpress.org/Administration_Over_SSL#Using_a_Reverse_Proxy if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') { $_SERVER['HTTPS'] = 'on'; } + EOPHP -${WORDPRESS_ADDITIONAL_CONFIG:-} -EOBASH chown "$user:$group" wp-config.php fi diff --git a/php7.0/apache/docker-entrypoint.sh b/php7.0/apache/docker-entrypoint.sh index a91cd2dc7f..66726a0ea2 100755 --- a/php7.0/apache/docker-entrypoint.sh +++ b/php7.0/apache/docker-entrypoint.sh @@ -93,6 +93,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then "${uniqueEnvs[@]/#/WORDPRESS_}" WORDPRESS_TABLE_PREFIX WORDPRESS_DEBUG + WORDPRESS_CONFIG_EXTRA ) haveConfig= for e in "${envs[@]}"; do @@ -128,7 +129,17 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then sed -ri -e 's/\r$//' wp-config* if [ ! -e wp-config.php ]; then - awk '/^\/\*.*stop editing.*\*\/$/ && c == 0 { c = 1; system("cat") } { print }' wp-config-sample.php > wp-config.php <<'EOPHP' + awk ' + /^\/\*.*stop editing.*\*\/$/ && c == 0 { + c = 1 + system("cat") + if (ENVIRON["WORDPRESS_CONFIG_EXTRA"]) { + print "// WORDPRESS_CONFIG_EXTRA" + print ENVIRON["WORDPRESS_CONFIG_EXTRA"] "\n" + } + } + { print } + ' wp-config-sample.php > wp-config.php <<'EOPHP' // If we're behind a proxy server and using HTTPS, we need to alert Wordpress of that fact // see also http://codex.wordpress.org/Administration_Over_SSL#Using_a_Reverse_Proxy if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') { diff --git a/php7.0/fpm-alpine/docker-entrypoint.sh b/php7.0/fpm-alpine/docker-entrypoint.sh index a91cd2dc7f..66726a0ea2 100755 --- a/php7.0/fpm-alpine/docker-entrypoint.sh +++ b/php7.0/fpm-alpine/docker-entrypoint.sh @@ -93,6 +93,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then "${uniqueEnvs[@]/#/WORDPRESS_}" WORDPRESS_TABLE_PREFIX WORDPRESS_DEBUG + WORDPRESS_CONFIG_EXTRA ) haveConfig= for e in "${envs[@]}"; do @@ -128,7 +129,17 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then sed -ri -e 's/\r$//' wp-config* if [ ! -e wp-config.php ]; then - awk '/^\/\*.*stop editing.*\*\/$/ && c == 0 { c = 1; system("cat") } { print }' wp-config-sample.php > wp-config.php <<'EOPHP' + awk ' + /^\/\*.*stop editing.*\*\/$/ && c == 0 { + c = 1 + system("cat") + if (ENVIRON["WORDPRESS_CONFIG_EXTRA"]) { + print "// WORDPRESS_CONFIG_EXTRA" + print ENVIRON["WORDPRESS_CONFIG_EXTRA"] "\n" + } + } + { print } + ' wp-config-sample.php > wp-config.php <<'EOPHP' // If we're behind a proxy server and using HTTPS, we need to alert Wordpress of that fact // see also http://codex.wordpress.org/Administration_Over_SSL#Using_a_Reverse_Proxy if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') { diff --git a/php7.0/fpm/docker-entrypoint.sh b/php7.0/fpm/docker-entrypoint.sh index 82c98fdcea..66726a0ea2 100755 --- a/php7.0/fpm/docker-entrypoint.sh +++ b/php7.0/fpm/docker-entrypoint.sh @@ -93,6 +93,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then "${uniqueEnvs[@]/#/WORDPRESS_}" WORDPRESS_TABLE_PREFIX WORDPRESS_DEBUG + WORDPRESS_CONFIG_EXTRA ) haveConfig= for e in "${envs[@]}"; do @@ -128,15 +129,24 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then sed -ri -e 's/\r$//' wp-config* if [ ! -e wp-config.php ]; then - awk '/^\/\*.*stop editing.*\*\/$/ && c == 0 { c = 1; system("cat") } { print }' wp-config-sample.php > wp-config.php <<'EOPHP' < wp-config.php <<'EOPHP' // If we're behind a proxy server and using HTTPS, we need to alert Wordpress of that fact // see also http://codex.wordpress.org/Administration_Over_SSL#Using_a_Reverse_Proxy if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') { $_SERVER['HTTPS'] = 'on'; } + EOPHP -${WORDPRESS_ADDITIONAL_CONFIG:-} -EOBASH chown "$user:$group" wp-config.php fi diff --git a/php7.1/apache/docker-entrypoint.sh b/php7.1/apache/docker-entrypoint.sh index a91cd2dc7f..66726a0ea2 100755 --- a/php7.1/apache/docker-entrypoint.sh +++ b/php7.1/apache/docker-entrypoint.sh @@ -93,6 +93,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then "${uniqueEnvs[@]/#/WORDPRESS_}" WORDPRESS_TABLE_PREFIX WORDPRESS_DEBUG + WORDPRESS_CONFIG_EXTRA ) haveConfig= for e in "${envs[@]}"; do @@ -128,7 +129,17 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then sed -ri -e 's/\r$//' wp-config* if [ ! -e wp-config.php ]; then - awk '/^\/\*.*stop editing.*\*\/$/ && c == 0 { c = 1; system("cat") } { print }' wp-config-sample.php > wp-config.php <<'EOPHP' + awk ' + /^\/\*.*stop editing.*\*\/$/ && c == 0 { + c = 1 + system("cat") + if (ENVIRON["WORDPRESS_CONFIG_EXTRA"]) { + print "// WORDPRESS_CONFIG_EXTRA" + print ENVIRON["WORDPRESS_CONFIG_EXTRA"] "\n" + } + } + { print } + ' wp-config-sample.php > wp-config.php <<'EOPHP' // If we're behind a proxy server and using HTTPS, we need to alert Wordpress of that fact // see also http://codex.wordpress.org/Administration_Over_SSL#Using_a_Reverse_Proxy if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') { diff --git a/php7.1/fpm-alpine/docker-entrypoint.sh b/php7.1/fpm-alpine/docker-entrypoint.sh index a91cd2dc7f..66726a0ea2 100755 --- a/php7.1/fpm-alpine/docker-entrypoint.sh +++ b/php7.1/fpm-alpine/docker-entrypoint.sh @@ -93,6 +93,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then "${uniqueEnvs[@]/#/WORDPRESS_}" WORDPRESS_TABLE_PREFIX WORDPRESS_DEBUG + WORDPRESS_CONFIG_EXTRA ) haveConfig= for e in "${envs[@]}"; do @@ -128,7 +129,17 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then sed -ri -e 's/\r$//' wp-config* if [ ! -e wp-config.php ]; then - awk '/^\/\*.*stop editing.*\*\/$/ && c == 0 { c = 1; system("cat") } { print }' wp-config-sample.php > wp-config.php <<'EOPHP' + awk ' + /^\/\*.*stop editing.*\*\/$/ && c == 0 { + c = 1 + system("cat") + if (ENVIRON["WORDPRESS_CONFIG_EXTRA"]) { + print "// WORDPRESS_CONFIG_EXTRA" + print ENVIRON["WORDPRESS_CONFIG_EXTRA"] "\n" + } + } + { print } + ' wp-config-sample.php > wp-config.php <<'EOPHP' // If we're behind a proxy server and using HTTPS, we need to alert Wordpress of that fact // see also http://codex.wordpress.org/Administration_Over_SSL#Using_a_Reverse_Proxy if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') { diff --git a/php7.1/fpm/docker-entrypoint.sh b/php7.1/fpm/docker-entrypoint.sh index 82c98fdcea..66726a0ea2 100755 --- a/php7.1/fpm/docker-entrypoint.sh +++ b/php7.1/fpm/docker-entrypoint.sh @@ -93,6 +93,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then "${uniqueEnvs[@]/#/WORDPRESS_}" WORDPRESS_TABLE_PREFIX WORDPRESS_DEBUG + WORDPRESS_CONFIG_EXTRA ) haveConfig= for e in "${envs[@]}"; do @@ -128,15 +129,24 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then sed -ri -e 's/\r$//' wp-config* if [ ! -e wp-config.php ]; then - awk '/^\/\*.*stop editing.*\*\/$/ && c == 0 { c = 1; system("cat") } { print }' wp-config-sample.php > wp-config.php <<'EOPHP' < wp-config.php <<'EOPHP' // If we're behind a proxy server and using HTTPS, we need to alert Wordpress of that fact // see also http://codex.wordpress.org/Administration_Over_SSL#Using_a_Reverse_Proxy if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') { $_SERVER['HTTPS'] = 'on'; } + EOPHP -${WORDPRESS_ADDITIONAL_CONFIG:-} -EOBASH chown "$user:$group" wp-config.php fi diff --git a/php7.2/apache/docker-entrypoint.sh b/php7.2/apache/docker-entrypoint.sh index a91cd2dc7f..66726a0ea2 100755 --- a/php7.2/apache/docker-entrypoint.sh +++ b/php7.2/apache/docker-entrypoint.sh @@ -93,6 +93,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then "${uniqueEnvs[@]/#/WORDPRESS_}" WORDPRESS_TABLE_PREFIX WORDPRESS_DEBUG + WORDPRESS_CONFIG_EXTRA ) haveConfig= for e in "${envs[@]}"; do @@ -128,7 +129,17 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then sed -ri -e 's/\r$//' wp-config* if [ ! -e wp-config.php ]; then - awk '/^\/\*.*stop editing.*\*\/$/ && c == 0 { c = 1; system("cat") } { print }' wp-config-sample.php > wp-config.php <<'EOPHP' + awk ' + /^\/\*.*stop editing.*\*\/$/ && c == 0 { + c = 1 + system("cat") + if (ENVIRON["WORDPRESS_CONFIG_EXTRA"]) { + print "// WORDPRESS_CONFIG_EXTRA" + print ENVIRON["WORDPRESS_CONFIG_EXTRA"] "\n" + } + } + { print } + ' wp-config-sample.php > wp-config.php <<'EOPHP' // If we're behind a proxy server and using HTTPS, we need to alert Wordpress of that fact // see also http://codex.wordpress.org/Administration_Over_SSL#Using_a_Reverse_Proxy if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') { diff --git a/php7.2/fpm-alpine/docker-entrypoint.sh b/php7.2/fpm-alpine/docker-entrypoint.sh index a91cd2dc7f..66726a0ea2 100755 --- a/php7.2/fpm-alpine/docker-entrypoint.sh +++ b/php7.2/fpm-alpine/docker-entrypoint.sh @@ -93,6 +93,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then "${uniqueEnvs[@]/#/WORDPRESS_}" WORDPRESS_TABLE_PREFIX WORDPRESS_DEBUG + WORDPRESS_CONFIG_EXTRA ) haveConfig= for e in "${envs[@]}"; do @@ -128,7 +129,17 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then sed -ri -e 's/\r$//' wp-config* if [ ! -e wp-config.php ]; then - awk '/^\/\*.*stop editing.*\*\/$/ && c == 0 { c = 1; system("cat") } { print }' wp-config-sample.php > wp-config.php <<'EOPHP' + awk ' + /^\/\*.*stop editing.*\*\/$/ && c == 0 { + c = 1 + system("cat") + if (ENVIRON["WORDPRESS_CONFIG_EXTRA"]) { + print "// WORDPRESS_CONFIG_EXTRA" + print ENVIRON["WORDPRESS_CONFIG_EXTRA"] "\n" + } + } + { print } + ' wp-config-sample.php > wp-config.php <<'EOPHP' // If we're behind a proxy server and using HTTPS, we need to alert Wordpress of that fact // see also http://codex.wordpress.org/Administration_Over_SSL#Using_a_Reverse_Proxy if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') { diff --git a/php7.2/fpm/docker-entrypoint.sh b/php7.2/fpm/docker-entrypoint.sh index 82c98fdcea..66726a0ea2 100755 --- a/php7.2/fpm/docker-entrypoint.sh +++ b/php7.2/fpm/docker-entrypoint.sh @@ -93,6 +93,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then "${uniqueEnvs[@]/#/WORDPRESS_}" WORDPRESS_TABLE_PREFIX WORDPRESS_DEBUG + WORDPRESS_CONFIG_EXTRA ) haveConfig= for e in "${envs[@]}"; do @@ -128,15 +129,24 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then sed -ri -e 's/\r$//' wp-config* if [ ! -e wp-config.php ]; then - awk '/^\/\*.*stop editing.*\*\/$/ && c == 0 { c = 1; system("cat") } { print }' wp-config-sample.php > wp-config.php <<'EOPHP' < wp-config.php <<'EOPHP' // If we're behind a proxy server and using HTTPS, we need to alert Wordpress of that fact // see also http://codex.wordpress.org/Administration_Over_SSL#Using_a_Reverse_Proxy if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') { $_SERVER['HTTPS'] = 'on'; } + EOPHP -${WORDPRESS_ADDITIONAL_CONFIG:-} -EOBASH chown "$user:$group" wp-config.php fi