Merge pull request #4193 from coollabsio/next

v4.0.0-beta.364
This commit is contained in:
Andras Bacsai
2024-11-08 18:11:15 +01:00
committed by GitHub
16 changed files with 62 additions and 64 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Livewire\Project\Application\Preview;
use App\Models\Application;
use Livewire\Attributes\Validate;
use Livewire\Component;
use Spatie\Url\Url;

View File

@@ -99,6 +99,14 @@ class SettingsBackup extends Component
$this->database->refresh();
$this->backup->refresh();
$this->s3s = S3Storage::whereTeamId(0)->get();
$this->uuid = $this->database->uuid;
$this->name = $this->database->name;
$this->description = $this->database->description;
$this->postgres_user = $this->database->postgres_user;
$this->postgres_password = $this->database->postgres_password;
$this->executions = $this->backup->executions;
} catch (\Exception $e) {
return handleError($e, $this);
}

View File

@@ -63,6 +63,8 @@ class SettingsEmail extends Component
$this->settings->smtp_username = $this->smtpUsername;
$this->settings->smtp_password = $this->smtpPassword;
$this->settings->smtp_timeout = $this->smtpTimeout;
$this->settings->smtp_from_address = $this->smtpFromAddress;
$this->settings->smtp_from_name = $this->smtpFromName;
$this->settings->resend_enabled = $this->resendEnabled;
$this->settings->resend_api_key = $this->resendApiKey;

View File

@@ -23,7 +23,7 @@ class Create extends Component
public function mount()
{
$this->name = substr(generate_random_name(), 0, 34); // GitHub Apps names can only be 34 characters long
$this->name = substr(generate_random_name(), 0, 30);
}
public function createGitHubApp()

View File

@@ -359,8 +359,11 @@ function fqdnLabelsForTraefik(string $uuid, Collection $domains, bool $is_force_
$https_label = "https-{$loop}-{$uuid}-{$service_name}";
}
if (str($image)->contains('ghost')) {
$labels->push("traefik.http.middlewares.redir-ghost.redirectregex.regex=^{$path}/(.*)");
$labels->push('traefik.http.middlewares.redir-ghost.redirectregex.replacement=/$1');
$labels->push("traefik.http.middlewares.redir-ghost-{$uuid}.redirectregex.regex=^{$path}/(.*)");
$labels->push("traefik.http.middlewares.redir-ghost-{$uuid}.redirectregex.replacement=/$1");
$labels->push("caddy_{$loop}.handle_path.{$loop}_redir-ghost-{$uuid}.handler=rewrite");
$labels->push("caddy_{$loop}.handle_path.{$loop}_redir-ghost-{$uuid}.rewrite.regexp=^{$path}/(.*)");
$labels->push("caddy_{$loop}.handle_path.{$loop}_redir-ghost-{$uuid}.rewrite.replacement=/$1");
}
$to_www_name = "{$loop}-{$uuid}-to-www";

View File

@@ -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.363',
'release' => '4.0.0-beta.364',
// When left empty or `null` the Laravel environment will be used
'environment' => config('app.env'),

View File

@@ -1,3 +1,3 @@
<?php
return '4.0.0-beta.363';
return '4.0.0-beta.364';

View File

@@ -70,7 +70,7 @@
</div>
<div class="flex items-end gap-2">
<x-forms.select label="Direction" id="application.redirect" required
helper="You need to add both the www and non-www A DNS records pointing to your server.">
helper="You must need to add www and non-www as an A DNS record. Make sure the www domain is added under Domains.">
<option value="both">Allow www & non-www.</option>
<option value="www">Redirect to www.</option>
<option value="non-www">Redirect to non-www.</option>

View File

@@ -1,7 +1,7 @@
<div>
<div class="flex items-end gap-2">
<h1>Create a new Application</h1>
<x-modal-input buttonTitle="+ Add GitHub App" title="New GitHub App">
<x-modal-input buttonTitle="+ Add GitHub App" title="New GitHub App" closeOutside="false">
<livewire:source.github.create />
</x-modal-input>
@if ($repositories->count() > 0)

View File

@@ -1,11 +1,11 @@
<div>
<div class="flex gap-2">
<h2>Scheduled Tasks</h2>
<x-modal-input buttonTitle="+ Add" title="New Scheduled Task" :closeOutside=false>
<x-modal-input buttonTitle="+ Add" title="New Scheduled Task" :closeOutside="false">
@if ($resource->type() == 'application')
<livewire:project.shared.scheduled-task.add :type="$resource->type()" :containerNames="$containerNames"/>
<livewire:project.shared.scheduled-task.add :type="$resource->type()" :containerNames="$containerNames" />
@elseif ($resource->type() == 'service')
<livewire:project.shared.scheduled-task.add :type="$resource->type()" :containerNames="$containerNames"/>
<livewire:project.shared.scheduled-task.add :type="$resource->type()" :containerNames="$containerNames" />
@endif
</x-modal-input>
</div>

View File

@@ -124,7 +124,7 @@
<template
x-for="timezone in timezones.filter(tz => tz.toLowerCase().includes(search.toLowerCase()))"
:key="timezone">
<div @click="search = timezone; open = false; $wire.set('server.settings.server_timezone', timezone)"
<div @click="search = timezone; open = false; $wire.set('serverTimezone', timezone)"
class="px-4 py-2 text-gray-800 cursor-pointer hover:bg-gray-100 dark:hover:bg-coolgray-300 dark:text-gray-200"
x-text="timezone"></div>
</template>

View File

@@ -130,29 +130,39 @@
</div>
<h4 class="py-4">Confirmation Settings</h4>
@if ($disable_two_step_confirmation)
<div class="md:w-96 pb-4">
<x-forms.checkbox instantSave id="disable_two_step_confirmation" label="Disable Two Step Confirmation"
helper="When disabled, you will not need to confirm actions with a text and user password. This significantly reduces security and may lead to accidental deletions or unwanted changes. Use with extreme caution, especially on production servers." />
<div x-data="{ open: false }" class="mb-32 md:w-[40rem]">
<button type="button" @click.prevent="open = !open" class="flex items-center justify-between w-full p-4 bg-coolgray-100 hover:bg-coolgray-200 rounded-md">
<span class="font-medium">Two-Step Confirmation Settings</span>
<svg class="w-5 h-5 transition-transform" :class="{ 'rotate-180': open }" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
</svg>
</button>
<div x-show="open" x-transition class="mt-4">
@if ($disable_two_step_confirmation)
<div class="md:w-96 pb-4">
<x-forms.checkbox instantSave id="disable_two_step_confirmation" label="Disable Two Step Confirmation"
helper="When disabled, you will not need to confirm actions with a text and user password. This significantly reduces security and may lead to accidental deletions or unwanted changes. Use with extreme caution, especially on production servers." />
</div>
@else
<div class="md:w-96 pb-4">
<x-modal-confirmation title="Disable Two Step Confirmation?"
buttonTitle="Disable Two Step Confirmation" isErrorButton submitAction="toggleTwoStepConfirmation"
:actions="[
'Tow Step confimation will be disabled globally.',
'Disabling two step confirmation reduces security (as anyone can easily delete anything).',
'The risk of accidental actions will increase.',
]" confirmationText="DISABLE TWO STEP CONFIRMATION"
confirmationLabel="Please type the confirmation text to disable two step confirmation."
shortConfirmationLabel="Confirmation text" step3ButtonText="Disable Two Step Confirmation" />
</div>
<div class="w-full px-4 py-2 mb-4 text-white rounded-sm border-l-4 border-red-500 bg-error">
<p class="font-bold">Warning!</p>
<p>Disabling two step confirmation reduces security (as anyone can easily delete anything) and increases
the risk of accidental actions. This is not recommended for production servers.</p>
</div>
@endif
</div>
@else
<div class="md:w-96 pb-4">
<x-modal-confirmation title="Disable Two Step Confirmation?"
buttonTitle="Disable Two Step Confirmation" isErrorButton submitAction="toggleTwoStepConfirmation"
:actions="[
'Tow Step confimation will be disabled globally.',
'Disabling two step confirmation reduces security (as anyone can easily delete anything).',
'The risk of accidental actions will increase.',
]" confirmationText="DISABLE TWO STEP CONFIRMATION"
confirmationLabel="Please type the confirmation text to disable two step confirmation."
shortConfirmationLabel="Confirmation text" step3ButtonText="Disable Two Step Confirmation" />
</div>
<div class="p-4 mb-4 text-white border-l-4 border-red-500 bg-error md:w-[40rem] w-full mb-32">
<p class="font-bold">Warning!</p>
<p>Disabling two step confirmation reduces security (as anyone can easily delete anything) and increases
the
risk of accidental actions. This is not recommended for production servers.</p>
</div>
@endif
</div>
</form>
</div>

View File

@@ -4,7 +4,7 @@
</x-slot>
<div class="flex items-start gap-2">
<h1>Sources</h1>
<x-modal-input buttonTitle="+ Add" title="New GitHub App">
<x-modal-input buttonTitle="+ Add" title="New GitHub App" :closeOutside="false">
<livewire:source.github.create />
</x-modal-input>
</div>

View File

@@ -1,4 +0,0 @@
<x-layout>
<h1>New GitHub Source</h1>
</x-layout>

View File

@@ -1,22 +0,0 @@
<x-layout>
<h1>New Source</h1>
<div class="subtitle ">Add source providers for your applications.</div>
<div x-data="{ activeTab: window.location.hash ? window.location.hash.substring(1) : 'github' }">
{{-- <div class="flex justify-center h-full gap-2 pb-6">
<a class="flex items-center justify-center w-1/2 p-2 transition-colors rounded-none min-h-12 bg-coolgray-200 hover:bg-coollabs-100 hover:dark:text-white hover:no-underline"
:class="activeTab === 'github' && 'bg-coollabs dark:text-white'"
@click.prevent="activeTab = 'github'; window.location.hash = 'github'" href="#">GitHub
</a>
<a class="flex items-center justify-center w-1/2 p-2 transition-colors rounded-none min-h-12 bg-coolgray-200 hover:bg-coollabs-100 hover:dark:text-white hover:no-underline"
:class="activeTab === 'gitlab' && 'bg-coollabs dark:text-white'"
@click.prevent="activeTab = 'gitlab'; window.location.hash = 'gitlab'" href="#">GitLab
</a>
</div> --}}
<div x-cloak x-show="activeTab === 'github'" class="h-full">
<livewire:source.github.create />
</div>
{{-- <div x-cloak x-show="activeTab === 'gitlab'" class="h-full">
WIP
</div> --}}
</div>
</x-layout>

View File

@@ -1,10 +1,10 @@
{
"coolify": {
"v4": {
"version": "4.0.0-beta.363"
"version": "4.0.0-beta.364"
},
"nightly": {
"version": "4.0.0-beta.364"
"version": "4.0.0-beta.365"
},
"helper": {
"version": "1.0.3"