format muhahaha

This commit is contained in:
Andras Bacsai 2023-08-11 20:48:52 +02:00
parent c762195c8a
commit 82a01b4483
109 changed files with 295 additions and 244 deletions

View File

@ -29,8 +29,10 @@ public function update(User $user, array $input): void
],
])->validateWithBag('updateProfileInformation');
if ($input['email'] !== $user->email &&
$user instanceof MustVerifyEmail) {
if (
$input['email'] !== $user->email &&
$user instanceof MustVerifyEmail
) {
$this->updateVerifiedUser($user, $input);
} else {
$user->forceFill([

View File

@ -22,5 +22,4 @@ public function __invoke(Server $server, bool $reset = false)
return $proxy_configuration;
}
}

View File

@ -43,15 +43,16 @@ private function showHelp()
style('coolify')->color('#9333EA');
style('title-box')->apply('mt-1 px-2 py-1 bg-coolify');
render(<<<'HTML'
render(
<<<'HTML'
<div>
<div class="title-box">
Coolify
</div>
<p class="ml-1 mt-1 ">
<p class="mt-1 ml-1 ">
Demo Notify <strong class="text-coolify">=></strong> Send a demo notification to a given channel.
</p>
<p class="ml-1 mt-1 bg-coolify px-1">
<p class="px-1 mt-1 ml-1 bg-coolify">
php artisan app:demo-notify {channel}
</p>
<div class="my-1">

View File

@ -54,7 +54,6 @@ private function check_scheduled_backups($schedule)
backup: $scheduled_backup
))->cron($scheduled_backup->frequency);
}
}
protected function commands(): void

View File

@ -22,7 +22,6 @@ public function __construct(
public ?Model $model = null,
public string $status = ProcessStatus::QUEUED->value,
public bool $ignore_errors = false,
)
{
) {
}
}

View File

@ -11,7 +11,6 @@ class ServerMetadata extends Data
public function __construct(
public ?ProxyTypes $type,
public ?ProxyStatus $status
)
{
) {
}
}

View File

@ -24,7 +24,7 @@ public function subscription()
abort(404);
}
return view('subscription', [
'settings' => InstanceSettings::get()
'settings' => InstanceSettings::get(),
]);
}
@ -34,7 +34,7 @@ public function license()
abort(404);
}
return view('settings.license', [
'settings' => InstanceSettings::get()
'settings' => InstanceSettings::get(),
]);
}
@ -63,13 +63,11 @@ public function settings()
$settings = InstanceSettings::get();
$database = StandalonePostgresql::whereName('coolify-db')->first();
if ($database) {
$backup = $database->scheduledBackups->first();
$s3s = S3Storage::whereTeamId(0)->get();
}
return view('settings.configuration', [
'settings' => $settings,
'database' => $database,
'backup' => $backup ?? null,
's3s' => $s3s ?? [],
]);
} else {

View File

@ -31,7 +31,6 @@ public function save()
} catch (\Throwable $th) {
return general_error_handler($th, $this, false);
}
}
public function get_files()

View File

@ -54,18 +54,13 @@ public function instantSave()
} catch (\Exception $e) {
$this->emit('error', $e->getMessage());
}
}
private function custom_validate()
{
// if ($this->backup->save_s3) {
// if (!is_numeric($this->selected_storage_id)) {
// throw new \Exception('Invalid S3 Storage');
// } else {
// $this->backup->s3_storage_id = $this->selected_storage_id;
// }
// }
if (!is_numeric($this->backup->s3_storage_id)) {
$this->backup->s3_storage_id = null;
}
$isValid = validate_cron_expression($this->backup->frequency);
if (!$isValid) {
throw new \Exception('Invalid Cron / Human expression');

View File

@ -11,7 +11,6 @@ class BackupExecution extends Component
public function download()
{
}
public function delete(): void

View File

@ -0,0 +1,18 @@
<?php
namespace App\Http\Livewire\Project\Database;
use App\Jobs\DatabaseBackupJob;
use Livewire\Component;
class BackupNow extends Component
{
public $backup;
public function backup_now()
{
dispatch(new DatabaseBackupJob(
backup: $this->backup
));
$this->emit('success', 'Backup queued. It will be available in a few minutes');
}
}

View File

@ -2,12 +2,12 @@
namespace App\Http\Livewire\Settings;
use App\Jobs\DatabaseBackupJob;
use App\Models\InstanceSettings;
use App\Models\S3Storage;
use App\Models\ScheduledDatabaseBackup;
use App\Models\Server;
use App\Models\StandalonePostgresql;
use App\Jobs\DatabaseBackupJob;
use Livewire\Component;
class Backup extends Component
@ -16,6 +16,7 @@ class Backup extends Component
public $s3s;
public StandalonePostgresql|null $database = null;
public ScheduledDatabaseBackup|null $backup = null;
public $executions = [];
protected $rules = [
'database.uuid' => 'required',
@ -33,9 +34,13 @@ class Backup extends Component
'database.postgres_password' => 'postgres password',
];
public function mount()
{
$this->backup = $this->database->scheduledBackups->first();
$this->executions = $this->backup->executions;
}
public function add_coolify_database()
{
ray('add_coolify_database');
$server = Server::find(0);
$out = instant_remote_process(['docker inspect coolify-db'], $server);
$envs = format_docker_envs_to_json($out);
@ -68,7 +73,8 @@ public function add_coolify_database()
$this->s3s = S3Storage::whereTeamId(0)->get();
}
public function backup_now() {
public function backup_now()
{
dispatch(new DatabaseBackupJob(
backup: $this->backup
));
@ -78,5 +84,4 @@ public function submit()
{
$this->emit('success', 'Backup updated successfully');
}
}

View File

@ -70,7 +70,6 @@ public function submit()
} catch (\Throwable $th) {
return general_error_handler($th, $this);
}
}
private function test_s3_connection()

View File

@ -25,8 +25,7 @@ public function __construct(
public int $pull_request_id,
public string $deployment_uuid,
public string $status
)
{
) {
}
public function handle()

View File

@ -20,8 +20,7 @@ class CoolifyTask implements ShouldQueue
public function __construct(
public Activity $activity,
public bool $ignore_errors = false,
)
{
) {
}
/**

View File

@ -183,6 +183,5 @@ private function save_backup_logs(): void
'message' => $this->backup_output,
'size' => $this->size,
]);
}
}

View File

@ -28,8 +28,7 @@ class SendMessageToDiscordJob implements ShouldQueue
public function __construct(
public string $text,
public string $webhookUrl
)
{
) {
}
/**

View File

@ -49,7 +49,6 @@ public function via($notifiable)
return ['mail'];
}
throw new \Exception('SMTP is not enabled');
}
public function toMail($notifiable)

View File

@ -23,7 +23,8 @@ class FortifyServiceProvider extends ServiceProvider
*/
public function register(): void
{
$this->app->instance(RegisterResponse::class, new class implements RegisterResponse {
$this->app->instance(RegisterResponse::class, new class implements RegisterResponse
{
public function toResponse($request)
{
// First user (root) will be redirected to /settings instead of / on registration.

View File

@ -17,8 +17,7 @@ public function __construct(
public bool $noStyle = false,
public string|null $modalId = null,
public string $defaultClass = "btn btn-primary btn-sm font-normal text-white normal-case no-animation rounded border-none"
)
{
) {
if ($this->noStyle) {
$this->defaultClass = "";
}

View File

@ -20,8 +20,7 @@ public function __construct(
public bool $instantSave = false,
public bool $disabled = false,
public string $defaultClass = "toggle toggle-xs toggle-warning rounded disabled:bg-coolgray-200 disabled:opacity-50 placeholder:text-neutral-700"
)
{
) {
//
}

View File

@ -21,8 +21,7 @@ public function __construct(
public string|null $helper = null,
public bool $allowToPeak = true,
public string $defaultClass = "input input-sm bg-coolgray-200 rounded text-white w-full disabled:bg-coolgray-200/50 disabled:border-none placeholder:text-coolgray-500 read-only:text-neutral-500 read-only:bg-coolgray-200/50"
)
{
) {
}
public function render(): View|Closure|string

View File

@ -20,8 +20,7 @@ public function __construct(
public string|null $helper = null,
public bool $required = false,
public string $defaultClass = "select select-sm w-full rounded text-white text-sm bg-coolgray-200 font-normal disabled:bg-coolgray-200/50 disabled:border-none"
)
{
) {
//
}

View File

@ -25,8 +25,7 @@ public function __construct(
public bool $readonly = false,
public string|null $helper = null,
public string $defaultClass = "textarea bg-coolgray-200 rounded text-white scrollbar disabled:bg-coolgray-200/50 disabled:border-none placeholder:text-coolgray-500 read-only:text-neutral-500 read-only:bg-coolgray-200/50"
)
{
) {
//
}

View File

@ -18,8 +18,7 @@ public function __construct(
public string|null $modalSubmit = null,
public bool $yesOrNo = false,
public string $action = 'delete'
)
{
) {
//
}

View File

@ -27,8 +27,7 @@ function remote_process(
?string $type_uuid = null,
?Model $model = null,
bool $ignore_errors = false,
): Activity
{
): Activity {
$command_string = implode("\n", $command);
if (auth()->user()) {

View File

@ -178,5 +178,3 @@ function validate_cron_expression($expression_to_validate): bool
}
return $isValid;
}

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -5,7 +5,8 @@
use Illuminate\Support\Facades\Schema;
use Laravel\Fortify\Fortify;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -6,7 +6,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
public function up(): void
{
Schema::create('scheduled_database_backups', function (Blueprint $table) {

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
public function up(): void
{
Schema::create('scheduled_database_backup_executions', function (Blueprint $table) {

View File

@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
public function up(): void
{
Schema::table('teams', function (Blueprint $table) {

View File

@ -1,6 +1,5 @@
@if ($pull_request_id !== 0)
Pull Request #{{ $pull_request_id }} of {{ $name }} (<a target="_blank"
href="{{ $fqdn }}">{{ $fqdn }}</a>) deployment failed:
Pull Request #{{ $pull_request_id }} of {{ $name }} (<a target="_blank" href="{{ $fqdn }}">{{ $fqdn }}</a>) deployment failed:
@else
Deployment failed of {{ $name }} (<a target="_blank" href="{{ $fqdn }}">{{ $fqdn }}</a>):
@endif

View File

@ -1,8 +1,7 @@
@if ($pull_request_id === 0)
A new version of <a target="_blank" href="{{ $fqdn }}">{{ $fqdn }}</a> is available:
@else
Pull request #{{ $pull_request_id }} of {{ $name }} deployed successfully: <a target="_blank"
href="{{ $fqdn }}">Application Link</a> |
Pull request #{{ $pull_request_id }} of {{ $name }} deployed successfully: <a target="_blank" href="{{ $fqdn }}">Application Link</a> |
@endif
<a target="_blank" href="{{ $deployment_url }}">View
Deployment Logs</a><br><br>

View File

@ -4,6 +4,7 @@
<x-forms.button type="submit">
Save
</x-forms.button>
<livewire:project.database.backup-now :backup="$backup" />
@if ($backup->database_id !== 0)
<x-forms.button isError wire:click="delete">Delete</x-forms.button>
@endif

View File

@ -1,5 +1,6 @@
<div class="flex gap-2">
<div class="flex-1"></div>
{{-- @if (data_get($execution, 'status') !== 'failed') --}}
{{-- <x-forms.button class="bg-coollabs-100 hover:bg-coollabs" wire:click="download">Download</x-forms.button> --}}
{{-- @endif --}}

View File

@ -0,0 +1 @@
<x-forms.button wire:click='backup_now'>Backup Now</x-forms.button>

View File

@ -6,7 +6,6 @@
<x-forms.button type="submit" wire:click="submit">
Save
</x-forms.button>
<x-forms.button wire:click="backup_now">Backup Now</x-forms.button>
@endif
</div>
<div class="pb-4">Backup your Coolify instance settings</div>
@ -30,5 +29,9 @@
<x-forms.button wire:click="add_coolify_database">Add Database</x-forms.button>
@endif
</div>
<div class="py-4">
<h2 class="pb-4">Executions</h2>
<livewire:project.database.backup-executions :backup="$backup" :executions="$executions" />
</div>
</div>
</div>

View File

@ -14,7 +14,7 @@
<livewire:settings.configuration :settings="$settings" />
</div>
<div x-cloak x-show="activeTab === 'backup'" class="h-full">
<livewire:settings.backup :settings="$settings" :database="$database" :backup="$backup" :s3s="$s3s" />
<livewire:settings.backup :settings="$settings" :database="$database" :s3s="$s3s" />
</div>
<div x-cloak x-show="activeTab === 'smtp'" class="h-full">
<livewire:settings.email :settings="$settings" />

View File

@ -41,7 +41,8 @@ protected function driver(): RemoteWebDriver
return RemoteWebDriver::create(
$_ENV['DUSK_DRIVER_URL'] ?? 'http://localhost:9515',
DesiredCapabilities::chrome()->setCapability(
ChromeOptions::CAPABILITY, $options
ChromeOptions::CAPABILITY,
$options
)
);
}