From a6ab8bc90634f12275db070939d970c0ad268b4f Mon Sep 17 00:00:00 2001 From: yellowcooln <12516003+yellowcooln@users.noreply.github.com> Date: Sat, 29 Aug 2026 23:19:09 -0400 Subject: [PATCH] feat: shallow clone Console distribution --- README.md | 5 +++-- scripts/openhop-update | 3 ++- scripts/proxmox-install.sh | 2 +- tests/test_proxmox_installer.py | 6 ++++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ebb4c62..2f1763c 100644 --- a/README.md +++ b/README.md @@ -316,8 +316,9 @@ whether to download the optional openHop Console WebUI. It will then: 6. Install an `update` command for Debian and openHop Repeater updates. 7. Run `manage.sh install` inside the container. 8. Optionally install openHop Console WebUI assets after Repeater installation. - The public Console distribution repository is cloned to `/root/pymc_console` - so it can be inspected and upgraded in the same way as Repeater. Console is + The public Console distribution repository is cloned as a depth-one, + single-branch checkout without tags at `/root/pymc_console`, minimizing disk + usage while keeping it upgradeable in the same way as Repeater. Console is not selected as the default frontend, allowing the Repeater setup wizard to be completed first. 9. Display the dashboard URL. diff --git a/scripts/openhop-update b/scripts/openhop-update index 0d06521..f292906 100755 --- a/scripts/openhop-update +++ b/scripts/openhop-update @@ -71,7 +71,8 @@ if [[ "$CONSOLE_INSTALLED" == "true" ]]; then exit 1 fi echo "==> Creating openHop Console checkout" - git clone --branch main --single-branch "$CONSOLE_REPO_URL" "$CONSOLE_REPO_DIR" + git clone --depth 1 --single-branch --branch main --no-tags \ + "$CONSOLE_REPO_URL" "$CONSOLE_REPO_DIR" CONSOLE_CHECKOUT=true fi diff --git a/scripts/proxmox-install.sh b/scripts/proxmox-install.sh index f3b1c3b..ed77fc1 100644 --- a/scripts/proxmox-install.sh +++ b/scripts/proxmox-install.sh @@ -345,7 +345,7 @@ msg_ok "manage.sh install completed" # ── Optional openHop Console WebUI ───────────────────────────────────────── if [[ "$INSTALL_CONSOLE" == "true" ]]; then msg_info "Cloning openHop Console distribution repository..." - pct exec "$CTID" -- git clone --branch main --single-branch \ + pct exec "$CTID" -- git clone --depth 1 --single-branch --branch main --no-tags \ "$CONSOLE_REPO" /root/pymc_console msg_ok "Console repository cloned to /root/pymc_console" diff --git a/tests/test_proxmox_installer.py b/tests/test_proxmox_installer.py index f8429f3..9310627 100644 --- a/tests/test_proxmox_installer.py +++ b/tests/test_proxmox_installer.py @@ -151,10 +151,12 @@ def test_console_checkout_is_created_and_updated_when_console_is_installed() -> installer = INSTALLER.read_text() updater = UPDATER.read_text() - assert "git clone --branch main --single-branch" in installer + shallow_clone = "git clone --depth 1 --single-branch --branch main --no-tags" + assert shallow_clone in installer assert "/root/pymc_console" in installer assert 'readonly CONSOLE_REPO_DIR="/root/pymc_console"' in updater - assert 'git clone --branch main --single-branch "$CONSOLE_REPO_URL"' in updater + assert shallow_clone in updater + assert '"$CONSOLE_REPO_URL" "$CONSOLE_REPO_DIR"' in updater assert 'git -C "$CONSOLE_REPO_DIR" pull --ff-only' in updater assert "ASSUME_YES=1 NO_COLOR=1 bash manage.sh upgrade" in updater