Jailing v-run-wp-cli

This commit is contained in:
Peca 2025-06-17 11:43:48 +02:00
parent 31413a8f73
commit 596bce582f

View file

@ -63,6 +63,9 @@ if [ ! -d "/home/$user/web/$domain/public_html" ]; then
exit 1;
fi
mkdir -p /home/$user/.wp-cli
chown $user:$user /home/$user/.wp-cli
phpver=$(/usr/local/vesta/bin/v-get-php-version-of-domain "$domain")
#----------------------------------------------------------#
@ -70,7 +73,11 @@ phpver=$(/usr/local/vesta/bin/v-get-php-version-of-domain "$domain")
#----------------------------------------------------------#
cd /home/$USER/web/$domain/public_html
sudo -u $USER /usr/bin/php$phpver /usr/local/bin/wp $wp_command
sudo -u $USER /usr/bin/php$phpver -d disable_functions=pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,exec,system,passthru,shell_exec,proc_open,popen -d open_basedir=/home/$user/web/$domain:/home/$user/.wp-cli:/home/$user/tmp:/usr/local/bin /usr/local/bin/wp --path=/home/$user/web/$domain/public_html/ $wp_command 2>/home/$user/web/$domain/wp-cli-error.log
echo "WP CLI: Done."
echo "To see Warning/Error log: "
echo "cat /home/$user/web/$domain/wp-cli-error.log"
#----------------------------------------------------------#
# Vesta #