fix: make sure proxy path created

This commit is contained in:
Andras Bacsai 2023-09-23 11:53:30 +02:00
parent 78b9166bdb
commit 9bc61a0a17
3 changed files with 3 additions and 4 deletions

View File

@ -13,6 +13,7 @@ public function handle(Server $server, bool $reset = false)
{
$proxy_path = get_proxy_path();
$proxy_configuration = instant_remote_process([
"mkdir -p $proxy_path",
"cat $proxy_path/docker-compose.yml",
], $server, false);

View File

@ -31,7 +31,7 @@ public function handle(Server $server, bool $async = true): Activity|string
"command -v lsof >/dev/null || apt-get update",
"command -v lsof >/dev/null || apt install -y lsof",
"command -v lsof >/dev/null || command -v fuser >/dev/null || apt install -y psmisc",
"cd $proxy_path",
"mkdir -p $proxy_path && cd $proxy_path",
"echo '####### Creating Docker Compose file...'",
"echo '####### Pulling docker image...'",
'docker compose pull || docker-compose pull',

View File

@ -106,12 +106,11 @@ function generate_default_proxy_configuration(Server $server)
function setup_default_redirect_404(string|null $redirect_url, Server $server)
{
ray('called');
$traefik_dynamic_conf_path = get_proxy_path() . "/dynamic";
$traefik_default_redirect_file = "$traefik_dynamic_conf_path/default_redirect_404.yaml";
ray($redirect_url);
if (empty($redirect_url)) {
instant_remote_process([
"mkdir -p $traefik_dynamic_conf_path",
"rm -f $traefik_default_redirect_file",
], $server);
} else {
@ -171,7 +170,6 @@ function setup_default_redirect_404(string|null $redirect_url, Server $server)
$yaml;
$base64 = base64_encode($yaml);
ray("mkdir -p $traefik_dynamic_conf_path");
instant_remote_process([
"mkdir -p $traefik_dynamic_conf_path",
"echo '$base64' | base64 -d > $traefik_default_redirect_file",