diff --git a/matomo/scripts/bootstrap.sh b/matomo/scripts/bootstrap.sh index 3fa8752..5a1f21a 100755 --- a/matomo/scripts/bootstrap.sh +++ b/matomo/scripts/bootstrap.sh @@ -156,6 +156,9 @@ matomo_update_config() { "mail.encryption=\"$MATOMO_SMTP_ENCRYPTION\"" } +# Just in case, correct permissions +chown -R www-data:www-data . + # Only initialize if we do NOT have a config file if [ ! -f "$config_file" ]; then start_server diff --git a/matomo/scripts/docker-entrypoint.sh b/matomo/scripts/docker-entrypoint.sh index c94c242..6ba7094 100755 --- a/matomo/scripts/docker-entrypoint.sh +++ b/matomo/scripts/docker-entrypoint.sh @@ -8,7 +8,6 @@ set -euo pipefail if [ ! -e matomo.php ]; then tar cf - --one-file-system -C /usr/src/matomo . | tar xf - - chown -R www-data:www-data . fi @@ -21,7 +20,7 @@ if [ "$1" = 'serve' ]; then # Helper to run cron jobs elif [ "$1" = 'scheduler' ]; then - exec php console core:archive --verbose --no-interaction + exec su www-data -s /bin/sh -c 'php console core:archive --verbose --no-interaction' # Init script, for use in initContainers (for example) elif [ "$1" = 'init' ]; then