commit
c008564aa3
@ -33,7 +33,7 @@ class Index extends Component
|
|||||||
public ?string $remoteServerUser = 'root';
|
public ?string $remoteServerUser = 'root';
|
||||||
public ?Server $createdServer = null;
|
public ?Server $createdServer = null;
|
||||||
|
|
||||||
public Collection|array $projects = [];
|
public Collection $projects;
|
||||||
public ?int $selectedExistingProject = null;
|
public ?int $selectedExistingProject = null;
|
||||||
public ?Project $createdProject = null;
|
public ?Project $createdProject = null;
|
||||||
|
|
||||||
|
@ -64,21 +64,10 @@ class Create extends Component
|
|||||||
}
|
}
|
||||||
$this->storage->team_id = currentTeam()->id;
|
$this->storage->team_id = currentTeam()->id;
|
||||||
$this->storage->testConnection();
|
$this->storage->testConnection();
|
||||||
$this->storage->is_usable = true;
|
|
||||||
$this->storage->save();
|
$this->storage->save();
|
||||||
return redirect()->route('team.storages.show', $this->storage->uuid);
|
return redirect()->route('team.storages.show', $this->storage->uuid);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function test_s3_connection()
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
$this->storage->testConnection();
|
|
||||||
return $this->emit('success', 'Connection is working. Tested with "ListObjectsV2" action.');
|
|
||||||
} catch (\Throwable $e) {
|
|
||||||
return handleError($e, $this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ class Form extends Component
|
|||||||
public function test_s3_connection()
|
public function test_s3_connection()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$this->storage->testConnection();
|
$this->storage->testConnection(shouldSave: true);
|
||||||
return $this->emit('success', 'Connection is working. Tested with "ListObjectsV2" action.');
|
return $this->emit('success', 'Connection is working. Tested with "ListObjectsV2" action.');
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
@ -53,10 +53,7 @@ class Form extends Component
|
|||||||
{
|
{
|
||||||
$this->validate();
|
$this->validate();
|
||||||
try {
|
try {
|
||||||
$this->storage->testConnection();
|
$this->test_s3_connection();
|
||||||
$this->emit('success', 'Connection is working. Tested with "ListObjectsV2" action.');
|
|
||||||
$this->storage->save();
|
|
||||||
$this->emit('success', 'Storage settings saved.');
|
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
}
|
}
|
||||||
|
@ -434,7 +434,7 @@ class DatabaseBackupJob implements ShouldQueue, ShouldBeEncrypted
|
|||||||
// $region = $this->s3->region;
|
// $region = $this->s3->region;
|
||||||
$bucket = $this->s3->bucket;
|
$bucket = $this->s3->bucket;
|
||||||
$endpoint = $this->s3->endpoint;
|
$endpoint = $this->s3->endpoint;
|
||||||
$this->s3->testConnection();
|
$this->s3->testConnection(shouldSave: true);
|
||||||
if (data_get($this->backup, 'database_type') === 'App\Models\ServiceDatabase') {
|
if (data_get($this->backup, 'database_type') === 'App\Models\ServiceDatabase') {
|
||||||
$network = $this->database->service->destination->network;
|
$network = $this->database->service->destination->network;
|
||||||
} else {
|
} else {
|
||||||
|
@ -36,14 +36,13 @@ class S3Storage extends BaseModel
|
|||||||
return "{$this->endpoint}/{$this->bucket}";
|
return "{$this->endpoint}/{$this->bucket}";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testConnection()
|
public function testConnection(bool $shouldSave = false)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
set_s3_target($this);
|
set_s3_target($this);
|
||||||
Storage::disk('custom-s3')->files();
|
Storage::disk('custom-s3')->files();
|
||||||
$this->unusable_email_sent = false;
|
$this->unusable_email_sent = false;
|
||||||
$this->is_usable = true;
|
$this->is_usable = true;
|
||||||
return;
|
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
$this->is_usable = false;
|
$this->is_usable = false;
|
||||||
if ($this->unusable_email_sent === false && is_transactional_emails_active()) {
|
if ($this->unusable_email_sent === false && is_transactional_emails_active()) {
|
||||||
@ -65,7 +64,9 @@ class S3Storage extends BaseModel
|
|||||||
|
|
||||||
throw $e;
|
throw $e;
|
||||||
} finally {
|
} finally {
|
||||||
$this->save();
|
if ($shouldSave) {
|
||||||
|
$this->save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -511,7 +511,7 @@ function generateDeployWebhook($resource)
|
|||||||
return $url;
|
return $url;
|
||||||
}
|
}
|
||||||
function generateGitManualWebhook($resource, $type) {
|
function generateGitManualWebhook($resource, $type) {
|
||||||
if ($resource->source_id !== 0) {
|
if ($resource->source_id !== 0 && !is_null($resource->source_id)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if ($resource->getMorphClass() === 'App\Models\Application') {
|
if ($resource->getMorphClass() === 'App\Models\Application') {
|
||||||
|
@ -7,7 +7,7 @@ return [
|
|||||||
|
|
||||||
// The release version of your application
|
// The release version of your application
|
||||||
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
|
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
|
||||||
'release' => '4.0.0-beta.134',
|
'release' => '4.0.0-beta.135',
|
||||||
// When left empty or `null` the Laravel environment will be used
|
// When left empty or `null` the Laravel environment will be used
|
||||||
'environment' => config('app.env'),
|
'environment' => config('app.env'),
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return '4.0.0-beta.134';
|
return '4.0.0-beta.135';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<div>
|
<div>
|
||||||
<h1>Create a new S3 Storage</h1>
|
<h1>Create a new S3 Storage</h1>
|
||||||
<div class="subtitle ">S3 Storage used to save backups / files</div>
|
<div class="subtitle">S3 Storage used to save backups / files</div>
|
||||||
<form class="flex flex-col gap-2" wire:submit.prevent='submit'>
|
<form class="flex flex-col gap-2" wire:submit.prevent='submit'>
|
||||||
<div class="flex gap-2">
|
<div class="flex gap-2">
|
||||||
<x-forms.input label="Name" id="name" />
|
<x-forms.input label="Name" id="name" />
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"version": "3.12.36"
|
"version": "3.12.36"
|
||||||
},
|
},
|
||||||
"v4": {
|
"v4": {
|
||||||
"version": "4.0.0-beta.134"
|
"version": "4.0.0-beta.135"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user