mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-07 17:02:34 +00:00
Isolate Users (#431)
* WIP to isolate users * Resolved issue with SSH AsUser Updated Isolated User Script to use Server User for Team Access Updated Path creation script to simplify for running as the isolated user * Included the server user * PHPMyAdmin script updated Wordpress Script Updated Updated Execute Script to support executing as isolated users * Issue Resolution & Resolved Failing Unit Tests * Fix for isolated_username vs user * Run the deploy as the isolated user * queue updates for isolated user * Support isolated users in cronjobs * script tests for isolated users * Queue tests for isolated users * Cronjob tests for isolated user * Removed default queue command for laravel apps * add default user to factory * laravel pint fixes * ensure echos are consistent * removed unneeded parameter * update * fix queues for isolated users * revert addslashes --------- Co-authored-by: Saeed Vaziry <mr.saeedvaziry@gmail.com>
This commit is contained in:
@ -11,10 +11,12 @@ class Wordpress
|
||||
|
||||
public function install(Site $site): void
|
||||
{
|
||||
$site->server->ssh()->exec(
|
||||
$site->server->ssh($site->user)->exec(
|
||||
$this->getScript('install.sh', [
|
||||
'path' => $site->path,
|
||||
'domain' => $site->domain,
|
||||
'is_isolated' => $site->isIsolated(),
|
||||
'isolated_username' => $site->user,
|
||||
'db_name' => $site->type_data['database'],
|
||||
'db_user' => $site->type_data['database_user'],
|
||||
'db_pass' => $site->type_data['database_password'],
|
||||
@ -25,7 +27,8 @@ public function install(Site $site): void
|
||||
'email' => $site->type_data['email'],
|
||||
'title' => $site->type_data['title'],
|
||||
]),
|
||||
'install-wordpress'
|
||||
'install-wordpress',
|
||||
$site->id
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -6,8 +6,14 @@ if ! chmod +x wp-cli.phar; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
if ! sudo mv wp-cli.phar /usr/local/bin/wp; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
if [ "__is_isolated__" == "true" ]; then
|
||||
if ! mv wp-cli.phar /home/__isolated_username__/bin/wp; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
else
|
||||
if ! mv wp-cli.phar /usr/local/bin/wp; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -rf __path__
|
||||
@ -16,12 +22,20 @@ if ! wp --path=__path__ core download; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
if ! wp --path=__path__ core config --dbname='__db_name__' --dbuser='__db_user__' --dbpass='__db_pass__' --dbhost='__db_host__' --dbprefix='__db_prefix__'; then
|
||||
if ! wp --path=__path__ core config \
|
||||
--dbname="__db_name__" \
|
||||
--dbuser="__db_user__" \
|
||||
--dbpass="__db_pass__" \
|
||||
--dbhost="__db_host__" \
|
||||
--dbprefix="__db_prefix__"; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
if ! wp --path=__path__ core install --url='http://__domain__' --title="__title__" --admin_user='__username__' --admin_password="__password__" --admin_email='__email__'; then
|
||||
if ! wp --path=__path__ core install \
|
||||
--url="http://__domain__" \
|
||||
--title="__title__" \
|
||||
--admin_user="__username__" \
|
||||
--admin_password="__password__" \
|
||||
--admin_email="__email__"; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
echo "Wordpress installed!"
|
||||
|
Reference in New Issue
Block a user