Skip to content

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.

fix: service updates

Andras Bacsaie40f397cc74e
diff --git a/app/Http/Livewire/Project/Service/StackForm.php b/app/Http/Livewire/Project/Service/StackForm.php
index 2c1fa54955..30a3e73809 100644
--- a/app/Http/Livewire/Project/Service/StackForm.php
+++ b/app/Http/Livewire/Project/Service/StackForm.php
@@ -7,6 +7,7 @@ use Livewire\Component;
class StackForm extends Component
{
public $service;
+ public $isConfigurationRequired = false;
protected $listeners = ["saveCompose"];
protected $rules = [
'service.docker_compose_raw' => 'required',
@@ -14,8 +15,14 @@ class StackForm extends Component
'service.name' => 'required',
'service.description' => 'nullable',
];
+ public function mount () {
+ if ($this->service->applications->filter(fn($app) => str($app->image)->contains('minio/minio'))->count() > 0) {
+ $this->isConfigurationRequired = true;
+ }
+ }
public function saveCompose($raw)
{
+
$this->service->docker_compose_raw = $raw;
$this->submit();
}
diff --git a/app/Models/Service.php b/app/Models/Service.php
index a1fa4b4baa..14084f2829 100644
--- a/app/Models/Service.php
+++ b/app/Models/Service.php
@@ -453,15 +453,31 @@ class Service extends BaseModel
'service_id' => $this->id,
])->first();
if ($value->startsWith('SERVICE_')) {
- $command = $value->after('SERVICE_')->beforeLast('_');
- $forService = $value->afterLast('_');
- $generatedValue = null;
+ // Count _ in $value
+ $count = substr_count($value->value(), '_');
+ if ($count === 2) {
+ // SERVICE_FQDN_UMAMI
+ $command = $value->after('SERVICE_')->beforeLast('_');
+ $forService = $value->afterLast('_');
+ $generatedValue = null;
+ $port = null;
+ }
+ if ($count === 3) {
+ // SERVICE_FQDN_UMAMI_1000
+ $command = $value->after('SERVICE_')->before('_');
+ $forService = $value->after('SERVICE_')->after('_')->before('_');
+ $generatedValue = null;
+ $port = $value->afterLast('_');
+ }
if ($command->value() === 'FQDN' || $command->value() === 'URL') {
if (Str::lower($forService) === $serviceName) {
$fqdn = generateFqdn($this->server, $containerName);
} else {
$fqdn = generateFqdn($this->server, Str::lower($forService) . '-' . $this->uuid);
}
+ if ($port) {
+ $fqdn = "$fqdn:$port";
+ }
if ($foundEnv) {
$fqdn = data_get($foundEnv, 'value');
} else {
@@ -477,7 +493,7 @@ class Service extends BaseModel
]);
}
if (!$isDatabase) {
- if ($command->value() === 'FQDN') {
+ if ($command->value() === 'FQDN' && is_null($savedService->fqdn)) {
$savedService->fqdn = $fqdn;
$savedService->save();
}
diff --git a/bootstrap/helpers/services.php b/bootstrap/helpers/services.php
index 762b835633..b9a305a429 100644
--- a/bootstrap/helpers/services.php
+++ b/bootstrap/helpers/services.php
@@ -85,7 +85,6 @@ function getFilesystemVolumesFromServer(ServiceApplication|ServiceDatabase $oneS
} else {
$fileLocation = $path;
}
- ray($path,$fileLocation);
// Exists and is a file
$isFile = instant_remote_process(["test -f $fileLocation && echo OK || echo NOK"], $server);
// Exists and is a directory
@@ -127,6 +126,7 @@ function getFilesystemVolumesFromServer(ServiceApplication|ServiceDatabase $oneS
function updateCompose($resource)
{
try {
+ ray($resource);
$name = data_get($resource, 'name');
$dockerComposeRaw = data_get($resource, 'service.docker_compose_raw');
$dockerCompose = Yaml::parse($dockerComposeRaw);
@@ -135,19 +135,21 @@ function updateCompose($resource)
$image = data_get($resource, 'image');
data_set($dockerCompose, "services.{$name}.image", $image);
- // Update FQDN
- $variableName = "SERVICE_FQDN_" . Str::of($resource->name)->upper();
- $generatedEnv = EnvironmentVariable::where('service_id', $resource->service_id)->where('key', $variableName)->first();
- if ($generatedEnv) {
- $generatedEnv->value = $resource->fqdn;
- $generatedEnv->save();
- }
- $variableName = "SERVICE_URL_" . Str::of($resource->name)->upper();
- $generatedEnv = EnvironmentVariable::where('service_id', $resource->service_id)->where('key', $variableName)->first();
- if ($generatedEnv) {
- $url = Str::of($resource->fqdn)->after('://');
- $generatedEnv->value = $url;
- $generatedEnv->save();
+ if (!str($resource->fqdn)->contains(',')) {
+ // Update FQDN
+ $variableName = "SERVICE_FQDN_" . Str::of($resource->name)->upper();
+ $generatedEnv = EnvironmentVariable::where('service_id', $resource->service_id)->where('key', $variableName)->first();
+ if ($generatedEnv) {
+ $generatedEnv->value = $resource->fqdn;
+ $generatedEnv->save();
+ }
+ $variableName = "SERVICE_URL_" . Str::of($resource->name)->upper();
+ $generatedEnv = EnvironmentVariable::where('service_id', $resource->service_id)->where('key', $variableName)->first();
+ if ($generatedEnv) {
+ $url = Str::of($resource->fqdn)->after('://');
+ $generatedEnv->value = $url;
+ $generatedEnv->save();
+ }
}
$dockerComposeRaw = Yaml::dump($dockerCompose, 10, 2);
diff --git a/config/sentry.php b/config/sentry.php
index 3a9aa3df63..c889afb12a 100644
--- a/config/sentry.php
+++ b/config/sentry.php
@@ -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.122',
+ 'release' => '4.0.0-beta.123',
// When left empty or `null` the Laravel environment will be used
'environment' => config('app.env'),
diff --git a/config/version.php b/config/version.php
index 5a47704b86..f31b19ca00 100644
--- a/config/version.php
+++ b/config/version.php
@@ -1,3 +1,3 @@
<?php
-return '4.0.0-beta.122';
+return '4.0.0-beta.123';
diff --git a/resources/views/livewire/project/service/stack-form.blade.php b/resources/views/livewire/project/service/stack-form.blade.php
index 7225770c1f..ae1d72e064 100644
--- a/resources/views/livewire/project/service/stack-form.blade.php
+++ b/resources/views/livewire/project/service/stack-form.blade.php
@@ -9,8 +9,12 @@
File</x-forms.button>
</div>
<div class="flex gap-2">
- <x-forms.input id="service.name" required label="Service Name"
- placeholder="My super wordpress site" />
+ <x-forms.input id="service.name" required label="Service Name" placeholder="My super wordpress site" />
<x-forms.input id="service.description" label="Description" />
</div>
+ @if ($isConfigurationRequired)
+ <div class="text-warning">This service requires additional confiugration. Please check our <a
+ href="https://coolify.io/docs" class="text-white underline">documentation</a> for further information.
+ </div>
+ @endif
</form>
diff --git a/templates/compose/minio.yaml b/templates/compose/minio.yaml
index fb1e12710e..569172ca07 100644
--- a/templates/compose/minio.yaml
+++ b/templates/compose/minio.yaml
@@ -1,4 +1,3 @@
-# ignore: true
# documentation: https://docs.min.io/docs/minio-docker-quickstart-guide.html
# slogan: MinIO is a high performance object storage server compatible with Amazon S3 APIs.
# tags: object, storage, server, s3, api
@@ -8,12 +7,35 @@ services:
image: quay.io/minio/minio:latest
command: server /data --console-address ":9001"
environment:
- - SERVICE_FQDN_MINIO_9000
- - SERVICE_FQDN_CONSOLE_9001
- - MINIO_DOMAIN=$SERVICE_URL_MINIO_9000
- - MINIO_SERVER_URL=$SERVICE_FQDN_MINIO_9000
- - MINIO_BROWSER_REDIRECT_URL=$SERVICE_FQDN_CONSOLE_9001
+ - MINIO_SERVER_URL=$MINIO_SERVER_URL
+ - MINIO_BROWSER_REDIRECT_URL=$MINIO_BROWSER_REDIRECT_URL
- MINIO_ROOT_USER=$SERVICE_USER_MINIO
- MINIO_ROOT_PASSWORD=$SERVICE_PASSWORD_MINIO
volumes:
- minio-data:/data
+
+# services:
+# minio:
+# image: minio/minio
+# command: server /data --address ":9000" --console-address ":9001"
+# networks:
+# - coolify
+# environment:
+# - MINIO_SERVER_URL=http://minio.65.21.189.27.sslip.io
+# - MINIO_BROWSER_REDIRECT_URL=http://console.65.21.189.27.sslip.io
+# - MINIO_BROWSER=on
+# - MINIO_ROOT_USER=asd
+# - MINIO_ROOT_PASSWORD=asdasdasd
+# labels:
+# - "traefik.enable=true"
+# - "traefik.http.routers.minio-console.rule=Host(`console.65.21.189.27.sslip.io`)"
+# - "traefik.http.routers.minio-console.entrypoints=http"
+# - "traefik.http.routers.minio-console.service=minio-console"
+# - "traefik.http.services.minio-console.loadbalancer.server.port=9001"
+# - "traefik.http.routers.minio.rule=Host(`minio.65.21.189.27.sslip.io`)"
+# - "traefik.http.routers.minio.entrypoints=http"
+# - "traefik.http.routers.minio.service=minio"
+# - "traefik.http.services.minio.loadbalancer.server.port=9000"
+# networks:
+# coolify:
+# external: true
diff --git a/templates/service-templates.json b/templates/service-templates.json
index 13b79ed8ef..34bf517870 100644
--- a/templates/service-templates.json
+++ b/templates/service-templates.json
@@ -300,6 +300,18 @@
"playlist"
]
},
+ "minio": {
+ "documentation": "https:\/\/docs.min.io\/docs\/minio-docker-quickstart-guide.html",
+ "slogan": "MinIO is a high performance object storage server compatible with Amazon S3 APIs.",
+ "compose": "c2VydmljZXM6CiAgbWluaW86CiAgICBpbWFnZTogJ3F1YXkuaW8vbWluaW8vbWluaW86bGF0ZXN0JwogICAgY29tbWFuZDogJ3NlcnZlciAvZGF0YSAtLWNvbnNvbGUtYWRkcmVzcyAiOjkwMDEiJwogICAgZW52aXJvbm1lbnQ6CiAgICAgIC0gTUlOSU9fU0VSVkVSX1VSTD0kTUlOSU9fU0VSVkVSX1VSTAogICAgICAtIE1JTklPX0JST1dTRVJfUkVESVJFQ1RfVVJMPSRNSU5JT19CUk9XU0VSX1JFRElSRUNUX1VSTAogICAgICAtIE1JTklPX1JPT1RfVVNFUj0kU0VSVklDRV9VU0VSX01JTklPCiAgICAgIC0gTUlOSU9fUk9PVF9QQVNTV09SRD0kU0VSVklDRV9QQVNTV09SRF9NSU5JTwogICAgdm9sdW1lczoKICAgICAgLSAnbWluaW8tZGF0YTovZGF0YScK",
+ "tags": [
+ "object",
+ "storage",
+ "server",
+ "s3",
+ "api"
+ ]
+ },
"moodle": {
"documentation": "https:\/\/moodle.org",
"slogan": "Moodle is the world\u2019s most customisable and trusted eLearning solution that empowers educators to improve our world.",
diff --git a/versions.json b/versions.json
index 21fa4227d8..c62fd27f5b 100644
--- a/versions.json
+++ b/versions.json
@@ -4,7 +4,7 @@
"version": "3.12.36"
},
"v4": {
- "version": "4.0.0-beta.122"
+ "version": "4.0.0-beta.123"
}
}
}