refactor(file-transfer): replace base64 encoding with direct file transfer method in various components for improved clarity and efficiency

This commit is contained in:
Andras Bacsai
2025-09-09 11:10:38 +02:00
parent fe2c4fd1c7
commit feacedbb04
8 changed files with 36 additions and 51 deletions

View File

@@ -1424,12 +1424,10 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
}
$private_key = data_get($this->application, 'private_key.private_key');
if ($private_key) {
$private_key = base64_encode($private_key);
$this->execute_remote_command([
executeInDocker($this->deployment_uuid, 'mkdir -p /root/.ssh'),
]);
$key_content = base64_decode($private_key);
transfer_file_to_container($key_content, '/root/.ssh/id_rsa', $this->deployment_uuid, $this->server);
transfer_file_to_container($private_key, '/root/.ssh/id_rsa', $this->deployment_uuid, $this->server);
$this->execute_remote_command(
[
executeInDocker($this->deployment_uuid, 'chmod 600 /root/.ssh/id_rsa'),