diff --git a/app/Http/Livewire/Project/Shared/Webhooks.php b/app/Http/Livewire/Project/Shared/Webhooks.php new file mode 100644 index 000000000..a943347b1 --- /dev/null +++ b/app/Http/Livewire/Project/Shared/Webhooks.php @@ -0,0 +1,19 @@ +deploywebhook = generateDeployWebhook($this->resource); + } + public function render() + { + return view('livewire.project.shared.webhooks'); + } +} diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index 3348ce1ae..8e8b2ec3e 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.php index a966c56d4..933c89ecd 100644 --- a/resources/views/livewire/project/service/index.blade.php +++ b/resources/views/livewire/project/service/index.blade.php @@ -4,16 +4,25 @@
Documentation - Service Stack - Storages + Service Stack + Storages + Webhooks + Environment Variables - Danger Zone + Danger Zone
@@ -100,7 +109,9 @@ @foreach ($databases as $database) @endforeach - +
+
+
diff --git a/resources/views/livewire/project/shared/webhooks.blade.php b/resources/views/livewire/project/shared/webhooks.blade.php new file mode 100644 index 000000000..ba0461bdb --- /dev/null +++ b/resources/views/livewire/project/shared/webhooks.blade.php @@ -0,0 +1,10 @@ +
+
+

Webhooks

+ +
+
+ +
+
diff --git a/resources/views/project/application/configuration.blade.php b/resources/views/project/application/configuration.blade.php index 78f0a3061..d4766362f 100644 --- a/resources/views/project/application/configuration.blade.php +++ b/resources/views/project/application/configuration.blade.php @@ -19,6 +19,9 @@ Storages + Webhooks + @if ($application->git_based()) Preview @@ -57,6 +60,9 @@
+
+ +
diff --git a/resources/views/project/database/configuration.blade.php b/resources/views/project/database/configuration.blade.php index 3ad6e6df5..c65ef4301 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
+ Webhooks +
+
+ +
diff --git a/routes/api.php b/routes/api.php index 53ae1bd09..ef233e37e 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.yaml index a30f4c4e5..81ac5fe3d 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.yaml new file mode 100644 index 000000000..25955583d --- /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.yaml new file mode 100644 index 000000000..c8613cf03 --- /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/.n8n diff --git a/templates/service-templates.json b/templates/service-templates.json index d5af2b37c..4c06f76c0 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": "c2VydmljZXM6CiAgbjhuOgogICAgaW1hZ2U6IGRvY2tlci5uOG4uaW8vbjhuaW8vbjhuCiAgICBlbnZpcm9ubWVudDoKICAgICAgLSBTRVJWSUNFX0ZRRE5fTjhOCiAgICAgIC0gJ044Tl9FRElUT1JfQkFTRV9VUkw9JHtTRVJWSUNFX0ZRRE5fTjhOfScKICAgICAgLSAnTjhOX0hPU1Q9JHtTRVJWSUNFX0ZRRE5fTjhOfScKICAgICAgLSAnR0VORVJJQ19USU1FWk9ORT0iRXVyb3BlL0JlcmxpbiInCiAgICAgIC0gJ1RaPSJFdXJvcGUvQmVybGluIicKICAgICAgLSBEQl9UWVBFPXBvc3RncmVzZGIKICAgICAgLSAnREJfUE9TVEdSRVNEQl9EQVRBQkFTRT0ke1BPU1RHUkVTX0RCOi11bWFtaX0nCiAgICAgIC0gREJfUE9TVEdSRVNEQl9IT1NUPXBvc3RncmVzcWwKICAgICAgLSBEQl9QT1NUR1JFU0RCX1BPUlQ9NTQzMgogICAgICAtIERCX1BPU1RHUkVTREJfVVNFUj0kU0VSVklDRV9VU0VSX1BPU1RHUkVTCiAgICAgIC0gREJfUE9TVEdSRVNEQl9TQ0hFTUE9cHVibGljCiAgICAgIC0gREJfUE9TVEdSRVNEQl9QQVNTV09SRD0kU0VSVklDRV9QQVNTV09SRF9QT1NUR1JFUwogICAgdm9sdW1lczoKICAgICAgLSAnbjhuLWRhdGE6L2hvbWUvbm9kZS8ubjhuJwogICAgZGVwZW5kc19vbjoKICAgICAgLSBwb3N0Z3Jlc3FsCiAgcG9zdGdyZXNxbDoKICAgIGltYWdlOiAncG9zdGdyZXM6MTUtYWxwaW5lJwogICAgdm9sdW1lczoKICAgICAgLSAncG9zdGdyZXNxbC1kYXRhOi92YXIvbGliL3Bvc3RncmVzcWwvZGF0YScKICAgIGVudmlyb25tZW50OgogICAgICAtIFBPU1RHUkVTX1VTRVI9JFNFUlZJQ0VfVVNFUl9QT1NUR1JFUwogICAgICAtIFBPU1RHUkVTX1BBU1NXT1JEPSRTRVJWSUNFX1BBU1NXT1JEX1BPU1RHUkVTCiAgICAgIC0gJ1BPU1RHUkVTX0RCPSR7UE9TVEdSRVNfREI6LXVtYW1pfScKICAgIGhlYWx0aGNoZWNrOgogICAgICB0ZXN0OgogICAgICAgIC0gQ01ELVNIRUxMCiAgICAgICAgLSAncGdfaXNyZWFkeSAtVSAkJHtQT1NUR1JFU19VU0VSfSAtZCAkJHtQT1NUR1JFU19EQn0nCiAgICAgIGludGVydmFsOiA1cwogICAgICB0aW1lb3V0OiA1cwogICAgICByZXRyaWVzOiAxMAo=", + "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.",