From 6449b1dbfab5830537dac94003fd5842bd4c3ee4 Mon Sep 17 00:00:00 2001 From: usmannasir Date: Wed, 5 Nov 2025 09:24:34 +0500 Subject: [PATCH] Lower download size threshold to support smaller module files Reduce minimum file size from 1MB to 10KB to allow the module file (~35KB) to pass validation. The 1MB threshold was too strict and only appropriate for the main OLS binary. Now displays size in KB or MB appropriately. --- install/installCyberPanel.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index 42b130bce..b58c344a4 100644 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -236,9 +236,12 @@ class InstallCyberPanel: # Check if file was downloaded successfully by verifying it exists and has reasonable size if os.path.exists(destination): file_size = os.path.getsize(destination) - # Verify file size is reasonable (at least 1MB for a real binary) - if file_size > 1048576: # 1MB - InstallCyberPanel.stdOut(f"Downloaded successfully ({file_size / (1024*1024):.2f} MB)", 1) + # Verify file size is reasonable (at least 10KB to avoid error pages/empty files) + if file_size > 10240: # 10KB + if file_size > 1048576: # 1MB + InstallCyberPanel.stdOut(f"Downloaded successfully ({file_size / (1024*1024):.2f} MB)", 1) + else: + InstallCyberPanel.stdOut(f"Downloaded successfully ({file_size / 1024:.2f} KB)", 1) return True else: InstallCyberPanel.stdOut(f"ERROR: Downloaded file too small ({file_size} bytes)", 1)