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.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix
Andras Bacsai167379b0e0e9
diff --git a/app/Actions/CoolifyTask/RunRemoteProcess.php b/app/Actions/CoolifyTask/RunRemoteProcess.phpindex 38cec0d9d0..45040b7178 100644--- a/app/Actions/CoolifyTask/RunRemoteProcess.php+++ b/app/Actions/CoolifyTask/RunRemoteProcess.php@@ -100,7 +100,7 @@ class RunRemoteProcess$port = $this->activity->getExtraProperty('port');$command = $this->activity->getExtraProperty('command');- return generateSshCommand($private_key_location, $server_ip, $user, $port, $command);+ return generate_ssh_command($private_key_location, $server_ip, $user, $port, $command);}protected function handleOutput(string $type, string $output)diff --git a/app/Actions/Proxy/CheckProxySettingsInSync.php b/app/Actions/Proxy/CheckProxySettingsInSync.phpindex ce2b4c0342..88c01d624f 100644--- a/app/Actions/Proxy/CheckProxySettingsInSync.php+++ b/app/Actions/Proxy/CheckProxySettingsInSync.php@@ -11,7 +11,7 @@ class CheckProxySettingsInSyncpublic function __invoke(Server $server, bool $reset = false){$proxy_path = config('coolify.proxy_config_path');- $output = instantRemoteProcess([+ $output = instant_remote_process(["cat $proxy_path/docker-compose.yml",], $server, false);if (is_null($output) || $reset) {@@ -23,7 +23,7 @@ class CheckProxySettingsInSync$server->extra_attributes->last_saved_proxy_settings = Str::of($docker_compose_yml_base64)->pipe('md5')->value;$server->save();if (is_null($output) || $reset) {- instantRemoteProcess([+ instant_remote_process(["mkdir -p $proxy_path","echo '$docker_compose_yml_base64' | base64 -d > $proxy_path/docker-compose.yml",], $server);diff --git a/app/Actions/Proxy/InstallProxy.php b/app/Actions/Proxy/InstallProxy.phpindex 42492ba413..67bfb12059 100644--- a/app/Actions/Proxy/InstallProxy.php+++ b/app/Actions/Proxy/InstallProxy.php@@ -25,7 +25,7 @@ class InstallProxyreturn "docker network ls --format '{{.Name}}' | grep '^$network$' >/dev/null 2>&1 || docker network create --attachable $network > /dev/null 2>&1";});- $configuration = instantRemoteProcess([+ $configuration = instant_remote_process(["cat $proxy_path/docker-compose.yml",], $server, false);if (is_null($configuration)) {@@ -40,7 +40,7 @@ class InstallProxy$env_file_base64 = base64_encode($this->getEnvContents());- $activity = remoteProcess([+ $activity = remote_process([...$create_networks_command,"echo 'Docker networks created...'","mkdir -p $proxy_path",diff --git a/app/Actions/Server/InstallDocker.php b/app/Actions/Server/InstallDocker.phpindex 55c1fcc4ba..69aae28981 100644--- a/app/Actions/Server/InstallDocker.php+++ b/app/Actions/Server/InstallDocker.php@@ -10,7 +10,7 @@ class InstallDockerpublic function __invoke(Server $server){$config = base64_encode('{ "live-restore": true }');- $activity = remoteProcess([+ $activity = remote_process(["echo Installing Docker...","curl https://releases.rancher.com/install-docker/23.0.sh | sh","echo Configuring Docker...",diff --git a/app/Http/Livewire/Destination/Form.php b/app/Http/Livewire/Destination/Form.phpindex 9bc2369f8b..bc1c24c880 100644--- a/app/Http/Livewire/Destination/Form.php+++ b/app/Http/Livewire/Destination/Form.php@@ -25,8 +25,8 @@ class Form extends Componentif ($this->destination->attachedTo()) {return $this->emit('error', 'You must delete all resources before deleting this destination.');}- instantRemoteProcess(["docker network disconnect {$this->destination->network} coolify-proxy"], $this->destination->server, throwError: false);- instantRemoteProcess(['docker network rm -f ' . $this->destination->network], $this->destination->server);+ instant_remote_process(["docker network disconnect {$this->destination->network} coolify-proxy"], $this->destination->server, throwError: false);+ instant_remote_process(['docker network rm -f ' . $this->destination->network], $this->destination->server);}$this->destination->delete();return redirect()->route('dashboard');diff --git a/app/Http/Livewire/Destination/New/StandaloneDocker.php b/app/Http/Livewire/Destination/New/StandaloneDocker.phpindex 1ebb3824e2..d9d5565101 100644--- a/app/Http/Livewire/Destination/New/StandaloneDocker.php+++ b/app/Http/Livewire/Destination/New/StandaloneDocker.php@@ -45,8 +45,8 @@ class StandaloneDocker extends Componentreturn;}$server = Server::find($this->server_id);- instantRemoteProcess(['docker network create --attachable ' . $this->network], $server, throwError: false);- instantRemoteProcess(["docker network connect $this->network coolify-proxy"], $server, throwError: false);+ instant_remote_process(['docker network create --attachable ' . $this->network], $server, throwError: false);+ instant_remote_process(["docker network connect $this->network coolify-proxy"], $server, throwError: false);$docker = ModelsStandaloneDocker::create(['name' => $this->name,diff --git a/app/Http/Livewire/ForceUpgrade.php b/app/Http/Livewire/ForceUpgrade.phpindex 033f3ef431..c66272bcca 100644--- a/app/Http/Livewire/ForceUpgrade.php+++ b/app/Http/Livewire/ForceUpgrade.php@@ -15,10 +15,10 @@ class ForceUpgrade extends Componentif (!$server) {return;}- instantRemoteProcess([+ instant_remote_process(["sleep 2"], $server);- remoteProcess([+ remote_process(["sleep 10"], $server, ActivityTypes::INLINE->value);$this->emit('updateInitiated');@@ -31,18 +31,18 @@ class ForceUpgrade extends Componentreturn;}- instantRemoteProcess([+ instant_remote_process(["curl -fsSL $cdn/docker-compose.yml -o /data/coolify/source/docker-compose.yml","curl -fsSL $cdn/docker-compose.prod.yml -o /data/coolify/source/docker-compose.prod.yml","curl -fsSL $cdn/.env.production -o /data/coolify/source/.env.production","curl -fsSL $cdn/upgrade.sh -o /data/coolify/source/upgrade.sh",], $server);- instantRemoteProcess([+ instant_remote_process(["docker compose -f /data/coolify/source/docker-compose.yml -f /data/coolify/source/docker-compose.prod.yml pull",], $server);- remoteProcess([+ remote_process(["bash /data/coolify/source/upgrade.sh $latestVersion"], $server, ActivityTypes::INLINE->value);diff --git a/app/Http/Livewire/Project/Application/Danger.php b/app/Http/Livewire/Project/Application/Danger.phpindex 33e8a613b3..52c947c581 100644--- a/app/Http/Livewire/Project/Application/Danger.php+++ b/app/Http/Livewire/Project/Application/Danger.php@@ -18,7 +18,7 @@ class Danger extends Component{$destination = $this->application->destination->getMorphClass()::where('id', $this->application->destination->id)->first();- instantRemoteProcess(["docker rm -f {$this->application->uuid}"], $destination->server);+ instant_remote_process(["docker rm -f {$this->application->uuid}"], $destination->server);$this->application->delete();return redirect()->route('project.resources', ['project_uuid' => $this->parameters['project_uuid'],diff --git a/app/Http/Livewire/Project/Application/Rollback.php b/app/Http/Livewire/Project/Application/Rollback.phpindex 1ee01a7469..853e0f9cf5 100644--- a/app/Http/Livewire/Project/Application/Rollback.php+++ b/app/Http/Livewire/Project/Application/Rollback.php@@ -42,13 +42,13 @@ class Rollback extends Component{try {$image = $this->application->uuid;- $output = instantRemoteProcess([+ $output = instant_remote_process(["docker inspect --format='{{.Config.Image}}' {$this->application->uuid}",], $this->application->destination->server, throwError: false);$current_tag = Str::of($output)->trim()->explode(":");$this->current = data_get($current_tag, 1);- $output = instantRemoteProcess([+ $output = instant_remote_process(["docker images --format '{{.Repository}}#{{.Tag}}#{{.CreatedAt}}'",], $this->application->destination->server);$this->images = Str::of($output)->trim()->explode("\n")->filter(function ($item) use ($image) {diff --git a/app/Http/Livewire/RunCommand.php b/app/Http/Livewire/RunCommand.phpindex 2db18ab847..aca7297202 100755--- a/app/Http/Livewire/RunCommand.php+++ b/app/Http/Livewire/RunCommand.php@@ -26,7 +26,7 @@ class RunCommand extends Component{try {$this->validate();- $activity = remoteProcess([$this->command], Server::where('uuid', $this->server)->first(), ActivityTypes::INLINE->value);+ $activity = remote_process([$this->command], Server::where('uuid', $this->server)->first(), ActivityTypes::INLINE->value);$this->emit('newMonitorActivity', $activity->id);} catch (\Exception $e) {return general_error_handler($e);diff --git a/app/Http/Livewire/Server/Form.php b/app/Http/Livewire/Server/Form.phpindex 2e7522ecdd..83d7567f50 100644--- a/app/Http/Livewire/Server/Form.php+++ b/app/Http/Livewire/Server/Form.php@@ -36,7 +36,7 @@ class Form extends Componentpublic function validateServer(){try {- $this->uptime = instantRemoteProcess(['uptime'], $this->server, false);+ $this->uptime = instant_remote_process(['uptime'], $this->server, false);if (!$this->uptime) {$this->uptime = 'Server not reachable.';throw new \Exception('Server not reachable.');@@ -47,11 +47,11 @@ class Form extends Component$this->emit('serverValidated');}}- $this->dockerVersion = instantRemoteProcess(['docker version|head -2|grep -i version'], $this->server, false);+ $this->dockerVersion = instant_remote_process(['docker version|head -2|grep -i version'], $this->server, false);if (!$this->dockerVersion) {$this->dockerVersion = 'Not installed.';}- $this->dockerComposeVersion = instantRemoteProcess(['docker compose version|head -2|grep -i version'], $this->server, false);+ $this->dockerComposeVersion = instant_remote_process(['docker compose version|head -2|grep -i version'], $this->server, false);if (!$this->dockerComposeVersion) {$this->dockerComposeVersion = 'Not installed.';}diff --git a/app/Http/Livewire/Server/Proxy.php b/app/Http/Livewire/Server/Proxy.phpindex dc5ba8adf2..8c637e1fe7 100644--- a/app/Http/Livewire/Server/Proxy.php+++ b/app/Http/Livewire/Server/Proxy.php@@ -51,7 +51,7 @@ class Proxy extends Component}public function stopProxy(){- instantRemoteProcess([+ instant_remote_process(["docker rm -f coolify-proxy",], $this->server);$this->server->extra_attributes->proxy_status = 'exited';@@ -65,7 +65,7 @@ class Proxy extends Component$docker_compose_yml_base64 = base64_encode($this->proxy_settings);$this->server->extra_attributes->last_saved_proxy_settings = Str::of($docker_compose_yml_base64)->pipe('md5')->value;$this->server->save();- instantRemoteProcess([+ instant_remote_process(["echo '$docker_compose_yml_base64' | base64 -d > $proxy_path/docker-compose.yml",], $this->server);} catch (\Exception $e) {diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.phpindex 95f914b18b..b96355d285 100644--- a/app/Jobs/ApplicationDeploymentJob.php+++ b/app/Jobs/ApplicationDeploymentJob.php@@ -60,7 +60,7 @@ class ApplicationDeploymentJob implements ShouldQueue$server = $this->destination->server;- $private_key_location = savePrivateKeyForServer($server);+ $private_key_location = save_private_key_for_server($server);$remoteProcessArgs = new CoolifyTaskArgs(server_ip: $server->ip,@@ -452,13 +452,13 @@ COPY --from={$this->application->uuid}:{$this->git_commit}-build /app/{$this->apif ($isDebuggable && !$this->application->settings->is_debug) {$hideFromOutput = true;}- $remoteProcess = resolve(RunRemoteProcess::class, [+ $remote_process = resolve(RunRemoteProcess::class, ['activity' => $this->activity,'hideFromOutput' => $hideFromOutput,'isFinished' => $isFinished,'ignoreErrors' => $ignoreErrors,]);- $result = $remoteProcess();+ $result = $remote_process();if ($propertyName) {$this->activity->properties = $this->activity->properties->merge([$propertyName => trim($result->output()),diff --git a/app/Jobs/ContainerStatusJob.php b/app/Jobs/ContainerStatusJob.phpindex 2b3209ffc7..4264c1dd49 100644--- a/app/Jobs/ContainerStatusJob.php+++ b/app/Jobs/ContainerStatusJob.php@@ -47,7 +47,7 @@ class ContainerStatusJob implements ShouldQueue, ShouldBeUnique$not_found_applications = $applications;$containers = collect();foreach ($servers as $server) {- $output = instantRemoteProcess(['docker ps -a -q --format \'{{json .}}\''], $server);+ $output = instant_remote_process(['docker ps -a -q --format \'{{json .}}\''], $server);$containers = $containers->concat(format_docker_command_output_to_json($output));}foreach ($containers as $container) {diff --git a/app/Jobs/ContainerStopJob.php b/app/Jobs/ContainerStopJob.phpindex d1cdb18a29..d44851d9ad 100644--- a/app/Jobs/ContainerStopJob.php+++ b/app/Jobs/ContainerStopJob.php@@ -29,7 +29,7 @@ class ContainerStopJob implements ShouldQueue, ShouldBeUnique{try {$application = Application::find($this->application_id)->first();- instantRemoteProcess(["docker rm -f {$application->uuid}"], $this->server);+ instant_remote_process(["docker rm -f {$application->uuid}"], $this->server);$application->status = get_container_status(server: $application->destination->server, container_id: $application->uuid);$application->save();} catch (\Exception $e) {diff --git a/app/Jobs/CoolifyTask.php b/app/Jobs/CoolifyTask.phpindex d96095cc4f..df4b0e8cc8 100755--- a/app/Jobs/CoolifyTask.php+++ b/app/Jobs/CoolifyTask.php@@ -19,18 +19,19 @@ class CoolifyTask implements ShouldQueue*/public function __construct(public Activity $activity,- ){}+ ) {+ }/*** Execute the job.*/public function handle(): void{- $remoteProcess = resolve(RunRemoteProcess::class, [+ $remote_process = resolve(RunRemoteProcess::class, ['activity' => $this->activity,]);- $remoteProcess();+ $remote_process();// @TODO: Remove file at $this->activity->getExtraProperty('private_key_location') after process is finished}}diff --git a/app/Jobs/InstanceAutoUpdate.php b/app/Jobs/InstanceAutoUpdate.phpindex 2955772b2e..3bb9b67848 100644--- a/app/Jobs/InstanceAutoUpdate.php+++ b/app/Jobs/InstanceAutoUpdate.php@@ -46,10 +46,10 @@ class InstanceAutoUpdate implements ShouldQueueif (!$server) {return;}- instantRemoteProcess([+ instant_remote_process(["sleep 2"], $server);- remoteProcess([+ remote_process(["sleep 10"], $server, ActivityTypes::INLINE->value);} else {@@ -68,18 +68,18 @@ class InstanceAutoUpdate implements ShouldQueuereturn;}- instantRemoteProcess([+ instant_remote_process(["curl -fsSL $cdn/docker-compose.yml -o /data/coolify/source/docker-compose.yml","curl -fsSL $cdn/docker-compose.prod.yml -o /data/coolify/source/docker-compose.prod.yml","curl -fsSL $cdn/.env.production -o /data/coolify/source/.env.production","curl -fsSL $cdn/upgrade.sh -o /data/coolify/source/upgrade.sh",], $server);- instantRemoteProcess([+ instant_remote_process(["docker compose -f /data/coolify/source/docker-compose.yml -f /data/coolify/source/docker-compose.prod.yml pull",], $server);- remoteProcess([+ remote_process(["bash /data/coolify/source/upgrade.sh $latest_version"], $server, ActivityTypes::INLINE->value);}diff --git a/app/Jobs/InstanceDockerCleanup.php b/app/Jobs/InstanceDockerCleanup.phpindex 253fac8155..0bb238e0e4 100644--- a/app/Jobs/InstanceDockerCleanup.php+++ b/app/Jobs/InstanceDockerCleanup.php@@ -31,7 +31,7 @@ class InstanceDockerCleanup implements ShouldQueuetry {$servers = Server::all();foreach ($servers as $server) {- instantRemoteProcess(['docker image prune -f'], $server);+ instant_remote_process(['docker image prune -f'], $server);}} catch (\Exception $e) {Log::error($e->getMessage());diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.phpindex be599237ac..015584d9e9 100644--- a/app/Providers/AppServiceProvider.php+++ b/app/Providers/AppServiceProvider.php@@ -27,7 +27,7 @@ class AppServiceProvider extends ServiceProviderpublic function boot(): void{Queue::after(function (JobProcessed $event) {- // @TODO: Remove `coolify-builder` container after the remoteProcess job is finishged and remoteProcess->type == `deployment`.+ // @TODO: Remove `coolify-builder` container after the remote_process job is finishged and remote_process->type == `deployment`.if ($event->job->resolveName() === CoolifyTask::class) {}});diff --git a/bootstrap/helpers/docker.php b/bootstrap/helpers/docker.phpindex f4c28f6738..ce6057e5fd 100644--- a/bootstrap/helpers/docker.php+++ b/bootstrap/helpers/docker.php@@ -31,7 +31,7 @@ function format_docker_labels_to_json($rawOutput): Collectionfunction get_container_status(Server $server, string $container_id, bool $throwError = false){- $container = instantRemoteProcess(["docker inspect --format '{{json .State}}' {$container_id}"], $server, $throwError);+ $container = instant_remote_process(["docker inspect --format '{{json .State}}' {$container_id}"], $server, $throwError);if (!$container) {return 'exited';}diff --git a/bootstrap/helpers/remoteProcess.php b/bootstrap/helpers/remoteProcess.phpindex ade752b414..5d06669517 100644--- a/bootstrap/helpers/remoteProcess.php+++ b/bootstrap/helpers/remoteProcess.php@@ -1,5 +1,6 @@<?php+use App\Actions\CoolifyTask\PrepareCoolifyTask;use App\Data\CoolifyTaskArgs;use App\Models\Server;use Illuminate\Database\Eloquent\Model;@@ -7,96 +8,87 @@ use Illuminate\Support\Facades\Process;use Illuminate\Support\Facades\Storage;use Spatie\Activitylog\Models\Activity;-if (!function_exists('remoteProcess')) {- /**- * Run a Remote Process, which SSH's asynchronously into a machine to run the command(s).- * @TODO Change 'root' to 'coolify' when it's able to run Docker commands without sudo- *- */- function remoteProcess(- array $command,- Server $server,- string $type,- ?string $type_uuid = null,- ?Model $model = null,- ): Activity {+/**+ * Run a Remote Process, which SSH's asynchronously into a machine to run the command(s).+ * @TODO Change 'root' to 'coolify' when it's able to run Docker commands without sudo+ *+ */+function remote_process(+ array $command,+ Server $server,+ string $type,+ ?string $type_uuid = null,+ ?Model $model = null,+): Activity {- $command_string = implode("\n", $command);+ $command_string = implode("\n", $command);- // @TODO: Check if the user has access to this server- // checkTeam($server->team_id);+ // @TODO: Check if the user has access to this server+ // checkTeam($server->team_id);- $private_key_location = savePrivateKeyForServer($server);+ $private_key_location = save_private_key_for_server($server);- return resolve(PrepareCoolifyTask::class, [- 'remoteProcessArgs' => new CoolifyTaskArgs(- server_ip: $server->ip,- private_key_location: $private_key_location,- command: <<<EOT+ return resolve(PrepareCoolifyTask::class, [+ 'remoteProcessArgs' => new CoolifyTaskArgs(+ server_ip: $server->ip,+ private_key_location: $private_key_location,+ command: <<<EOT{$command_string}EOT,- port: $server->port,- user: $server->user,- type: $type,- type_uuid: $type_uuid,- model: $model,- ),- ])();- }+ port: $server->port,+ user: $server->user,+ type: $type,+ type_uuid: $type_uuid,+ model: $model,+ ),+ ])();}--if (!function_exists('savePrivateKeyForServer')) {- function savePrivateKeyForServer(Server $server)- {- $temp_file = "id.root@{$server->ip}";- Storage::disk('ssh-keys')->put($temp_file, $server->privateKey->private_key);- return '/var/www/html/storage/app/ssh-keys/' . $temp_file;- }+function save_private_key_for_server(Server $server)+{+ $temp_file = "id.root@{$server->ip}";+ Storage::disk('ssh-keys')->put($temp_file, $server->privateKey->private_key);+ return '/var/www/html/storage/app/ssh-keys/' . $temp_file;}-if (!function_exists('generateSshCommand')) {- function generateSshCommand(string $private_key_location, string $server_ip, string $user, string $port, string $command, bool $isMux = true)- {- Storage::disk('local')->makeDirectory('.ssh');+function generate_ssh_command(string $private_key_location, string $server_ip, string $user, string $port, string $command, bool $isMux = true)+{+ Storage::disk('local')->makeDirectory('.ssh');- $delimiter = 'EOF-COOLIFY-SSH';- $ssh_command = "ssh ";+ $delimiter = 'EOF-COOLIFY-SSH';+ $ssh_command = "ssh ";- if ($isMux && config('coolify.mux_enabled')) {- $ssh_command .= '-o ControlMaster=auto -o ControlPersist=1m -o ControlPath=/var/www/html/storage/app/.ssh/ssh_mux_%h_%p_%r ';- }- $ssh_command .= "-i {$private_key_location} "- . '-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null '- . '-o PasswordAuthentication=no '- . '-o ConnectTimeout=3600 '- . '-o ServerAliveInterval=20 '- . '-o RequestTTY=no '- . '-o LogLevel=ERROR '- . "-p {$port} "- . "{$user}@{$server_ip} "- . " 'bash -se' << \\$delimiter" . PHP_EOL- . $command . PHP_EOL- . $delimiter;-- return $ssh_command;+ if ($isMux && config('coolify.mux_enabled')) {+ $ssh_command .= '-o ControlMaster=auto -o ControlPersist=1m -o ControlPath=/var/www/html/storage/app/.ssh/ssh_mux_%h_%p_%r ';}+ $ssh_command .= "-i {$private_key_location} "+ . '-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null '+ . '-o PasswordAuthentication=no '+ . '-o ConnectTimeout=3600 '+ . '-o ServerAliveInterval=20 '+ . '-o RequestTTY=no '+ . '-o LogLevel=ERROR '+ . "-p {$port} "+ . "{$user}@{$server_ip} "+ . " 'bash -se' << \\$delimiter" . PHP_EOL+ . $command . PHP_EOL+ . $delimiter;++ return $ssh_command;}-if (!function_exists('instantRemoteProcess')) {- function instantRemoteProcess(array $command, Server $server, $throwError = true)- {- $command_string = implode("\n", $command);- $private_key_location = savePrivateKeyForServer($server);- $ssh_command = generateSshCommand($private_key_location, $server->ip, $server->user, $server->port, $command_string);- $process = Process::run($ssh_command);- $output = trim($process->output());- $exitCode = $process->exitCode();- if ($exitCode !== 0) {- if (!$throwError) {- return null;- }- throw new \RuntimeException($process->errorOutput());+function instant_remote_process(array $command, Server $server, $throwError = true)+{+ $command_string = implode("\n", $command);+ $private_key_location = save_private_key_for_server($server);+ $ssh_command = generate_ssh_command($private_key_location, $server->ip, $server->user, $server->port, $command_string);+ $process = Process::run($ssh_command);+ $output = trim($process->output());+ $exitCode = $process->exitCode();+ if ($exitCode !== 0) {+ if (!$throwError) {+ return null;}- return $output;+ throw new \RuntimeException($process->errorOutput());}+ return $output;}diff --git a/tests/Feature/DockerCommandsTest.php b/tests/Feature/DockerCommandsTest.phpindex b29d6191d1..202c276aa5 100644--- a/tests/Feature/DockerCommandsTest.php+++ b/tests/Feature/DockerCommandsTest.php@@ -33,28 +33,28 @@ it('starts a docker container correctly', function () {$containerName = 'coolify_test_' . now()->format('Ymd_his');$host = Server::where('name', 'testing-local-docker-container')->first();- remoteProcess([+ remote_process(["docker rm -f $(docker ps --filter='name={$coolifyNamePrefix}*' -aq) > /dev/null 2>&1"], $host);// Assert there's no containers start with coolify_test_*- $activity = remoteProcess([$areThereCoolifyTestContainers], $host);+ $activity = remote_process([$areThereCoolifyTestContainers], $host);$tidyOutput = RunRemoteProcess::decodeOutput($activity);$containers = format_docker_command_output_to_json($tidyOutput);expect($containers)->toBeEmpty();// start a container nginx -d --name = $containerName- $activity = remoteProcess(["docker run -d --rm --name {$containerName} nginx"], $host);+ $activity = remote_process(["docker run -d --rm --name {$containerName} nginx"], $host);expect($activity->getExtraProperty('exitCode'))->toBe(0);// docker ps name = $container- $activity = remoteProcess([$areThereCoolifyTestContainers], $host);+ $activity = remote_process([$areThereCoolifyTestContainers], $host);$tidyOutput = RunRemoteProcess::decodeOutput($activity);$containers = format_docker_command_output_to_json($tidyOutput);expect($containers->where('Names', $containerName)->count())->toBe(1);// Stop testing containers- $activity = remoteProcess([+ $activity = remote_process(["docker ps --filter='name={$coolifyNamePrefix}*' -aq && " ."docker rm -f $(docker ps --filter='name={$coolifyNamePrefix}*' -aq)"], $host);diff --git a/tests/Feature/RemoteProcessTest.php b/tests/Feature/RemoteProcessTest.phpindex 12786b82b6..ca3777e9d9 100644--- a/tests/Feature/RemoteProcessTest.php+++ b/tests/Feature/RemoteProcessTest.php@@ -17,7 +17,7 @@ it('outputs correctly', function () {$host = Server::where('name', 'testing-local-docker-container')->first();- $activity = remoteProcess([+ $activity = remote_process(['pwd','x=1; while [ $x -le 3 ]; do sleep 0.1 && echo "Welcome $x times" $(( x++ )); done',], $host);