Skip to content

Commit

Permalink
chore: add www-data user home to PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
janosmiko committed Nov 23, 2024
1 parent 2c65e97 commit c9e64d0
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ else
fi

if [ "${CRON_ENABLED:-false}" = "true" ]; then
printf "PATH=/home/www-data/.composer/vendor/bin:/home/www-data/.local/bin:/var/www/html/node_modules/.bin:/home/www-data/node_modules/.bin:/home/www-data/.local/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\nSHELL=/bin/bash\n" |
printf "PATH=/home/www-data/.composer/vendor/bin:/home/www-data/bin:/home/www-data/.local/bin:/var/www/html/node_modules/.bin:/home/www-data/node_modules/.bin:/home/www-data/.local/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\nSHELL=/bin/bash\n" |
crontab -u www-data -

# If CRONJOBS is set, write it to the crontab
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ fi
## support packages installed via pip into --user context
export PATH=~/.local/bin:$PATH

## support user binaries
export PATH=~/bin:$PATH

## support packages installed via `composer global require <packages>`
export PATH=~/.composer/vendor/bin:$PATH
2 changes: 1 addition & 1 deletion images/php-fpm-rootless/base/tpl.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ EOF
WORKDIR /home/www-data
USER www-data

ENV PATH="/var/www/html/node_modules/.bin:/home/www-data/node_modules/.bin:/home/www-data/.local/bin:${PATH}"
ENV PATH="/var/www/html/node_modules/.bin:/home/www-data/node_modules/.bin:/home/www-data/bin:/home/www-data/.local/bin:${PATH}"
ENV N_PREFIX="/home/www-data/.local"

COPY --from=composer:1 /usr/bin/composer /home/www-data/.local/bin/composer1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ else
fi

if [ "${CRON_ENABLED:-false}" = "true" ]; then
printf "PATH=/home/www-data/.composer/vendor/bin:/home/www-data/.local/bin:/var/www/html/node_modules/.bin:/home/www-data/node_modules/.bin:/home/www-data/.local/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\nSHELL=/bin/bash\n" |
printf "PATH=/home/www-data/.composer/vendor/bin:/home/www-data/bin:/home/www-data/.local/bin:/var/www/html/node_modules/.bin:/home/www-data/node_modules/.bin:/home/www-data/.local/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\nSHELL=/bin/bash\n" |
crontab -u www-data -

# If CRONJOBS is set, write it to the crontab
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ else
fi

if [ "${CRON_ENABLED:-false}" = "true" ]; then
printf "PATH=/home/www-data/.composer/vendor/bin:/home/www-data/.local/bin:/var/www/html/node_modules/.bin:/home/www-data/node_modules/.bin:/home/www-data/.local/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\nSHELL=/bin/bash\n" |
printf "PATH=/home/www-data/.composer/vendor/bin:/home/www-data/bin:/home/www-data/.local/bin:/var/www/html/node_modules/.bin:/home/www-data/node_modules/.bin:/home/www-data/.local/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\nSHELL=/bin/bash\n" |
crontab -u www-data -

# If CRONJOBS is set, write it to the crontab
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ else
fi

if [ "${CRON_ENABLED:-false}" = "true" ]; then
printf "PATH=/home/www-data/.composer/vendor/bin:/home/www-data/.local/bin:/var/www/html/node_modules/.bin:/home/www-data/node_modules/.bin:/home/www-data/.local/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\nSHELL=/bin/bash\n" |
printf "PATH=/home/www-data/.composer/vendor/bin:/home/www-data/bin:/home/www-data/.local/bin:/var/www/html/node_modules/.bin:/home/www-data/node_modules/.bin:/home/www-data/.local/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\nSHELL=/bin/bash\n" |
crontab -u www-data -

# If CRONJOBS is set, write it to the crontab
Expand Down
2 changes: 1 addition & 1 deletion images/php-fpm/base/context/rootfs/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ done
sudo chown www-data:www-data /var/www/html

if [ "${CRON_ENABLED:-false}" = "true" ]; then
printf "PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\nSHELL=/bin/bash\n" |
printf "PATH=/home/www-data/bin:/home/www-data/.local/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\nSHELL=/bin/bash\n" |
crontab -u www-data -

# If CRONJOBS is set, write it to the crontab
Expand Down
3 changes: 3 additions & 0 deletions images/php-fpm/base/context/rootfs/etc/profile.d/path.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ fi
## support packages installed via pip into --user context
export PATH=~/.local/bin:$PATH

## support user binaries
export PATH=~/bin:$PATH

## support packages installed via `composer global require <packages>`
export PATH=~/.composer/vendor/bin:$PATH
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ if [ "${WWWDATA_PASSWORD}" != "" ]; then
fi

if [ "${CRON_ENABLED:-false}" = "true" ]; then
printf "PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\nSHELL=/bin/bash\n" |
printf "PATH=/home/www-data/bin:/home/www-data/.local/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\nSHELL=/bin/bash\n" |
crontab -u www-data -

# If CRONJOBS is set, write it to the crontab
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ else
fi

if [ "${CRON_ENABLED:-false}" = "true" ]; then
printf "PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\nSHELL=/bin/bash\n" |
printf "PATH=/home/www-data/bin:/home/www-data/.local/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\nSHELL=/bin/bash\n" |
crontab -u www-data -

# If CRONJOBS is set, write it to the crontab
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ if [ "${WWWDATA_PASSWORD}" != "" ]; then
fi

if [ "${CRON_ENABLED:-false}" = "true" ]; then
printf "PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\nSHELL=/bin/bash\n" |
printf "PATH=/home/www-data/bin:/home/www-data/.local/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\nSHELL=/bin/bash\n" |
crontab -u www-data -

# If CRONJOBS is set, write it to the crontab
Expand Down

0 comments on commit c9e64d0

Please sign in to comment.