add support for ubuntu 24
This commit is contained in:
parent
cb31db90f7
commit
f69840d0b9
|
|
@ -10,25 +10,6 @@ For the full list of settings and their values, see
|
||||||
https://docs.djangoproject.com/en/1.11/ref/settings/
|
https://docs.djangoproject.com/en/1.11/ref/settings/
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Fix for botocore.vendored.six.moves import error
|
|
||||||
import sys
|
|
||||||
try:
|
|
||||||
import six
|
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
# Create a compatibility shim for botocore.vendored
|
|
||||||
if 'botocore' not in sys.modules:
|
|
||||||
import botocore
|
|
||||||
if not hasattr(sys.modules.get('botocore', None), 'vendored'):
|
|
||||||
import types
|
|
||||||
vendored = types.ModuleType('vendored')
|
|
||||||
vendored.six = six
|
|
||||||
sys.modules['botocore'].vendored = vendored
|
|
||||||
sys.modules['botocore.vendored'] = vendored
|
|
||||||
sys.modules['botocore.vendored.six'] = six
|
|
||||||
sys.modules['botocore.vendored.six.moves'] = six.moves
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -720,15 +720,18 @@ password="%s"
|
||||||
|
|
||||||
os.chdir("/usr/local/CyberCP")
|
os.chdir("/usr/local/CyberCP")
|
||||||
|
|
||||||
# Clear Python cache to avoid botocore vendored six import errors
|
# Clear Python cache to avoid import errors
|
||||||
command = "find /usr/local/CyberCP -name '*.pyc' -delete"
|
command = "find /usr/local/CyberCP -name '*.pyc' -delete"
|
||||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||||
|
|
||||||
command = "find /usr/local/CyberCP -name '__pycache__' -type d -exec rm -rf {} +"
|
command = "find /usr/local/CyberCP -name '__pycache__' -type d -exec rm -rf {} +"
|
||||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||||
|
|
||||||
# Ensure six module is installed to fix botocore compatibility
|
# Uninstall any old versions of boto3/botocore and reinstall clean versions
|
||||||
command = "/usr/local/CyberPanel/bin/python -m pip install six==1.16.0"
|
command = "/usr/local/CyberPanel/bin/python -m pip uninstall -y boto3 botocore"
|
||||||
|
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||||
|
|
||||||
|
command = "/usr/local/CyberPanel/bin/python -m pip install --no-cache-dir boto3==1.34.153 botocore==1.34.153"
|
||||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||||
|
|
||||||
command = "/usr/local/CyberPanel/bin/python manage.py makemigrations"
|
command = "/usr/local/CyberPanel/bin/python manage.py makemigrations"
|
||||||
|
|
|
||||||
|
|
@ -1086,10 +1086,10 @@ class ACLManager:
|
||||||
|
|
||||||
if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
|
if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
|
||||||
#command = f"sed -i 's/docRoot\s\s*.*/docRoot {NewDocRoot}/g " + vhostConf
|
#command = f"sed -i 's/docRoot\s\s*.*/docRoot {NewDocRoot}/g " + vhostConf
|
||||||
command = f"sed -i 's#docRoot\s\s*.*#docRoot {NewDocRoot}#g' " + vhostConf
|
command = f"sed -i 's#docRoot\\s\\s*.*#docRoot {NewDocRoot}#g' " + vhostConf
|
||||||
ProcessUtilities.executioner(command, 'root', True)
|
ProcessUtilities.executioner(command, 'root', True)
|
||||||
else:
|
else:
|
||||||
command = f"sed -i 's#DocumentRoot\s\s*[^[:space:]]*#DocumentRoot {NewDocRoot}#g' " + vhostConf
|
command = f"sed -i 's#DocumentRoot\\s\\s*[^[:space:]]*#DocumentRoot {NewDocRoot}#g' " + vhostConf
|
||||||
ProcessUtilities.executioner(command, 'root', True)
|
ProcessUtilities.executioner(command, 'root', True)
|
||||||
|
|
||||||
except:
|
except:
|
||||||
|
|
@ -1120,7 +1120,7 @@ class ACLManager:
|
||||||
finalConfPath = ApacheVhost.configBasePath + domainName + '.conf'
|
finalConfPath = ApacheVhost.configBasePath + domainName + '.conf'
|
||||||
|
|
||||||
if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
|
if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
|
||||||
command = f"sed -i 's#DocumentRoot\s\s*[^[:space:]]*#DocumentRoot {NewDocRoot}#g' " + finalConfPath
|
command = f"sed -i 's#DocumentRoot\\s\\s*[^[:space:]]*#DocumentRoot {NewDocRoot}#g' " + finalConfPath
|
||||||
ProcessUtilities.executioner(command, 'root', True)
|
ProcessUtilities.executioner(command, 'root', True)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
@ -1152,7 +1152,7 @@ class ACLManager:
|
||||||
$_ENV['snappymail_INCLUDE_AS_API'] = true;
|
$_ENV['snappymail_INCLUDE_AS_API'] = true;
|
||||||
include '/usr/local/CyberCP/public/snappymail/index.php';
|
include '/usr/local/CyberCP/public/snappymail/index.php';
|
||||||
|
|
||||||
$oConfig = \snappymail\Api::Config();
|
$oConfig = \\snappymail\\Api::Config();
|
||||||
$oConfig->SetPassword('%s');
|
$oConfig->SetPassword('%s');
|
||||||
echo $oConfig->Save() ? 'Done' : 'Error';
|
echo $oConfig->Save() ? 'Done' : 'Error';
|
||||||
|
|
||||||
|
|
@ -1177,10 +1177,10 @@ echo $oConfig->Save() ? 'Done' : 'Error';
|
||||||
|
|
||||||
###### fix Core CyberPanel permissions
|
###### fix Core CyberPanel permissions
|
||||||
|
|
||||||
command = "find /usr/local/CyberCP -type d -exec chmod 0755 {} \;"
|
command = "find /usr/local/CyberCP -type d -exec chmod 0755 {} \\;"
|
||||||
ProcessUtilities.executioner(command, 'root', True)
|
ProcessUtilities.executioner(command, 'root', True)
|
||||||
|
|
||||||
command = "find /usr/local/CyberCP -type f -exec chmod 0644 {} \;"
|
command = "find /usr/local/CyberCP -type f -exec chmod 0644 {} \\;"
|
||||||
ProcessUtilities.executioner(command, 'root', True)
|
ProcessUtilities.executioner(command, 'root', True)
|
||||||
|
|
||||||
command = "chmod -R 755 /usr/local/CyberCP/bin"
|
command = "chmod -R 755 /usr/local/CyberCP/bin"
|
||||||
|
|
@ -1193,10 +1193,10 @@ echo $oConfig->Save() ? 'Done' : 'Error';
|
||||||
|
|
||||||
########### Fix LSCPD
|
########### Fix LSCPD
|
||||||
|
|
||||||
command = "find /usr/local/lscp -type d -exec chmod 0755 {} \;"
|
command = "find /usr/local/lscp -type d -exec chmod 0755 {} \\;"
|
||||||
ProcessUtilities.executioner(command, 'root', True)
|
ProcessUtilities.executioner(command, 'root', True)
|
||||||
|
|
||||||
command = "find /usr/local/lscp -type f -exec chmod 0644 {} \;"
|
command = "find /usr/local/lscp -type f -exec chmod 0644 {} \\;"
|
||||||
ProcessUtilities.executioner(command, 'root', True)
|
ProcessUtilities.executioner(command, 'root', True)
|
||||||
|
|
||||||
command = "chmod -R 755 /usr/local/lscp/bin"
|
command = "chmod -R 755 /usr/local/lscp/bin"
|
||||||
|
|
|
||||||
|
|
@ -2260,10 +2260,10 @@ class MailServerManagerUtils(multi.Thread):
|
||||||
def fixCyberPanelPermissions(self):
|
def fixCyberPanelPermissions(self):
|
||||||
|
|
||||||
###### fix Core CyberPanel permissions
|
###### fix Core CyberPanel permissions
|
||||||
command = "find /usr/local/CyberCP -type d -exec chmod 0755 {} \;"
|
command = "find /usr/local/CyberCP -type d -exec chmod 0755 {} \\;"
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
command = "find /usr/local/CyberCP -type f -exec chmod 0644 {} \;"
|
command = "find /usr/local/CyberCP -type f -exec chmod 0644 {} \\;"
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
command = "chmod -R 755 /usr/local/CyberCP/bin"
|
command = "chmod -R 755 /usr/local/CyberCP/bin"
|
||||||
|
|
@ -2276,10 +2276,10 @@ class MailServerManagerUtils(multi.Thread):
|
||||||
|
|
||||||
########### Fix LSCPD
|
########### Fix LSCPD
|
||||||
|
|
||||||
command = "find /usr/local/lscp -type d -exec chmod 0755 {} \;"
|
command = "find /usr/local/lscp -type d -exec chmod 0755 {} \\;"
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
command = "find /usr/local/lscp -type f -exec chmod 0644 {} \;"
|
command = "find /usr/local/lscp -type f -exec chmod 0644 {} \\;"
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
command = "chmod -R 755 /usr/local/lscp/bin"
|
command = "chmod -R 755 /usr/local/lscp/bin"
|
||||||
|
|
|
||||||
|
|
@ -950,7 +950,7 @@ password=%s
|
||||||
connection, cursor = mysqlUtilities.setupConnection()
|
connection, cursor = mysqlUtilities.setupConnection()
|
||||||
cursor.execute("use mysql")
|
cursor.execute("use mysql")
|
||||||
database = Databases.objects.get(dbName=databaseName)
|
database = Databases.objects.get(dbName=databaseName)
|
||||||
databaseName = databaseName.replace('_', '\_')
|
databaseName = databaseName.replace('_', '\\_')
|
||||||
query = "select user from db where db = '%s'" % (databaseName)
|
query = "select user from db where db = '%s'" % (databaseName)
|
||||||
|
|
||||||
if connection == 0:
|
if connection == 0:
|
||||||
|
|
|
||||||
|
|
@ -224,7 +224,7 @@ context /.well-known/acme-challenge {
|
||||||
<Proxy "unix:{sockPath}{virtualHostName}.sock|fcgi://php-fpm-{externalApp}">
|
<Proxy "unix:{sockPath}{virtualHostName}.sock|fcgi://php-fpm-{externalApp}">
|
||||||
ProxySet disablereuse=off
|
ProxySet disablereuse=off
|
||||||
</proxy>
|
</proxy>
|
||||||
<FilesMatch \.php$>
|
<FilesMatch \\.php$>
|
||||||
SetHandler proxy:fcgi://php-fpm-{externalApp}
|
SetHandler proxy:fcgi://php-fpm-{externalApp}
|
||||||
</FilesMatch>
|
</FilesMatch>
|
||||||
#CustomLog /home/{virtualHostName}/logs/{virtualHostName}.access_log combined
|
#CustomLog /home/{virtualHostName}/logs/{virtualHostName}.access_log combined
|
||||||
|
|
@ -249,7 +249,7 @@ context /.well-known/acme-challenge {
|
||||||
<Proxy "unix:{sockPath}{virtualHostName}.sock|fcgi://php-fpm-{externalApp}">
|
<Proxy "unix:{sockPath}{virtualHostName}.sock|fcgi://php-fpm-{externalApp}">
|
||||||
ProxySet disablereuse=off
|
ProxySet disablereuse=off
|
||||||
</proxy>
|
</proxy>
|
||||||
<FilesMatch \.php$>
|
<FilesMatch \\.php$>
|
||||||
SetHandler proxy:fcgi://php-fpm-{externalApp}
|
SetHandler proxy:fcgi://php-fpm-{externalApp}
|
||||||
</FilesMatch>
|
</FilesMatch>
|
||||||
#CustomLog /home/{virtualHostName}/logs/{virtualHostName}.access_log combined
|
#CustomLog /home/{virtualHostName}/logs/{virtualHostName}.access_log combined
|
||||||
|
|
@ -279,7 +279,7 @@ context /.well-known/acme-challenge {
|
||||||
<Proxy "unix:{sockPath}{virtualHostName}.sock|fcgi://php-fpm-{externalApp}">
|
<Proxy "unix:{sockPath}{virtualHostName}.sock|fcgi://php-fpm-{externalApp}">
|
||||||
ProxySet disablereuse=off
|
ProxySet disablereuse=off
|
||||||
</proxy>
|
</proxy>
|
||||||
<FilesMatch \.php$>
|
<FilesMatch \\.php$>
|
||||||
SetHandler proxy:fcgi://php-fpm-{externalApp}
|
SetHandler proxy:fcgi://php-fpm-{externalApp}
|
||||||
</FilesMatch>
|
</FilesMatch>
|
||||||
#CustomLog /home/{virtualHostName}/logs/{virtualHostName}.access_log combined
|
#CustomLog /home/{virtualHostName}/logs/{virtualHostName}.access_log combined
|
||||||
|
|
@ -304,7 +304,7 @@ context /.well-known/acme-challenge {
|
||||||
<Proxy "unix:{sockPath}{virtualHostName}.sock|fcgi://php-fpm-{externalApp}">
|
<Proxy "unix:{sockPath}{virtualHostName}.sock|fcgi://php-fpm-{externalApp}">
|
||||||
ProxySet disablereuse=off
|
ProxySet disablereuse=off
|
||||||
</proxy>
|
</proxy>
|
||||||
<FilesMatch \.php$>
|
<FilesMatch \\.php$>
|
||||||
SetHandler proxy:fcgi://php-fpm-{externalApp}
|
SetHandler proxy:fcgi://php-fpm-{externalApp}
|
||||||
</FilesMatch>
|
</FilesMatch>
|
||||||
#CustomLog /home/{virtualHostName}/logs/{virtualHostName}.access_log combined
|
#CustomLog /home/{virtualHostName}/logs/{virtualHostName}.access_log combined
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ cloudflare==2.20.0
|
||||||
cryptography==43.0.0
|
cryptography==43.0.0
|
||||||
cffi
|
cffi
|
||||||
Django==4.2.14
|
Django==4.2.14
|
||||||
six==1.16.0
|
|
||||||
docker==7.1.0
|
docker==7.1.0
|
||||||
google-api-core==2.19.1
|
google-api-core==2.19.1
|
||||||
google-api-python-client==2.139.0
|
google-api-python-client==2.139.0
|
||||||
|
|
|
||||||
|
|
@ -4851,13 +4851,13 @@ StrictHostKeyChecking no
|
||||||
|
|
||||||
if pages <= 1.0:
|
if pages <= 1.0:
|
||||||
pages = 1
|
pages = 1
|
||||||
pagination.append('<li><a href="\#"></a></li>')
|
pagination.append('<li><a href="\\#"></a></li>')
|
||||||
else:
|
else:
|
||||||
pages = ceil(pages)
|
pages = ceil(pages)
|
||||||
finalPages = int(pages) + 1
|
finalPages = int(pages) + 1
|
||||||
|
|
||||||
for i in range(1, finalPages):
|
for i in range(1, finalPages):
|
||||||
pagination.append('<li><a href="\#">' + str(i) + '</a></li>')
|
pagination.append('<li><a href="\\#">' + str(i) + '</a></li>')
|
||||||
|
|
||||||
return pagination
|
return pagination
|
||||||
|
|
||||||
|
|
@ -4869,13 +4869,13 @@ StrictHostKeyChecking no
|
||||||
|
|
||||||
if pages <= 1.0:
|
if pages <= 1.0:
|
||||||
pages = 1
|
pages = 1
|
||||||
pagination.append('<li><a href="\#"></a></li>')
|
pagination.append('<li><a href="\\#"></a></li>')
|
||||||
else:
|
else:
|
||||||
pages = ceil(pages)
|
pages = ceil(pages)
|
||||||
finalPages = int(pages) + 1
|
finalPages = int(pages) + 1
|
||||||
|
|
||||||
for i in range(1, finalPages):
|
for i in range(1, finalPages):
|
||||||
pagination.append('<li><a href="\#">' + str(i) + '</a></li>')
|
pagination.append('<li><a href="\\#">' + str(i) + '</a></li>')
|
||||||
|
|
||||||
return pagination
|
return pagination
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue