remove some logs

This commit is contained in:
Saeed Vaziry 2023-08-06 23:04:01 +02:00
parent 94f14dc7a7
commit c2d515f9e5
5 changed files with 94 additions and 121 deletions

View File

@ -76,10 +76,6 @@ public function connect(bool $sftp = false): void
if (! $login) {
throw new SSHAuthenticationError("Error authenticating");
}
Log::info("Login status", [
'status' => $login
]);
} catch (Throwable $e) {
Log::error("Error connecting", [
"msg" => $e->getMessage()
@ -122,15 +118,10 @@ public function upload(string $local, string $remote): void
{
$this->log = null;
Log::info("Starting to upload");
if (! $this->connection) {
$this->connect(true);
}
Log::info("Uploading");
$uploaded = $this->connection->put($remote, $local, SFTP::SOURCE_LOCAL_FILE);
Log::info("Upload finished", [
'status' => $uploaded
]);
$this->connection->put($remote, $local, SFTP::SOURCE_LOCAL_FILE);
}
/**
@ -139,28 +130,17 @@ public function upload(string $local, string $remote): void
protected function executeCommand(string|SSHCommand $command): string
{
if ($command instanceof SSHCommand) {
$commandContent = $command->content($this->server->os);
$commandContent = $command->content();
} else {
$commandContent = $command;
}
Log::info("command", [
"asUser" => $this->asUser,
"content" => $commandContent
]);
if ($this->asUser) {
$commandContent = 'sudo su - '.$this->asUser.' -c '.'"'.addslashes($commandContent).'"';
}
Log::info("Running command", [
"cmd" => $commandContent
]);
$output = $this->connection->exec($commandContent);
Log::info("Command executed");
$this->log?->write($output);
if (Str::contains($output, 'VITO_SSH_ERROR')) {

View File

@ -8,7 +8,6 @@
use Aws\Ec2\Ec2Client;
use Aws\EC2InstanceConnect\EC2InstanceConnectClient;
use Exception;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
class AWS extends AbstractProvider
@ -35,8 +34,6 @@ public function createValidationRules(array $input): array
}
$rules['region'] = 'required|in:'.implode(',', $regions);
Log::info("AWS Creation Rules", $rules);
return $rules;
}
@ -116,8 +113,6 @@ public function isRunning(): bool
return true;
}
}
Log::info($result);
}
return false;

View File

@ -133,8 +133,6 @@ public function deployKey(string $title, string $repo, string $key): void
]
);
info('github response', $response->json());
if ($response->status() != 201) {
throw new FailedToDeployGitKey(json_decode($response->body())->message);
}

View File

@ -1,7 +1,7 @@
{
"name": "laravel/laravel",
"name": "vitodeploy/vito",
"type": "project",
"description": "The Laravel Framework.",
"description": "The ultimate server management tool",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
@ -14,7 +14,6 @@
"laravel/socialite": "^5.2",
"laravel/tinker": "^2.8",
"livewire/livewire": "^2.12",
"opcodesio/log-viewer": "^2.5",
"phpseclib/phpseclib": "~3.0",
"pusher/pusher-php-server": "^7.2"
},
@ -24,6 +23,7 @@
"laravel/sail": "^1.18",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^7.0",
"opcodesio/log-viewer": "^2.5",
"phpunit/phpunit": "^10.0",
"spatie/laravel-ignition": "^2.0"
},

178
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "662f1820db3e99f0684657a45feb4f2c",
"content-hash": "ea391b7d2db59369ea02452c50954ab3",
"packages": [
{
"name": "aws/aws-crt-php",
@ -2916,94 +2916,6 @@
],
"time": "2023-02-08T01:06:31+00:00"
},
{
"name": "opcodesio/log-viewer",
"version": "v2.5.1",
"source": {
"type": "git",
"url": "https://github.com/opcodesio/log-viewer.git",
"reference": "d3c6f6652d155d2849af5f5003b8b1c32d1ac7ae"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/opcodesio/log-viewer/zipball/d3c6f6652d155d2849af5f5003b8b1c32d1ac7ae",
"reference": "d3c6f6652d155d2849af5f5003b8b1c32d1ac7ae",
"shasum": ""
},
"require": {
"illuminate/contracts": "^8.0|^9.0|^10.0",
"php": "^8.0"
},
"conflict": {
"arcanedev/log-viewer": "^8.0"
},
"require-dev": {
"guzzlehttp/guzzle": "^7.2",
"itsgoingd/clockwork": "^5.1",
"laravel/pint": "^1.0",
"nunomaduro/collision": "^6.0",
"orchestra/testbench": "^7.6|^8.0",
"pestphp/pest": "^1.21",
"pestphp/pest-plugin-laravel": "^1.1",
"phpunit/phpunit": "^9.5",
"spatie/test-time": "^1.3"
},
"suggest": {
"guzzlehttp/guzzle": "Required for multi-host support. ^7.2"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Opcodes\\LogViewer\\LogViewerServiceProvider"
],
"aliases": {
"LogViewer": "Opcodes\\LogViewer\\Facades\\LogViewer"
}
}
},
"autoload": {
"psr-4": {
"Opcodes\\LogViewer\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Arunas Skirius",
"email": "arukomp@gmail.com",
"role": "Developer"
}
],
"description": "Fast and easy-to-use log viewer for your Laravel application",
"homepage": "https://github.com/opcodesio/log-viewer",
"keywords": [
"arukompas",
"better-log-viewer",
"laravel",
"log viewer",
"logs",
"opcodesio"
],
"support": {
"issues": "https://github.com/opcodesio/log-viewer/issues",
"source": "https://github.com/opcodesio/log-viewer/tree/v2.5.1"
},
"funding": [
{
"url": "https://www.buymeacoffee.com/arunas",
"type": "custom"
},
{
"url": "https://github.com/arukompas",
"type": "github"
}
],
"time": "2023-07-10T09:20:47+00:00"
},
{
"name": "paragonie/constant_time_encoding",
"version": "v2.6.3",
@ -7132,6 +7044,94 @@
],
"time": "2023-04-14T10:39:16+00:00"
},
{
"name": "opcodesio/log-viewer",
"version": "v2.5.3",
"source": {
"type": "git",
"url": "https://github.com/opcodesio/log-viewer.git",
"reference": "91a17c2bca0d54e3077a253f6852e173f64a8a49"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/opcodesio/log-viewer/zipball/91a17c2bca0d54e3077a253f6852e173f64a8a49",
"reference": "91a17c2bca0d54e3077a253f6852e173f64a8a49",
"shasum": ""
},
"require": {
"illuminate/contracts": "^8.0|^9.0|^10.0",
"php": "^8.0"
},
"conflict": {
"arcanedev/log-viewer": "^8.0"
},
"require-dev": {
"guzzlehttp/guzzle": "^7.2",
"itsgoingd/clockwork": "^5.1",
"laravel/pint": "^1.0",
"nunomaduro/collision": "^6.0",
"orchestra/testbench": "^7.6|^8.0",
"pestphp/pest": "^1.21",
"pestphp/pest-plugin-laravel": "^1.1",
"phpunit/phpunit": "^9.5",
"spatie/test-time": "^1.3"
},
"suggest": {
"guzzlehttp/guzzle": "Required for multi-host support. ^7.2"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Opcodes\\LogViewer\\LogViewerServiceProvider"
],
"aliases": {
"LogViewer": "Opcodes\\LogViewer\\Facades\\LogViewer"
}
}
},
"autoload": {
"psr-4": {
"Opcodes\\LogViewer\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Arunas Skirius",
"email": "arukomp@gmail.com",
"role": "Developer"
}
],
"description": "Fast and easy-to-use log viewer for your Laravel application",
"homepage": "https://github.com/opcodesio/log-viewer",
"keywords": [
"arukompas",
"better-log-viewer",
"laravel",
"log viewer",
"logs",
"opcodesio"
],
"support": {
"issues": "https://github.com/opcodesio/log-viewer/issues",
"source": "https://github.com/opcodesio/log-viewer/tree/v2.5.3"
},
"funding": [
{
"url": "https://www.buymeacoffee.com/arunas",
"type": "custom"
},
{
"url": "https://github.com/arukompas",
"type": "github"
}
],
"time": "2023-07-29T10:15:21+00:00"
},
{
"name": "phar-io/manifest",
"version": "2.0.3",