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.

feat(server): auto-resolve Sentinel URL and polish setup UI

Andras Bacsai8f7eb2d79051
diff --git a/app/Actions/Server/StartSentinel.php b/app/Actions/Server/StartSentinel.php
index 6350a5f374..cec90288e1 100644
--- a/app/Actions/Server/StartSentinel.php
+++ b/app/Actions/Server/StartSentinel.php
@@ -23,13 +23,10 @@ class StartSentinel
$refreshRate = data_get($server, 'settings.sentinel_metrics_refresh_rate_seconds');
$pushInterval = data_get($server, 'settings.sentinel_push_interval_seconds');
$token = $server->settings->ensureValidSentinelToken();
- $endpoint = data_get($server, 'settings.sentinel_custom_url');
+ $endpoint = $server->settings->ensureSentinelUrl();
$debug = data_get($server, 'settings.is_sentinel_debug_enabled');
$mountDir = '/data/coolify/sentinel';
$image = coolifyRegistryUrl().'/coollabsio/sentinel:'.$version;
- if (! $endpoint) {
- throw new \RuntimeException('You should set FQDN in Instance Settings.');
- }
$environments = [
'TOKEN' => $token,
'DEBUG' => $debug ? 'true' : 'false',
diff --git a/app/Livewire/Server/Sentinel.php b/app/Livewire/Server/Sentinel.php
index 909ed54f9a..cd05002aae 100644
--- a/app/Livewire/Server/Sentinel.php
+++ b/app/Livewire/Server/Sentinel.php
@@ -114,9 +114,10 @@ class Sentinel extends Component
return;
}
- $this->isSentinelEnabled = true;
$customImage = isDev() ? $this->sentinelCustomDockerImage : null;
StartSentinel::run($this->server, true, null, $customImage);
+ $this->sentinelCustomUrl = $this->server->settings->sentinel_custom_url;
+ $this->isSentinelEnabled = true;
} else {
$this->isSentinelEnabled = false;
$this->isMetricsEnabled = false;
diff --git a/app/Livewire/Server/ValidateAndInstall.php b/app/Livewire/Server/ValidateAndInstall.php
index c7181ebcf5..9e6108de0f 100644
--- a/app/Livewire/Server/ValidateAndInstall.php
+++ b/app/Livewire/Server/ValidateAndInstall.php
@@ -39,6 +39,8 @@ class ValidateAndInstall extends Component
public bool $ask = false;
+ public bool $isInstalling = false;
+
protected $listeners = [
'init',
'validateConnection',
@@ -51,6 +53,7 @@ class ValidateAndInstall extends Component
public function init(int $data = 0)
{
+ $this->isInstalling = false;
$this->uptime = null;
$this->supported_os_type = null;
$this->prerequisites_installed = null;
@@ -172,6 +175,7 @@ class ValidateAndInstall extends Component
if ($this->number_of_tries <= $this->max_tries) {
$this->installationStep = 'Prerequisites';
$activity = $this->server->installPrerequisites();
+ $this->isInstalling = true;
$this->number_of_tries++;
$this->dispatch('activityMonitor', $activity->id, 'init', $this->number_of_tries, "{$this->installationStep} Installation Logs");
}
@@ -208,6 +212,7 @@ class ValidateAndInstall extends Component
if ($this->number_of_tries <= $this->max_tries) {
$this->installationStep = 'Docker';
$activity = $this->server->installDocker();
+ $this->isInstalling = true;
$this->number_of_tries++;
$this->dispatch('activityMonitor', $activity->id, 'init', $this->number_of_tries, "{$this->installationStep} Installation Logs");
}
diff --git a/app/Models/ServerSetting.php b/app/Models/ServerSetting.php
index 0453dc7932..3bd39aeb1f 100644
--- a/app/Models/ServerSetting.php
+++ b/app/Models/ServerSetting.php
@@ -219,7 +219,22 @@ class ServerSetting extends Model
return $token;
}
- public function generateSentinelUrl(bool $save = true, bool $ignoreEvent = false)
+ public function ensureSentinelUrl(): string
+ {
+ $url = $this->sentinel_custom_url;
+
+ if (blank($url)) {
+ $url = $this->generateSentinelUrl(ignoreEvent: true);
+ }
+
+ if (blank($url)) {
+ throw new \RuntimeException('Set an instance FQDN or public IP before enabling Sentinel.');
+ }
+
+ return $url;
+ }
+
+ public function generateSentinelUrl(bool $save = true, bool $ignoreEvent = false): ?string
{
$domain = null;
$settings = InstanceSettings::get();
diff --git a/bootstrap/helpers/remoteProcess.php b/bootstrap/helpers/remoteProcess.php
index 84522a5e14..fee3f376f5 100644
--- a/bootstrap/helpers/remoteProcess.php
+++ b/bootstrap/helpers/remoteProcess.php
@@ -253,7 +253,7 @@ function decode_remote_command_output(?ApplicationDeploymentQueue $application_d
} catch (Exception) {
$timestamp->setTimezone('UTC');
}
- data_set($i, 'timestamp', $timestamp->format('Y-M-d H:i:s.u'));
+ data_set($i, 'timestamp', $timestamp->format('Y-M-d H:i:s'));
return $i;
})
diff --git a/resources/views/livewire/activity-monitor.blade.php b/resources/views/livewire/activity-monitor.blade.php
index f3e79db0e4..495d5cf523 100644
--- a/resources/views/livewire/activity-monitor.blade.php
+++ b/resources/views/livewire/activity-monitor.blade.php
@@ -1,7 +1,7 @@
@php use App\Actions\CoolifyTask\RunRemoteProcess; @endphp
<div @class([
'h-full flex flex-col overflow-hidden' => $fullHeight,
- 'h-full overflow-hidden' => !$fullHeight,
+ 'overflow-hidden' => !$fullHeight,
])>
@if ($activity)
@if (isset($header))
diff --git a/resources/views/livewire/boarding/index.blade.php b/resources/views/livewire/boarding/index.blade.php
index 62048602fd..dca26797d3 100644
--- a/resources/views/livewire/boarding/index.blade.php
+++ b/resources/views/livewire/boarding/index.blade.php
@@ -507,16 +507,16 @@
</section>
@endif
- <x-slide-over closeWithX fullScreen>
+ <x-process-dialog closeWithX size="xl">
<x-slot:title>Server validation</x-slot:title>
<x-slot:content>
<livewire:server.validate-and-install :server="$this->createdServer" />
</x-slot:content>
- <x-forms.button @click="slideOverOpen=true" class="w-full justify-center"
+ <x-forms.button @click="processDialogOpen = true" class="w-full justify-center"
wire:click.prevent="installServer" isHighlighted>
Start validation
</x-forms.button>
- </x-slide-over>
+ </x-process-dialog>
</div>
</x-slot:actions>
<x-slot:explanation>
@@ -659,7 +659,7 @@
</div>
@if ($currentState !== 'welcome' && $currentState !== 'create-resource')
- <div class="mt-6 flex w-full max-w-3xl flex-col items-center gap-3">
+ <div class="mx-auto mt-6 flex w-full max-w-3xl flex-col items-center gap-3">
<div
class="inline-flex flex-wrap items-center justify-center gap-0.5 rounded-lg border border-neutral-200 bg-neutral-50 p-0.5 dark:border-white/[0.08] dark:bg-white/[0.025]">
<button type="button" wire:click="skipBoarding"
diff --git a/resources/views/livewire/server/charts.blade.php b/resources/views/livewire/server/charts.blade.php
index 27544837fe..cd88495461 100644
--- a/resources/views/livewire/server/charts.blade.php
+++ b/resources/views/livewire/server/charts.blade.php
@@ -280,10 +280,6 @@
@else
<x-application.settings-section id="server-metrics-overview-section" title="Metrics"
helper="Inspect recent CPU and memory usage reported by Sentinel.">
- <x-slot:actions>
- <x-status-badge status="Unavailable" type="warning" />
- </x-slot:actions>
-
<x-empty size="sm" title="Sentinel is required"
description="Enable Sentinel before collecting CPU and memory metrics for this server."
icon-name="dashboard">
diff --git a/resources/views/livewire/server/create.blade.php b/resources/views/livewire/server/create.blade.php
index 52c0391287..fea01333e4 100644
--- a/resources/views/livewire/server/create.blade.php
+++ b/resources/views/livewire/server/create.blade.php
@@ -3,38 +3,42 @@
New Server | Coolify
</x-slot>
- <div class="mb-4 flex flex-wrap items-center justify-end gap-2">
- <a href="{{ $selectedType ? route('server.create') : route('server.index') }}" class="button"
- {{ wireNavigate() }}>
- {{ $selectedType ? 'Change method' : 'Back to servers' }}
- </a>
- @if ($selectedType && $selectedType !== 'manual' && ! $selectedTokenUuid)
- @php
- $tokenProvider = $selectedType === 'digital-ocean' ? 'digitalocean' : $selectedType;
- $tokenProviderName = $selectedType === 'digital-ocean'
- ? 'DigitalOcean'
- : str($selectedType)->headline();
- @endphp
- @can('create', App\Models\CloudProviderToken::class)
- <x-modal-input title="New {{ $tokenProviderName }} token">
- <x-slot:content>
- <button type="button"
- class="button button-highlighted">
- <x-reicon name="plus" class="size-3.5" />
- New token
- </button>
- </x-slot:content>
- <livewire:security.cloud-provider-token-form :modal_mode="true" :provider="$tokenProvider"
- wire:key="new-server-token-{{ $tokenProvider }}" />
- </x-modal-input>
- @endcan
- @endif
+ <div class="mb-5 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
+ <h1 class="min-w-0 text-[24px]! leading-7! font-semibold! tracking-tight!">New server</h1>
+ <div class="flex flex-wrap items-center gap-2">
+ @if ($selectedType)
+ <a href="{{ route('server.create') }}" class="button" {{ wireNavigate() }}>
+ Change method
+ </a>
+ @endif
+ @if ($selectedType && $selectedType !== 'manual' && ! $selectedTokenUuid)
+ @php
+ $tokenProvider = $selectedType === 'digital-ocean' ? 'digitalocean' : $selectedType;
+ $tokenProviderName = $selectedType === 'digital-ocean'
+ ? 'DigitalOcean'
+ : str($selectedType)->headline();
+ @endphp
+ @can('create', App\Models\CloudProviderToken::class)
+ <x-modal-input title="New {{ $tokenProviderName }} token">
+ <x-slot:content>
+ <button type="button"
+ class="button button-highlighted">
+ <x-reicon name="plus" class="size-3.5" />
+ New token
+ </button>
+ </x-slot:content>
+ <livewire:security.cloud-provider-token-form :modal_mode="true" :provider="$tokenProvider"
+ wire:key="new-server-token-{{ $tokenProvider }}" />
+ </x-modal-input>
+ @endcan
+ @endif
+ </div>
</div>
@if (!$selectedType)
<div class="application-settings-form">
- <x-application.settings-section title="Add a server"
- description="Provision with a cloud provider or connect any reachable Linux server." flush>
+ <section class="application-settings-section">
+ <div class="application-settings-section-body is-flush">
<div class="grid grid-cols-1 gap-3 p-3 sm:grid-cols-2 lg:grid-cols-4">
@can('viewAny', App\Models\CloudProviderToken::class)
<a href="{{ route('server.create.type', ['type' => 'hetzner']) }}"
@@ -115,7 +119,8 @@
</div>
</a>
</div>
- </x-application.settings-section>
+ </div>
+ </section>
</div>
@else
<div class="application-settings-form">
diff --git a/resources/views/livewire/server/new/by-ip.blade.php b/resources/views/livewire/server/new/by-ip.blade.php
index d7fe021788..95e674ab58 100644
--- a/resources/views/livewire/server/new/by-ip.blade.php
+++ b/resources/views/livewire/server/new/by-ip.blade.php
@@ -20,28 +20,17 @@
</button>
</x-slot:actions>
- <div class="grid gap-4 lg:grid-cols-2">
- <x-forms.input id="name" label="Name" required />
- <x-forms.input id="description" label="Description" />
- </div>
-
- <div class="mt-5 grid gap-4 border-t border-neutral-200 pt-4 lg:grid-cols-3 dark:border-white/[0.08]">
+ <div class="mb-5">
<x-forms.input id="ip" label="IP address or domain" required
helper="For example 127.0.0.1 or server.example.com." />
- <x-forms.input id="user" label="User" required
- helper="Non-root SSH users are experimental." />
- <x-forms.input type="number" id="port" label="Port" required />
</div>
- <div class="mt-5 grid items-end gap-4 border-t border-neutral-200 pt-4 lg:grid-cols-2 dark:border-white/[0.08]">
- <x-forms.listbox id="private_key_id" label="Private key"
- placeholder="Select a private key" :options="$privateKeyOptions" />
-
- <div class="flex items-center justify-between gap-3">
- <x-forms.checkbox id="is_build_server"
- helper="Build servers compile applications but do not host deployments."
- label="Use as a build server" />
-
+ <div class="mb-5">
+ <div class="flex items-end gap-3">
+ <div class="min-w-0 flex-1">
+ <x-forms.listbox id="private_key_id" label="Private key"
+ placeholder="Select a private key" :options="$privateKeyOptions" />
+ </div>
@can('create', App\Models\PrivateKey::class)
<div x-data="{ dropdownOpen: false }" class="relative shrink-0"
@click.outside="dropdownOpen = false"
@@ -81,6 +70,33 @@
@endcan
</div>
</div>
+
+ <div class="grid gap-4 border-t border-neutral-200 pt-4 lg:grid-cols-2 dark:border-white/[0.08]">
+ <x-forms.input id="name" label="Name" required />
+ <x-forms.input id="description" label="Description" />
+ </div>
+
+ <div x-data="{ advancedOpen: false }"
+ class="mt-5 border-t border-neutral-200 pt-4 dark:border-white/[0.08]">
+ <button type="button" @click="advancedOpen = !advancedOpen"
+ class="flex w-full items-center justify-between gap-3 text-left text-[13px] font-medium text-neutral-600 dark:text-fg-dim"
+ :aria-expanded="advancedOpen">
+ Advanced settings
+ <x-reicon name="chevron-down" class="size-3.5 transition-transform"
+ x-bind:class="advancedOpen && 'rotate-180'" />
+ </button>
+
+ <div x-show="advancedOpen" x-cloak class="mt-4 flex flex-col gap-4">
+ <div class="grid gap-4 lg:grid-cols-2">
+ <x-forms.input id="user" label="User" required
+ helper="Non-root SSH users are experimental." />
+ <x-forms.input type="number" id="port" label="Port" required />
+ </div>
+ <x-forms.checkbox id="is_build_server"
+ helper="Build servers compile applications but do not host deployments. Enabling this makes the server build-only."
+ label="Use as a dedicated build server" />
+ </div>
+ </div>
</x-application.settings-section>
</form>
@endif
diff --git a/resources/views/livewire/server/sentinel.blade.php b/resources/views/livewire/server/sentinel.blade.php
index 2354b79cd8..e5041fb4b6 100644
--- a/resources/views/livewire/server/sentinel.blade.php
+++ b/resources/views/livewire/server/sentinel.blade.php
@@ -13,19 +13,14 @@
helper="Monitor server and container health while collecting historical metrics.">
<x-slot:actions>
<div class="flex items-center gap-2">
- <x-status-badge
- :status="!$isSentinelEnabled
- ? 'Disabled'
- : ($server->isSentinelLive() ? 'In sync' : 'Out of sync')"
- :type="!$isSentinelEnabled
- ? 'neutral'
- : ($server->isSentinelLive() ? 'success' : 'warning')" />
@if (!$isSentinelEnabled)
<x-forms.button canGate="update" :canResource="$server" isHighlighted
wire:click="toggleSentinel">
Enable Sentinel
</x-forms.button>
@else
+ <x-status-badge :status="$server->isSentinelLive() ? 'In sync' : 'Out of sync'"
+ :type="$server->isSentinelLive() ? 'success' : 'warning'" />
<x-forms.button wire:click="restartSentinel" canGate="update"
:canResource="$server">
<x-reicon name="refresh" class="size-3.5" />
diff --git a/resources/views/livewire/server/show.blade.php b/resources/views/livewire/server/show.blade.php
index c3e6a35b3c..dbe82c5eeb 100644
--- a/resources/views/livewire/server/show.blade.php
+++ b/resources/views/livewire/server/show.blade.php
@@ -192,17 +192,17 @@
</div>
@endif
- <x-slide-over closeWithX fullScreen>
+ <x-process-dialog closeWithX size="xl">
<x-slot:title>Validate and configure</x-slot:title>
<x-slot:content>
<livewire:server.validate-and-install :server="$server" :ask="$server->isFunctional()" />
</x-slot:content>
- <x-forms.button type="button"
- @click="slideOverOpen=true" wire:click.prevent="validateServer">
- <x-reicon name="refresh" class="size-3.5" />
+ <x-forms.button type="button" :isHighlighted="! $server->isFunctional()"
+ @click="processDialogOpen = true" wire:click.prevent="validateServer">
+ <x-reicon :name="$server->isFunctional() ? 'refresh' : 'alert-circle'" class="size-3.5" />
{{ $server->isFunctional() ? 'Revalidate connection' : 'Validate connection' }}
</x-forms.button>
- </x-slide-over>
+ </x-process-dialog>
</x-slot:actions>
@if ($this->limaStartCommand)
@@ -261,10 +261,11 @@
@if ($isBuildServerLocked)
<x-forms.checkbox disabled id="isBuildServer"
helper="This server already hosts resources and cannot become build-only."
- label="Use as a build server" />
+ label="Use as a dedicated build server" />
@else
<x-forms.checkbox canGate="update" :canResource="$server" instantSave
- id="isBuildServer" label="Use as a build server"
+ id="isBuildServer" label="Use as a dedicated build server"
+ helper="Build servers compile applications but do not host deployments. Enabling this makes the server build-only."
:disabled="$isValidating" />
@endif
</div>
diff --git a/resources/views/livewire/server/validate-and-install.blade.php b/resources/views/livewire/server/validate-and-install.blade.php
index 0bba6652c3..09dc7aec68 100644
--- a/resources/views/livewire/server/validate-and-install.blade.php
+++ b/resources/views/livewire/server/validate-and-install.blade.php
@@ -21,6 +21,12 @@
$showDocker = (bool) ($uptime && $supported_os_type && $prerequisites_installed);
$showCompose = $showDocker;
$showVersion = (bool) ($showDocker && $docker_compose_installed);
+ $validationComplete = (bool) ($uptime
+ && $supported_os_type
+ && $prerequisites_installed
+ && $docker_installed
+ && $docker_compose_installed
+ && $docker_version);
$checkpoints = [
[
@@ -66,7 +72,7 @@
];
@endphp
-<div class="flex flex-col gap-4">
+<div class="flex h-full min-h-0 flex-col gap-4 overflow-y-auto scrollbar">
@if ($ask)
<div
class="rounded-[10px] border border-neutral-200 bg-neutral-50 px-4 py-3 text-[13px] leading-5 text-neutral-600 dark:border-white/[0.08] dark:bg-white/[0.025] dark:text-fg-dim">
@@ -77,28 +83,36 @@
Continue
</x-forms.button>
@else
- <section class="application-settings-section">
- <header>
- <div class="flex items-center gap-2">
- <h3>Validation checkpoints</h3>
- </div>
- </header>
- <div class="application-settings-section-body is-flush">
- <div class="divide-y divide-neutral-200 dark:divide-white/[0.07]">
- @foreach ($checkpoints as $checkpoint)
- @continue(! $checkpoint['visible'])
- <x-checkpoint-item :title="$checkpoint['title']" :description="$checkpoint['description']"
- :status="$checkpoint['status']" />
- @endforeach
- </div>
+ <div data-validation-checkpoints
+ class="overflow-hidden rounded-[10px] border border-neutral-200 dark:border-white/[0.08]">
+ <div class="border-b border-neutral-200 px-4 py-2.5 dark:border-white/[0.08]">
+ <h3 class="text-[13px] font-medium text-neutral-600 dark:text-fg-dim">Validation checkpoints</h3>
+ </div>
+ <div class="divide-y divide-neutral-200 dark:divide-white/[0.07]">
+ @foreach ($checkpoints as $checkpoint)
+ <x-checkpoint-item :title="$checkpoint['title']" :description="$checkpoint['description']"
+ :status="$checkpoint['status']" />
+ @endforeach
</div>
- </section>
+ </div>
- <section class="application-settings-section">
- <div class="application-settings-section-body">
- <livewire:activity-monitor :header="$installationStep.' installation logs'" :showWaiting="false" />
+ @if ($validationComplete)
+ <div class="mt-auto flex shrink-0 items-center justify-between gap-3 rounded-[10px] border border-emerald-500/20 bg-emerald-500/[0.06] px-4 py-3">
+ <div class="flex items-center gap-2 text-[13px] font-medium text-emerald-700 dark:text-emerald-300">
+ <x-reicon name="check-circle" class="size-4 shrink-0" />
+ Validation complete
+ </div>
+ <x-forms.button type="button" @click="processDialogOpen = false">
+ Close
+ </x-forms.button>
</div>
- </section>
+ @elseif ($isInstalling)
+ <section class="application-settings-section">
+ <div class="application-settings-section-body">
+ <livewire:activity-monitor :header="$installationStep.' installation logs'" :showWaiting="false" />
+ </div>
+ </section>
+ @endif
@isset($error)
<div
diff --git a/tests/Feature/BoardingActionsLayoutTest.php b/tests/Feature/BoardingActionsLayoutTest.php
new file mode 100644
index 0000000000..8d90f5bc8a
--- /dev/null
+++ b/tests/Feature/BoardingActionsLayoutTest.php
@@ -0,0 +1,16 @@
+<?php
+
+test('boarding utility actions are centered', function () {
+ $view = file_get_contents(resource_path('views/livewire/boarding/index.blade.php'));
+
+ expect($view)->toContain('class="mx-auto mt-6 flex w-full max-w-3xl flex-col items-center gap-3"');
+});
+
+test('server validation opens in the centered process dialog', function () {
+ $view = file_get_contents(resource_path('views/livewire/boarding/index.blade.php'));
+
+ expect($view)
+ ->toContain('<x-process-dialog closeWithX size="xl">')
+ ->toContain('@click="processDialogOpen = true"')
+ ->not->toContain('<x-slide-over closeWithX fullScreen>');
+});
diff --git a/tests/Feature/Livewire/SentinelComponentTest.php b/tests/Feature/Livewire/SentinelComponentTest.php
index 47cad4e222..41b3f2b497 100644
--- a/tests/Feature/Livewire/SentinelComponentTest.php
+++ b/tests/Feature/Livewire/SentinelComponentTest.php
@@ -19,3 +19,20 @@ it('dispatches a server navbar refresh after toggling sentinel', function () {
expect($matches['body'] ?? '')
->toContain("\$this->dispatch('refreshServerShow');");
});
+
+it('only marks sentinel enabled after startup succeeds', function () {
+ $componentSource = file_get_contents(app_path('Livewire/Server/Sentinel.php'));
+
+ preg_match('/public function toggleSentinel\([^)]*\).*?\{(?<body>.*?)\n \}/s', $componentSource, $matches);
+ $toggleBody = $matches['body'] ?? '';
+
+ expect(strpos($toggleBody, 'StartSentinel::run'))->toBeLessThan(
+ strpos($toggleBody, '$this->isSentinelEnabled = true;')
+ );
+});
+
+it('does not repeat a disabled status badge in the sentinel empty state', function () {
+ $view = file_get_contents(resource_path('views/livewire/server/sentinel.blade.php'));
+
+ expect($view)->not->toContain("? 'Disabled'");
+});
diff --git a/tests/Feature/ServerBuildRoleHelperTest.php b/tests/Feature/ServerBuildRoleHelperTest.php
new file mode 100644
index 0000000000..3cb85e608d
--- /dev/null
+++ b/tests/Feature/ServerBuildRoleHelperTest.php
@@ -0,0 +1,9 @@
+<?php
+
+test('server settings explain dedicated build server mode', function () {
+ $view = file_get_contents(resource_path('views/livewire/server/show.blade.php'));
+
+ expect($view)
+ ->toContain('label="Use as a dedicated build server"')
+ ->toContain('helper="Build servers compile applications but do not host deployments. Enabling this makes the server build-only."');
+});
diff --git a/tests/Feature/ServerCreatePageLayoutTest.php b/tests/Feature/ServerCreatePageLayoutTest.php
new file mode 100644
index 0000000000..66d2c50f36
--- /dev/null
+++ b/tests/Feature/ServerCreatePageLayoutTest.php
@@ -0,0 +1,10 @@
+<?php
+
+test('server creation uses the standard page title without redundant navigation', function () {
+ $view = file_get_contents(resource_path('views/livewire/server/create.blade.php'));
+
+ expect($view)
+ ->toContain('<h1 class="min-w-0 text-[24px]! leading-7! font-semibold! tracking-tight!">New server</h1>')
+ ->not->toContain('Back to servers')
+ ->not->toContain('title="Add a server"');
+});
diff --git a/tests/Feature/ServerCreationBuildRoleLayoutTest.php b/tests/Feature/ServerCreationBuildRoleLayoutTest.php
new file mode 100644
index 0000000000..2f5eaf1fa6
--- /dev/null
+++ b/tests/Feature/ServerCreationBuildRoleLayoutTest.php
@@ -0,0 +1,22 @@
+<?php
+
+test('server creation keeps private key actions together and advanced options collapsed', function () {
+ $view = file_get_contents(resource_path('views/livewire/server/new/by-ip.blade.php'));
+
+ expect($view)
+ ->toContain('class="flex items-end gap-3"')
+ ->toContain('x-data="{ advancedOpen: false }"')
+ ->toContain('x-show="advancedOpen" x-cloak')
+ ->toContain('Advanced settings')
+ ->toContain('label="Use as a dedicated build server"')
+ ->toContain('helper="Build servers compile applications but do not host deployments. Enabling this makes the server build-only."');
+});
+
+test('server creation places the IP address and private key before optional details', function () {
+ $view = file_get_contents(resource_path('views/livewire/server/new/by-ip.blade.php'));
+
+ expect($view)
+ ->toContain('class="mb-5"')
+ ->and(strpos($view, 'id="ip"'))->toBeLessThan(strpos($view, 'id="private_key_id"'))
+ ->and(strpos($view, 'id="private_key_id"'))->toBeLessThan(strpos($view, 'id="name"'));
+});
diff --git a/tests/Feature/ServerMetricsEmptyStateTest.php b/tests/Feature/ServerMetricsEmptyStateTest.php
new file mode 100644
index 0000000000..e3c34065bf
--- /dev/null
+++ b/tests/Feature/ServerMetricsEmptyStateTest.php
@@ -0,0 +1,10 @@
+<?php
+
+test('sentinel-required metrics state does not repeat an unavailable badge', function () {
+ $view = file_get_contents(resource_path('views/livewire/server/charts.blade.php'));
+ $sentinelRequiredState = str($view)->after('@else')->before('@endif')->toString();
+
+ expect($sentinelRequiredState)
+ ->toContain('title="Sentinel is required"')
+ ->not->toContain('status="Unavailable"');
+});
diff --git a/tests/Feature/ServerValidationDialogTest.php b/tests/Feature/ServerValidationDialogTest.php
new file mode 100644
index 0000000000..bf6c139f30
--- /dev/null
+++ b/tests/Feature/ServerValidationDialogTest.php
@@ -0,0 +1,55 @@
+<?php
+
+test('server revalidation opens in the centered process dialog', function () {
+ $view = file_get_contents(resource_path('views/livewire/server/show.blade.php'));
+
+ expect($view)
+ ->toContain('<x-process-dialog closeWithX size="xl">')
+ ->toContain(':isHighlighted="! $server->isFunctional()"')
+ ->toContain('@click="processDialogOpen = true" wire:click.prevent="validateServer"');
+});
+
+test('completed server validation shows a close action instead of empty logs', function () {
+ $view = file_get_contents(resource_path('views/livewire/server/validate-and-install.blade.php'));
+
+ expect($view)
+ ->toContain('$validationComplete')
+ ->toContain('mt-auto')
+ ->toContain('<x-forms.button type="button" @click="processDialogOpen = false">')
+ ->toContain('@click="processDialogOpen = false"')
+ ->toContain('Validation complete')
+ ->toContain('Close');
+});
+
+test('installation logs are only shown after an installation starts', function () {
+ $view = file_get_contents(resource_path('views/livewire/server/validate-and-install.blade.php'));
+ $component = file_get_contents(app_path('Livewire/Server/ValidateAndInstall.php'));
+
+ expect($view)->toContain('@elseif ($isInstalling)')
+ ->and($component)
+ ->toContain('public bool $isInstalling = false;')
+ ->toContain('$this->isInstalling = true;');
+});
+
+test('server validation content scrolls within the dialog', function () {
+ $view = file_get_contents(resource_path('views/livewire/server/validate-and-install.blade.php'));
+ $activityMonitor = file_get_contents(resource_path('views/livewire/activity-monitor.blade.php'));
+
+ expect($view)->toContain('class="flex h-full min-h-0 flex-col gap-4 overflow-y-auto scrollbar"')
+ ->and($activityMonitor)->toContain("'overflow-hidden' => !\$fullHeight")
+ ->and($activityMonitor)->not->toContain("'h-full overflow-hidden' => !\$fullHeight");
+});
+
+test('validation checkpoints use the standard bordered list treatment', function () {
+ $view = file_get_contents(resource_path('views/livewire/server/validate-and-install.blade.php'));
+
+ expect($view)
+ ->toContain('data-validation-checkpoints')
+ ->toContain('overflow-hidden rounded-[10px] border border-neutral-200 dark:border-white/[0.08]');
+});
+
+test('all validation checkpoints remain visible while only the current phase runs', function () {
+ $view = file_get_contents(resource_path('views/livewire/server/validate-and-install.blade.php'));
+
+ expect($view)->not->toContain("@continue(! \$checkpoint['visible'])");
+});
diff --git a/tests/Unit/LogTimestampDisplayTest.php b/tests/Unit/LogTimestampDisplayTest.php
new file mode 100644
index 0000000000..d2846065eb
--- /dev/null
+++ b/tests/Unit/LogTimestampDisplayTest.php
@@ -0,0 +1,9 @@
+<?php
+
+test('deployment log timestamps omit microseconds', function () {
+ $helper = file_get_contents(dirname(__DIR__, 2).'/bootstrap/helpers/remoteProcess.php');
+
+ expect($helper)
+ ->toContain("->format('Y-M-d H:i:s')")
+ ->not->toContain("->format('Y-M-d H:i:s.u')");
+});
diff --git a/tests/Unit/StartSentinelEndpointFallbackTest.php b/tests/Unit/StartSentinelEndpointFallbackTest.php
new file mode 100644
index 0000000000..7cb913682e
--- /dev/null
+++ b/tests/Unit/StartSentinelEndpointFallbackTest.php
@@ -0,0 +1,16 @@
+<?php
+
+test('sentinel startup regenerates an empty endpoint from instance settings', function () {
+ $action = file_get_contents(dirname(__DIR__, 2).'/app/Actions/Server/StartSentinel.php');
+ $component = file_get_contents(dirname(__DIR__, 2).'/app/Livewire/Server/Sentinel.php');
+
+ expect($action)
+ ->toContain('ensureSentinelUrl()')
+ ->and($component)
+ ->toContain('$this->sentinelCustomUrl = $this->server->settings->sentinel_custom_url;')
+ ->and(file_get_contents(dirname(__DIR__, 2).'/app/Models/ServerSetting.php'))
+ ->toContain('generateSentinelUrl(ignoreEvent: true)')
+ ->toContain('Set an instance FQDN or public IP before enabling Sentinel.')
+ ->and($component)
+ ->toContain('$this->sentinelCustomUrl = $this->server->settings->sentinel_custom_url;');
+});