An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
revert: wip
Andras Bacsai810b55163cf7
diff --git a/app/Events/ApplicationDeploymentFinished.php b/app/Events/ApplicationDeploymentFinished.phpdeleted file mode 100644index fb43f72c52..0000000000--- a/app/Events/ApplicationDeploymentFinished.php+++ /dev/null@@ -1,38 +0,0 @@-<?php--namespace App\Events;--use Illuminate\Broadcasting\Channel;-use Illuminate\Broadcasting\InteractsWithSockets;-use Illuminate\Broadcasting\PresenceChannel;-use Illuminate\Broadcasting\PrivateChannel;-use Illuminate\Contracts\Broadcasting\ShouldBroadcast;-use Illuminate\Foundation\Events\Dispatchable;-use Illuminate\Queue\SerializesModels;--class ApplicationDeploymentFinished implements ShouldBroadcast-{- use Dispatchable, InteractsWithSockets, SerializesModels;-- public ?int $teamId = null;-- /**- * Create a new event instance.- */- public function __construct(public ?string $applicationUuid = null, public ?string $status = null)- {- $this->teamId = auth()->user()->currentTeam()->id;- }-- /**- * Get the channels the event should broadcast on.- *- * @return array<int, \Illuminate\Broadcasting\Channel>- */- public function broadcastOn(): array- {- return [- new PrivateChannel("custom.{$this->teamId}"),- ];- }-}diff --git a/app/Http/Livewire/Project/Application/Heading.php b/app/Http/Livewire/Project/Application/Heading.phpindex 9a212867a9..3d5af34da8 100644--- a/app/Http/Livewire/Project/Application/Heading.php+++ b/app/Http/Livewire/Project/Application/Heading.php@@ -11,24 +11,11 @@ use Visus\Cuid2\Cuid2;class Heading extends Component{- protected string $deploymentUuid;public Application $application;public array $parameters;- public function getListeners()- {- $teamId = auth()->user()->currentTeam()->id;- return [- "echo-private:custom.{$teamId},ApplicationDeploymentFinished" => 'updateStatus',- ];- }- public function updateStatus($message)- {- $applicationUuid = data_get($message, 'applicationUuid');- if ($this->application->uuid === $applicationUuid) {- $this->application->status = data_get($message, 'status');- }- }+ protected string $deploymentUuid;+public function mount(){$this->parameters = get_route_parameters();diff --git a/app/Jobs/ApplicationDeploymentNewJob.php b/app/Jobs/ApplicationDeploymentNewJob.phpindex 40301bbe95..94b9a4e270 100644--- a/app/Jobs/ApplicationDeploymentNewJob.php+++ b/app/Jobs/ApplicationDeploymentNewJob.php@@ -3,33 +3,18 @@namespace App\Jobs;use App\Enums\ApplicationDeploymentStatus;-use App\Enums\ProxyTypes;-use App\Events\ApplicationDeploymentFinished;use App\Models\Application;use App\Models\ApplicationDeploymentQueue;-use App\Models\ApplicationPreview;-use App\Models\GithubApp;-use App\Models\GitlabApp;use App\Models\Server;-use App\Models\StandaloneDocker;-use App\Models\SwarmDocker;-use App\Notifications\Application\DeploymentFailed;-use App\Notifications\Application\DeploymentSuccess;use App\Traits\ExecuteRemoteCommand;-use Exception;use Illuminate\Bus\Queueable;use Illuminate\Contracts\Queue\ShouldBeEncrypted;use Illuminate\Contracts\Queue\ShouldQueue;use Illuminate\Foundation\Bus\Dispatchable;use Illuminate\Queue\InteractsWithQueue;use Illuminate\Queue\SerializesModels;-use Illuminate\Support\Collection;-use Illuminate\Support\Str;use RuntimeException;-use Spatie\Url\Url;-use Symfony\Component\Yaml\Yaml;use Throwable;-use Visus\Cuid2\Cuid2;class ApplicationDeploymentNewJob implements ShouldQueue, ShouldBeEncrypted{@@ -102,7 +87,6 @@ class ApplicationDeploymentNewJob implements ShouldQueue, ShouldBeEncrypted});}$this->next(ApplicationDeploymentStatus::FINISHED->value);- ApplicationDeploymentFinished::dispatch($this->application->uuid, ApplicationDeploymentStatus::FINISHED->value);} catch (Throwable $exception) {$this->fail($exception);} finally {diff --git a/config/app.php b/config/app.phpindex 5851640be9..246ad1f995 100644--- a/config/app.php+++ b/config/app.php@@ -194,7 +194,7 @@ return [App\Providers\AppServiceProvider::class,App\Providers\FortifyServiceProvider::class,App\Providers\AuthServiceProvider::class,- App\Providers\BroadcastServiceProvider::class,+ // App\Providers\BroadcastServiceProvider::class,App\Providers\EventServiceProvider::class,App\Providers\HorizonServiceProvider::class,App\Providers\RouteServiceProvider::class,diff --git a/docker-compose.dev.yml b/docker-compose.dev.ymlindex d52c83b7d5..510ebb0206 100644--- a/docker-compose.dev.yml+++ b/docker-compose.dev.yml@@ -21,7 +21,7 @@ services:SSL_MODE: "off"AUTORUN_LARAVEL_STORAGE_LINK: "false"AUTORUN_LARAVEL_MIGRATION: "false"- PUSHER_HOST: "${PUSHER_HOST:-127.0.0.1}"+ PUSHER_HOST: "coolify-soketi"PUSHER_APP_ID: "${PUSHER_APP_ID:-coolify}"PUSHER_APP_KEY: "${PUSHER_APP_KEY:-coolify}"PUSHER_APP_SECRET: "${PUSHER_APP_SECRET:-coolify}"@@ -48,23 +48,21 @@ services:volumes:- /data/coolify/_volumes/redis/:/data# - coolify-redis-data-dev:/data- soketi:- env_file:- - .env- ports:- - "${FORWARD_SOKETI_PORT:-6001}:6001"- environment:- SOKETI_DEBUG: "true"- SOKETI_DEFAULT_APP_ID: "${PUSHER_APP_ID:-coolify}"- SOKETI_DEFAULT_APP_KEY: "${PUSHER_APP_KEY:-coolify}"- SOKETI_DEFAULT_APP_SECRET: "${PUSHER_APP_SECRET:-coolify}"+ # soketi:+ # env_file:+ # - .env+ # ports:+ # - "${FORWARD_SOKETI_PORT:-6001}:6001"+ # environment:+ # SOKETI_DEBUG: "true"+ # SOKETI_DEFAULT_APP_ID: "${PUSHER_APP_ID:-coolify}"+ # SOKETI_DEFAULT_APP_KEY: "${PUSHER_APP_KEY:-coolify}"+ # SOKETI_DEFAULT_APP_SECRET: "${PUSHER_APP_SECRET:-coolify}"vite:image: node:20working_dir: /var/www/htmlenvironment:- VITE_PUSHER_HOST: "${PUSHER_HOST:-127.0.0.1}"VITE_PUSHER_APP_KEY: "${PUSHER_APP_KEY:-coolify}"- VITE_PUSHER_PORT: "${FORWARD_SOKETI_PORT:-6001}"ports:- "${VITE_PORT:-5173}:${VITE_PORT:-5173}"volumes:diff --git a/docker-compose.prod.yml b/docker-compose.prod.ymlindex 4ba513d5a5..96b5193fd3 100644--- a/docker-compose.prod.yml+++ b/docker-compose.prod.yml@@ -35,13 +35,6 @@ services:- PHP_PM_START_SERVERS=1- PHP_PM_MIN_SPARE_SERVERS=1- PHP_PM_MAX_SPARE_SERVERS=10- - PUSHER_HOST- - PUSHER_APP_ID- - PUSHER_APP_KEY- - PUSHER_APP_SECRET- - VITE_PUSHER_HOST- - VITE_PUSHER_APP_KEY- - VITE_PUSHER_PORT- SELF_HOSTED- WAITLIST- SUBSCRIPTION_PROVIDERdiff --git a/docker-compose.yml b/docker-compose.ymlindex 2509f6fc84..ab900f5f9d 100644--- a/docker-compose.yml+++ b/docker-compose.yml@@ -24,12 +24,12 @@ services:restart: alwaysnetworks:- coolify- soketi:- image: 'quay.io/soketi/soketi:latest-16-alpine'- container_name: coolify-soketi- restart: always- networks:- - coolify+ # soketi:+ # image: 'quay.io/soketi/soketi:latest-16-alpine'+ # container_name: coolify-soketi+ # restart: always+ # networks:+ # - coolifynetworks:coolify:name: coolifydiff --git a/resources/js/app.js b/resources/js/app.jsindex 33a3cce439..869794ae32 100644--- a/resources/js/app.js+++ b/resources/js/app.js@@ -1,25 +1,25 @@import Alpine from "alpinejs";-import Echo from 'laravel-echo';-import Pusher from 'pusher-js';+// import Echo from 'laravel-echo';+// import Pusher from 'pusher-js';import { createApp } from "vue";import MagicBar from "./components/MagicBar.vue";import Toaster from "../../vendor/masmerise/livewire-toaster/resources/js";-window.Pusher = Pusher;--window.Echo = new Echo({- broadcaster: 'pusher',- cluster: window.location.hostname,- key: import.meta.env.VITE_PUSHER_APP_KEY ?? 'coolify',- wsHost: window.location.hostname,- wsPort: 6001,- wssPort: 6001,- forceTLS: false,- encrypted: true,- disableStats: false,- enableLogging: true,- enabledTransports: ['ws', 'wss'],-});+// window.Pusher = Pusher;++// window.Echo = new Echo({+// broadcaster: 'pusher',+// cluster: window.location.hostname,+// key: import.meta.env.VITE_PUSHER_APP_KEY ?? 'coolify',+// wsHost: window.location.hostname,+// wsPort: 6001,+// wssPort: 6001,+// forceTLS: false,+// encrypted: true,+// disableStats: false,+// enableLogging: true,+// enabledTransports: ['ws', 'wss'],+// });Alpine.plugin(Toaster);diff --git a/resources/views/components/applications/navbar.blade.php b/resources/views/components/applications/navbar.blade.phpindex 98ddb8d5f4..457e90604e 100644--- a/resources/views/components/applications/navbar.blade.php+++ b/resources/views/components/applications/navbar.blade.php@@ -45,18 +45,18 @@</svg>Restart</button>- @if(isDev())- <button title="Restart without rebuilding" wire:click='restartNew'- class="flex items-center gap-2 cursor-pointer hover:text-white text-neutral-400">- <svg class="w-5 h-5 text-warning" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">- <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"- stroke-width="2">- <path d="M19.933 13.041a8 8 0 1 1-9.925-8.788c3.899-1 7.935 1.007 9.425 4.747" />- <path d="M20 4v5h-5" />- </g>- </svg>- Restart (new)- </button>+ @if (isDev())+ <button title="Restart without rebuilding" wire:click='restartNew'+ class="flex items-center gap-2 cursor-pointer hover:text-white text-neutral-400">+ <svg class="w-5 h-5 text-warning" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">+ <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"+ stroke-width="2">+ <path d="M19.933 13.041a8 8 0 1 1-9.925-8.788c3.899-1 7.935 1.007 9.425 4.747" />+ <path d="M20 4v5h-5" />+ </g>+ </svg>+ Restart (new)+ </button>@endif@endif<button wire:click='stop' class="flex items-center gap-2 cursor-pointer hover:text-white text-neutral-400">diff --git a/resources/views/livewire/project/application/heading.blade.php b/resources/views/livewire/project/application/heading.blade.phpindex 3a197e8105..ca76d38e81 100644--- a/resources/views/livewire/project/application/heading.blade.php+++ b/resources/views/livewire/project/application/heading.blade.php@@ -1,4 +1,4 @@-<nav x-init="$wire.check_status">+<nav x-init="$wire.check_status" wire:poll.10000ms="check_status"><x-resources.breadcrumbs :resource="$application" :parameters="$parameters" /><x-applications.navbar :application="$application" :parameters="$parameters" /></nav>diff --git a/routes/web.php b/routes/web.phpindex 8db90b16c4..1e276e738c 100644--- a/routes/web.php+++ b/routes/web.php@@ -1,6 +1,5 @@<?php-use App\Events\ApplicationDeploymentFinished;use App\Http\Controllers\ApplicationController;use App\Http\Controllers\Controller;use App\Http\Controllers\DatabaseController;@@ -40,11 +39,6 @@ use Laravel\Fortify\Contracts\FailedPasswordResetLinkRequestResponse;use Laravel\Fortify\Contracts\SuccessfulPasswordResetLinkRequestResponse;use Laravel\Fortify\Fortify;-Route::get('/fire', function () {- ApplicationDeploymentFinished::dispatch('kk0gg0s', 'stopped');-- return 'Event has been sent!';-});if (isDev()) {Route::get('/dev/compose', Compose::class)->name('dev.compose');}diff --git a/scripts/upgrade.sh b/scripts/upgrade.shindex f3a8a18a14..02dcfe6ad1 100644--- a/scripts/upgrade.sh+++ b/scripts/upgrade.sh@@ -1,7 +1,7 @@#!/bin/bash## Do not modify this file. You will lost the ability to autoupdate!-VERSION="1.0.3"+VERSION="1.0.4"CDN="https://cdn.coollabs.io/coolify"curl -fsSL $CDN/docker-compose.yml -o /data/coolify/source/docker-compose.yml@@ -9,7 +9,29 @@ curl -fsSL $CDN/docker-compose.prod.yml -o /data/coolify/source/docker-compose.pcurl -fsSL $CDN/.env.production -o /data/coolify/source/.env.production# Merge .env and .env.production. New values will be added to .env-sort -u -t '=' -k 1,1 /data/coolify/source/.env /data/coolify/source/.env.production | sed '/^$/d' > /data/coolify/source/.env.temp && mv /data/coolify/source/.env.temp /data/coolify/source/.env+sort -u -t '=' -k 1,1 /data/coolify/source/.env /data/coolify/source/.env.production | sed '/^$/d' >/data/coolify/source/.env.temp && mv /data/coolify/source/.env.temp /data/coolify/source/.env++# Check if PUSHER_APP_ID or PUSHER_APP_KEY or PUSHER_APP_SECRET is empty in /data/coolify/source/.env+# if grep -q "PUSHER_APP_ID=$" /data/coolify/source/.env; then+# echo "PUSHER_APP_ID is not set in .env"+# sed -i "s|PUSHER_APP_ID=.*|PUSHER_APP_ID=$(openssl rand -hex 32)|g" /data/coolify/source/.env+# else+# echo "PUSHER_APP_ID is set in .env"+# fi++# if grep -q "PUSHER_APP_KEY=$" /data/coolify/source/.env; then+# echo "PUSHER_APP_KEY is not set in .env"+# sed -i "s|PUSHER_APP_KEY=.*|PUSHER_APP_KEY=$(openssl rand -hex 32)|g" /data/coolify/source/.env+# else+# echo "PUSHER_APP_KEY is set in .env"+# fi++# if grep -q "PUSHER_APP_SECRET=$" /data/coolify/source/.env; then+# echo "PUSHER_APP_SECRET is not set in .env"+# sed -i "s|PUSHER_APP_SECRET=.*|PUSHER_APP_SECRET=$(openssl rand -hex 32)|g" /data/coolify/source/.env+# else+# echo "PUSHER_APP_SECRET is set in .env"+# fi# Make sure coolify network existsdocker network create --attachable coolify 2>/dev/null