diff --git a/2019.09/apache/cron.sh b/2019.09/apache/cron.sh index cf1f504..708eb8c 100755 --- a/2019.09/apache/cron.sh +++ b/2019.09/apache/cron.sh @@ -8,4 +8,4 @@ done # TODO let the database and the autoinstall time to complete - not winning a beauty contest sleep 15s -php /var/www/html/bin/daemon.php -f start +exec php /var/www/html/bin/daemon.php -f start diff --git a/2019.09/apache/entrypoint.sh b/2019.09/apache/entrypoint.sh index 9c7ea16..f007407 100755 --- a/2019.09/apache/entrypoint.sh +++ b/2019.09/apache/entrypoint.sh @@ -3,10 +3,11 @@ set -eu # run an command with the www-data user run_as() { + set -- -eu -c "cd /var/www/html; $*" if [ "$(id -u)" -eq 0 ]; then - su - www-data -s /bin/sh -c "cd /var/www/html;$1" + su - www-data -s /bin/sh "$@" else - sh -c "$1" + sh "$@" fi } @@ -44,10 +45,10 @@ clone_develop() { # Removing the whole directory first rm -fr /usr/src/friendica - sh -c "git clone -q -b ${friendica_git} https://github.com/${friendica_repo} /usr/src/friendica" + git clone -q -b ${friendica_git} "https://github.com/${friendica_repo}" /usr/src/friendica mkdir /usr/src/friendica/addon - sh -c "git clone -q -b ${addons_git} https://github.com/${friendica_addons_repo} /usr/src/friendica/addon" + git clone -q -b ${addons_git} "https://github.com/${friendica_addons_repo}" /usr/src/friendica/addon echo "Download finished" @@ -200,7 +201,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then echo "Starting Friendica installation ..." # TODO Let the database time to warm up - not winning a beauty contest sleep 10s - run_as "cd /var/www/html; php /var/www/html/bin/console.php autoinstall $install_options" + run_as "php /var/www/html/bin/console.php autoinstall $install_options" # TODO Workaround because of a strange permission issue rm -fr /var/www/html/view/smarty3/compiled @@ -217,7 +218,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then # upgrade else echo "Upgrading Friendica ..." - run_as 'cd /var/www/html; php /var/www/html/bin/console.php dbstructure update' + run_as 'php /var/www/html/bin/console.php dbstructure update' echo "Upgrading finished" fi fi diff --git a/2019.09/fpm-alpine/cron.sh b/2019.09/fpm-alpine/cron.sh index cf1f504..708eb8c 100755 --- a/2019.09/fpm-alpine/cron.sh +++ b/2019.09/fpm-alpine/cron.sh @@ -8,4 +8,4 @@ done # TODO let the database and the autoinstall time to complete - not winning a beauty contest sleep 15s -php /var/www/html/bin/daemon.php -f start +exec php /var/www/html/bin/daemon.php -f start diff --git a/2019.09/fpm-alpine/entrypoint.sh b/2019.09/fpm-alpine/entrypoint.sh index 9c7ea16..f007407 100755 --- a/2019.09/fpm-alpine/entrypoint.sh +++ b/2019.09/fpm-alpine/entrypoint.sh @@ -3,10 +3,11 @@ set -eu # run an command with the www-data user run_as() { + set -- -eu -c "cd /var/www/html; $*" if [ "$(id -u)" -eq 0 ]; then - su - www-data -s /bin/sh -c "cd /var/www/html;$1" + su - www-data -s /bin/sh "$@" else - sh -c "$1" + sh "$@" fi } @@ -44,10 +45,10 @@ clone_develop() { # Removing the whole directory first rm -fr /usr/src/friendica - sh -c "git clone -q -b ${friendica_git} https://github.com/${friendica_repo} /usr/src/friendica" + git clone -q -b ${friendica_git} "https://github.com/${friendica_repo}" /usr/src/friendica mkdir /usr/src/friendica/addon - sh -c "git clone -q -b ${addons_git} https://github.com/${friendica_addons_repo} /usr/src/friendica/addon" + git clone -q -b ${addons_git} "https://github.com/${friendica_addons_repo}" /usr/src/friendica/addon echo "Download finished" @@ -200,7 +201,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then echo "Starting Friendica installation ..." # TODO Let the database time to warm up - not winning a beauty contest sleep 10s - run_as "cd /var/www/html; php /var/www/html/bin/console.php autoinstall $install_options" + run_as "php /var/www/html/bin/console.php autoinstall $install_options" # TODO Workaround because of a strange permission issue rm -fr /var/www/html/view/smarty3/compiled @@ -217,7 +218,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then # upgrade else echo "Upgrading Friendica ..." - run_as 'cd /var/www/html; php /var/www/html/bin/console.php dbstructure update' + run_as 'php /var/www/html/bin/console.php dbstructure update' echo "Upgrading finished" fi fi diff --git a/2019.09/fpm/cron.sh b/2019.09/fpm/cron.sh index cf1f504..708eb8c 100755 --- a/2019.09/fpm/cron.sh +++ b/2019.09/fpm/cron.sh @@ -8,4 +8,4 @@ done # TODO let the database and the autoinstall time to complete - not winning a beauty contest sleep 15s -php /var/www/html/bin/daemon.php -f start +exec php /var/www/html/bin/daemon.php -f start diff --git a/2019.09/fpm/entrypoint.sh b/2019.09/fpm/entrypoint.sh index 9c7ea16..f007407 100755 --- a/2019.09/fpm/entrypoint.sh +++ b/2019.09/fpm/entrypoint.sh @@ -3,10 +3,11 @@ set -eu # run an command with the www-data user run_as() { + set -- -eu -c "cd /var/www/html; $*" if [ "$(id -u)" -eq 0 ]; then - su - www-data -s /bin/sh -c "cd /var/www/html;$1" + su - www-data -s /bin/sh "$@" else - sh -c "$1" + sh "$@" fi } @@ -44,10 +45,10 @@ clone_develop() { # Removing the whole directory first rm -fr /usr/src/friendica - sh -c "git clone -q -b ${friendica_git} https://github.com/${friendica_repo} /usr/src/friendica" + git clone -q -b ${friendica_git} "https://github.com/${friendica_repo}" /usr/src/friendica mkdir /usr/src/friendica/addon - sh -c "git clone -q -b ${addons_git} https://github.com/${friendica_addons_repo} /usr/src/friendica/addon" + git clone -q -b ${addons_git} "https://github.com/${friendica_addons_repo}" /usr/src/friendica/addon echo "Download finished" @@ -200,7 +201,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then echo "Starting Friendica installation ..." # TODO Let the database time to warm up - not winning a beauty contest sleep 10s - run_as "cd /var/www/html; php /var/www/html/bin/console.php autoinstall $install_options" + run_as "php /var/www/html/bin/console.php autoinstall $install_options" # TODO Workaround because of a strange permission issue rm -fr /var/www/html/view/smarty3/compiled @@ -217,7 +218,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then # upgrade else echo "Upgrading Friendica ..." - run_as 'cd /var/www/html; php /var/www/html/bin/console.php dbstructure update' + run_as 'php /var/www/html/bin/console.php dbstructure update' echo "Upgrading finished" fi fi diff --git a/2019.12-dev/apache/cron.sh b/2019.12-dev/apache/cron.sh index cf1f504..708eb8c 100755 --- a/2019.12-dev/apache/cron.sh +++ b/2019.12-dev/apache/cron.sh @@ -8,4 +8,4 @@ done # TODO let the database and the autoinstall time to complete - not winning a beauty contest sleep 15s -php /var/www/html/bin/daemon.php -f start +exec php /var/www/html/bin/daemon.php -f start diff --git a/2019.12-dev/apache/entrypoint.sh b/2019.12-dev/apache/entrypoint.sh index 9c7ea16..f007407 100755 --- a/2019.12-dev/apache/entrypoint.sh +++ b/2019.12-dev/apache/entrypoint.sh @@ -3,10 +3,11 @@ set -eu # run an command with the www-data user run_as() { + set -- -eu -c "cd /var/www/html; $*" if [ "$(id -u)" -eq 0 ]; then - su - www-data -s /bin/sh -c "cd /var/www/html;$1" + su - www-data -s /bin/sh "$@" else - sh -c "$1" + sh "$@" fi } @@ -44,10 +45,10 @@ clone_develop() { # Removing the whole directory first rm -fr /usr/src/friendica - sh -c "git clone -q -b ${friendica_git} https://github.com/${friendica_repo} /usr/src/friendica" + git clone -q -b ${friendica_git} "https://github.com/${friendica_repo}" /usr/src/friendica mkdir /usr/src/friendica/addon - sh -c "git clone -q -b ${addons_git} https://github.com/${friendica_addons_repo} /usr/src/friendica/addon" + git clone -q -b ${addons_git} "https://github.com/${friendica_addons_repo}" /usr/src/friendica/addon echo "Download finished" @@ -200,7 +201,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then echo "Starting Friendica installation ..." # TODO Let the database time to warm up - not winning a beauty contest sleep 10s - run_as "cd /var/www/html; php /var/www/html/bin/console.php autoinstall $install_options" + run_as "php /var/www/html/bin/console.php autoinstall $install_options" # TODO Workaround because of a strange permission issue rm -fr /var/www/html/view/smarty3/compiled @@ -217,7 +218,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then # upgrade else echo "Upgrading Friendica ..." - run_as 'cd /var/www/html; php /var/www/html/bin/console.php dbstructure update' + run_as 'php /var/www/html/bin/console.php dbstructure update' echo "Upgrading finished" fi fi diff --git a/2019.12-dev/fpm-alpine/cron.sh b/2019.12-dev/fpm-alpine/cron.sh index cf1f504..708eb8c 100755 --- a/2019.12-dev/fpm-alpine/cron.sh +++ b/2019.12-dev/fpm-alpine/cron.sh @@ -8,4 +8,4 @@ done # TODO let the database and the autoinstall time to complete - not winning a beauty contest sleep 15s -php /var/www/html/bin/daemon.php -f start +exec php /var/www/html/bin/daemon.php -f start diff --git a/2019.12-dev/fpm-alpine/entrypoint.sh b/2019.12-dev/fpm-alpine/entrypoint.sh index 9c7ea16..f007407 100755 --- a/2019.12-dev/fpm-alpine/entrypoint.sh +++ b/2019.12-dev/fpm-alpine/entrypoint.sh @@ -3,10 +3,11 @@ set -eu # run an command with the www-data user run_as() { + set -- -eu -c "cd /var/www/html; $*" if [ "$(id -u)" -eq 0 ]; then - su - www-data -s /bin/sh -c "cd /var/www/html;$1" + su - www-data -s /bin/sh "$@" else - sh -c "$1" + sh "$@" fi } @@ -44,10 +45,10 @@ clone_develop() { # Removing the whole directory first rm -fr /usr/src/friendica - sh -c "git clone -q -b ${friendica_git} https://github.com/${friendica_repo} /usr/src/friendica" + git clone -q -b ${friendica_git} "https://github.com/${friendica_repo}" /usr/src/friendica mkdir /usr/src/friendica/addon - sh -c "git clone -q -b ${addons_git} https://github.com/${friendica_addons_repo} /usr/src/friendica/addon" + git clone -q -b ${addons_git} "https://github.com/${friendica_addons_repo}" /usr/src/friendica/addon echo "Download finished" @@ -200,7 +201,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then echo "Starting Friendica installation ..." # TODO Let the database time to warm up - not winning a beauty contest sleep 10s - run_as "cd /var/www/html; php /var/www/html/bin/console.php autoinstall $install_options" + run_as "php /var/www/html/bin/console.php autoinstall $install_options" # TODO Workaround because of a strange permission issue rm -fr /var/www/html/view/smarty3/compiled @@ -217,7 +218,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then # upgrade else echo "Upgrading Friendica ..." - run_as 'cd /var/www/html; php /var/www/html/bin/console.php dbstructure update' + run_as 'php /var/www/html/bin/console.php dbstructure update' echo "Upgrading finished" fi fi diff --git a/2019.12-dev/fpm/cron.sh b/2019.12-dev/fpm/cron.sh index cf1f504..708eb8c 100755 --- a/2019.12-dev/fpm/cron.sh +++ b/2019.12-dev/fpm/cron.sh @@ -8,4 +8,4 @@ done # TODO let the database and the autoinstall time to complete - not winning a beauty contest sleep 15s -php /var/www/html/bin/daemon.php -f start +exec php /var/www/html/bin/daemon.php -f start diff --git a/2019.12-dev/fpm/entrypoint.sh b/2019.12-dev/fpm/entrypoint.sh index 9c7ea16..f007407 100755 --- a/2019.12-dev/fpm/entrypoint.sh +++ b/2019.12-dev/fpm/entrypoint.sh @@ -3,10 +3,11 @@ set -eu # run an command with the www-data user run_as() { + set -- -eu -c "cd /var/www/html; $*" if [ "$(id -u)" -eq 0 ]; then - su - www-data -s /bin/sh -c "cd /var/www/html;$1" + su - www-data -s /bin/sh "$@" else - sh -c "$1" + sh "$@" fi } @@ -44,10 +45,10 @@ clone_develop() { # Removing the whole directory first rm -fr /usr/src/friendica - sh -c "git clone -q -b ${friendica_git} https://github.com/${friendica_repo} /usr/src/friendica" + git clone -q -b ${friendica_git} "https://github.com/${friendica_repo}" /usr/src/friendica mkdir /usr/src/friendica/addon - sh -c "git clone -q -b ${addons_git} https://github.com/${friendica_addons_repo} /usr/src/friendica/addon" + git clone -q -b ${addons_git} "https://github.com/${friendica_addons_repo}" /usr/src/friendica/addon echo "Download finished" @@ -200,7 +201,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then echo "Starting Friendica installation ..." # TODO Let the database time to warm up - not winning a beauty contest sleep 10s - run_as "cd /var/www/html; php /var/www/html/bin/console.php autoinstall $install_options" + run_as "php /var/www/html/bin/console.php autoinstall $install_options" # TODO Workaround because of a strange permission issue rm -fr /var/www/html/view/smarty3/compiled @@ -217,7 +218,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then # upgrade else echo "Upgrading Friendica ..." - run_as 'cd /var/www/html; php /var/www/html/bin/console.php dbstructure update' + run_as 'php /var/www/html/bin/console.php dbstructure update' echo "Upgrading finished" fi fi diff --git a/docker-cron.sh b/docker-cron.sh index cf1f504..708eb8c 100755 --- a/docker-cron.sh +++ b/docker-cron.sh @@ -8,4 +8,4 @@ done # TODO let the database and the autoinstall time to complete - not winning a beauty contest sleep 15s -php /var/www/html/bin/daemon.php -f start +exec php /var/www/html/bin/daemon.php -f start diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 9c7ea16..f007407 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -3,10 +3,11 @@ set -eu # run an command with the www-data user run_as() { + set -- -eu -c "cd /var/www/html; $*" if [ "$(id -u)" -eq 0 ]; then - su - www-data -s /bin/sh -c "cd /var/www/html;$1" + su - www-data -s /bin/sh "$@" else - sh -c "$1" + sh "$@" fi } @@ -44,10 +45,10 @@ clone_develop() { # Removing the whole directory first rm -fr /usr/src/friendica - sh -c "git clone -q -b ${friendica_git} https://github.com/${friendica_repo} /usr/src/friendica" + git clone -q -b ${friendica_git} "https://github.com/${friendica_repo}" /usr/src/friendica mkdir /usr/src/friendica/addon - sh -c "git clone -q -b ${addons_git} https://github.com/${friendica_addons_repo} /usr/src/friendica/addon" + git clone -q -b ${addons_git} "https://github.com/${friendica_addons_repo}" /usr/src/friendica/addon echo "Download finished" @@ -200,7 +201,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then echo "Starting Friendica installation ..." # TODO Let the database time to warm up - not winning a beauty contest sleep 10s - run_as "cd /var/www/html; php /var/www/html/bin/console.php autoinstall $install_options" + run_as "php /var/www/html/bin/console.php autoinstall $install_options" # TODO Workaround because of a strange permission issue rm -fr /var/www/html/view/smarty3/compiled @@ -217,7 +218,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then # upgrade else echo "Upgrading Friendica ..." - run_as 'cd /var/www/html; php /var/www/html/bin/console.php dbstructure update' + run_as 'php /var/www/html/bin/console.php dbstructure update' echo "Upgrading finished" fi fi