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

This reverts commit feacedbb04.
This commit is contained in:
Andras Bacsai
2025-09-15 17:56:48 +02:00
parent 393745b68c
commit 133e72336a
7 changed files with 48 additions and 35 deletions

View File

@@ -309,7 +309,10 @@ class Server extends BaseModel
$conf = Yaml::dump($dynamic_conf, 12, 2);
}
$conf = $banner.$conf;
transfer_file_to_server($conf, $default_redirect_file, $this);
$base64 = base64_encode($conf);
instant_remote_process([
"echo '$base64' | base64 -d | tee $default_redirect_file > /dev/null",
], $this);
}
if ($proxy_type === 'CADDY') {
@@ -443,10 +446,11 @@ class Server extends BaseModel
"# Do not edit it manually (only if you know what are you doing).\n\n".
$yaml;
$base64 = base64_encode($yaml);
instant_remote_process([
"mkdir -p $dynamic_config_path",
"echo '$base64' | base64 -d | tee $file > /dev/null",
], $this);
transfer_file_to_server($yaml, $file, $this);
}
} elseif ($this->proxyType() === 'CADDY') {
$file = "$dynamic_config_path/coolify.caddy";
@@ -469,7 +473,10 @@ $schema://$host {
}
reverse_proxy coolify:8080
}";
transfer_file_to_server($caddy_file, $file, $this);
$base64 = base64_encode($caddy_file);
instant_remote_process([
"echo '$base64' | base64 -d | tee $file > /dev/null",
], $this);
$this->reloadCaddy();
}
}