From 76356d3032bd354fec044a2cefcdad1ec7707622 Mon Sep 17 00:00:00 2001 From: usmannasir Date: Thu, 18 Sep 2025 23:16:37 +0500 Subject: [PATCH 1/2] debian 12 --- install/install.py | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/install/install.py b/install/install.py index f2cd71320..17e952abd 100644 --- a/install/install.py +++ b/install/install.py @@ -660,13 +660,36 @@ password="%s" os.chdir("/usr/local/CyberCP") + # Try makemigrations first command = "/usr/local/CyberPanel/bin/python manage.py makemigrations" - preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + result = preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) + + # If makemigrations fails due to migration dependency issues, try to fix it + if result != 1: + preFlightsChecks.stdOut("Migration dependency issue detected, attempting to fix...") + + # Reset baseTemplate migrations to resolve dependency issues + command = "/usr/local/CyberPanel/bin/python manage.py migrate baseTemplate zero --fake" + preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) + + # Create a new initial migration for baseTemplate + command = "/usr/local/CyberPanel/bin/python manage.py makemigrations baseTemplate --empty" + preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) + + # Try makemigrations again + command = "/usr/local/CyberPanel/bin/python manage.py makemigrations" + preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) ## - command = "/usr/local/CyberPanel/bin/python manage.py migrate" - preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + # Apply migrations with fake-initial to handle missing initial migrations + command = "/usr/local/CyberPanel/bin/python manage.py migrate --fake-initial" + result = preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) + + # If fake-initial fails, try regular migrate + if result != 1: + command = "/usr/local/CyberPanel/bin/python manage.py migrate" + preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) if not os.path.exists("/usr/local/CyberCP/public"): os.mkdir("/usr/local/CyberCP/public") From 2f297029d0606d7fed58201b8ece44218084c0b4 Mon Sep 17 00:00:00 2001 From: usmannasir Date: Thu, 18 Sep 2025 23:20:05 +0500 Subject: [PATCH 2/2] debian 12 --- install/install.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install/install.py b/install/install.py index 17e952abd..50b165258 100644 --- a/install/install.py +++ b/install/install.py @@ -445,10 +445,11 @@ class preFlightsChecks: ### Docker User/group - if self.distro == ubuntu: + if self.distro == ubuntu or self.distro == debian12: command = 'adduser --disabled-login --gecos "" docker' else: - command = "adduser docker" + # For CentOS/RHEL, use useradd which is non-interactive + command = "useradd -r -s /bin/false docker" preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)