mirror of
https://github.com/ershisan99/coolify.git
synced 2025-12-27 04:59:31 +00:00
Compare commits
26 Commits
v4.0.0-bet
...
v4.0.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3535dbb98f | ||
|
|
84b2af53d8 | ||
|
|
ba70451765 | ||
|
|
f3ec4ca4a3 | ||
|
|
174923de98 | ||
|
|
68ab8dc14c | ||
|
|
b218356f2d | ||
|
|
e83aecebc3 | ||
|
|
0bb1f57ea7 | ||
|
|
d006edc485 | ||
|
|
aa28c99827 | ||
|
|
567bbe9d0b | ||
|
|
59d2c9748a | ||
|
|
bd2e1ad9fe | ||
|
|
43df918e43 | ||
|
|
1a8d15390d | ||
|
|
4af6caa79c | ||
|
|
8e91d958be | ||
|
|
17d55630d5 | ||
|
|
70dfa101ef | ||
|
|
d6b4e33db3 | ||
|
|
a9670bd6eb | ||
|
|
02165c2b9f | ||
|
|
afbdd2eb06 | ||
|
|
b0e6014e8f | ||
|
|
0f13af2eca |
@@ -543,7 +543,7 @@ class GetContainersStatus
|
||||
}
|
||||
}
|
||||
}
|
||||
$exitedServices = $exitedServices->unique('id');
|
||||
$exitedServices = $exitedServices->unique('uuid');
|
||||
foreach ($exitedServices as $exitedService) {
|
||||
if (str($exitedService->status)->startsWith('exited')) {
|
||||
continue;
|
||||
|
||||
@@ -1442,14 +1442,24 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
|
||||
if ($this->pull_request_id !== 0) {
|
||||
$local_branch = "pull/{$this->pull_request_id}/head";
|
||||
}
|
||||
$private_key = $this->application->privateKey?->getKeyLocation();
|
||||
$private_key = data_get($this->application, 'private_key.private_key');
|
||||
if ($private_key) {
|
||||
$private_key = base64_encode($private_key);
|
||||
$this->execute_remote_command(
|
||||
[
|
||||
executeInDocker($this->deployment_uuid, "GIT_SSH_COMMAND=\"ssh -o ConnectTimeout=30 -p {$this->customPort} -o Port={$this->customPort} -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i {$private_key}\" git ls-remote {$this->fullRepoUrl} {$local_branch}"),
|
||||
executeInDocker($this->deployment_uuid, 'mkdir -p /root/.ssh'),
|
||||
],
|
||||
[
|
||||
executeInDocker($this->deployment_uuid, "echo '{$private_key}' | base64 -d | tee /root/.ssh/id_rsa > /dev/null"),
|
||||
],
|
||||
[
|
||||
executeInDocker($this->deployment_uuid, 'chmod 600 /root/.ssh/id_rsa'),
|
||||
],
|
||||
[
|
||||
executeInDocker($this->deployment_uuid, "GIT_SSH_COMMAND=\"ssh -o ConnectTimeout=30 -p {$this->customPort} -o Port={$this->customPort} -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null\" git ls-remote {$this->fullRepoUrl} {$local_branch}"),
|
||||
'hidden' => true,
|
||||
'save' => 'git_commit_sha',
|
||||
],
|
||||
]
|
||||
);
|
||||
} else {
|
||||
$this->execute_remote_command(
|
||||
|
||||
@@ -33,7 +33,7 @@ class StackForm extends Component
|
||||
$key = data_get($field, 'key');
|
||||
$value = data_get($field, 'value');
|
||||
$rules = data_get($field, 'rules', 'nullable');
|
||||
$isPassword = data_get($field, 'isPassword');
|
||||
$isPassword = data_get($field, 'isPassword', false);
|
||||
$this->fields->put($key, [
|
||||
'serviceName' => $serviceName,
|
||||
'key' => $key,
|
||||
@@ -47,7 +47,15 @@ class StackForm extends Component
|
||||
$this->validationAttributes["fields.$key.value"] = $fieldKey;
|
||||
}
|
||||
}
|
||||
$this->fields = $this->fields->sortBy('name');
|
||||
$this->fields = $this->fields->groupBy('serviceName')->map(function ($group) {
|
||||
return $group->sortBy(function ($field) {
|
||||
return data_get($field, 'isPassword') ? 1 : 0;
|
||||
})->mapWithKeys(function ($field) {
|
||||
return [$field['key'] => $field];
|
||||
});
|
||||
})->flatMap(function ($group) {
|
||||
return $group;
|
||||
});
|
||||
}
|
||||
|
||||
public function saveCompose($raw)
|
||||
|
||||
@@ -9,6 +9,20 @@ use Livewire\Component;
|
||||
|
||||
class Terminal extends Component
|
||||
{
|
||||
public function getListeners()
|
||||
{
|
||||
$teamId = auth()->user()->currentTeam()->id;
|
||||
|
||||
return [
|
||||
"echo-private:team.{$teamId},ApplicationStatusChanged" => 'closeTerminal',
|
||||
];
|
||||
}
|
||||
|
||||
public function closeTerminal()
|
||||
{
|
||||
$this->dispatch('reloadWindow');
|
||||
}
|
||||
|
||||
#[On('send-terminal-command')]
|
||||
public function sendTerminalCommand($isContainer, $identifier, $serverUuid)
|
||||
{
|
||||
|
||||
@@ -2928,7 +2928,7 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
|
||||
}
|
||||
|
||||
$parsedServices = collect([]);
|
||||
ray()->clearAll();
|
||||
// ray()->clearAll();
|
||||
|
||||
$allMagicEnvironments = collect([]);
|
||||
foreach ($services as $serviceName => $service) {
|
||||
@@ -3484,6 +3484,18 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
|
||||
$value = $value->after('?');
|
||||
}
|
||||
if ($originalValue->value() === $value->value()) {
|
||||
// This means the variable does not have a default value, so it needs to be created in Coolify
|
||||
$parsedKeyValue = replaceVariables($value);
|
||||
$resource->environment_variables()->where('key', $parsedKeyValue)->where($nameOfId, $resource->id)->firstOrCreate([
|
||||
'key' => $parsedKeyValue,
|
||||
$nameOfId => $resource->id,
|
||||
], [
|
||||
'is_build_time' => false,
|
||||
'is_preview' => false,
|
||||
]);
|
||||
// Add the variable to the environment so it will be shown in the deployable compose file
|
||||
$environment[$parsedKeyValue->value()] = $resource->environment_variables()->where('key', $parsedKeyValue)->where($nameOfId, $resource->id)->first()->value;
|
||||
|
||||
continue;
|
||||
}
|
||||
$resource->environment_variables()->where('key', $key)->where($nameOfId, $resource->id)->firstOrCreate([
|
||||
@@ -3576,6 +3588,17 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
|
||||
if ($environment->count() > 0) {
|
||||
$environment = $environment->filter(function ($value, $key) {
|
||||
return ! str($key)->startsWith('SERVICE_FQDN_');
|
||||
})->map(function ($value, $key) use ($resource) {
|
||||
// if value is empty, set it to null so if you set the environment variable in the .env file (Coolify's UI), it will used
|
||||
if (str($value)->isEmpty()) {
|
||||
if ($resource->environment_variables()->where('key', $key)->exists()) {
|
||||
$value = $resource->environment_variables()->where('key', $key)->first()->value;
|
||||
} else {
|
||||
$value = null;
|
||||
}
|
||||
}
|
||||
|
||||
return $value;
|
||||
});
|
||||
}
|
||||
$serviceLabels = $labels->merge($defaultLabels);
|
||||
|
||||
@@ -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.342',
|
||||
'release' => '4.0.0-beta.345',
|
||||
// When left empty or `null` the Laravel environment will be used
|
||||
'environment' => config('app.env'),
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<?php
|
||||
|
||||
return '4.0.0-beta.342';
|
||||
return '4.0.0-beta.345';
|
||||
|
||||
@@ -65,37 +65,39 @@ class ProductionSeeder extends Seeder
|
||||
]);
|
||||
}
|
||||
// Add Coolify host (localhost) as Server if it doesn't exist
|
||||
if (Server::find(0) == null) {
|
||||
$server_details = [
|
||||
'id' => 0,
|
||||
'name' => 'localhost',
|
||||
'description' => "This is the server where Coolify is running on. Don't delete this!",
|
||||
'user' => 'root',
|
||||
'ip' => 'host.docker.internal',
|
||||
'team_id' => 0,
|
||||
'private_key_id' => 0,
|
||||
];
|
||||
$server_details['proxy'] = ServerMetadata::from([
|
||||
'type' => ProxyTypes::TRAEFIK->value,
|
||||
'status' => ProxyStatus::EXITED->value,
|
||||
]);
|
||||
$server = Server::create($server_details);
|
||||
$server->settings->is_reachable = true;
|
||||
$server->settings->is_usable = true;
|
||||
$server->settings->save();
|
||||
} else {
|
||||
$server = Server::find(0);
|
||||
$server->settings->is_reachable = true;
|
||||
$server->settings->is_usable = true;
|
||||
$server->settings->save();
|
||||
}
|
||||
if (StandaloneDocker::find(0) == null) {
|
||||
StandaloneDocker::create([
|
||||
'id' => 0,
|
||||
'name' => 'localhost-coolify',
|
||||
'network' => 'coolify',
|
||||
'server_id' => 0,
|
||||
]);
|
||||
if (! isCloud()) {
|
||||
if (Server::find(0) == null) {
|
||||
$server_details = [
|
||||
'id' => 0,
|
||||
'name' => 'localhost',
|
||||
'description' => "This is the server where Coolify is running on. Don't delete this!",
|
||||
'user' => 'root',
|
||||
'ip' => 'host.docker.internal',
|
||||
'team_id' => 0,
|
||||
'private_key_id' => 0,
|
||||
];
|
||||
$server_details['proxy'] = ServerMetadata::from([
|
||||
'type' => ProxyTypes::TRAEFIK->value,
|
||||
'status' => ProxyStatus::EXITED->value,
|
||||
]);
|
||||
$server = Server::create($server_details);
|
||||
$server->settings->is_reachable = true;
|
||||
$server->settings->is_usable = true;
|
||||
$server->settings->save();
|
||||
} else {
|
||||
$server = Server::find(0);
|
||||
$server->settings->is_reachable = true;
|
||||
$server->settings->is_usable = true;
|
||||
$server->settings->save();
|
||||
}
|
||||
if (StandaloneDocker::find(0) == null) {
|
||||
StandaloneDocker::create([
|
||||
'id' => 0,
|
||||
'name' => 'localhost-coolify',
|
||||
'network' => 'coolify',
|
||||
'server_id' => 0,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
if (! isCloud() && config('coolify.is_windows_docker_desktop') == false) {
|
||||
@@ -112,8 +114,8 @@ class ProductionSeeder extends Seeder
|
||||
}
|
||||
} else {
|
||||
if ($coolify_key) {
|
||||
$coolify_key = Storage::disk('ssh-keys')->get($coolify_key);
|
||||
$user = str($coolify_key)->before('@')->after('id.');
|
||||
$coolify_key = Storage::disk('ssh-keys')->get($coolify_key);
|
||||
PrivateKey::create([
|
||||
'id' => 0,
|
||||
'team_id' => 0,
|
||||
|
||||
@@ -8,7 +8,7 @@ set -o pipefail # Cause a pipeline to return the status of the last command that
|
||||
CDN="https://cdn.coollabs.io/coolify-nightly"
|
||||
DATE=$(date +"%Y%m%d-%H%M%S")
|
||||
|
||||
VERSION="1.5"
|
||||
VERSION="1.6"
|
||||
DOCKER_VERSION="26.0"
|
||||
# TODO: Ask for a user
|
||||
CURRENT_USER=$USER
|
||||
@@ -39,6 +39,11 @@ if [ "$OS_TYPE" = "manjaro" ] || [ "$OS_TYPE" = "manjaro-arm" ]; then
|
||||
OS_TYPE="arch"
|
||||
fi
|
||||
|
||||
# Check if the OS is Asahi Linux, if so, change it to fedora
|
||||
if [ "$OS_TYPE" = "fedora-asahi-remix" ]; then
|
||||
OS_TYPE="fedora"
|
||||
fi
|
||||
|
||||
# Check if the OS is popOS, if so, change it to ubuntu
|
||||
if [ "$OS_TYPE" = "pop" ]; then
|
||||
OS_TYPE="ubuntu"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"coolify": {
|
||||
"v4": {
|
||||
"version": "4.0.0-beta.341"
|
||||
"version": "4.0.0-beta.344"
|
||||
},
|
||||
"nightly": {
|
||||
"version": "4.0.0-beta.342"
|
||||
"version": "4.0.0-beta.345"
|
||||
},
|
||||
"helper": {
|
||||
"version": "1.0.1"
|
||||
|
||||
6
package-lock.json
generated
6
package-lock.json
generated
@@ -1860,9 +1860,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/rollup": {
|
||||
"version": "3.29.4",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz",
|
||||
"integrity": "sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==",
|
||||
"version": "3.29.5",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.5.tgz",
|
||||
"integrity": "sha512-GVsDdsbJzzy4S/v3dqWPJ7EfvZJfCHiDqe80IyrF59LYuP+e6U1LJoUqeuqRbwAWoMNoXivMNeNAOf5E22VA1w==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"rollup": "dist/bin/rollup"
|
||||
|
||||
@@ -6,22 +6,26 @@
|
||||
'instantSave' => false,
|
||||
'value' => null,
|
||||
'hideLabel' => false,
|
||||
'fullWidth' => false,
|
||||
])
|
||||
|
||||
<div class="flex flex-row items-center gap-4 px-2 py-1 form-control min-w-fit dark:hover:bg-coolgray-100">
|
||||
@if(!$hideLabel)
|
||||
<label class="flex gap-4 px-0 min-w-fit label">
|
||||
<span class="flex gap-2">
|
||||
@if ($label)
|
||||
{!! $label !!}
|
||||
@else
|
||||
{{ $id }}
|
||||
@endif
|
||||
@if ($helper)
|
||||
<x-helper :helper="$helper" />
|
||||
@endif
|
||||
</span>
|
||||
</label>
|
||||
<div @class([
|
||||
'flex flex-row items-center gap-4 px-2 py-1 form-control min-w-fit dark:hover:bg-coolgray-100',
|
||||
'w-full' => $fullWidth,
|
||||
])>
|
||||
@if (!$hideLabel)
|
||||
<label class="flex gap-4 px-0 min-w-fit label">
|
||||
<span class="flex gap-2">
|
||||
@if ($label)
|
||||
{!! $label !!}
|
||||
@else
|
||||
{{ $id }}
|
||||
@endif
|
||||
@if ($helper)
|
||||
<x-helper :helper="$helper" />
|
||||
@endif
|
||||
</span>
|
||||
</label>
|
||||
@endif
|
||||
<span class="flex-grow"></span>
|
||||
<input @disabled($disabled) type="checkbox" {{ $attributes->merge(['class' => $defaultClass]) }}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
'w-full' => !$isMultiline,
|
||||
])>
|
||||
@if ($label)
|
||||
<label class="flex items-center gap-1 mb-1 text-sm font-medium">{{ $label }}
|
||||
<label class="flex gap-1 items-center mb-1 text-sm font-medium">{{ $label }}
|
||||
@if ($required)
|
||||
<x-highlighted text="*" />
|
||||
@endif
|
||||
@@ -16,7 +16,7 @@
|
||||
<div class="relative" x-data="{ type: 'password' }">
|
||||
@if ($allowToPeak)
|
||||
<div x-on:click="changePasswordFieldType"
|
||||
class="absolute inset-y-0 right-0 flex items-center pr-2 cursor-pointer hover:dark:text-white">
|
||||
class="flex absolute inset-y-0 right-0 items-center pr-2 cursor-pointer hover:dark:text-white">
|
||||
<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">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
@endif
|
||||
@else
|
||||
@if ($buttonFullWidth)
|
||||
<x-forms.button @click="modalOpen=true" class="flex w-full gap-2" wire:target>
|
||||
<x-forms.button @click="modalOpen=true" class="flex gap-2 w-full" wire:target>
|
||||
{{ $buttonTitle }}
|
||||
</x-forms.button>
|
||||
@else
|
||||
@@ -162,17 +162,17 @@
|
||||
x-transition:leave-start="opacity-100 translate-y-0 sm:scale-100"
|
||||
x-transition:leave-end="opacity-0 -translate-y-2 sm:scale-95"
|
||||
class="relative w-full py-6 border rounded min-w-full lg:min-w-[36rem] max-w-[48rem] bg-neutral-100 border-neutral-400 dark:bg-base px-7 dark:border-coolgray-300">
|
||||
<div class="flex items-center justify-between pb-3">
|
||||
<h3 class="text-2xl font-bold pr-8">{{ $title }}</h3>
|
||||
<div class="flex justify-between items-center pb-3">
|
||||
<h3 class="pr-8 text-2xl font-bold">{{ $title }}</h3>
|
||||
<button @click="modalOpen = false; resetModal()"
|
||||
class="absolute top-2 right-2 flex items-center justify-center w-8 h-8 rounded-full dark:text-white hover:bg-coolgray-300">
|
||||
class="flex absolute top-2 right-2 justify-center items-center w-8 h-8 rounded-full dark:text-white hover:bg-coolgray-300">
|
||||
<svg class="w-6 h-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
stroke-width="1.5" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div class="relative w-auto pb-8">
|
||||
<div class="relative pb-8 w-auto">
|
||||
@if (!empty($checkboxes))
|
||||
<!-- Step 1: Select actions -->
|
||||
<div x-show="step === 1">
|
||||
@@ -180,15 +180,11 @@
|
||||
<h4>Actions</h4>
|
||||
</div>
|
||||
@foreach ($checkboxes as $index => $checkbox)
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<label for="{{ $checkbox['id'] }}"
|
||||
class="text-sm leading-5 text-gray-700 dark:text-gray-300 flex-grow pr-4">
|
||||
{{ $checkbox['label'] }}
|
||||
</label>
|
||||
<x-forms.checkbox :id="$checkbox['id']" :wire:model="$checkbox['id']"
|
||||
<div class="flex justify-between items-center mb-2">
|
||||
<x-forms.checkbox fullWidth :label="$checkbox['label']" :id="$checkbox['id']"
|
||||
:wire:model="$checkbox['id']"
|
||||
x-on:change="toggleAction('{{ $checkbox['id'] }}')" :checked="$this->{$checkbox['id']}"
|
||||
x-bind:checked="selectedActions.includes('{{ $checkbox['id'] }}')"
|
||||
class="flex-shrink-0" :hideLabel="true" />
|
||||
x-bind:checked="selectedActions.includes('{{ $checkbox['id'] }}')" />
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@@ -196,7 +192,7 @@
|
||||
|
||||
<!-- Step 2: Confirm deletion -->
|
||||
<div x-show="step === 2">
|
||||
<div class="bg-error border-l-4 border-red-500 text-white p-4 mb-4" role="alert">
|
||||
<div class="p-4 mb-4 text-white border-l-4 border-red-500 bg-error" role="alert">
|
||||
<p class="font-bold">Warning</p>
|
||||
<p>This operation is permanent and cannot be undone. Please think again before proceeding!
|
||||
</p>
|
||||
@@ -205,7 +201,7 @@
|
||||
<ul class="mb-4 space-y-2">
|
||||
@foreach ($actions as $action)
|
||||
<li class="flex items-center text-red-500">
|
||||
<svg class="w-5 h-5 mr-2 flex-shrink-0" fill="none" stroke="currentColor"
|
||||
<svg class="flex-shrink-0 mr-2 w-5 h-5" fill="none" stroke="currentColor"
|
||||
viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M6 18L18 6M6 6l12 12"></path>
|
||||
@@ -216,7 +212,7 @@
|
||||
@foreach ($checkboxes as $checkbox)
|
||||
<template x-if="selectedActions.includes('{{ $checkbox['id'] }}')">
|
||||
<li class="flex items-center text-red-500">
|
||||
<svg class="w-5 h-5 mr-2 flex-shrink-0" fill="none" stroke="currentColor"
|
||||
<svg class="flex-shrink-0 mr-2 w-5 h-5" fill="none" stroke="currentColor"
|
||||
viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M6 18L18 6M6 6l12 12"></path>
|
||||
@@ -228,16 +224,16 @@
|
||||
</ul>
|
||||
@if ($confirmWithText)
|
||||
<div class="mb-4">
|
||||
<h4 class="text-lg font-semibold mb-2">Confirm Actions</h4>
|
||||
<p class="text-sm mb-2">{{ $confirmationLabel }}</p>
|
||||
<h4 class="mb-2 text-lg font-semibold">Confirm Actions</h4>
|
||||
<p class="mb-2 text-sm">{{ $confirmationLabel }}</p>
|
||||
<div class="relative mb-2">
|
||||
<input type="text" x-model="confirmationText"
|
||||
class="w-full p-2 pr-10 rounded text-black input cursor-text" readonly>
|
||||
class="p-2 pr-10 w-full text-black rounded cursor-text input" readonly>
|
||||
<button @click="copyConfirmationText()"
|
||||
class="absolute right-2 top-1/2 transform -translate-y-1/2 text-gray-500 hover:text-gray-700"
|
||||
class="absolute right-2 top-1/2 text-gray-500 transform -translate-y-1/2 hover:text-gray-700"
|
||||
title="Copy confirmation text" x-ref="copyButton">
|
||||
<template x-if="!copied">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20"
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" viewBox="0 0 20 20"
|
||||
fill="currentColor">
|
||||
<path d="M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z" />
|
||||
<path
|
||||
@@ -245,7 +241,7 @@
|
||||
</svg>
|
||||
</template>
|
||||
<template x-if="copied">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-green-500"
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-green-500"
|
||||
viewBox="0 0 20 20" fill="currentColor">
|
||||
<path fill-rule="evenodd"
|
||||
d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z"
|
||||
@@ -256,18 +252,18 @@
|
||||
</div>
|
||||
|
||||
<label for="userConfirmationText"
|
||||
class="block text-sm font-medium text-gray-700 dark:text-gray-300 mt-4">
|
||||
class="block mt-4 text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||
{{ $shortConfirmationLabel }}
|
||||
</label>
|
||||
<input type="text" x-model="userConfirmationText"
|
||||
class="w-full p-2 rounded text-black input mt-1">
|
||||
class="p-2 mt-1 w-full text-black rounded input">
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<!-- Step 3: Password confirmation -->
|
||||
<div x-show="step === 3 && confirmWithPassword">
|
||||
<div class="bg-error border-l-4 border-red-500 text-white p-4 mb-4" role="alert">
|
||||
<div class="p-4 mb-4 text-white border-l-4 border-red-500 bg-error" role="alert">
|
||||
<p class="font-bold">Final Confirmation</p>
|
||||
<p>Please enter your password to confirm this destructive action.</p>
|
||||
</div>
|
||||
@@ -276,11 +272,11 @@
|
||||
class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||
Your Password
|
||||
</label>
|
||||
<input type="password" id="password-confirm" x-model="password" class="input w-full"
|
||||
<input type="password" id="password-confirm" x-model="password" class="w-full input"
|
||||
placeholder="Enter your password">
|
||||
<p x-show="passwordError" x-text="passwordError" class="text-red-500 text-sm mt-1"></p>
|
||||
<p x-show="passwordError" x-text="passwordError" class="mt-1 text-sm text-red-500"></p>
|
||||
@error('password')
|
||||
<p class="text-red-500 text-sm mt-1">{{ $message }}</p>
|
||||
<p class="mt-1 text-sm text-red-500">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
@endif
|
||||
@if ($application->fqdn)
|
||||
<span class="flex gap-1 text-xs">{{ Str::limit($application->fqdn, 60) }}
|
||||
<x-modal-input title="Edit Domains">
|
||||
<x-modal-input title="Edit Domains" :closeOutside="false">
|
||||
<x-slot:content>
|
||||
<span class="cursor-pointer">
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
@@ -107,15 +107,14 @@
|
||||
Settings
|
||||
</a>
|
||||
@if (str($application->status)->contains('running'))
|
||||
<x-modal-confirmation
|
||||
title="Confirm Service Application Restart?"
|
||||
buttonTitle="Restart"
|
||||
submitAction="restartApplication({{ $application->id }})"
|
||||
:actions="['The selected service application will be unavailable during the restart.', 'If the service application is currently in use data could be lost.']"
|
||||
:confirmWithText="false"
|
||||
:confirmWithPassword="false"
|
||||
step2ButtonText="Restart Service Container"
|
||||
/>
|
||||
<x-modal-confirmation title="Confirm Service Application Restart?"
|
||||
buttonTitle="Restart"
|
||||
submitAction="restartApplication({{ $application->id }})" :actions="[
|
||||
'The selected service application will be unavailable during the restart.',
|
||||
'If the service application is currently in use data could be lost.',
|
||||
]"
|
||||
:confirmWithText="false" :confirmWithPassword="false"
|
||||
step2ButtonText="Restart Service Container" />
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@@ -155,15 +154,13 @@
|
||||
Settings
|
||||
</a>
|
||||
@if (str($database->status)->contains('running'))
|
||||
<x-modal-confirmation
|
||||
title="Confirm Service Database Restart?"
|
||||
buttonTitle="Restart"
|
||||
submitAction="restartDatabase({{ $database->id }})"
|
||||
:actions="['This service database will be unavailable during the restart.', 'If the service database is currently in use data could be lost.']"
|
||||
:confirmWithText="false"
|
||||
:confirmWithPassword="false"
|
||||
step2ButtonText="Restart Database"
|
||||
/>
|
||||
<x-modal-confirmation title="Confirm Service Database Restart?"
|
||||
buttonTitle="Restart" submitAction="restartDatabase({{ $database->id }})"
|
||||
:actions="[
|
||||
'This service database will be unavailable during the restart.',
|
||||
'If the service database is currently in use data could be lost.',
|
||||
]" :confirmWithText="false" :confirmWithPassword="false"
|
||||
step2ButtonText="Restart Database" />
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@@ -183,7 +180,8 @@
|
||||
lazy />
|
||||
@endforeach
|
||||
@foreach ($databases as $database)
|
||||
<livewire:project.service.storage wire:key="database-{{ $database->id }}" :resource="$database" lazy />
|
||||
<livewire:project.service.storage wire:key="database-{{ $database->id }}" :resource="$database"
|
||||
lazy />
|
||||
@endforeach
|
||||
</div>
|
||||
<div x-cloak x-show="activeTab === 'scheduled-tasks'">
|
||||
|
||||
@@ -6,6 +6,6 @@
|
||||
</div>
|
||||
<x-modal-confirmation title="Confirm Resource Deletion?" buttonTitle="Delete" isErrorButton submitAction="delete"
|
||||
buttonTitle="Delete" :checkboxes="$checkboxes" :actions="['Permanently delete all containers of this resource.']" confirmationText="{{ $resourceName }}"
|
||||
confirmationLabel="Please confirm the execution of the actions by entering the NAME of the resource below"
|
||||
confirmationLabel="Please confirm the execution of the actions by entering the Resource Name below"
|
||||
shortConfirmationLabel="Resource Name" step3ButtonText="Permanently Delete" />
|
||||
</div>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<x-forms.button type="submit">Connect</x-forms.button>
|
||||
</form>
|
||||
@else
|
||||
<div class="pt-4">No containers are not running.</div>
|
||||
<div class="pt-4">No containers are running.</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
<form wire:submit="submit" class="w-full">
|
||||
<div class="flex flex-col gap-2 pb-2">
|
||||
<div class="flex items-end gap-2 pt-4">
|
||||
<div class="flex gap-2 items-end pt-4">
|
||||
<h2>Scheduled Task</h2>
|
||||
<x-forms.button type="submit">
|
||||
Save
|
||||
@@ -23,7 +23,10 @@
|
||||
step2ButtonText="Permanently Delete" />
|
||||
|
||||
</div>
|
||||
<div class="flex w-full gap-2">
|
||||
<div class="w-48">
|
||||
<x-forms.checkbox instantSave id="task.enabled" label="Enabled" />
|
||||
</div>
|
||||
<div class="flex gap-2 w-full">
|
||||
<x-forms.input placeholder="Name" id="task.name" label="Name" required />
|
||||
<x-forms.input placeholder="php artisan schedule:run" id="task.command" label="Command" required />
|
||||
<x-forms.input placeholder="0 0 * * * or daily" id="task.frequency" label="Frequency" required />
|
||||
|
||||
@@ -10,6 +10,8 @@ DATE=$(date +"%Y%m%d-%H%M%S")
|
||||
|
||||
VERSION="1.6"
|
||||
DOCKER_VERSION="26.0"
|
||||
# TODO: Ask for a user
|
||||
CURRENT_USER=$USER
|
||||
|
||||
mkdir -p /data/coolify/{source,ssh,applications,databases,backups,services,proxy,webhooks-during-maintenance,metrics,logs}
|
||||
mkdir -p /data/coolify/ssh/{keys,mux}
|
||||
@@ -401,88 +403,18 @@ if [ ! -f ~/.ssh/authorized_keys ]; then
|
||||
chmod 600 ~/.ssh/authorized_keys
|
||||
fi
|
||||
|
||||
checkSshKeyInAuthorizedKeys() {
|
||||
grep -qw "root@coolify" ~/.ssh/authorized_keys
|
||||
return $?
|
||||
}
|
||||
set +e
|
||||
IS_COOLIFY_VOLUME_EXISTS=$(docker volume ls | grep coolify-db | wc -l)
|
||||
set -e
|
||||
|
||||
checkSshKeyInCoolifyData() {
|
||||
[ -s /data/coolify/ssh/keys/id.root@host.docker.internal ]
|
||||
return $?
|
||||
}
|
||||
|
||||
generateAuthorizedKeys() {
|
||||
sed -i "/root@coolify/d" ~/.ssh/authorized_keys
|
||||
cat /data/coolify/ssh/keys/id.root@host.docker.internal.pub >> ~/.ssh/authorized_keys
|
||||
rm -f /data/coolify/ssh/keys/id.root@host.docker.internal.pub
|
||||
}
|
||||
generateSshKey() {
|
||||
if [ "$IS_COOLIFY_VOLUME_EXISTS" -eq 0 ]; then
|
||||
echo " - Generating SSH key."
|
||||
ssh-keygen -t ed25519 -a 100 -f /data/coolify/ssh/keys/id.root@host.docker.internal -q -N "" -C root@coolify
|
||||
chown 9999 /data/coolify/ssh/keys/id.root@host.docker.internal
|
||||
generateAuthorizedKeys
|
||||
}
|
||||
|
||||
syncSshKeys() {
|
||||
DB_RUNNING=$(docker inspect coolify-db --format '{{ .State.Status }}' 2>/dev/null)
|
||||
# Check if SSH key exists in Coolify data but not in authorized_keys
|
||||
if checkSshKeyInCoolifyData && ! checkSshKeyInAuthorizedKeys; then
|
||||
# Add the existing Coolify SSH key to authorized_keys
|
||||
cat /data/coolify/ssh/keys/id.root@host.docker.internal.pub >> ~/.ssh/authorized_keys
|
||||
# Check if SSH key exists in authorized_keys but not in Coolify data
|
||||
elif checkSshKeyInAuthorizedKeys && ! checkSshKeyInCoolifyData; then
|
||||
# Ensure Coolify DB is running before proceeding
|
||||
if [ "$DB_RUNNING" = "running" ]; then
|
||||
# Retrieve DB user and SSH key from Coolify database
|
||||
DB_USER=$(docker inspect coolify-db --format '{{ .Config.Env }}' | grep -oP 'POSTGRES_USER=\K[^ ]+')
|
||||
DB_SSH_KEY=$(docker exec coolify-db psql -U $DB_USER -d coolify -t -c "SELECT \"private_key\" FROM \"private_keys\" WHERE id = 0 AND team_id = 0 LIMIT 1;" -A -t)
|
||||
|
||||
if [ -z "$DB_SSH_KEY" ]; then
|
||||
# If no key found in DB, generate a new one
|
||||
echo " - SSH key not found in database. Generating new key."
|
||||
generateSshKey
|
||||
else
|
||||
# If key found in DB, save it and update authorized_keys
|
||||
echo " - SSH key found in database. Saving to file."
|
||||
echo "$DB_SSH_KEY" > /data/coolify/ssh/keys/id.root@host.docker.internal
|
||||
chmod 600 /data/coolify/ssh/keys/id.root@host.docker.internal
|
||||
chown 9999 /data/coolify/ssh/keys/id.root@host.docker.internal
|
||||
|
||||
# Generate public key from private key and update authorized_keys
|
||||
ssh-keygen -y -f /data/coolify/ssh/keys/id.root@host.docker.internal -C root@coolify > /data/coolify/ssh/keys/id.root@host.docker.internal.pub
|
||||
sed -i "/root@coolify/d" ~/.ssh/authorized_keys
|
||||
cat /data/coolify/ssh/keys/id.root@host.docker.internal.pub >> ~/.ssh/authorized_keys
|
||||
rm -f /data/coolify/ssh/keys/id.root@host.docker.internal.pub
|
||||
chmod 600 ~/.ssh/authorized_keys
|
||||
fi
|
||||
fi
|
||||
# If SSH key doesn't exist in either location
|
||||
elif ! checkSshKeyInAuthorizedKeys && ! checkSshKeyInCoolifyData; then
|
||||
# Ensure Coolify DB is running before proceeding
|
||||
if [ "$DB_RUNNING" = "running" ]; then
|
||||
# Retrieve DB user and SSH key from Coolify database
|
||||
DB_USER=$(docker inspect coolify-db --format '{{ .Config.Env }}' | grep -oP 'POSTGRES_USER=\K[^ ]+')
|
||||
DB_SSH_KEY=$(docker exec coolify-db psql -U $DB_USER -d coolify -t -c "SELECT \"private_key\" FROM \"private_keys\" WHERE id = 0 AND team_id = 0 LIMIT 1;" -A -t)
|
||||
if [ -z "$DB_SSH_KEY" ]; then
|
||||
# If no key found in DB, generate a new one
|
||||
echo " - SSH key not found in database. Generating new key."
|
||||
generateSshKey
|
||||
else
|
||||
# If key found in DB, save it and update authorized_keys
|
||||
echo " - SSH key found in database. Saving to file."
|
||||
echo "$DB_SSH_KEY" > /data/coolify/ssh/keys/id.root@host.docker.internal
|
||||
chmod 600 /data/coolify/ssh/keys/id.root@host.docker.internal
|
||||
ssh-keygen -y -f /data/coolify/ssh/keys/id.root@host.docker.internal -C root@coolify > /data/coolify/ssh/keys/id.root@host.docker.internal.pub
|
||||
sed -i "/root@coolify/d" ~/.ssh/authorized_keys
|
||||
cat /data/coolify/ssh/keys/id.root@host.docker.internal.pub >> ~/.ssh/authorized_keys
|
||||
fi
|
||||
else
|
||||
generateSshKey
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
syncSshKeys || true
|
||||
ssh-keygen -t ed25519 -a 100 -f /data/coolify/ssh/keys/id.$CURRENT_USER@host.docker.internal -q -N "" -C coolify
|
||||
chown 9999 /data/coolify/ssh/keys/id.$CURRENT_USER@host.docker.internal
|
||||
sed -i "/coolify/d" ~/.ssh/authorized_keys
|
||||
cat /data/coolify/ssh/keys/id.$CURRENT_USER@host.docker.internal.pub >> ~/.ssh/authorized_keys
|
||||
rm -f /data/coolify/ssh/keys/id.$CURRENT_USER@host.docker.internal.pub
|
||||
fi
|
||||
|
||||
chown -R 9999:root /data/coolify
|
||||
chmod -R 700 /data/coolify
|
||||
@@ -492,7 +424,7 @@ echo -e " - It could take a while based on your server's performance, network sp
|
||||
echo -e " - Please wait."
|
||||
getAJoke
|
||||
|
||||
bash /data/coolify/source/upgrade.sh "${LATEST_VERSION:-latest}" "${LATEST_HELPER_VERSION:-latest}" >/dev/null 2>&1
|
||||
bash /data/coolify/source/upgrade.sh "${LATEST_VERSION:-latest}" "${LATEST_HELPER_VERSION:-latest}"
|
||||
echo " - Coolify installed successfully."
|
||||
rm -f $ENV_FILE-$DATE
|
||||
|
||||
|
||||
@@ -3,21 +3,30 @@
|
||||
# slogan:
|
||||
# tags:
|
||||
# logo:
|
||||
# port: 5000
|
||||
# port: 4200
|
||||
|
||||
services:
|
||||
postiz:
|
||||
image: "ghcr.io/gitroomhq/postiz-app:latest"
|
||||
environment:
|
||||
- SERVICE_FQDN_POSTIZ_5000
|
||||
- SERVICE_FQDN_POSTIZ_4200
|
||||
- MAIN_URL=${SERVICE_FQDN_POSTIZ}
|
||||
- FRONTEND_URL=${SERVICE_FQDN_POSTIZ}
|
||||
- NEXT_PUBLIC_BACKEND_URL=${SERVICE_FQDN_POSTIZ_3000}
|
||||
- NEXT_PUBLIC_BACKEND_URL=${SERVICE_FQDN_POSTIZAPI_3000}
|
||||
- JWT_SECRET=${SERVICE_REALBASE64_JWTSECRET}
|
||||
- DATABASE_URL=postgresql://${SERVICE_USER_POSTGRES}:${SERVICE_PASSWORD_POSTGRES}@postgres:5432/${POSTGRES_DB:-postiz}?schema=public
|
||||
- REDIS_URL=redis://redis:6379
|
||||
- BACKEND_INTERNAL_URL=${SERVICE_FQDN_POSTIZ}
|
||||
- BACKEND_INTERNAL_URL=http://localhost:3000/
|
||||
- IS_GENERAL=true
|
||||
- CLOUDFLARE_ACCOUNT_ID=${CLOUDFLARE_ACCOUNT_ID}
|
||||
- CLOUDFLARE_ACCESS_KEY=${CLOUDFLARE_ACCESS_KEY}
|
||||
- CLOUDFLARE_SECRET_ACCESS_KEY=${CLOUDFLARE_SECRET_ACCESS_KEY}
|
||||
- CLOUDFLARE_BUCKETNAME=${CLOUDFLARE_BUCKETNAME}
|
||||
- CLOUDFLARE_BUCKET_URL=${CLOUDFLARE_BUCKET_URL}
|
||||
- CLOUDFLARE_REGION=${CLOUDFLARE_REGION}
|
||||
- RESEND_API_KEY=${RESEND_API_KEY}
|
||||
- EMAIL_FROM_ADDRESS=${EMAIL_FROM_ADDRESS}
|
||||
- EMAIL_FROM_NAME=${EMAIL_FROM_NAME}
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"coolify": {
|
||||
"v4": {
|
||||
"version": "4.0.0-beta.342"
|
||||
"version": "4.0.0-beta.345"
|
||||
},
|
||||
"nightly": {
|
||||
"version": "4.0.0-beta.343"
|
||||
"version": "4.0.0-beta.346"
|
||||
},
|
||||
"helper": {
|
||||
"version": "1.0.1"
|
||||
|
||||
Reference in New Issue
Block a user