diff --git a/app/Jobs/DatabaseBackupJob.php b/app/Jobs/DatabaseBackupJob.php index a09ebeada..ed9694536 100644 --- a/app/Jobs/DatabaseBackupJob.php +++ b/app/Jobs/DatabaseBackupJob.php @@ -318,10 +318,15 @@ class DatabaseBackupJob implements ShouldQueue, ShouldBeEncrypted private function backup_standalone_mongodb(string $databaseWithCollections): void { try { + ray($this->database->toArray()); $url = $this->database->get_db_url(useInternal: true); if ($databaseWithCollections === 'all') { $commands[] = "mkdir -p " . $this->backup_dir; - $commands[] = "docker exec $this->container_name mongodump --authenticationDatabase=admin --uri=$url --gzip --archive > $this->backup_location"; + if (str($this->database->image)->startsWith('mongo:4.0')) { + $commands[] = "docker exec $this->container_name mongodump --uri=$url --gzip --archive > $this->backup_location"; + } else { + $commands[] = "docker exec $this->container_name mongodump --authenticationDatabase=admin --uri=$url --gzip --archive > $this->backup_location"; + } } else { if (str($databaseWithCollections)->contains(':')) { $databaseName = str($databaseWithCollections)->before(':'); @@ -332,9 +337,17 @@ class DatabaseBackupJob implements ShouldQueue, ShouldBeEncrypted } $commands[] = "mkdir -p " . $this->backup_dir; if ($collectionsToExclude->count() === 0) { - $commands[] = "docker exec $this->container_name mongodump --authenticationDatabase=admin --uri=$url --db $databaseName --gzip --archive > $this->backup_location"; + if (str($this->database->image)->startsWith('mongo:4.0')) { + $commands[] = "docker exec $this->container_name mongodump --uri=$url --gzip --archive > $this->backup_location"; + } else { + $commands[] = "docker exec $this->container_name mongodump --authenticationDatabase=admin --uri=$url --db $databaseName --gzip --archive > $this->backup_location"; + } } else { - $commands[] = "docker exec $this->container_name mongodump --authenticationDatabase=admin --uri=$url --db $databaseName --gzip --excludeCollection " . $collectionsToExclude->implode(' --excludeCollection ') . " --archive > $this->backup_location"; + if (str($this->database->image)->startsWith('mongo:4.0')) { + $commands[] = "docker exec $this->container_name mongodump --uri=$url --gzip --excludeCollection " . $collectionsToExclude->implode(' --excludeCollection ') . " --archive > $this->backup_location"; + } else { + $commands[] = "docker exec $this->container_name mongodump --authenticationDatabase=admin --uri=$url --db $databaseName --gzip --excludeCollection " . $collectionsToExclude->implode(' --excludeCollection ') . " --archive > $this->backup_location"; + } } } $this->backup_output = instant_remote_process($commands, $this->server); diff --git a/app/Jobs/SendMessageToDiscordJob.php b/app/Jobs/SendMessageToDiscordJob.php index b9255baaa..31f54f6d6 100644 --- a/app/Jobs/SendMessageToDiscordJob.php +++ b/app/Jobs/SendMessageToDiscordJob.php @@ -20,11 +20,12 @@ class SendMessageToDiscordJob implements ShouldQueue, ShouldBeEncrypted * @var int */ public $tries = 5; + public $backoff = 10; /** * The maximum number of unhandled exceptions to allow before failing. */ - public int $maxExceptions = 3; + public int $maxExceptions = 5; public function __construct( public string $text, diff --git a/app/Livewire/Project/Shared/GetLogs.php b/app/Livewire/Project/Shared/GetLogs.php index 996131f37..e14cd6113 100644 --- a/app/Livewire/Project/Shared/GetLogs.php +++ b/app/Livewire/Project/Shared/GetLogs.php @@ -91,15 +91,35 @@ class GetLogs extends Component if ($this->container) { if ($this->showTimeStamps) { if ($this->server->isSwarm()) { - $sshCommand = generateSshCommand($this->server, "docker service logs -n {$this->numberOfLines} -t {$this->container}"); + $command = "docker service logs -n {$this->numberOfLines} -t {$this->container}"; + if ($this->server->isNonRoot()) { + $command = parseCommandsByLineForSudo(collect($command), $this->server); + $command = $command[0]; + } + $sshCommand = generateSshCommand($this->server, $command); } else { - $sshCommand = generateSshCommand($this->server, "docker logs -n {$this->numberOfLines} -t {$this->container}"); + $command = "docker logs -n {$this->numberOfLines} -t {$this->container}"; + if ($this->server->isNonRoot()) { + $command = parseCommandsByLineForSudo(collect($command), $this->server); + $command = $command[0]; + } + $sshCommand = generateSshCommand($this->server, $command); } } else { if ($this->server->isSwarm()) { - $sshCommand = generateSshCommand($this->server, "docker service logs -n {$this->numberOfLines} {$this->container}"); + $command = "docker service logs -n {$this->numberOfLines} {$this->container}"; + if ($this->server->isNonRoot()) { + $command = parseCommandsByLineForSudo(collect($command), $this->server); + $command = $command[0]; + } + $sshCommand = generateSshCommand($this->server, $command); } else { - $sshCommand = generateSshCommand($this->server, "docker logs -n {$this->numberOfLines} {$this->container}"); + $command = "docker logs -n {$this->numberOfLines} {$this->container}"; + if ($this->server->isNonRoot()) { + $command = parseCommandsByLineForSudo(collect($command), $this->server); + $command = $command[0]; + } + $sshCommand = generateSshCommand($this->server, $command); } } if ($refresh) { diff --git a/app/Livewire/Storage/Create.php b/app/Livewire/Storage/Create.php index d1af807d5..1b2510f5d 100644 --- a/app/Livewire/Storage/Create.php +++ b/app/Livewire/Storage/Create.php @@ -16,13 +16,13 @@ class Create extends Component public string $endpoint; public S3Storage $storage; protected $rules = [ - 'name' => 'nullable|min:3|max:255', + 'name' => 'required|min:3|max:255', 'description' => 'nullable|min:3|max:255', 'region' => 'required|max:255', 'key' => 'required|max:255', 'secret' => 'required|max:255', 'bucket' => 'required|max:255', - 'endpoint' => 'nullable|url|max:255', + 'endpoint' => 'required|url|max:255', ]; protected $validationAttributes = [ 'name' => 'Name', diff --git a/app/Notifications/Application/DeploymentSuccess.php b/app/Notifications/Application/DeploymentSuccess.php index 322df5cec..816dac19d 100644 --- a/app/Notifications/Application/DeploymentSuccess.php +++ b/app/Notifications/Application/DeploymentSuccess.php @@ -43,15 +43,8 @@ class DeploymentSuccess extends Notification implements ShouldQueue public function via(object $notifiable): array { - $channels = setNotificationChannels($notifiable, 'deployments'); - if (isCloud()) { - $channels = array_filter($channels, function ($channel) { - return $channel !== 'App\Notifications\Channels\EmailChannel'; - }); - } - return $channels; + return setNotificationChannels($notifiable, 'deployments'); } - public function toMail(): MailMessage { $mail = new MailMessage(); diff --git a/config/constants.php b/config/constants.php index 091c60996..53f43ae5a 100644 --- a/config/constants.php +++ b/config/constants.php @@ -32,6 +32,7 @@ return [ 'basic' => env('LIMIT_SERVER_BASIC', 2), 'pro' => env('LIMIT_SERVER_PRO', 10), 'ultimate' => env('LIMIT_SERVER_ULTIMATE', 25), + 'dynamic' => env('LIMIT_SERVER_DYNAMIC', 2), ], 'email' => [ 'zero' => true, @@ -39,6 +40,7 @@ return [ 'basic' => true, 'pro' => true, 'ultimate' => true, + 'dynamic' => true, ], ], ]; diff --git a/config/sentry.php b/config/sentry.php index 15711e651..75705bd93 100644 --- a/config/sentry.php +++ b/config/sentry.php @@ -7,7 +7,7 @@ return [ // The release version of your application // Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')) - 'release' => '4.0.0-beta.271', + 'release' => '4.0.0-beta.272', // When left empty or `null` the Laravel environment will be used 'environment' => config('app.env'), diff --git a/config/version.php b/config/version.php index ebbaefd2a..cf5c01c23 100644 --- a/config/version.php +++ b/config/version.php @@ -1,3 +1,3 @@ Dashboard
- - $5 - for the first 2 servers - - - - $4 - /month + VAT - -
-- - $3 - for any additional - - - - $4 - /month + VAT - -
- - billed monthly (+VAT) - - - billed annually - -Begin hosting your own services in the - cloud. -
-
+
+ $5
+ for 2 servers
+
-
+
+ $3
+ per server from 3+ servers
+
-