use blade as conmmands template (#444)

* use blade as conmmands template

* fix lint

* fix ssl
This commit is contained in:
Saeed Vaziry
2025-01-27 21:27:58 +01:00
committed by GitHub
parent a73476c1dd
commit cdbde063f0
208 changed files with 1080 additions and 1012 deletions

View File

@ -2,26 +2,27 @@
namespace App\SSH\Wordpress;
use App\Exceptions\SSHError;
use App\Models\Site;
use App\SSH\HasScripts;
class Wordpress
{
use HasScripts;
/**
* @throws SSHError
*/
public function install(Site $site): void
{
$site->server->ssh($site->user)->exec(
$this->getScript('install.sh', [
view('ssh.wordpress.install', [
'path' => $site->path,
'domain' => $site->domain,
'is_isolated' => $site->isIsolated() ? 'true' : 'false',
'isolated_username' => $site->user,
'db_name' => $site->type_data['database'],
'db_user' => $site->type_data['database_user'],
'db_pass' => $site->type_data['database_password'],
'db_host' => 'localhost',
'db_prefix' => 'wp_',
'isIsolated' => $site->isIsolated() ? 'true' : 'false',
'isolatedUsername' => $site->user,
'dbName' => $site->type_data['database'],
'dbUser' => $site->type_data['database_user'],
'dbPass' => $site->type_data['database_password'],
'dbHost' => 'localhost',
'dbPrefix' => 'wp_',
'username' => $site->type_data['username'],
'password' => $site->type_data['password'],
'email' => $site->type_data['email'],

View File

@ -1,40 +0,0 @@
if ! curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar; then
echo 'VITO_SSH_ERROR' && exit 1
fi
if ! chmod +x wp-cli.phar; then
echo 'VITO_SSH_ERROR' && exit 1
fi
if [ "__is_isolated__" == "true" ]; then
mv wp-cli.phar /home/__isolated_username__/bin/
ln -s /home/__isolated_username__/bin/wp-cli.phar /home/__isolated_username__/bin/wp
else
if ! sudo mv wp-cli.phar /usr/local/bin/wp; then
echo 'VITO_SSH_ERROR' && exit 1
fi
fi
rm -rf __path__
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
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
echo 'VITO_SSH_ERROR' && exit 1
fi