From 4529d1c7097f2929d83c395ad165dd5626f3b958 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Fri, 10 Jun 2022 12:25:25 +0500 Subject: [PATCH 1/5] bug fix in sub domain creation --- install/install.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/install/install.py b/install/install.py index b58d33a65..f1de1601d 100755 --- a/install/install.py +++ b/install/install.py @@ -2051,6 +2051,27 @@ milter_default_action = accept logging.InstallLog.writeToFile('[ERROR] ' + str(msg) + " [enableDisableEmail]") return 0 + @staticmethod + def fixSudoers(): + try: + distroPath = '/etc/lsb-release' + + if not os.path.exists(distroPath): + fileName = '/etc/sudoers' + data = open(fileName, 'r').readlines() + + writeDataToFile = open(fileName, 'w') + for line in data: + if line.find("root") > -1 and line.find("ALL=(ALL)") > -1 and line[0] != '#': + writeDataToFile.writelines('root ALL=(ALL:ALL) ALL\n') + else: + writeDataToFile.write(line) + writeDataToFile.close() + + + except IOError as err: + pass + @staticmethod def setUpFirstAccount(): try: From 5c26218e38de39ecfa76d3399524a9fe6e272d9f Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Fri, 10 Jun 2022 12:29:33 +0500 Subject: [PATCH 2/5] bug fix: subdomain creation on cent/alma --- install/install.py | 20 ++++++++++++++++++++ plogical/upgrade.py | 3 +++ 2 files changed, 23 insertions(+) diff --git a/install/install.py b/install/install.py index 48d6c197d..e109267a8 100755 --- a/install/install.py +++ b/install/install.py @@ -2031,6 +2031,25 @@ milter_default_action = accept logging.InstallLog.writeToFile('[ERROR] ' + str(msg) + " [enableDisableEmail]") return 0 + @staticmethod + def fixSudoers(): + try: + distroPath = '/etc/lsb-release' + + if not os.path.exists(distroPath): + fileName = '/etc/sudoers' + data = open(fileName, 'r').readlines() + + writeDataToFile = open(fileName, 'w') + for line in data: + if line.find("root") > -1 and line.find("ALL=(ALL)") > -1 and line[0] != '#': + writeDataToFile.writelines('root ALL=(ALL:ALL) ALL\n') + else: + writeDataToFile.write(line) + writeDataToFile.close() + except IOError as err: + pass + @staticmethod def setUpFirstAccount(): try: @@ -2279,6 +2298,7 @@ def main(): checks.setupPHPAndComposer() checks.fix_selinux_issue() checks.install_psmisc() + checks.fixSudoers() if args.postfix is None: checks.install_postfix_dovecot() diff --git a/plogical/upgrade.py b/plogical/upgrade.py index 581f2a61d..63e9e09ba 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -248,6 +248,9 @@ class Upgrade: else: writeToFile.writelines(items) + if items.find("root") > -1 and items.find("ALL=(ALL)") > -1 and items[0] != '#': + writeToFile.writelines('root ALL=(ALL:ALL) ALL\n') + writeToFile.close() except: pass From 9cbd29df9c90b33067aa4162f8c415dab66a931c Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Fri, 10 Jun 2022 12:37:21 +0500 Subject: [PATCH 3/5] bug fix: subdomain creation on cent/alma --- plogical/upgrade.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plogical/upgrade.py b/plogical/upgrade.py index 63e9e09ba..8cefa941f 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -245,12 +245,11 @@ class Upgrade: for items in data: if items.find("wheel") > -1 and items.find("ALL=(ALL)"): continue + elif items.find("root") > -1 and items.find("ALL=(ALL)") > -1 and items[0] != '#': + writeToFile.writelines('root ALL=(ALL:ALL) ALL\n') else: writeToFile.writelines(items) - if items.find("root") > -1 and items.find("ALL=(ALL)") > -1 and items[0] != '#': - writeToFile.writelines('root ALL=(ALL:ALL) ALL\n') - writeToFile.close() except: pass From 292e1c1c4cf9fd68a95a3f16b272c1f5852fdb01 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Fri, 10 Jun 2022 14:41:33 +0500 Subject: [PATCH 4/5] bug fix: resolve https://github.com/usmannasir/cyberpanel/issues/855 --- plogical/vhostConfs.py | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/plogical/vhostConfs.py b/plogical/vhostConfs.py index 30b121484..1a1eb705d 100755 --- a/plogical/vhostConfs.py +++ b/plogical/vhostConfs.py @@ -36,18 +36,6 @@ accesslog $VH_ROOT/logs/$VH_NAME.access_log { compressArchive 1 } -errorpage 403 { - url 403.html -} - -errorpage 404 { - url 404.html -} - -errorpage 500 { - url 500.html -} - scripthandler { add lsapi:{virtualHostUser} php } @@ -145,18 +133,6 @@ module cache { storagePath /usr/local/lsws/cachedata/$VH_NAME } -errorpage 403 { - url 403.html -} - -errorpage 404 { - url 404.html -} - -errorpage 500 { - url 500.html -} - scripthandler { add lsapi:{externalApp} php } From 2003317a2fbc6d3a3ff3df5d4e6210350bb0a718 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sat, 11 Jun 2022 13:16:28 +0500 Subject: [PATCH 5/5] bug fix: ssl obtain for childdomain on lsws ent --- plogical/vhostConfs.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plogical/vhostConfs.py b/plogical/vhostConfs.py index 1a1eb705d..244ddf225 100755 --- a/plogical/vhostConfs.py +++ b/plogical/vhostConfs.py @@ -204,6 +204,7 @@ context /.well-known/acme-challenge { ServerAdmin {administratorEmail} SuexecUserGroup {externalApp} {externalApp} DocumentRoot {path} + Alias /.well-known/acme-challenge /usr/local/lsws/Example/html/.well-known/acme-challenge CustomLog /home/{masterDomain}/logs/{masterDomain}.access_log combined AddHandler application/x-httpd-php{php} .php .php7 .phtml