From 4e15ed7491662fc92e715e6a50392a587dfa996a Mon Sep 17 00:00:00 2001 From: usmannasir Date: Fri, 22 Dec 2023 12:37:10 +0500 Subject: [PATCH] command changes --- dockerManager/entrypoint.sh | 2 +- plogical/DockerSites.py | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/dockerManager/entrypoint.sh b/dockerManager/entrypoint.sh index d0fae37b1..7bf9a1c1a 100644 --- a/dockerManager/entrypoint.sh +++ b/dockerManager/entrypoint.sh @@ -22,7 +22,7 @@ SITE_NAME=${SITE_NAME:-"CyberPanel Site"} ### Install LSCache plugin -/usr/local/lsws/lsphp82/bin/php /usr/bin/wp plugin install litespeed-cache --allow-root --path="/usr/local/lsws/Example/html" +/usr/local/lsws/lsphp82/bin/php /usr/bin/wp plugin install litespeed-cache --allow-root --path="/usr/local/lsws/Example/html" --activate # Start OpenLiteSpeed /usr/local/lsws/bin/lswsctrl start diff --git a/plogical/DockerSites.py b/plogical/DockerSites.py index 729856e3b..62c36ddc5 100644 --- a/plogical/DockerSites.py +++ b/plogical/DockerSites.py @@ -291,7 +291,11 @@ services: ### WriteConfig to compose-file command = f"mkdir -p /home/docker/{self.data['finalURL']}" - ProcessUtilities.executioner(command) + result, message = ProcessUtilities.outputExecutioner(command) + + if result == 0: + logging.statusWriter(self.JobID, f'Error {str(message)} . [404]') + return 0 TempCompose = f'/home/cyberpanel/{self.data["finalURL"]}-docker-compose.yml' @@ -300,7 +304,11 @@ services: WriteToFile.close() command = f"mv {TempCompose} {self.data['ComposePath']}" - ProcessUtilities.executioner(command) + result, message = ProcessUtilities.outputExecutioner(command) + + if result == 0: + logging.statusWriter(self.JobID, f'Error {str(message)} . [404]') + return 0 command = f"chmod 600 {self.data['ComposePath']} && chown root:root {self.data['ComposePath']}" ProcessUtilities.executioner(command, 'root', True) @@ -308,10 +316,11 @@ services: #### command = f"docker-compose -f {self.data['ComposePath']} -p '{self.data['SiteName']}' up -d" - result = ProcessUtilities.outputExecutioner(command) + result, message = ProcessUtilities.outputExecutioner(command) - if os.path.exists(ProcessUtilities.debugPath): - logging.writeToFile(result) + if result == 0: + logging.statusWriter(self.JobID, f'Error {str(message)} . [404]') + return 0 ### Set up Proxy