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
feat: show webhook on ui feat: n8n service
Andras Bacsai379f4b9dff13
diff --git a/app/Http/Livewire/Project/Shared/Webhooks.php b/app/Http/Livewire/Project/Shared/Webhooks.phpnew file mode 100644index 0000000000..a943347b17--- /dev/null+++ b/app/Http/Livewire/Project/Shared/Webhooks.php@@ -0,0 +1,19 @@+<?php++namespace App\Http\Livewire\Project\Shared;++use Livewire\Component;++class Webhooks extends Component+{+ public $resource;+ public ?string $deploywebhook = null;+ public function mount()+ {+ $this->deploywebhook = generateDeployWebhook($this->resource);+ }+ public function render()+ {+ return view('livewire.project.shared.webhooks');+ }+}diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.phpindex 3348ce1ae9..8e8b2ec3ee 100644--- a/bootstrap/helpers/shared.php+++ b/bootstrap/helpers/shared.php@@ -4,7 +4,9 @@ use App\Models\Application;use App\Models\InstanceSettings;use App\Models\Server;use App\Models\Service;+use App\Models\StandaloneMariadb;use App\Models\StandaloneMongodb;+use App\Models\StandaloneMysql;use App\Models\StandalonePostgresql;use App\Models\StandaloneRedis;use App\Models\Team;@@ -484,5 +486,18 @@ function queryResourcesByUuid(string $uuid)if ($redis) return $redis;$mongodb = StandaloneMongodb::whereUuid($uuid)->first();if ($mongodb) return $mongodb;+ $mysql = StandaloneMysql::whereUuid($uuid)->first();+ if ($mysql) return $mysql;+ $mariadb = StandaloneMariadb::whereUuid($uuid)->first();+ if ($mariadb) return $mariadb;return $resource;}++function generateDeployWebhook($resource) {+ $baseUrl = base_url();+ $api = Url::fromString($baseUrl) . '/api/v1';+ $endpoint = '/deploy';+ $uuid = data_get($resource, 'uuid');+ $url = $api . $endpoint . "?uuid=$uuid&force=false";+ return $url;+}diff --git a/resources/views/livewire/project/service/index.blade.php b/resources/views/livewire/project/service/index.blade.phpindex a966c56d4d..933c89ecd4 100644--- a/resources/views/livewire/project/service/index.blade.php+++ b/resources/views/livewire/project/service/index.blade.php@@ -4,16 +4,25 @@<div class="flex h-full pt-6"><div class="flex flex-col items-start gap-4 min-w-fit"><a target="_blank" href="{{ $service->documentation() }}">Documentation <x-external-link /></a>- <a :class="activeTab === 'service-stack' && 'text-white'" @click.prevent="activeTab = 'service-stack';- window.location.hash = 'service-stack'" href="#">Service Stack</a>- <a :class="activeTab === 'storages' && 'text-white'" @click.prevent="activeTab = 'storages';- window.location.hash = 'storages'" href="#">Storages</a>+ <a :class="activeTab === 'service-stack' && 'text-white'"+ @click.prevent="activeTab = 'service-stack';+ window.location.hash = 'service-stack'"+ href="#">Service Stack</a>+ <a :class="activeTab === 'storages' && 'text-white'"+ @click.prevent="activeTab = 'storages';+ window.location.hash = 'storages'"+ href="#">Storages</a>+ <a :class="activeTab === 'webhooks' && 'text-white'"+ @click.prevent="activeTab = 'webhooks'; window.location.hash = 'webhooks'" href="#">Webhooks+ </a><a :class="activeTab === 'environment-variables' && 'text-white'"@click.prevent="activeTab = 'environment-variables'; window.location.hash = 'environment-variables'"href="#">EnvironmentVariables</a>- <a :class="activeTab === 'danger' && 'text-white'" @click.prevent="activeTab = 'danger';- window.location.hash = 'danger'" href="#">Danger Zone+ <a :class="activeTab === 'danger' && 'text-white'"+ @click.prevent="activeTab = 'danger';+ window.location.hash = 'danger'"+ href="#">Danger Zone</a></div><div class="w-full pl-8">@@ -100,7 +109,9 @@@foreach ($databases as $database)<livewire:project.service.storage wire:key="database-{{ $database->id }}" :resource="$database" />@endforeach-+ </div>+ <div x-cloak x-show="activeTab === 'webhooks'">+ <livewire:project.shared.webhooks :resource="$service" /></div><div x-cloak x-show="activeTab === 'environment-variables'"><div x-cloak x-show="activeTab === 'environment-variables'">diff --git a/resources/views/livewire/project/shared/webhooks.blade.php b/resources/views/livewire/project/shared/webhooks.blade.phpnew file mode 100644index 0000000000..ba0461bdbc--- /dev/null+++ b/resources/views/livewire/project/shared/webhooks.blade.php@@ -0,0 +1,10 @@+<div>+ <div class="flex items-center gap-2">+ <h2>Webhooks</h2>+ <x-helper+ helper="For more details goto our <a class='text-white underline' href='https://coolify.io/docs/api-endpoints' target='_blank'>docs</a>." />+ </div>+ <div>+ <x-forms.input readonly label="Deploy Webhook (auth required)" id="deploywebhook"></x-forms.input>+ </div>+</div>diff --git a/resources/views/project/application/configuration.blade.php b/resources/views/project/application/configuration.blade.phpindex 78f0a3061e..d4766362fd 100644--- a/resources/views/project/application/configuration.blade.php+++ b/resources/views/project/application/configuration.blade.php@@ -19,6 +19,9 @@<a :class="activeTab === 'storages' && 'text-white'"@click.prevent="activeTab = 'storages'; window.location.hash = 'storages'" href="#">Storages</a>+ <a :class="activeTab === 'webhooks' && 'text-white'"+ @click.prevent="activeTab = 'webhooks'; window.location.hash = 'webhooks'" href="#">Webhooks+ </a>@if ($application->git_based())<a :class="activeTab === 'previews' && 'text-white'"@click.prevent="activeTab = 'previews'; window.location.hash = 'previews'" href="#">Preview@@ -57,6 +60,9 @@<div x-cloak x-show="activeTab === 'storages'"><livewire:project.service.storage :resource="$application" /></div>+ <div x-cloak x-show="activeTab === 'webhooks'">+ <livewire:project.shared.webhooks :resource="$application" />+ </div><div x-cloak x-show="activeTab === 'previews'"><livewire:project.application.previews :application="$application" /></div>diff --git a/resources/views/project/database/configuration.blade.php b/resources/views/project/database/configuration.blade.phpindex 3ad6e6df58..c65ef43018 100644--- a/resources/views/project/database/configuration.blade.php+++ b/resources/views/project/database/configuration.blade.php@@ -31,6 +31,9 @@window.location.hash = 'storages'"href="#">Storages</a>+ <a :class="activeTab === 'webhooks' && 'text-white'"+ @click.prevent="activeTab = 'webhooks'; window.location.hash = 'webhooks'" href="#">Webhooks+ </a><a :class="activeTab === 'resource-limits' && 'text-white'"@click.prevent="activeTab = 'resource-limits';window.location.hash = 'resource-limits'"@@ -65,6 +68,9 @@<div x-cloak x-show="activeTab === 'storages'"><livewire:project.service.storage :resource="$database" /></div>+ <div x-cloak x-show="activeTab === 'webhooks'">+ <livewire:project.shared.webhooks :resource="$database" />+ </div><div x-cloak x-show="activeTab === 'resource-limits'"><livewire:project.shared.resource-limits :resource="$database" /></div>diff --git a/routes/api.php b/routes/api.phpindex 53ae1bd097..ef233e37eb 100644--- a/routes/api.php+++ b/routes/api.php@@ -97,7 +97,7 @@ Route::group([return response()->json(['message' => 'Database started.'], 200);} else if ($type === 'App\Models\Service') {StartService::run($resource);- return response()->json(['message' => 'Service started.'], 200);+ return response()->json(['message' => 'Service started. It could take a while, be patient.'], 200);}}return response()->json(['error' => "No resource found with {$uuid}."], 404);diff --git a/templates/compose/appsmith.yaml b/templates/compose/appsmith.yamlindex a30f4c4e51..81ac5fe3d8 100644--- a/templates/compose/appsmith.yaml+++ b/templates/compose/appsmith.yaml@@ -14,3 +14,5 @@ services:- APPSMITH_SMART_LOOK_ID=volumes:- stacks-data:/appsmith-stacks+ healthcheck:+ test: ["NONE"]diff --git a/templates/compose/n8n-with-postgresql.yaml b/templates/compose/n8n-with-postgresql.yamlnew file mode 100644index 0000000000..25955583da--- /dev/null+++ b/templates/compose/n8n-with-postgresql.yaml@@ -0,0 +1,38 @@+# documentation: https://docs.n8n.io/hosting/+# slogan: n8n is an extendable workflow automation tool which enables you to connect anything to everything via its open, fair-code model.+# tags: n8n,workflow,automation,open,source,low,code++services:+ n8n:+ image: docker.n8n.io/n8nio/n8n+ environment:+ - SERVICE_FQDN_N8N+ - N8N_EDITOR_BASE_URL=${SERVICE_FQDN_N8N}+ - N8N_HOST=${SERVICE_FQDN_N8N}+ - GENERIC_TIMEZONE="Europe/Berlin"+ - TZ="Europe/Berlin"+ - DB_TYPE=postgresdb+ - DB_POSTGRESDB_DATABASE=${POSTGRES_DB:-umami}+ - DB_POSTGRESDB_HOST=postgresql+ - DB_POSTGRESDB_PORT=5432+ - DB_POSTGRESDB_USER=$SERVICE_USER_POSTGRES+ - DB_POSTGRESDB_SCHEMA=public+ - DB_POSTGRESDB_PASSWORD=$SERVICE_PASSWORD_POSTGRES+ volumes:+ - n8n-data:/home/node/.n8n+ depends_on:+ - postgresql+ postgresql:+ image: postgres:15-alpine+ volumes:+ - postgresql-data:/var/lib/postgresql/data+ environment:+ - POSTGRES_USER=$SERVICE_USER_POSTGRES+ - POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES+ - POSTGRES_DB=${POSTGRES_DB:-umami}+ healthcheck:+ test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]+ interval: 5s+ timeout: 5s+ retries: 10+diff --git a/templates/compose/n8n.yaml b/templates/compose/n8n.yamlnew file mode 100644index 0000000000..c8613cf030--- /dev/null+++ b/templates/compose/n8n.yaml@@ -0,0 +1,15 @@+# documentation: https://docs.n8n.io/hosting/+# slogan: n8n is an extendable workflow automation tool which enables you to connect anything to everything via its open, fair-code model.+# tags: n8n,workflow,automation,open,source,low,code++services:+ n8n:+ image: docker.n8n.io/n8nio/n8n+ environment:+ - SERVICE_FQDN_N8N+ - N8N_EDITOR_BASE_URL=${SERVICE_FQDN_N8N}+ - N8N_HOST=${SERVICE_FQDN_N8N}+ - GENERIC_TIMEZONE="Europe/Berlin"+ - TZ="Europe/Berlin"+ volumes:+ - n8n-data:/home/node/.n8ndiff --git a/templates/service-templates.json b/templates/service-templates.jsonindex d5af2b37c7..4c06f76c04 100644--- a/templates/service-templates.json+++ b/templates/service-templates.json@@ -2,7 +2,7 @@"appsmith": {"documentation": "https:\/\/docs.appsmith.com","slogan": "Appsmith is an open-source, self-hosted application development platform that enables you to build powerful web applications with ease.",- "compose": "c2VydmljZXM6CiAgYXBwc21pdGg6CiAgICBpbWFnZTogJ2luZGV4LmRvY2tlci5pby9hcHBzbWl0aC9hcHBzbWl0aC1jZTpsYXRlc3QnCiAgICBlbnZpcm9ubWVudDoKICAgICAgLSBTRVJWSUNFX0ZRRE4KICAgICAgLSBBUFBTTUlUSF9NQUlMX0VOQUJMRUQ9ZmFsc2UKICAgICAgLSBBUFBTTUlUSF9ESVNBQkxFX1RFTEVNRVRSWT10cnVlCiAgICAgIC0gQVBQU01JVEhfRElTQUJMRV9JTlRFUkNPTT10cnVlCiAgICAgIC0gQVBQU01JVEhfU0VOVFJZX0RTTj0KICAgICAgLSBBUFBTTUlUSF9TTUFSVF9MT09LX0lEPQogICAgdm9sdW1lczoKICAgICAgLSAnc3RhY2tzLWRhdGE6L2FwcHNtaXRoLXN0YWNrcycK",+ "compose": "c2VydmljZXM6CiAgYXBwc21pdGg6CiAgICBpbWFnZTogJ2luZGV4LmRvY2tlci5pby9hcHBzbWl0aC9hcHBzbWl0aC1jZTpsYXRlc3QnCiAgICBlbnZpcm9ubWVudDoKICAgICAgLSBTRVJWSUNFX0ZRRE4KICAgICAgLSBBUFBTTUlUSF9NQUlMX0VOQUJMRUQ9ZmFsc2UKICAgICAgLSBBUFBTTUlUSF9ESVNBQkxFX1RFTEVNRVRSWT10cnVlCiAgICAgIC0gQVBQU01JVEhfRElTQUJMRV9JTlRFUkNPTT10cnVlCiAgICAgIC0gQVBQU01JVEhfU0VOVFJZX0RTTj0KICAgICAgLSBBUFBTTUlUSF9TTUFSVF9MT09LX0lEPQogICAgdm9sdW1lczoKICAgICAgLSAnc3RhY2tzLWRhdGE6L2FwcHNtaXRoLXN0YWNrcycKICAgIGhlYWx0aGNoZWNrOgogICAgICB0ZXN0OgogICAgICAgIC0gTk9ORQo=","tags": ["lowcode","nocode",@@ -110,6 +110,34 @@"api"]},+ "n8n-with-postgresql": {+ "documentation": "https:\/\/docs.n8n.io\/hosting\/",+ "slogan": "n8n is an extendable workflow automation tool which enables you to connect anything to everything via its open, fair-code model.",+ "compose": "c2VydmljZXM6CiAgbjhuOgogICAgaW1hZ2U6IGRvY2tlci5uOG4uaW8vbjhuaW8vbjhuCiAgICBlbnZpcm9ubWVudDoKICAgICAgLSBTRVJWSUNFX0ZRRE5fTjhOCiA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oZWNrOgogICAgICB0ZXN0OgogICAgICAgIC0gQ01ELVNIRUxMCiAgICAgICAgLSAncGdfaXNyZWFkeSAtVSAkJHtQT1NUR1JFU19VU0VSfSAtZCAkJHtQT1NUR1JFU19EQn0nCiAgICAgIGludGVydmFsOiA1cwogICAgICB0aW1lb3V0OiA1cwogICAgICByZXRyaWVzOiAxMAo=",+ "tags": [+ "n8n",+ "workflow",+ "automation",+ "open",+ "source",+ "low",+ "code"+ ]+ },+ "n8n": {+ "documentation": "https:\/\/docs.n8n.io\/hosting\/",+ "slogan": "n8n is an extendable workflow automation tool which enables you to connect anything to everything via its open, fair-code model.",+ "compose": "c2VydmljZXM6CiAgbjhuOgogICAgaW1hZ2U6IGRvY2tlci5uOG4uaW8vbjhuaW8vbjhuCiAgICBlbnZpcm9ubWVudDoKICAgICAgLSBTRVJWSUNFX0ZRRE5fTjhOCiAgICAgIC0gJ044Tl9FRElUT1JfQkFTRV9VUkw9JHtTRVJWSUNFX0ZRRE5fTjhOfScKICAgICAgLSAnTjhOX0hPU1Q9JHtTRVJWSUNFX0ZRRE5fTjhOfScKICAgICAgLSAnR0VORVJJQ19USU1FWk9ORT0iRXVyb3BlL0JlcmxpbiInCiAgICAgIC0gJ1RaPSJFdXJvcGUvQmVybGluIicKICAgIHZvbHVtZXM6CiAgICAgIC0gJ244bi1kYXRhOi9ob21lL25vZGUvLm44bicK",+ "tags": [+ "n8n",+ "workflow",+ "automation",+ "open",+ "source",+ "low",+ "code"+ ]+ },"pairdrop": {"documentation": "https:\/\/github.com\/schlagmichdoch\/PairDrop\/blob\/master\/docs\/faq.md","slogan": "Pairdrop is a self-hosted file sharing and collaboration platform, offering secure file sharing and collaboration capabilities for efficient teamwork.",