This commit is contained in:
Andras Bacsai 2023-06-14 12:48:29 +02:00
parent 8f0cd69cd3
commit 4698ab9722
24 changed files with 49 additions and 41 deletions

View File

@ -2,6 +2,7 @@
namespace App\Http\Livewire\Settings; namespace App\Http\Livewire\Settings;
use App\Jobs\InstanceProxyCheckJob;
use App\Models\InstanceSettings as ModelsInstanceSettings; use App\Models\InstanceSettings as ModelsInstanceSettings;
use App\Models\Server; use App\Models\Server;
use Livewire\Component; use Livewire\Component;
@ -193,12 +194,11 @@ class Configuration extends Component
$this->settings->save(); $this->settings->save();
$this->dynamic_config_path = '/data/coolify/proxy/dynamic'; $this->dynamic_config_path = '/data/coolify/proxy/dynamic';
if (config('app.env') == 'local') {
$this->server = Server::findOrFail(1);
} else {
$this->server = Server::findOrFail(0); $this->server = Server::findOrFail(0);
}
$this->setup_instance_fqdn(); $this->setup_instance_fqdn();
$this->setup_default_redirect_404(); $this->setup_default_redirect_404();
if ($this->settings->fqdn || $this->settings->default_redirect_404) {
dispatch(new InstanceProxyCheckJob());
}
} }
} }

View File

@ -303,12 +303,17 @@ COPY --from=$this->build_image_name /app/{$this->application->publish_directory}
]); ]);
$this->activity->save(); $this->activity->save();
} }
if ($this->pull_request_id) {
dispatch(new ApplicationPullRequestUpdateJob( dispatch(new ApplicationPullRequestUpdateJob(
application_id: $this->application->id, application_id: $this->application->id,
pull_request_id: $this->pull_request_id, pull_request_id: $this->pull_request_id,
deployment_uuid: $this->deployment_uuid, deployment_uuid: $this->deployment_uuid,
status: $status status: $status
)); ));
}
if ($this->application->fqdn) {
dispatch(new InstanceProxyCheckJob());
}
queue_next_deployment($this->application); queue_next_deployment($this->application);
} }
private function execute_in_builder(string $command) private function execute_in_builder(string $command)

View File

@ -29,7 +29,6 @@ class InstanceProxyCheckJob implements ShouldQueue
{ {
try { try {
$container_name = 'coolify-proxy'; $container_name = 'coolify-proxy';
$configuration_path = config('coolify.proxy_config_path');
$servers = Server::whereRelation('settings', 'is_validated', true)->where('extra_attributes->proxy_type', ProxyTypes::TRAEFIK_V2)->get(); $servers = Server::whereRelation('settings', 'is_validated', true)->where('extra_attributes->proxy_type', ProxyTypes::TRAEFIK_V2)->get();
foreach ($servers as $server) { foreach ($servers as $server) {

View File

@ -22,6 +22,7 @@ class ServerSeeder extends Seeder
$private_key_1 = PrivateKey::find(1); $private_key_1 = PrivateKey::find(1);
Server::create([ Server::create([
'id' => 0,
'name' => "testing-local-docker-container", 'name' => "testing-local-docker-container",
'description' => "This is a test docker container", 'description' => "This is a test docker container",
'ip' => "coolify-testing-host", 'ip' => "coolify-testing-host",

View File

@ -13,12 +13,12 @@ class ServerSettingSeeder extends Seeder
*/ */
public function run(): void public function run(): void
{ {
$server_2 = Server::find(1)->load(['settings']); $server_2 = Server::find(0)->load(['settings']);
$server_2->settings->is_build_server = true; $server_2->settings->is_build_server = true;
$server_2->settings->is_validated = true; $server_2->settings->is_validated = true;
$server_2->settings->save(); $server_2->settings->save();
$server_3 = Server::find(2)->load(['settings']); $server_3 = Server::find(1)->load(['settings']);
$server_3->settings->is_part_of_swarm = false; $server_3->settings->is_part_of_swarm = false;
$server_3->settings->is_validated = false; $server_3->settings->is_validated = false;
$server_3->settings->save(); $server_3->settings->save();

View File

@ -15,7 +15,7 @@ class StandaloneDockerSeeder extends Seeder
*/ */
public function run(): void public function run(): void
{ {
$server_1 = Server::find(1); $server_1 = Server::find(0);
StandaloneDocker::create([ StandaloneDocker::create([
'name' => 'Standalone Docker 1', 'name' => 'Standalone Docker 1',
'network' => 'coolify', 'network' => 'coolify',

View File

@ -16,7 +16,7 @@ class SwarmDockerSeeder extends Seeder
*/ */
public function run(): void public function run(): void
{ {
$server_2 = Server::find(2); $server_2 = Server::find(1);
SwarmDocker::create([ SwarmDocker::create([
'name' => 'Swarm Docker 1', 'name' => 'Swarm Docker 1',
'server_id' => $server_2->id, 'server_id' => $server_2->id,

View File

@ -4,7 +4,7 @@ ARG TARGETPLATFORM
# https://download.docker.com/linux/static/stable/ # https://download.docker.com/linux/static/stable/
ARG DOCKER_VERSION=24.0.2 ARG DOCKER_VERSION=24.0.2
# https://github.com/docker/compose/releases # https://github.com/docker/compose/releases
ARG DOCKER_COMPOSE_VERSION=2.19.1 ARG DOCKER_COMPOSE_VERSION=2.18.1
# https://github.com/docker/buildx/releases # https://github.com/docker/buildx/releases
ARG DOCKER_BUILDX_VERSION=0.10.5 ARG DOCKER_BUILDX_VERSION=0.10.5
# https://github.com/buildpacks/pack/releases # https://github.com/buildpacks/pack/releases

View File

@ -4,7 +4,7 @@ ARG TARGETPLATFORM
# https://download.docker.com/linux/static/stable/ # https://download.docker.com/linux/static/stable/
ARG DOCKER_VERSION=24.0.2 ARG DOCKER_VERSION=24.0.2
# https://github.com/docker/compose/releases # https://github.com/docker/compose/releases
ARG DOCKER_COMPOSE_VERSION=2.19.1 ARG DOCKER_COMPOSE_VERSION=2.18.1
# https://github.com/docker/buildx/releases # https://github.com/docker/buildx/releases
ARG DOCKER_BUILDX_VERSION=0.10.5 ARG DOCKER_BUILDX_VERSION=0.10.5
# https://github.com/buildpacks/pack/releases # https://github.com/buildpacks/pack/releases

View File

@ -14,7 +14,7 @@ body {
@apply scrollbar min-h-screen bg-coolgray-100 text-neutral-400 antialiased; @apply scrollbar min-h-screen bg-coolgray-100 text-neutral-400 antialiased;
} }
main { main {
@apply px-32 xl:px-14 mx-auto max-w-screen-xl pt-4; @apply pl-24 pr-10 lg:px-14 mx-auto max-w-screen-xl pt-4;
} }
input[type="checkbox"] { input[type="checkbox"] {

View File

@ -1,7 +1,7 @@
<template> <template>
<Transition name="fade"> <Transition name="fade">
<div> <div>
<div class="flex items-center p-1 px-2 mt-2 overflow-hidden transition-all transform rounded cursor-pointer bg-coolgray-200" <div class="flex items-center p-1 px-2 mt-1 overflow-hidden transition-all transform rounded cursor-pointer bg-coolgray-200"
@click="showCommandPalette = true"> @click="showCommandPalette = true">
<svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6 icon" viewBox="0 0 24 24" stroke-width="2" <svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6 icon" viewBox="0 0 24 24" stroke-width="2"
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">

View File

@ -21,9 +21,10 @@
<x-chevron-down /> <x-chevron-down />
</label> </label>
<div class="absolute hidden group-hover:block"> <div class="absolute hidden group-hover:block">
<ul tabindex="0" class="text-xs text-white normal-case rounded min-w-max menu bg-coolgray-200"> <ul tabindex="0"
class="relative -ml-24 text-xs text-white normal-case rounded min-w-max menu bg-coolgray-200">
<li> <li>
<a target="_blank" class="text-xs text-white rounded-none hover:no-underline hover:bg-coollabs" <a target="_blank" class="text-xs text-white rounded-none hover:no-underline"
href="{{ $application->gitBranchLocation }}"> href="{{ $application->gitBranchLocation }}">
<x-git-icon git="{{ $application->source?->getMorphClass() }}" /> <x-git-icon git="{{ $application->source?->getMorphClass() }}" />
Git Repository Git Repository

View File

@ -1,5 +1,5 @@
@auth @auth
<nav class="fixed h-full pt-16 overflow-hidden"> <nav class="fixed h-full overflow-hidden pt-14">
<ul class="gap-4 menu"> <ul class="gap-4 menu">
<li> <li>
<a class="hover:bg-transparent" @if (!request()->is('/')) href="/" @endif> <a class="hover:bg-transparent" @if (!request()->is('/')) href="/" @endif>
@ -73,7 +73,7 @@
<div class="fixed right-0 p-2 top-1"> <div class="fixed right-0 p-2 top-1">
<div class="group"> <div class="group">
<label tabindex="0" <label tabindex="0"
class="absolute top-0 right-0 p-2 m-2 cursor-pointer hover:bg-transparent hover:text-warning"> class="absolute top-0 right-0 p-2 m-2 my-1 cursor-pointer hover:bg-transparent hover:text-warning">
<div class="flex items-center justify-center gap-2 placeholder"> <div class="flex items-center justify-center gap-2 placeholder">
<svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24" stroke-width="1.5" <svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">

View File

@ -1,7 +1,7 @@
<x-layout> <x-layout>
<h1>Destinations</h1> <h1>Destinations</h1>
<div class="pt-2 pb-10 text-sm">All Destinations</div> <div class="pt-2 pb-10 text-sm">All Destinations</div>
<div class="grid grid-cols-2 gap-2"> <div class="grid lg:grid-cols-2 gap-2">
@forelse ($destinations as $destination) @forelse ($destinations as $destination)
@if ($destination->getMorphClass() === 'App\Models\StandaloneDocker') @if ($destination->getMorphClass() === 'App\Models\StandaloneDocker')
<a class="flex gap-4 text-center hover:no-underline box group" <a class="flex gap-4 text-center hover:no-underline box group"

View File

@ -5,7 +5,8 @@
</label> </label>
<div class="absolute hidden group-hover:block "> <div class="absolute hidden group-hover:block ">
@if ($application->status === 'running') @if ($application->status === 'running')
<ul tabindex="0" class="text-xs text-white normal-case rounded min-w-max menu bg-coolgray-200"> <ul tabindex="0"
class="relative text-xs text-white normal-case rounded -ml-44 min-w-max menu bg-coolgray-200">
<li> <li>
<div class="rounded-none hover:bg-coollabs" wire:click='deploy'><svg <div class="rounded-none hover:bg-coollabs" wire:click='deploy'><svg
xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24"

View File

@ -1,4 +1,4 @@
<div class="grid grid-cols-2"> <div class="grid lg:grid-cols-2 gap-2">
@forelse ($private_keys as $private_key) @forelse ($private_keys as $private_key)
<x-forms.button wire:click='setPrivateKey({{ $private_key->id }})'>{{ $private_key->name }} <x-forms.button wire:click='setPrivateKey({{ $private_key->id }})'>{{ $private_key->name }}
</x-forms.button> </x-forms.button>

View File

@ -7,7 +7,8 @@
<x-chevron-down /> <x-chevron-down />
</label> </label>
<div class="absolute hidden group-hover:block "> <div class="absolute hidden group-hover:block ">
<ul tabindex="0" class="text-xs text-white normal-case rounded min-w-max menu bg-coolgray-200"> <ul tabindex="0"
class="relative text-xs text-white normal-case rounded -ml-28 min-w-max menu bg-coolgray-200">
<li> <li>
<a target="_blank" <a target="_blank"
class="text-xs text-white rounded-none hover:no-underline hover:bg-coollabs" class="text-xs text-white rounded-none hover:no-underline hover:bg-coollabs"
@ -25,7 +26,7 @@
</label> </label>
<div class="absolute hidden group-hover:block "> <div class="absolute hidden group-hover:block ">
<ul tabindex="0" <ul tabindex="0"
class="mt-1 text-xs text-white normal-case rounded min-w-max menu bg-coolgray-200"> class="relative text-xs text-white normal-case rounded min-w-max menu bg-coolgray-200 -ml-14">
<li> <li>
<div class="rounded-none hover:bg-coollabs" wire:click='deploy'><svg <div class="rounded-none hover:bg-coollabs" wire:click='deploy'><svg
xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24"

View File

@ -13,7 +13,6 @@
</tr> </tr>
</thead> </thead>
<tbody x-data> <tbody x-data>
@foreach ($invitations as $invite) @foreach ($invitations as $invite)
<tr> <tr>
<td>{{ $invite->email }}</td> <td>{{ $invite->email }}</td>

View File

@ -1,9 +1,10 @@
<x-layout> <x-layout>
<h1>Configuration</h1> <h1>Configuration</h1>
<nav class="flex pt-2 pb-10 text-sm"> <nav class="flex pt-2 pb-10">
<ol class="inline-flex items-center"> <ol class="flex items-center">
<li class="inline-flex items-center"> <li class="inline-flex items-center">
<a href="{{ route('project.show', ['project_uuid' => request()->route('project_uuid')]) }}"> <a class="text-xs truncate lg:text-sm"
href="{{ route('project.show', ['project_uuid' => request()->route('project_uuid')]) }}">
{{ $application->environment->project->name }}</a> {{ $application->environment->project->name }}</a>
</li> </li>
<li> <li>
@ -14,7 +15,7 @@
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
clip-rule="evenodd"></path> clip-rule="evenodd"></path>
</svg> </svg>
<a <a class="text-xs truncate lg:text-sm"
href="{{ route('project.resources', ['environment_name' => request()->route('environment_name'), 'project_uuid' => request()->route('project_uuid')]) }}">{{ request()->route('environment_name') }}</a> href="{{ route('project.resources', ['environment_name' => request()->route('environment_name'), 'project_uuid' => request()->route('project_uuid')]) }}">{{ request()->route('environment_name') }}</a>
</div> </div>
</li> </li>
@ -26,7 +27,7 @@
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
clip-rule="evenodd"></path> clip-rule="evenodd"></path>
</svg> </svg>
<span>{{ data_get($application, 'name') }}</span> <span class="text-xs truncate lg:text-sm">{{ data_get($application, 'name') }}</span>
</div> </div>
</li> </li>
<li> <li>

View File

@ -28,7 +28,7 @@
@if ($environment->applications->count() === 0) @if ($environment->applications->count() === 0)
<p>No resources found.</p> <p>No resources found.</p>
@endif @endif
<div class="grid grid-cols-2 gap-2"> <div class="grid lg:grid-cols-2 gap-2">
@foreach ($environment->applications->sortBy('name') as $application) @foreach ($environment->applications->sortBy('name') as $application)
<a class="box" <a class="box"
href="{{ route('project.application.configuration', [$project->uuid, $environment->name, $application->uuid]) }}"> href="{{ route('project.application.configuration', [$project->uuid, $environment->name, $application->uuid]) }}">

View File

@ -4,7 +4,7 @@
<livewire:project.delete-project :project_id="$project->id" :resource_count="$project->applications->count()" /> <livewire:project.delete-project :project_id="$project->id" :resource_count="$project->applications->count()" />
</div> </div>
<div class="pt-2 pb-10 text-sm">{{ $project->name }}.</div> <div class="pt-2 pb-10 text-sm">{{ $project->name }}.</div>
<div class="grid grid-cols-2 gap-2"> <div class="grid lg:grid-cols-2 gap-2">
@forelse ($project->environments as $environment) @forelse ($project->environments as $environment)
<a class="box" href="{{ route('project.resources', [$project->uuid, $environment->name]) }}"> <a class="box" href="{{ route('project.resources', [$project->uuid, $environment->name]) }}">
{{ $environment->name }} {{ $environment->name }}

View File

@ -1,7 +1,7 @@
<x-layout> <x-layout>
<h1>Projects</h1> <h1>Projects</h1>
<div class="pt-2 pb-10 text-sm">All Projects</div> <div class="pt-2 pb-10 text-sm">All Projects</div>
<div class="grid grid-cols-2 gap-2"> <div class="grid gap-2 lg:grid-cols-2">
@forelse ($projects as $project) @forelse ($projects as $project)
<a href="{{ route('project.show', ['project_uuid' => data_get($project, 'uuid')]) }}" <a href="{{ route('project.show', ['project_uuid' => data_get($project, 'uuid')]) }}"
class="box">{{ $project->name }}</a> class="box">{{ $project->name }}</a>

View File

@ -1,7 +1,7 @@
<x-layout> <x-layout>
<h1>Servers</h1> <h1>Servers</h1>
<div class="pt-2 pb-10 text-sm">All Servers</div> <div class="pt-2 pb-10 text-sm">All Servers</div>
<div class="grid grid-cols-2 gap-2"> <div class="grid gap-2 lg:grid-cols-2">
@forelse ($servers as $server) @forelse ($servers as $server)
<a class="text-center hover:no-underline box group" <a class="text-center hover:no-underline box group"
href="{{ route('server.show', ['server_uuid' => data_get($server, 'uuid')]) }}"> href="{{ route('server.show', ['server_uuid' => data_get($server, 'uuid')]) }}">

View File

@ -1,7 +1,7 @@
<x-layout> <x-layout>
<h1>Sources</h1> <h1>Sources</h1>
<div class="pt-2 pb-10 text-sm">All Sources</div> <div class="pt-2 pb-10 text-sm">All Sources</div>
<div class="grid grid-cols-2 gap-2"> <div class="grid gap-2 lg:grid-cols-2">
@forelse ($sources as $source) @forelse ($sources as $source)
@if ($source->getMorphClass() === 'App\Models\GithubApp') @if ($source->getMorphClass() === 'App\Models\GithubApp')
<a class="flex gap-4 text-center hover:no-underline box group" <a class="flex gap-4 text-center hover:no-underline box group"