Merge pull request #3457 from coollabsio/next

v4.0.0-beta.337
This commit is contained in:
Andras Bacsai
2024-09-16 17:29:14 +02:00
committed by GitHub
24 changed files with 154 additions and 95 deletions

View File

@@ -31,7 +31,7 @@ class StartService
$network = $service->destination->network; $network = $service->destination->network;
$serviceNames = data_get(Yaml::parse($compose), 'services', []); $serviceNames = data_get(Yaml::parse($compose), 'services', []);
foreach ($serviceNames as $serviceName => $serviceConfig) { foreach ($serviceNames as $serviceName => $serviceConfig) {
$commands[] = "docker network connect --alias {$serviceName}-{$service->uuid} $network {$serviceName}-{$service->uuid} || true"; $commands[] = "docker network connect --alias {$serviceName}-{$service->uuid} $network {$serviceName}-{$service->uuid} >/dev/null 2>&1 || true";
} }
} }
$activity = remote_process($commands, $service->server, type_uuid: $service->uuid, callEventOnFinish: 'ServiceStatusChanged'); $activity = remote_process($commands, $service->server, type_uuid: $service->uuid, callEventOnFinish: 'ServiceStatusChanged');

View File

@@ -514,7 +514,7 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
'hidden' => true, 'hidden' => true,
'ignore_errors' => true, 'ignore_errors' => true,
], [ ], [
"docker network connect {$networkId} coolify-proxy || true", "docker network connect {$networkId} coolify-proxy >/dev/null 2>&1 || true",
'hidden' => true, 'hidden' => true,
'ignore_errors' => true, 'ignore_errors' => true,
]); ]);

View File

@@ -11,7 +11,7 @@ use Livewire\Component;
class ExecuteContainerCommand extends Component class ExecuteContainerCommand extends Component
{ {
public string $container; public $container;
public Collection $containers; public Collection $containers;
@@ -57,24 +57,13 @@ class ExecuteContainerCommand extends Component
if ($this->resource->destination->server->isFunctional()) { if ($this->resource->destination->server->isFunctional()) {
$this->servers = $this->servers->push($this->resource->destination->server); $this->servers = $this->servers->push($this->resource->destination->server);
} }
$this->container = $this->resource->uuid;
$this->containers->push($this->container);
} elseif (data_get($this->parameters, 'service_uuid')) { } elseif (data_get($this->parameters, 'service_uuid')) {
$this->type = 'service'; $this->type = 'service';
$this->resource = Service::where('uuid', $this->parameters['service_uuid'])->firstOrFail(); $this->resource = Service::where('uuid', $this->parameters['service_uuid'])->firstOrFail();
$this->resource->applications()->get()->each(function ($application) {
$this->containers->push(data_get($application, 'name').'-'.data_get($this->resource, 'uuid'));
});
$this->resource->databases()->get()->each(function ($database) {
$this->containers->push(data_get($database, 'name').'-'.data_get($this->resource, 'uuid'));
});
if ($this->resource->server->isFunctional()) { if ($this->resource->server->isFunctional()) {
$this->servers = $this->servers->push($this->resource->server); $this->servers = $this->servers->push($this->resource->server);
} }
} }
if ($this->containers->count() > 0) {
$this->container = $this->containers->first();
}
} }
public function loadContainers() public function loadContainers()
@@ -97,19 +86,42 @@ class ExecuteContainerCommand extends Component
]; ];
$this->containers = $this->containers->push($payload); $this->containers = $this->containers->push($payload);
} }
} elseif (data_get($this->parameters, 'database_uuid')) {
if ($this->resource->isRunning()) {
$this->containers = $this->containers->push([
'server' => $server,
'container' => [
'Names' => $this->resource->uuid,
],
]);
} }
} elseif (data_get($this->parameters, 'service_uuid')) {
$this->resource->applications()->get()->each(function ($application) {
ray($application);
if ($application->isRunning()) {
$this->containers->push([
'server' => $this->resource->server,
'container' => [
'Names' => data_get($application, 'name').'-'.data_get($this->resource, 'uuid'),
],
]);
}
});
$this->resource->databases()->get()->each(function ($database) {
if ($database->isRunning()) {
$this->containers->push([
'server' => $this->resource->server,
'container' => [
'Names' => data_get($database, 'name').'-'.data_get($this->resource, 'uuid'),
],
]);
}
});
}
} }
if ($this->containers->count() > 0) { if ($this->containers->count() > 0) {
if (data_get($this->parameters, 'application_uuid')) {
$this->container = data_get($this->containers->first(), 'container.Names');
} elseif (data_get($this->parameters, 'database_uuid')) {
$this->container = $this->containers->first(); $this->container = $this->containers->first();
} elseif (data_get($this->parameters, 'service_uuid')) {
$this->container = $this->containers->first();
}
if ($this->containers->count() === 1) {
$this->dispatch('connectToContainer');
}
} }
} }
@@ -117,17 +129,13 @@ class ExecuteContainerCommand extends Component
public function connectToContainer() public function connectToContainer()
{ {
try { try {
if (data_get($this->parameters, 'application_uuid')) { $container_name = data_get($this->container, 'container.Names');
$container = $this->containers->where('container.Names', $this->container)->first(); ray($this->container);
$container_name = data_get($container, 'container.Names'); if (is_null($container_name)) {
if (is_null($container)) {
throw new \RuntimeException('Container not found.'); throw new \RuntimeException('Container not found.');
} }
$server = data_get($container, 'server'); $server = data_get($this->container, 'server');
} else {
$container_name = $this->container;
$server = $this->servers->first();
}
if ($server->isForceDisabled()) { if ($server->isForceDisabled()) {
throw new \RuntimeException('Server is disabled.'); throw new \RuntimeException('Server is disabled.');
} }

View File

@@ -24,7 +24,7 @@ class Terminal extends Component
if ($isContainer) { if ($isContainer) {
$status = getContainerStatus($server, $identifier); $status = getContainerStatus($server, $identifier);
if ($status !== 'running') { if ($status !== 'running') {
return handleError(new \Exception('Container is not running'), $this); return;
} }
$command = generateSshCommand($server, "docker exec -it {$identifier} sh -c 'if [ -f ~/.profile ]; then . ~/.profile; fi; if [ -n \"\$SHELL\" ]; then exec \$SHELL; else sh; fi'"); $command = generateSshCommand($server, "docker exec -it {$identifier} sh -c 'if [ -f ~/.profile ]; then . ~/.profile; fi; if [ -n \"\$SHELL\" ]; then exec \$SHELL; else sh; fi'");
} else { } else {

View File

@@ -32,6 +32,16 @@ class ServiceApplication extends BaseModel
return ServiceApplication::whereRelation('service.environment.project.team', 'id', $teamId)->orderBy('name'); return ServiceApplication::whereRelation('service.environment.project.team', 'id', $teamId)->orderBy('name');
} }
public function isRunning()
{
return str($this->status)->contains('running');
}
public function isExited()
{
return str($this->status)->contains('exited');
}
public function isLogDrainEnabled() public function isLogDrainEnabled()
{ {
return data_get($this, 'is_log_drain_enabled', false); return data_get($this, 'is_log_drain_enabled', false);

View File

@@ -25,6 +25,16 @@ class ServiceDatabase extends BaseModel
remote_process(["docker restart {$container_id}"], $this->service->server); remote_process(["docker restart {$container_id}"], $this->service->server);
} }
public function isRunning()
{
return str($this->status)->contains('running');
}
public function isExited()
{
return str($this->status)->contains('exited');
}
public function isLogDrainEnabled() public function isLogDrainEnabled()
{ {
return data_get($this, 'is_log_drain_enabled', false); return data_get($this, 'is_log_drain_enabled', false);

View File

@@ -75,6 +75,11 @@ class StandaloneClickhouse extends BaseModel
} }
} }
public function isRunning()
{
return (bool) str($this->status)->contains('running');
}
public function isExited() public function isExited()
{ {
return (bool) str($this->status)->startsWith('exited'); return (bool) str($this->status)->startsWith('exited');

View File

@@ -75,6 +75,11 @@ class StandaloneDragonfly extends BaseModel
} }
} }
public function isRunning()
{
return (bool) str($this->status)->contains('running');
}
public function isExited() public function isExited()
{ {
return (bool) str($this->status)->startsWith('exited'); return (bool) str($this->status)->startsWith('exited');

View File

@@ -75,6 +75,11 @@ class StandaloneKeydb extends BaseModel
} }
} }
public function isRunning()
{
return (bool) str($this->status)->contains('running');
}
public function isExited() public function isExited()
{ {
return (bool) str($this->status)->startsWith('exited'); return (bool) str($this->status)->startsWith('exited');

View File

@@ -75,6 +75,11 @@ class StandaloneMariadb extends BaseModel
} }
} }
public function isRunning()
{
return (bool) str($this->status)->contains('running');
}
public function isExited() public function isExited()
{ {
return (bool) str($this->status)->startsWith('exited'); return (bool) str($this->status)->startsWith('exited');

View File

@@ -79,6 +79,11 @@ class StandaloneMongodb extends BaseModel
} }
} }
public function isRunning()
{
return (bool) str($this->status)->contains('running');
}
public function isExited() public function isExited()
{ {
return (bool) str($this->status)->startsWith('exited'); return (bool) str($this->status)->startsWith('exited');

View File

@@ -76,6 +76,11 @@ class StandaloneMysql extends BaseModel
} }
} }
public function isRunning()
{
return (bool) str($this->status)->contains('running');
}
public function isExited() public function isExited()
{ {
return (bool) str($this->status)->startsWith('exited'); return (bool) str($this->status)->startsWith('exited');

View File

@@ -102,6 +102,11 @@ class StandalonePostgresql extends BaseModel
} }
} }
public function isRunning()
{
return (bool) str($this->status)->contains('running');
}
public function isExited() public function isExited()
{ {
return (bool) str($this->status)->startsWith('exited'); return (bool) str($this->status)->startsWith('exited');

View File

@@ -71,6 +71,11 @@ class StandaloneRedis extends BaseModel
} }
} }
public function isRunning()
{
return (bool) str($this->status)->contains('running');
}
public function isExited() public function isExited()
{ {
return (bool) str($this->status)->startsWith('exited'); return (bool) str($this->status)->startsWith('exited');

View File

@@ -229,12 +229,12 @@ function generateServiceSpecificFqdns(ServiceApplication|Application $resource)
} }
if (is_null($MINIO_BROWSER_REDIRECT_URL?->value)) { if (is_null($MINIO_BROWSER_REDIRECT_URL?->value)) {
$MINIO_BROWSER_REDIRECT_URL?->update([ $MINIO_BROWSER_REDIRECT_URL?->update([
'value' => generateFqdn($server, 'console-'.$uuid), 'value' => generateFqdn($server, 'console-'.$uuid, true),
]); ]);
} }
if (is_null($MINIO_SERVER_URL?->value)) { if (is_null($MINIO_SERVER_URL?->value)) {
$MINIO_SERVER_URL?->update([ $MINIO_SERVER_URL?->update([
'value' => generateFqdn($server, 'minio-'.$uuid), 'value' => generateFqdn($server, 'minio-'.$uuid, true),
]); ]);
} }
$payload = collect([ $payload = collect([

View File

@@ -478,7 +478,7 @@ function data_get_str($data, $key, $default = null): Stringable
return str($str); return str($str);
} }
function generateFqdn(Server $server, string $random): string function generateFqdn(Server $server, string $random, bool $forceHttps = false): string
{ {
$wildcard = data_get($server, 'settings.wildcard_domain'); $wildcard = data_get($server, 'settings.wildcard_domain');
if (is_null($wildcard) || $wildcard === '') { if (is_null($wildcard) || $wildcard === '') {
@@ -488,6 +488,9 @@ function generateFqdn(Server $server, string $random): string
$host = $url->getHost(); $host = $url->getHost();
$path = $url->getPath() === '/' ? '' : $url->getPath(); $path = $url->getPath() === '/' ? '' : $url->getPath();
$scheme = $url->getScheme(); $scheme = $url->getScheme();
if ($forceHttps) {
$scheme = 'https';
}
$finalFqdn = "$scheme://{$random}.$host$path"; $finalFqdn = "$scheme://{$random}.$host$path";
return $finalFqdn; return $finalFqdn;

View File

@@ -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.336', 'release' => '4.0.0-beta.337',
// 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'),

View File

@@ -1,3 +1,3 @@
<?php <?php
return '4.0.0-beta.336'; return '4.0.0-beta.337';

View File

@@ -5,6 +5,7 @@ set -e # Exit immediately if a command exits with a non-zero status
## $1 could be empty, so we need to disable this check ## $1 could be empty, so we need to disable this check
#set -u # Treat unset variables as an error and exit #set -u # Treat unset variables as an error and exit
set -o pipefail # Cause a pipeline to return the status of the last command that exited with a non-zero status set -o pipefail # Cause a pipeline to return the status of the last command that exited with a non-zero status
CDN="https://cdn.coollabs.io/coolify-nightly"
DATE=$(date +"%Y%m%d-%H%M%S") DATE=$(date +"%Y%m%d-%H%M%S")
VERSION="1.5" VERSION="1.5"
@@ -21,7 +22,13 @@ INSTALLATION_LOG_WITH_DATE="/data/coolify/source/installation-${DATE}.log"
exec > >(tee -a $INSTALLATION_LOG_WITH_DATE) 2>&1 exec > >(tee -a $INSTALLATION_LOG_WITH_DATE) 2>&1
CDN="https://cdn.coollabs.io/coolify-nightly" getAJoke() {
JOKES=$(curl -s --max-time 2 https://v2.jokeapi.dev/joke/Programming?format=txt&type=single&amount=1 || true)
if [ "$JOKES" != "" ]; then
echo -e " - Until then, here's a joke for you:\n"
echo -e "$JOKES\n"
fi
}
OS_TYPE=$(grep -w "ID" /etc/os-release | cut -d "=" -f 2 | tr -d '"') OS_TYPE=$(grep -w "ID" /etc/os-release | cut -d "=" -f 2 | tr -d '"')
ENV_FILE="/data/coolify/source/.env" ENV_FILE="/data/coolify/source/.env"
@@ -202,6 +209,7 @@ fi
echo -e "3. Check Docker Installation. " echo -e "3. Check Docker Installation. "
if ! [ -x "$(command -v docker)" ]; then if ! [ -x "$(command -v docker)" ]; then
echo " - Docker is not installed. Installing Docker. It may take a while." echo " - Docker is not installed. Installing Docker. It may take a while."
getAJoke
case "$OS_TYPE" in case "$OS_TYPE" in
"almalinux") "almalinux")
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo >/dev/null 2>&1 dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo >/dev/null 2>&1
@@ -477,22 +485,14 @@ chmod -R 700 /data/coolify
echo -e "9. Installing Coolify ($LATEST_VERSION)" echo -e "9. Installing Coolify ($LATEST_VERSION)"
echo -e " - It could take a while based on your server's performance, network speed, stars, etc." echo -e " - It could take a while based on your server's performance, network speed, stars, etc."
echo -e " - Please wait." echo -e " - Please wait."
JOKES=$(curl -s https://v2.jokeapi.dev/joke/Programming?format=txt&type=single&amount=1 || true) getAJoke
if [ "$JOKES" != "" ]; then
echo -e " - Until then, here's a joke for you:\n"
echo -e "$JOKES\n"
fi
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}" >/dev/null 2>&1
echo " - Coolify installed successfully." echo " - Coolify installed successfully."
rm -f $ENV_FILE-$DATE rm -f $ENV_FILE-$DATE
echo " - Waiting for 20 seconds for Coolify (database migrations) to be ready." echo " - Waiting for 20 seconds for Coolify (database migrations) to be ready."
JOKES=$(curl -s https://v2.jokeapi.dev/joke/Programming?format=txt&type=single&amount=1 || true) getAJoke
if [ "$JOKES" != "" ]; then
echo -e " - Until then, here's a joke for you:\n"
echo -e "$JOKES\n"
fi
sleep 20 sleep 20
echo -e "\033[0;35m echo -e "\033[0;35m
@@ -505,5 +505,5 @@ echo -e "\033[0;35m
\033[0m" \033[0m"
echo -e "\nYour instance is ready to use." echo -e "\nYour instance is ready to use."
echo -e "Please visit http://$(curl -4s https://ifconfig.io):8000 to get started.\n" echo -e "Please visit http://$(curl -4s https://ifconfig.io):8000 to get started.\n"
echo -e "WARNING: We recommend you backup your /data/coolify/source/.env file to a safe location, outside of this server." echo -e "WARNING: We recommend you to backup your /data/coolify/source/.env file to a safe location, outside of this server."
cp /data/coolify/source/.env /data/coolify/source/.env.backup cp /data/coolify/source/.env /data/coolify/source/.env.backup

View File

@@ -1,10 +1,10 @@
{ {
"coolify": { "coolify": {
"v4": { "v4": {
"version": "4.0.0-beta.336" "version": "4.0.0-beta.337"
}, },
"nightly": { "nightly": {
"version": "4.0.0-beta.337" "version": "4.0.0-beta.338"
}, },
"helper": { "helper": {
"version": "1.0.1" "version": "1.0.1"

View File

@@ -3,8 +3,8 @@
{{ data_get_str($service, 'name')->limit(10) }} > Configuration | Coolify {{ data_get_str($service, 'name')->limit(10) }} > Configuration | Coolify
</x-slot> </x-slot>
<livewire:project.service.navbar :service="$service" :parameters="$parameters" :query="$query" /> <livewire:project.service.navbar :service="$service" :parameters="$parameters" :query="$query" />
<div class="flex flex-col h-full gap-8 pt-6 sm:flex-row"> <div class="flex flex-col gap-8 pt-6 h-full sm:flex-row">
<div class="flex flex-col items-start gap-2 min-w-fit"> <div class="flex flex-col gap-2 items-start min-w-fit">
<a class="menu-item sm:min-w-fit" target="_blank" href="{{ $service->documentation() }}">Documentation <a class="menu-item sm:min-w-fit" target="_blank" href="{{ $service->documentation() }}">Documentation
<x-external-link /></a> <x-external-link /></a>
<a class="menu-item sm:min-w-fit" :class="activeTab === 'service-stack' && 'menu-item-active'" <a class="menu-item sm:min-w-fit" :class="activeTab === 'service-stack' && 'menu-item-active'"
@@ -23,10 +23,10 @@
@click.prevent="activeTab = 'scheduled-tasks'; window.location.hash = 'scheduled-tasks'" @click.prevent="activeTab = 'scheduled-tasks'; window.location.hash = 'scheduled-tasks'"
href="#">Scheduled Tasks href="#">Scheduled Tasks
</a> </a>
<a class="menu-item sm:min-w-fit" :class="activeTab === 'execute-command' && 'menu-item-active'" <a class="menu-item sm:min-w-fit" :class="activeTab === 'terminal' && 'menu-item-active'"
@click.prevent="activeTab = 'execute-command'; @click.prevent="activeTab = 'terminal';
window.location.hash = 'execute-command'" window.location.hash = 'terminal'"
href="#">Execute Command</a> href="#">Terminal</a>
<a class="menu-item sm:min-w-fit" :class="activeTab === 'logs' && 'menu-item-active'" <a class="menu-item sm:min-w-fit" :class="activeTab === 'logs' && 'menu-item-active'"
@click.prevent="activeTab = 'logs'; @click.prevent="activeTab = 'logs';
window.location.hash = 'logs'" window.location.hash = 'logs'"
@@ -168,7 +168,7 @@
</div> </div>
</div> </div>
<div x-cloak x-show="activeTab === 'storages'"> <div x-cloak x-show="activeTab === 'storages'">
<div class="flex items-center gap-2"> <div class="flex gap-2 items-center">
<h2>Storages</h2> <h2>Storages</h2>
</div> </div>
<div class="pb-4">Persistent storage to preserve data between deployments.</div> <div class="pb-4">Persistent storage to preserve data between deployments.</div>
@@ -191,7 +191,7 @@
<div x-cloak x-show="activeTab === 'logs'"> <div x-cloak x-show="activeTab === 'logs'">
<livewire:project.shared.logs :resource="$service" /> <livewire:project.shared.logs :resource="$service" />
</div> </div>
<div x-cloak x-show="activeTab === 'execute-command'"> <div x-cloak x-show="activeTab === 'terminal'">
<livewire:project.shared.execute-container-command :resource="$service" /> <livewire:project.shared.execute-container-command :resource="$service" />
</div> </div>
<div x-cloak x-show="activeTab === 'environment-variables'"> <div x-cloak x-show="activeTab === 'environment-variables'">

View File

@@ -14,7 +14,7 @@
@endif @endif
<div x-init="$wire.loadContainers"> <div x-init="$wire.loadContainers">
<div class="pt-4" wire:loading wire:target='loadContainers'> <div class="pt-4" wire:loading wire:target='loadContainers'>
Loading containers... Loading resources...
</div> </div>
<div wire:loading.remove wire:target='loadContainers'> <div wire:loading.remove wire:target='loadContainers'>
@if (count($containers) > 0) @if (count($containers) > 0)
@@ -22,24 +22,12 @@
wire:submit="$dispatchSelf('connectToContainer')"> wire:submit="$dispatchSelf('connectToContainer')">
<x-forms.select label="Container" id="container" required> <x-forms.select label="Container" id="container" required>
<option disabled selected>Select container</option> <option disabled selected>Select container</option>
@if (data_get($this->parameters, 'application_uuid'))
@foreach ($containers as $container) @foreach ($containers as $container)
<option value="{{ data_get($container, 'container.Names') }}"> <option value="{{ data_get($container, 'container.Names') }}">
{{ data_get($container, 'container.Names') }} {{ data_get($container, 'container.Names') }}
({{ data_get($container, 'server.name') }}) ({{ data_get($container, 'server.name') }})
</option> </option>
@endforeach @endforeach
@elseif(data_get($this->parameters, 'service_uuid'))
@foreach ($containers as $container)
<option value="{{ $container }}">
{{ $container }} ({{ data_get($servers, '0.name') }})
</option>
@endforeach
@else
<option value="{{ $container }}">
{{ $container }} ({{ data_get($servers, '0.name') }})
</option>
@endif
</x-forms.select> </x-forms.select>
<x-forms.button type="submit">Connect</x-forms.button> <x-forms.button type="submit">Connect</x-forms.button>
</form> </form>

View File

@@ -5,6 +5,7 @@ set -e # Exit immediately if a command exits with a non-zero status
## $1 could be empty, so we need to disable this check ## $1 could be empty, so we need to disable this check
#set -u # Treat unset variables as an error and exit #set -u # Treat unset variables as an error and exit
set -o pipefail # Cause a pipeline to return the status of the last command that exited with a non-zero status set -o pipefail # Cause a pipeline to return the status of the last command that exited with a non-zero status
CDN="https://cdn.coollabs.io/coolify"
DATE=$(date +"%Y%m%d-%H%M%S") DATE=$(date +"%Y%m%d-%H%M%S")
VERSION="1.5" VERSION="1.5"
@@ -21,7 +22,13 @@ INSTALLATION_LOG_WITH_DATE="/data/coolify/source/installation-${DATE}.log"
exec > >(tee -a $INSTALLATION_LOG_WITH_DATE) 2>&1 exec > >(tee -a $INSTALLATION_LOG_WITH_DATE) 2>&1
CDN="https://cdn.coollabs.io/coolify-nightly" getAJoke() {
JOKES=$(curl -s --max-time 2 https://v2.jokeapi.dev/joke/Programming?format=txt&type=single&amount=1 || true)
if [ "$JOKES" != "" ]; then
echo -e " - Until then, here's a joke for you:\n"
echo -e "$JOKES\n"
fi
}
OS_TYPE=$(grep -w "ID" /etc/os-release | cut -d "=" -f 2 | tr -d '"') OS_TYPE=$(grep -w "ID" /etc/os-release | cut -d "=" -f 2 | tr -d '"')
ENV_FILE="/data/coolify/source/.env" ENV_FILE="/data/coolify/source/.env"
@@ -202,6 +209,7 @@ fi
echo -e "3. Check Docker Installation. " echo -e "3. Check Docker Installation. "
if ! [ -x "$(command -v docker)" ]; then if ! [ -x "$(command -v docker)" ]; then
echo " - Docker is not installed. Installing Docker. It may take a while." echo " - Docker is not installed. Installing Docker. It may take a while."
getAJoke
case "$OS_TYPE" in case "$OS_TYPE" in
"almalinux") "almalinux")
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo >/dev/null 2>&1 dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo >/dev/null 2>&1
@@ -477,22 +485,14 @@ chmod -R 700 /data/coolify
echo -e "9. Installing Coolify ($LATEST_VERSION)" echo -e "9. Installing Coolify ($LATEST_VERSION)"
echo -e " - It could take a while based on your server's performance, network speed, stars, etc." echo -e " - It could take a while based on your server's performance, network speed, stars, etc."
echo -e " - Please wait." echo -e " - Please wait."
JOKES=$(curl -s https://v2.jokeapi.dev/joke/Programming?format=txt&type=single&amount=1 || true) getAJoke
if [ "$JOKES" != "" ]; then
echo -e " - Until then, here's a joke for you:\n"
echo -e "$JOKES\n"
fi
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}" >/dev/null 2>&1
echo " - Coolify installed successfully." echo " - Coolify installed successfully."
rm -f $ENV_FILE-$DATE rm -f $ENV_FILE-$DATE
echo " - Waiting for 20 seconds for Coolify (database migrations) to be ready." echo " - Waiting for 20 seconds for Coolify (database migrations) to be ready."
JOKES=$(curl -s https://v2.jokeapi.dev/joke/Programming?format=txt&type=single&amount=1 || true) getAJoke
if [ "$JOKES" != "" ]; then
echo -e " - Until then, here's a joke for you:\n"
echo -e "$JOKES\n"
fi
sleep 20 sleep 20
echo -e "\033[0;35m echo -e "\033[0;35m
@@ -505,5 +505,5 @@ echo -e "\033[0;35m
\033[0m" \033[0m"
echo -e "\nYour instance is ready to use." echo -e "\nYour instance is ready to use."
echo -e "Please visit http://$(curl -4s https://ifconfig.io):8000 to get started.\n" echo -e "Please visit http://$(curl -4s https://ifconfig.io):8000 to get started.\n"
echo -e "WARNING: We recommend you backup your /data/coolify/source/.env file to a safe location, outside of this server." echo -e "WARNING: We recommend you to backup your /data/coolify/source/.env file to a safe location, outside of this server."
cp /data/coolify/source/.env /data/coolify/source/.env.backup cp /data/coolify/source/.env /data/coolify/source/.env.backup

View File

@@ -1,10 +1,10 @@
{ {
"coolify": { "coolify": {
"v4": { "v4": {
"version": "4.0.0-beta.336" "version": "4.0.0-beta.337"
}, },
"nightly": { "nightly": {
"version": "4.0.0-beta.337" "version": "4.0.0-beta.338"
}, },
"helper": { "helper": {
"version": "1.0.1" "version": "1.0.1"