Refactor muxFilename method to use UUID instead of IP, port, and user

This commit is contained in:
Andras Bacsai
2024-09-05 14:41:04 +02:00
parent 2531574a9a
commit e4854aaa1b
2 changed files with 2 additions and 3 deletions

View File

@@ -880,7 +880,7 @@ $schema://$host {
public function muxFilename()
{
return "{$this->ip}_{$this->port}_{$this->user}";
return $this->uuid;
}
public function team()

View File

@@ -146,7 +146,7 @@ function generateSshCommand(Server $server, string $command)
$ssh_command = "timeout $timeout ssh ";
if (config('coolify.mux_enabled') && config('coolify.is_windows_docker_desktop') == false) {
$ssh_command .= "-o ControlMaster=auto -o ControlPersist={$muxPersistTime} -o ControlPath=/var/www/html/storage/app/ssh/mux/%h_%p_%r ";
$ssh_command .= "-o ControlMaster=auto -o ControlPersist={$muxPersistTime} -o ControlPath=/var/www/html/storage/app/ssh/mux/{$server->muxFilename()} ";
}
if (data_get($server, 'settings.is_cloudflare_tunnel')) {
$ssh_command .= '-o ProxyCommand="/usr/local/bin/cloudflared access ssh --hostname %h" ';
@@ -167,7 +167,6 @@ function generateSshCommand(Server $server, string $command)
.$command.PHP_EOL
.$delimiter;
// ray($ssh_command);
return $ssh_command;
}
function instant_remote_process(Collection|array $command, Server $server, bool $throwError = true, bool $no_sudo = false): ?string