mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-14 00:33:44 -04:00
Container ownership labels now use UUIDs: coolify.applicationUuid, coolify.serviceUuid, coolify.service.subUuid and coolify.databaseUuid. Numeric ids differ between Coolify instances, so after a server transfer the target could not find existing containers: redeploys left the old container running and service statuses were wrong. Containers are matched by UUID label first, then by the compose project (Swarm: stack namespace), which is the resource UUID since July 2024, and last by the older numeric id label. Existing containers keep working without a redeploy and get the UUID labels on the next deploy or restart.
51 lines
1.3 KiB
PHP
51 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Livewire\Project\Application;
|
|
|
|
use App\Models\Application;
|
|
use Illuminate\Contracts\View\View;
|
|
use Livewire\Component;
|
|
|
|
class InternalAccess extends Component
|
|
{
|
|
protected $listeners = [
|
|
'applicationNetworkingUpdated' => 'refreshApplicationNetworking',
|
|
];
|
|
|
|
public Application $application;
|
|
|
|
public ?string $currentInternalHostname = null;
|
|
|
|
public bool $currentInternalHostnameLoaded = false;
|
|
|
|
public function refreshApplicationNetworking(): void
|
|
{
|
|
$this->application->refresh();
|
|
}
|
|
|
|
public function loadCurrentInternalHostname(): void
|
|
{
|
|
try {
|
|
$containers = getCurrentApplicationContainerStatus(
|
|
$this->application->destination->server,
|
|
$this->application,
|
|
0
|
|
);
|
|
$currentContainer = $containers->first(
|
|
fn ($container) => data_get($container, 'State') === 'running'
|
|
) ?? $containers->first();
|
|
|
|
$this->currentInternalHostname = data_get($currentContainer, 'Names');
|
|
} catch (\Throwable) {
|
|
$this->currentInternalHostname = null;
|
|
} finally {
|
|
$this->currentInternalHostnameLoaded = true;
|
|
}
|
|
}
|
|
|
|
public function render(): View
|
|
{
|
|
return view('livewire.project.application.internal-access');
|
|
}
|
|
}
|