mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-19 18:01:37 +00:00
refactoring leftovers
This commit is contained in:
parent
428140b931
commit
f907bacdd0
@ -1,9 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Exceptions;
|
|
||||||
|
|
||||||
use Exception;
|
|
||||||
|
|
||||||
class BackupFileException extends Exception
|
|
||||||
{
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Exceptions;
|
|
||||||
|
|
||||||
use Exception;
|
|
||||||
|
|
||||||
class CannotDeployKey extends Exception
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Exceptions;
|
|
||||||
|
|
||||||
use Exception;
|
|
||||||
|
|
||||||
class ComposerInstallFailed extends Exception
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Exceptions;
|
|
||||||
|
|
||||||
use Exception;
|
|
||||||
|
|
||||||
class ErrorUpdatingRedirects extends Exception
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Exceptions;
|
|
||||||
|
|
||||||
use Exception;
|
|
||||||
|
|
||||||
class FailedToInstallWordpress extends Exception
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Exceptions;
|
|
||||||
|
|
||||||
use Exception;
|
|
||||||
|
|
||||||
class ProcessFailed extends Exception
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
@ -72,6 +72,6 @@ public function path(): string
|
|||||||
|
|
||||||
public function storagePath(): string
|
public function storagePath(): string
|
||||||
{
|
{
|
||||||
return '/'.$this->name.'.zip';
|
return '/'.$this->backup->database->name.'/'.$this->name.'.zip';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,10 +63,6 @@ public function deploySSHKey(string $key): void
|
|||||||
|
|
||||||
public function deleteSSHKey(string $key): void
|
public function deleteSSHKey(string $key): void
|
||||||
{
|
{
|
||||||
info($this->getScript('delete-ssh-key.sh', [
|
|
||||||
'key' => $key,
|
|
||||||
'user' => $this->server->getSshUser(),
|
|
||||||
]));
|
|
||||||
$this->server->ssh()->exec(
|
$this->server->ssh()->exec(
|
||||||
$this->getScript('delete-ssh-key.sh', [
|
$this->getScript('delete-ssh-key.sh', [
|
||||||
'key' => $key,
|
'key' => $key,
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
if ! echo '__data__' | sudo -u __user__ crontab -; then
|
|
||||||
echo 'VITO_SSH_ERROR' && exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! sudo -u __user__ crontab -l; then
|
|
||||||
echo 'VITO_SSH_ERROR' && exit 1
|
|
||||||
fi
|
|
@ -1,5 +0,0 @@
|
|||||||
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -;
|
|
||||||
|
|
||||||
sudo DEBIAN_FRONTEND=noninteractive apt update
|
|
||||||
|
|
||||||
sudo DEBIAN_FRONTEND=noninteractive apt install nodejs -y
|
|
@ -1,17 +0,0 @@
|
|||||||
if ! sudo chown -R 755 /home/vito/phpmyadmin; then
|
|
||||||
echo 'VITO_SSH_ERROR' && exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! echo '__vhost__' | sudo tee /etc/nginx/sites-available/phpmyadmin; then
|
|
||||||
echo 'VITO_SSH_ERROR' && exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! sudo ln -s /etc/nginx/sites-available/phpmyadmin /etc/nginx/sites-enabled/; then
|
|
||||||
echo 'VITO_SSH_ERROR' && exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! sudo service nginx restart; then
|
|
||||||
echo 'VITO_SSH_ERROR' && exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "PHPMyAdmin vhost created"
|
|
@ -1,11 +0,0 @@
|
|||||||
sudo rm -rf __path__
|
|
||||||
|
|
||||||
sudo rm /etc/nginx/sites-available/phpmyadmin
|
|
||||||
|
|
||||||
sudo rm /etc/nginx/sites-enabled/phpmyadmin
|
|
||||||
|
|
||||||
if ! sudo service nginx restart; then
|
|
||||||
echo 'VITO_SSH_ERROR' && exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "PHPMyAdmin deleted"
|
|
@ -1,21 +0,0 @@
|
|||||||
sudo rm -rf phpmyadmin
|
|
||||||
|
|
||||||
if ! wget https://files.phpmyadmin.net/phpMyAdmin/5.1.2/phpMyAdmin-5.1.2-all-languages.zip; then
|
|
||||||
echo 'VITO_SSH_ERROR' && exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! unzip phpMyAdmin-5.1.2-all-languages.zip; then
|
|
||||||
echo 'VITO_SSH_ERROR' && exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! rm -rf phpMyAdmin-5.1.2-all-languages.zip; then
|
|
||||||
echo 'VITO_SSH_ERROR' && exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! mv phpMyAdmin-5.1.2-all-languages phpmyadmin; then
|
|
||||||
echo 'VITO_SSH_ERROR' && exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! mv phpmyadmin/config.sample.inc.php phpmyadmin/config.inc.php; then
|
|
||||||
echo 'VITO_SSH_ERROR' && exit 1
|
|
||||||
fi
|
|
@ -1,3 +0,0 @@
|
|||||||
sudo service __service__ restart
|
|
||||||
|
|
||||||
sudo service __service__ status | cat
|
|
@ -1 +0,0 @@
|
|||||||
sudo service __service__ status | cat
|
|
@ -1,3 +0,0 @@
|
|||||||
sudo service __service__ start
|
|
||||||
|
|
||||||
sudo service __service__ status | cat
|
|
@ -1,3 +0,0 @@
|
|||||||
sudo service __service__ stop
|
|
||||||
|
|
||||||
sudo service __service__ status | cat
|
|
@ -1 +0,0 @@
|
|||||||
sudo DEBIAN_FRONTEND=noninteractive apt install certbot python3-certbot-nginx -y
|
|
@ -1 +0,0 @@
|
|||||||
sudo sed -i 's/__key__//g' ~/.ssh/authorized_keys
|
|
@ -1,27 +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 ! sudo mv wp-cli.phar /usr/local/bin/wp; then
|
|
||||||
echo 'VITO_SSH_ERROR' && exit 1
|
|
||||||
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
|
|
||||||
|
|
||||||
print "Wordpress installed!"
|
|
@ -32,6 +32,7 @@ class="p-6"
|
|||||||
|
|
||||||
<div class="mt-6">
|
<div class="mt-6">
|
||||||
<x-input-label for="backup_storage" :value="__('Storage')" />
|
<x-input-label for="backup_storage" :value="__('Storage')" />
|
||||||
|
<div class="mt-1 flex items-center">
|
||||||
<x-select-input id="backup_storage" name="backup_storage" class="mt-1 w-full">
|
<x-select-input id="backup_storage" name="backup_storage" class="mt-1 w-full">
|
||||||
<option value="" selected disabled>{{ __("Select") }}</option>
|
<option value="" selected disabled>{{ __("Select") }}</option>
|
||||||
@foreach (auth()->user()->storageProviders as $st)
|
@foreach (auth()->user()->storageProviders as $st)
|
||||||
@ -40,6 +41,10 @@ class="p-6"
|
|||||||
</option>
|
</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
</x-select-input>
|
</x-select-input>
|
||||||
|
<x-secondary-button :href="route('storage-providers')" class="ml-2 flex-none">
|
||||||
|
Connect
|
||||||
|
</x-secondary-button>
|
||||||
|
</div>
|
||||||
@error("backup_storage")
|
@error("backup_storage")
|
||||||
<x-input-error class="mt-2" :messages="$message" />
|
<x-input-error class="mt-2" :messages="$message" />
|
||||||
@enderror
|
@enderror
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<x-modal name="connect-provider">
|
<x-modal name="connect-provider">
|
||||||
@php
|
@php
|
||||||
$oldProvider = old("provider", request()->input("provider") ?? "");
|
$oldProvider = old("provider", request()->input("provider") ?? "dropbox");
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
<form
|
<form
|
||||||
@ -33,6 +33,9 @@ class="p-6"
|
|||||||
@if ($p !== "custom")
|
@if ($p !== "custom")
|
||||||
<option value="{{ $p }}" @if($oldProvider === $p) selected @endif>
|
<option value="{{ $p }}" @if($oldProvider === $p) selected @endif>
|
||||||
{{ $p }}
|
{{ $p }}
|
||||||
|
@if ($p === "ftp")
|
||||||
|
(Beta)
|
||||||
|
@endif
|
||||||
</option>
|
</option>
|
||||||
@endif
|
@endif
|
||||||
@endforeach
|
@endforeach
|
||||||
@ -56,6 +59,14 @@ class="p-6"
|
|||||||
@error("token")
|
@error("token")
|
||||||
<x-input-error class="mt-2" :messages="$message" />
|
<x-input-error class="mt-2" :messages="$message" />
|
||||||
@enderror
|
@enderror
|
||||||
|
|
||||||
|
<a
|
||||||
|
class="mt-1 text-primary-500"
|
||||||
|
href="https://dropbox.tech/developers/generate-an-access-token-for-your-own-account"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
How to generate?
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div x-show="provider === 'ftp'" class="mt-6">
|
<div x-show="provider === 'ftp'" class="mt-6">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user