feat: make initializing pages first for all apps

This commit is contained in:
lolwierd
2026-03-30 16:55:35 +05:30
parent 471c36fa91
commit 52982ca9e7
15 changed files with 66 additions and 18 deletions

View File

@@ -16,6 +16,14 @@
SCRIPT_DIR_CADDY="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
reload_or_start_caddy() {
if systemctl is-active --quiet caddy; then
systemctl reload caddy
else
systemctl enable --now caddy
fi
}
write_loading_pages() {
local app_name="$1"
local app_dir="$2"
@@ -48,8 +56,7 @@ https://${domain} {
}
EOF
systemctl enable caddy
systemctl reload caddy
reload_or_start_caddy
echo "Caddy serving initializing page for ${app_name}"
}
@@ -89,7 +96,7 @@ EOF
fi
touch "${app_dir}/.excloud/.ready"
systemctl reload caddy
reload_or_start_caddy
echo "App is ready — Caddy switched to reverse proxy"
}
@@ -119,7 +126,7 @@ https://${domain} {
EOF
fi
systemctl reload caddy
reload_or_start_caddy
echo "Domain switched to ${domain}"
}