diff --git a/app/Livewire/Modals/HostShell.php b/app/Livewire/Modals/HostShell.php index c606f82..f67639b 100644 --- a/app/Livewire/Modals/HostShell.php +++ b/app/Livewire/Modals/HostShell.php @@ -10,14 +10,16 @@ use Illuminate\Validation\ValidationException; use LivewireUI\Modal\ModalComponent; /** - * Form modal: configure the SSH login for the "Clusev host" terminal. Stores a single - * HostCredential (encrypted) so the terminal sidecar can SSH into the actual host instead of - * opening a shell in its own container. On edit, leaving the secret blank keeps the stored one. - * The clear-text secret is never echoed back into the form. + * Form modal: configure the SSH login for the "Clusev host" terminal. The target is ALWAYS the local + * machine Clusev runs on (the Docker host, reached at host.docker.internal — fixed, not a free-form + * host, because an arbitrary machine is what fleet servers are for). The operator only supplies the + * login (user + password/key, and the port). Stores a single encrypted HostCredential; on edit a + * blank secret keeps the stored one, and the clear-text secret is never echoed back into the form. */ class HostShell extends ModalComponent { - public string $host = 'host.docker.internal'; + /** The host terminal always targets the local machine; not operator-editable. */ + private const HOST = 'host.docker.internal'; public int $port = 22; @@ -42,7 +44,6 @@ class HostShell extends ModalComponent $hc = HostCredential::current(); if ($hc !== null) { $this->configured = true; - $this->host = $hc->host; $this->port = $hc->port; $this->username = $hc->username; $this->authType = $hc->auth_type; @@ -56,7 +57,6 @@ class HostShell extends ModalComponent protected function rules(): array { return [ - 'host' => ['required', 'string', 'max:255'], 'port' => ['required', 'integer', 'min:1', 'max:65535'], 'username' => ['required', 'string', 'max:120'], 'authType' => ['required', Rule::in(['password', 'key'])], @@ -73,7 +73,6 @@ class HostShell extends ModalComponent protected function validationAttributes(): array { return [ - 'host' => __('terminal.host_field_host'), 'port' => __('terminal.host_field_port'), 'username' => __('terminal.host_field_user'), 'authType' => __('terminal.host_field_auth'), @@ -95,7 +94,7 @@ class HostShell extends ModalComponent } $hc = $existing ?? new HostCredential; - $hc->host = trim($data['host']); + $hc->host = self::HOST; // always the local machine — not operator-editable $hc->port = (int) $data['port']; $hc->username = trim($data['username']); $hc->auth_type = $data['authType'] === 'key' ? 'key' : 'password'; diff --git a/app/Livewire/Terminal/Index.php b/app/Livewire/Terminal/Index.php index c408808..6637202 100644 --- a/app/Livewire/Terminal/Index.php +++ b/app/Livewire/Terminal/Index.php @@ -102,7 +102,8 @@ class Index extends Component 'serverCount' => $serverCount, 'showSearch' => $serverCount > self::SEARCH_THRESHOLD, 'hostConfigured' => $host !== null, - 'hostTarget' => $host !== null ? $host->username.'@'.$host->host : null, + // The host is always the local machine, so the tile shows just the login user. + 'hostTarget' => $host?->username, ])->title($this->title()); } } diff --git a/lang/de/terminal.php b/lang/de/terminal.php index c8c9db9..5b2270e 100644 --- a/lang/de/terminal.php +++ b/lang/de/terminal.php @@ -28,8 +28,6 @@ return [ // Host-Login-Einrichtung (Clusev-Host-Terminal) 'host_setup_title' => 'Clusev-Host-Login', 'host_setup_subtitle' => 'SSH-Zugang zum Clusev-Host. Damit wird das Terminal ein echtes Login auf der Maschine — kein Container.', - 'host_field_host' => 'Host / IP', - 'host_field_host_hint' => 'Standard: die Maschine, auf der Clusev läuft (Docker-Host). So lassen — oder eine andere IP/Host eintragen.', 'host_field_port' => 'Port', 'host_field_user' => 'Benutzer', 'host_field_auth' => 'Authentifizierung', diff --git a/lang/en/terminal.php b/lang/en/terminal.php index e8ee508..f1f2192 100644 --- a/lang/en/terminal.php +++ b/lang/en/terminal.php @@ -28,8 +28,6 @@ return [ // Host login setup (Clusev host terminal) 'host_setup_title' => 'Clusev host login', 'host_setup_subtitle' => 'SSH access to the Clusev host. This makes the terminal a real login on the machine — not a container.', - 'host_field_host' => 'Host / IP', - 'host_field_host_hint' => 'Default: the machine Clusev runs on (the Docker host). Leave it — or enter another IP/host.', 'host_field_port' => 'Port', 'host_field_user' => 'User', 'host_field_auth' => 'Authentication', diff --git a/resources/views/livewire/modals/host-shell.blade.php b/resources/views/livewire/modals/host-shell.blade.php index 60eca0c..1114983 100644 --- a/resources/views/livewire/modals/host-shell.blade.php +++ b/resources/views/livewire/modals/host-shell.blade.php @@ -10,13 +10,13 @@
{{ __('terminal.host_field_host_hint') }}
+ @error('username')