Revert "refactor(file-transfer): replace base64 encoding with direct file transfer method across multiple database actions for improved clarity and efficiency"
This reverts commit 18068857b1.
This commit is contained in:
@@ -1075,6 +1075,7 @@ $schema://$host {
|
||||
|
||||
public function validateConnection(bool $justCheckingNewKey = false)
|
||||
{
|
||||
ray('validateConnection', $this->id);
|
||||
$this->disableSshMux();
|
||||
|
||||
if ($this->skipServer()) {
|
||||
@@ -1312,6 +1313,7 @@ $schema://$host {
|
||||
public function generateCaCertificate()
|
||||
{
|
||||
try {
|
||||
ray('Generating CA certificate for server', $this->id);
|
||||
SslHelper::generateSslCertificate(
|
||||
commonName: 'Coolify CA Certificate',
|
||||
serverId: $this->id,
|
||||
@@ -1319,6 +1321,7 @@ $schema://$host {
|
||||
validityDays: 10 * 365
|
||||
);
|
||||
$caCertificate = SslCertificate::where('server_id', $this->id)->where('is_ca_certificate', true)->first();
|
||||
ray('CA certificate generated', $caCertificate);
|
||||
if ($caCertificate) {
|
||||
$certificateContent = $caCertificate->ssl_certificate;
|
||||
$caCertPath = config('constants.coolify.base_config_path').'/ssl/';
|
||||
|
||||
@@ -1280,10 +1280,8 @@ class Service extends BaseModel
|
||||
if ($envs->count() === 0) {
|
||||
$commands[] = 'touch .env';
|
||||
} else {
|
||||
$envs_content = $envs->implode("\n");
|
||||
transfer_file_to_server($envs_content, $this->workdir().'/.env', $this->server);
|
||||
|
||||
return;
|
||||
$envs_base64 = base64_encode($envs->implode("\n"));
|
||||
$commands[] = "echo '$envs_base64' | base64 -d | tee .env > /dev/null";
|
||||
}
|
||||
|
||||
instant_remote_process($commands, $this->server);
|
||||
|
||||
Reference in New Issue
Block a user