diff --git a/app/Http/Livewire/Project/Application/General.php b/app/Http/Livewire/Project/Application/General.php
index 6281f45dd..b9d65f504 100644
--- a/app/Http/Livewire/Project/Application/General.php
+++ b/app/Http/Livewire/Project/Application/General.php
@@ -127,7 +127,7 @@ class General extends Component
}
if (data_get($this->application, 'dockerfile')) {
$port = get_port_from_dockerfile($this->application->dockerfile);
- if ($port) {
+ if ($port && !$this->application->ports_exposes) {
$this->application->ports_exposes = $port;
}
}
diff --git a/app/Http/Livewire/Project/Service/Navbar.php b/app/Http/Livewire/Project/Service/Navbar.php
index e4980696c..3f7679c56 100644
--- a/app/Http/Livewire/Project/Service/Navbar.php
+++ b/app/Http/Livewire/Project/Service/Navbar.php
@@ -21,7 +21,6 @@ class Navbar extends Component
}
public function serviceStatusUpdated()
{
- ray('serviceStatusUpdated');
$this->check_status();
}
public function check_status()
diff --git a/app/Http/Livewire/Project/Shared/GetLogs.php b/app/Http/Livewire/Project/Shared/GetLogs.php
new file mode 100644
index 000000000..cd0ee98fd
--- /dev/null
+++ b/app/Http/Livewire/Project/Shared/GetLogs.php
@@ -0,0 +1,40 @@
+outputs .= $output;
+ }
+ public function instantSave()
+ {
+ }
+ public function getLogs($refresh = false)
+ {
+ if ($this->container) {
+ $sshCommand = generateSshCommand($this->server, "docker logs -n {$this->numberOfLines} -t {$this->container}");
+ if ($refresh) {
+ $this->outputs = '';
+ }
+ Process::run($sshCommand, function (string $type, string $output) {
+ $this->doSomethingWithThisChunkOfOutput($output);
+ });
+ }
+ }
+ public function render()
+ {
+ return view('livewire.project.shared.get-logs');
+ }
+}
diff --git a/app/Http/Livewire/Project/Shared/Logs.php b/app/Http/Livewire/Project/Shared/Logs.php
new file mode 100644
index 000000000..69848a7c5
--- /dev/null
+++ b/app/Http/Livewire/Project/Shared/Logs.php
@@ -0,0 +1,53 @@
+parameters = get_route_parameters();
+ $this->query = request()->query();
+ if (data_get($this->parameters, 'application_uuid')) {
+ $this->type = 'application';
+ $this->resource = Application::where('uuid', $this->parameters['application_uuid'])->firstOrFail();
+ $this->status = $this->resource->status;
+ $this->server = $this->resource->destination->server;
+ $containers = getCurrentApplicationContainerStatus($this->server, $this->resource->id);
+ if ($containers->count() > 0) {
+ $this->container = data_get($containers[0], 'Names');
+ }
+ } else if (data_get($this->parameters, 'database_uuid')) {
+ $this->type = 'database';
+ $this->resource = StandalonePostgresql::where('uuid', $this->parameters['database_uuid'])->firstOrFail();
+ $this->status = $this->resource->status;
+ $this->server = $this->resource->destination->server;
+ $this->container = $this->resource->uuid;
+ } else if (data_get($this->parameters, 'service_uuid')) {
+ $this->type = 'service';
+ $this->resource = Service::where('uuid', $this->parameters['service_uuid'])->firstOrFail();
+ $this->status = $this->resource->status;
+ $this->server = $this->resource->server;
+ $this->container = data_get($this->parameters, 'service_name') . '-' . $this->resource->uuid;
+ }
+ }
+
+ public function render()
+ {
+ return view('livewire.project.shared.logs');
+ }
+}
diff --git a/app/Http/Livewire/Project/Shared/Storages/Add.php b/app/Http/Livewire/Project/Shared/Storages/Add.php
index e7831f1cb..1edfe03a4 100644
--- a/app/Http/Livewire/Project/Shared/Storages/Add.php
+++ b/app/Http/Livewire/Project/Shared/Storages/Add.php
@@ -6,6 +6,7 @@ use Livewire\Component;
class Add extends Component
{
+ public $uuid;
public $parameters;
public string $name;
public string $mount_path;
@@ -31,8 +32,9 @@ class Add extends Component
public function submit()
{
$this->validate();
+ $name = $this->uuid . '-' . $this->name;
$this->emitUp('submit', [
- 'name' => $this->name,
+ 'name' => $name,
'mount_path' => $this->mount_path,
'host_path' => $this->host_path,
]);
diff --git a/app/Http/Livewire/Project/Shared/Storages/Show.php b/app/Http/Livewire/Project/Shared/Storages/Show.php
index 46dd84aff..84593aef3 100644
--- a/app/Http/Livewire/Project/Shared/Storages/Show.php
+++ b/app/Http/Livewire/Project/Shared/Storages/Show.php
@@ -11,7 +11,6 @@ class Show extends Component
public LocalPersistentVolume $storage;
public bool $isReadOnly = false;
public ?string $modalId = null;
- public ?string $realName = null;
protected $rules = [
'storage.name' => 'required|string',
@@ -26,11 +25,6 @@ class Show extends Component
public function mount()
{
- if ($this->storage->resource_type === 'App\Models\ServiceApplication' || $this->storage->resource_type === 'App\Models\ServiceDatabase') {
- $this->realName = "{$this->storage->service->service->uuid}_{$this->storage->name}";
- } else {
- $this->realName = $this->storage->name;
- }
$this->modalId = new Cuid2(7);
}
diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php
index f9ff54fd0..0726d66e5 100644
--- a/app/Jobs/ApplicationDeploymentJob.php
+++ b/app/Jobs/ApplicationDeploymentJob.php
@@ -379,9 +379,6 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted
private function prepare_builder_image()
{
$pull = "--pull=always";
- if (isDev()) {
- $pull = "--pull=never";
- }
$helperImage = config('coolify.helper_image');
$runCommand = "docker run {$pull} -d --network {$this->destination->network} -v /:/host --name {$this->deployment_uuid} --rm -v /var/run/docker.sock:/var/run/docker.sock {$helperImage}";
diff --git a/app/Models/Service.php b/app/Models/Service.php
index 883a2a784..05be5fef4 100644
--- a/app/Models/Service.php
+++ b/app/Models/Service.php
@@ -248,7 +248,7 @@ class Service extends BaseModel
// Collect/create/update volumes
if ($serviceVolumes->count() > 0) {
- foreach ($serviceVolumes as $volume) {
+ $serviceVolumes = $serviceVolumes->map(function ($volume) use ($savedService, $topLevelVolumes, $isNew) {
$type = null;
$source = null;
$target = null;
@@ -276,10 +276,10 @@ class Service extends BaseModel
}
if ($type->value() === 'bind') {
if ($source->value() === "/var/run/docker.sock") {
- continue;
+ return $volume;
}
if ($source->value() === '/tmp' || $source->value() === '/tmp/') {
- continue;
+ return $volume;
}
LocalFileVolume::updateOrCreate(
[
@@ -297,7 +297,21 @@ class Service extends BaseModel
]
);
} else if ($type->value() === 'volume') {
- $topLevelVolumes->put($source->value(), null);
+ $slug = Str::slug($source, '-');
+ if ($isNew) {
+ $name = "{$savedService->service->uuid}-{$slug}";
+ } else {
+ $name = "{$savedService->service->uuid}_{$slug}";
+ }
+ if (is_string($volume)) {
+ $source = Str::of($volume)->before(':');
+ $target = Str::of($volume)->after(':')->beforeLast(':');
+ $source = $name;
+ $volume = "$source:$target";
+ } else if(is_array($volume)) {
+ data_set($volume, 'source', $name);
+ }
+ $topLevelVolumes->put($name, null);
LocalPersistentVolume::updateOrCreate(
[
'mount_path' => $target,
@@ -305,7 +319,7 @@ class Service extends BaseModel
'resource_type' => get_class($savedService)
],
[
- 'name' => Str::slug($source, '-'),
+ 'name' => $name,
'mount_path' => $target,
'resource_id' => $savedService->id,
'resource_type' => get_class($savedService)
@@ -313,7 +327,9 @@ class Service extends BaseModel
);
}
$savedService->getFilesFromServer();
- }
+ return $volume;
+ });
+ data_set($service, 'volumes', $serviceVolumes->toArray());
}
// Add env_file with at least .env to the service
diff --git a/config/sentry.php b/config/sentry.php
index b2cf7844d..47aa02db2 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.56',
+ 'release' => '4.0.0-beta.57',
// 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 3a4bcf65b..8ff3d53a5 100644
--- a/config/version.php
+++ b/config/version.php
@@ -1,3 +1,3 @@
+
+
+