Skip to content

Commit

Permalink
Merge branch 'v2.3.3-dev' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir authored Oct 14, 2022
2 parents 2dfabdb + f4cff2f commit e373b90
Show file tree
Hide file tree
Showing 22 changed files with 410 additions and 56 deletions.
2 changes: 2 additions & 0 deletions baseTemplate/static/baseTemplate/custom-js/system-status.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

/* Utilities */



function getCookie(name) {
var cookieValue = null;
if (document.cookie && document.cookie !== '') {
Expand Down
31 changes: 18 additions & 13 deletions baseTemplate/templates/baseTemplate/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@

<!-- HELPERS -->

{% with version="2.3.2.1" %}
{% with version="2.3.2.2" %}

<link rel="stylesheet" type="text/css" href="{% static 'baseTemplate/assets/finalBase/finalBase.css' %}">

Expand Down Expand Up @@ -105,6 +105,7 @@
</script>
<script src="https://cdn.jsdelivr.net/npm/flot-charts@0.8.3/jquery.flot.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery.flot@0.8.3/jquery.flot.time.js"></script>
<script async src="https://js.stripe.com/v3/pricing-table.js"></script>

{% block header_scripts %}
{% endblock %}
Expand Down Expand Up @@ -274,7 +275,8 @@
{# </div>#}
{# </div>#}
{# </div>#}
<a class="header-btn" target="_blank" href="https://www.youtube.com/channel/UCS6sgUWEhaFl1TO238Ck0xw?sub_confirmation=1"
<a class="header-btn" target="_blank"
href="https://www.youtube.com/channel/UCS6sgUWEhaFl1TO238Ck0xw?sub_confirmation=1"
title="{% trans 'Youtube Channel' %}">
<i class="glyph-icon icon-youtube"></i>
</a>
Expand All @@ -300,12 +302,14 @@
<ul id="sidebar-menu">
<li class="header"><span>{% trans "Overview" %}</span></li>
<li>
<a id="sidebar-menu-item-server-ip-address" href="#" title="{% trans 'Server IP Address' %}">
<a id="sidebar-menu-item-server-ip-address" href="#"
title="{% trans 'Server IP Address' %}">
<i class="glyph-icon tooltip-button icon-laptop" title="{% trans 'Server IP Address' %}"
data-original-title=".icon-laptop"></i>
<span style="color: #488a3f;font-weight: bold;">{{ ipAddress }}</span>
</a>
<a id="sidebar-menu-item-dashboard" href="{% url 'index' %}" title="{% trans 'Dashboard' %}">
<a id="sidebar-menu-item-dashboard" href="{% url 'index' %}"
title="{% trans 'Dashboard' %}">
<i class="glyph-icon icon-dashboard"></i>
<span>{% trans "Dashboard" %}</span>
</a>
Expand Down Expand Up @@ -394,17 +398,17 @@

<li id="sidebar-menu-item-websites">

<!-------------WordPress--------------------------->
<!-------------WordPress--------------------------->
<li>
<a href="{% url 'loadWebsitesHome' %}" title="{% trans 'WordPress' %}">
<div class="glyph-icon icon-wordpress" title="{% trans 'WordPress' %}"></div>
<span>{% trans "WordPress" %}</span>
</a>
<div class="sidebar-submenu">
<div class="sidebar-submenu">

<ul>
{% if admin or createWebsite %}
<li><a href="{% url 'createWordpress' %}"
{% if admin or createWebsite %}
<li><a href="{% url 'createWordpress' %}"
title="{% trans 'Deploy WordPress' %}"><span>{% trans "Deploy WordPress" %}</span></a>
</li>
{% endif %}
Expand Down Expand Up @@ -434,7 +438,7 @@
<div class="sidebar-submenu">

<ul>
{% if admin or createWebsite %}
{% if admin or createWebsite %}
<li><a href="{% url 'createWebsite' %}"
title="{% trans 'Create Website' %}"><span>{% trans "Create Website" %}</span></a>
</li>
Expand Down Expand Up @@ -621,9 +625,9 @@
title="{% trans 'DKIM Manager' %}"><span>{% trans "DKIM Manager" %}</span></a>
</li>
{% endif %}
<li><a href="{% url 'EmailDebugger' %}"
title="{% trans 'Email Debugger' %}"><span>{% trans "Email Debugger" %}</span></a>
</li>
<li><a href="{% url 'EmailDebugger' %}"
title="{% trans 'Email Debugger' %}"><span>{% trans "Email Debugger" %}</span></a>
</li>

{% if admin or createEmail %}
<li><a href="/snappymail/index.php" title="{% trans 'Access Webmail' %}"
Expand Down Expand Up @@ -781,7 +785,8 @@
<li>
<a href="{% url 'Filemanager' %}"
title="{% trans 'Root File Manager' %}">
<i class="glyph-icon tooltip-button icon-link" title="{% trans 'Root File Manager' %}"
<i class="glyph-icon tooltip-button icon-link"
title="{% trans 'Root File Manager' %}"
data-original-title=".icon-cloud-upload" aria-describedby="tooltip896208"></i>
<span>{% trans "Root File Manager" %}</span>
</a>
Expand Down
16 changes: 11 additions & 5 deletions cyberpanel_upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ elif grep -q -E "CloudLinux 7|CloudLinux 8" /etc/os-release ; then
Server_OS="CloudLinux"
elif grep -q "AlmaLinux-8" /etc/os-release ; then
Server_OS="AlmaLinux"
elif grep -q -E "Ubuntu 18.04|Ubuntu 20.04|Ubuntu 20.10" /etc/os-release ; then
elif grep -q -E "Ubuntu 18.04|Ubuntu 20.04|Ubuntu 20.10|Ubuntu 22.04" /etc/os-release ; then
Server_OS="Ubuntu"
elif grep -q -E "openEuler 20.03|openEuler 22.03" /etc/os-release ; then
Server_OS="openEuler"
Expand Down Expand Up @@ -422,7 +422,13 @@ elif [[ "$Server_OS" = "Ubuntu" ]] ; then

apt update -y
DEBIAN_FRONTEND=noninteractive apt upgrade -y
DEBIAN_FRONTEND=noninteractive apt install -y htop telnet libcurl4-gnutls-dev libgnutls28-dev libgcrypt20-dev libattr1 libattr1-dev liblzma-dev libgpgme-dev libmariadbclient-dev libcurl4-gnutls-dev libssl-dev nghttp2 libnghttp2-dev idn2 libidn2-dev libidn2-0-dev librtmp-dev libpsl-dev nettle-dev libgnutls28-dev libldap2-dev libgssapi-krb5-2 libk5crypto3 libkrb5-dev libcomerr2 libldap2-dev virtualenv git dnsutils

if [[ "$Server_OS_Version" = "22" ]] ; then
DEBIAN_FRONTEND=noninteracitve apt install -y dnsutils net-tools htop telnet libcurl4-gnutls-dev libgnutls28-dev libgcrypt20-dev libattr1 libattr1-dev liblzma-dev libgpgme-dev libcurl4-gnutls-dev libssl-dev nghttp2 libnghttp2-dev idn2 libidn2-dev libidn2-0-dev librtmp-dev libpsl-dev nettle-dev libgnutls28-dev libldap2-dev libgssapi-krb5-2 libk5crypto3 libkrb5-dev libcomerr2 libldap2-dev virtualenv git socat vim unzip zip libmariadb-dev-compat libmariadb-dev

else
DEBIAN_FRONTEND=noninteracitve apt install -y htop telnet libcurl4-gnutls-dev libgnutls28-dev libgcrypt20-dev libattr1 libattr1-dev liblzma-dev libgpgme-dev libmariadbclient-dev libcurl4-gnutls-dev libssl-dev nghttp2 libnghttp2-dev idn2 libidn2-dev libidn2-0-dev librtmp-dev libpsl-dev nettle-dev libgnutls28-dev libldap2-dev libgssapi-krb5-2 libk5crypto3 libkrb5-dev libcomerr2 libldap2-dev virtualenv git dnsutils
fi
DEBIAN_FRONTEND=noninteractive apt install -y python3-pip
DEBIAN_FRONTEND=noninteractive apt install -y build-essential libssl-dev libffi-dev python3-dev
DEBIAN_FRONTEND=noninteractive apt install -y python3-venv
Expand Down Expand Up @@ -607,9 +613,9 @@ else
Check_Return
fi

wget https://cyberpanel.sh/www.litespeedtech.com/packages/lsapi/wsgi-lsapi-1.7.tgz
tar xf wsgi-lsapi-1.7.tgz
cd wsgi-lsapi-1.7 || exit
wget https://cyberpanel.sh/www.litespeedtech.com/packages/lsapi/wsgi-lsapi-2.1.tgz
tar xf wsgi-lsapi-2.1.tgz
cd wsgi-lsapi-2.1 || exit
/usr/local/CyberPanel/bin/python ./configure.py
make

Expand Down
2 changes: 1 addition & 1 deletion cyberpanel_utility.sh
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ sudo_check() {
echo -e "\nYou must use root user to use CyberPanel Utility..."
exit
else
echo -e "\nYou are runing as root..."
echo -e "\nYou are running as root..."
fi
}

Expand Down
49 changes: 39 additions & 10 deletions emailPremium/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1890,12 +1890,18 @@ def RunServerLevelEmailChecks(request):
else:
return ACLManager.loadErrorJson()

if ACLManager.CheckForPremFeature('wp-manager'):
if ACLManager.CheckForPremFeature('email-debugger'):
ob = CloudManager()
res = ob.RunServerLevelEmailChecks()
return res
except KeyError:
return redirect(loadLoginPage)
else:
dic = {'status': 0, 'error_message': 'Kindly purchase email debugger Add-on'}
json_data = json.dumps(dic)
return HttpResponse(json_data)
except BaseException as msg:
dic = {'status': 0, 'error_message': str(msg)}
json_data = json.dumps(dic)
return HttpResponse(json_data)


def ResetEmailConfigurations(request):
Expand All @@ -1910,10 +1916,15 @@ def ResetEmailConfigurations(request):
if ACLManager.CheckForPremFeature('email-debugger'):
ob = CloudManager()
res = ob.ResetEmailConfigurations()

return res
except KeyError:
return redirect(loadLoginPage)
else:
dic = {'status': 0, 'error_message': 'Kindly purchase email debugger Add-on'}
json_data = json.dumps(dic)
return HttpResponse(json_data)
except BaseException as msg:
dic = {'status': 0, 'error_message': str(msg)}
json_data = json.dumps(dic)
return HttpResponse(json_data)

def statusFunc(request):
try:
Expand All @@ -1929,8 +1940,14 @@ def statusFunc(request):
ob = CloudManager(json.loads(request.body))
res = ob.statusFunc()
return res
except KeyError:
return redirect(loadLoginPage)
else:
dic = {'status': 0, 'error_message': 'Kindly purchase email debugger Add-on'}
json_data = json.dumps(dic)
return HttpResponse(json_data)
except BaseException as msg:
dic = {'status': 0, 'error_message': str(msg)}
json_data = json.dumps(dic)
return HttpResponse(json_data)

def ReadReport(request):
try:
Expand Down Expand Up @@ -2010,6 +2027,10 @@ def CheckPort(port):
return 0 , Result
except BaseException as msg:
logging.CyberCPLogFileWriter.writeToFile("Result....3:" + str(msg))
else:
dic = {'status': 0, 'error_message': 'Kindly purchase email debugger Add-on'}
json_data = json.dumps(dic)
return HttpResponse(json_data)
except KeyError:
return redirect(loadLoginPage)

Expand All @@ -2022,10 +2043,14 @@ def debugEmailForSite(request):
pass
else:
return ACLManager.loadErrorJson()
if ACLManager.CheckForPremFeature('wp-manager'):
if ACLManager.CheckForPremFeature('email-debugger'):
ob = CloudManager(json.loads(request.body))
res = ob.debugEmailForSite()
return res
else:
dic = {'status': 0, 'error_message': 'Kindly purchase email debugger Add-on'}
json_data = json.dumps(dic)
return HttpResponse(json_data)
except KeyError:
return redirect(loadLoginPage)

Expand All @@ -2039,11 +2064,15 @@ def fixMailSSL(request):
else:
return ACLManager.loadErrorJson()
admin = Administrator.objects.get(pk=userID)
if ACLManager.CheckForPremFeature('wp-manager'):
if ACLManager.CheckForPremFeature('email-debugger'):
cm = CloudManager(json.loads(request.body), admin)
res = cm.fixMailSSL(request)
if os.path.exists(ProcessUtilities.debugPath):
logging.CyberCPLogFileWriter.writeToFile("Result....3:" + str(res.content))
return res
else:
dic = {'status': 0, 'error_message': 'Kindly purchase email debugger Add-on'}
json_data = json.dumps(dic)
return HttpResponse(json_data)
except KeyError:
return redirect(loadLoginPage)
2 changes: 1 addition & 1 deletion filemanager/templates/filemanager/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ <h5 class="modal-title" >{% trans "Confirm Restore!" %} <img ng-hide="cyberPanel
<a style="border-bottom: 1px solid #007bff;" onclick="return false;" ng-click="showDeleteModal()" href="#"><li class="list-group-item"><i class="fa fa-trash" aria-hidden="true"></i> {% trans "Delete" %}</li></a>
<a style="border-bottom: 1px solid #007bff;" onclick="return false;" ng-click="showCompressionModal()" href="#"><li class="list-group-item"><i class="fa fa-compress" aria-hidden="true"></i> {% trans "Compress" %}</li></a>
<a style="border-bottom: 1px solid #007bff;" id="extractOnRight" onclick="return false;" ng-click="showExtractionModal()" href="#"><li class="list-group-item"><i class="fa fa-expand" aria-hidden="true"></i> {% trans "Extract" %}</li></a>
<a style="border-bottom: 1px solid #007bff;" id="editOnRight" onclick="return false;" ng-click="showHTMLEditorModal()" href="#"><li class="list-group-item"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> {% trans "Edit" %}</li></a>
<a style="border-bottom: 1px solid #007bff;" id="editOnRight" onclick="return false;" ng-click="showHTMLEditorModal(1)" href="#"><li class="list-group-item"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> {% trans "Edit" %}</li></a>
<a style="border-bottom: 1px solid #007bff;" id="editOnRightCodeMirror" onclick="return false;" ng-click="editWithCodeMirror()" href="#"><li class="list-group-item"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> {% trans "Edit with CodeMirror" %}</li></a>
<a style="border-bottom: 1px solid #007bff;" id="restoreRight" onclick="return false;" ng-click="showRestoreModal()" href="#"><li class="list-group-item"><i class="fa fa-window-restore" aria-hidden="true"></i> {% trans "Restore" %}</li></a>
</ul>
Expand Down
17 changes: 15 additions & 2 deletions install/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,12 @@ def fixCyberPanelPermissions(self):

command = 'chmod 640 /etc/pdns/pdns.conf'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
else:
command = 'chown root:pdns /etc/powerdns/pdns.conf'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)

command = 'chmod 640 /etc/powerdns/pdns.conf'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)

command = 'chmod 640 /usr/local/lscp/cyberpanel/logs/access.log'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
Expand Down Expand Up @@ -1451,13 +1457,20 @@ def installLSCPD(self):

lscpdPath = '/usr/local/lscp/bin/lscpd'

command = 'cp -f /usr/local/CyberCP/lscpd-0.3.1 /usr/local/lscp/bin/lscpd-0.3.1'
lscpdSelection = 'lscpd-0.3.1'
if os.path.exists('/etc/lsb-release'):
result = open('/etc/lsb-release', 'r').read()
if result.find('22.04') > -1:
lscpdSelection = 'lscpd.0.4.0'


command = f'cp -f /usr/local/CyberCP/{lscpdSelection} /usr/local/lscp/bin/{lscpdSelection}'
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)

command = 'rm -f /usr/local/lscp/bin/lscpd'
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)

command = 'mv /usr/local/lscp/bin/lscpd-0.3.1 /usr/local/lscp/bin/lscpd'
command = f'mv /usr/local/lscp/bin/{lscpdSelection} /usr/local/lscp/bin/lscpd'
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)

command = 'chmod 755 %s' % (lscpdPath)
Expand Down
14 changes: 14 additions & 0 deletions install/installCyberPanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,20 @@ def installMySQL(self, mysql):
elif self.distro == centos:
command = 'yum --enablerepo=mariadb -y install MariaDB-server MariaDB-client'
elif self.distro == cent8 or self.distro == openeuler:
### check if cent8 which means Alma8 then add Mariadb 10.6 repo
if self.distro == cent8:
content = """
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.6/rhel8-amd64
module_hotfixes=1
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
"""
writeToFile = open('/etc/yum.repos.d/mariadb.repo', 'w')
writeToFile.write(content)
writeToFile.close()

command = 'dnf -y install mariadb-server'

install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
Expand Down
5 changes: 5 additions & 0 deletions install/litespeed/conf/httpd_config.conf
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ listener Default{
map Example *
}

listener Default IPv6{
address [ANY]:80
secure 0
map Example *
}


vhTemplate centralConfigLog {
Expand Down
Binary file added lscpd.0.4.0
Binary file not shown.
6 changes: 6 additions & 0 deletions mailServer/mailserverManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1576,6 +1576,12 @@ def fixCyberPanelPermissions(self):

command = 'chmod 640 /etc/pdns/pdns.conf'
ProcessUtilities.executioner(command)
else:
command = 'chown root:pdns /etc/powerdns/pdns.conf'
ProcessUtilities.executioner(command)

command = 'chmod 640 /etc/powerdns/pdns.conf'
ProcessUtilities.executioner(command)

command = 'chmod 640 /usr/local/lscp/cyberpanel/logs/access.log'
ProcessUtilities.executioner(command)
Expand Down
4 changes: 4 additions & 0 deletions plogical/applicationInstaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -1697,6 +1697,10 @@ def wordpressInstallNew(self):
try:
website = Websites.objects.get(domain=DataToPass['domainName'])

if website.phpSelection == 'PHP 7.3':
website.phpSelection = 'PHP 7.4'
website.save()

if ACLManager.checkOwnership(website.domain, self.extraArgs['adminID'],
self.extraArgs['currentACL']) == 0:
statusFile = open(tempStatusPath, 'w')
Expand Down
2 changes: 1 addition & 1 deletion plogical/mailUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ def checkIfSpamAssassinInstalled():
command = "cat " + path
output = ProcessUtilities.outputExecutioner(command)

if output.find('content_filter=spamassassin') > -1:
if output.find('spamassassin') > -1 and output.find('user=spamd') > -1:
return 1
else:
return 0
Expand Down
3 changes: 1 addition & 2 deletions plogical/mysqlUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,7 @@ def fetchDatabases():
checker = 0

for items in result:
if items[0] == 'information_schema' or items[0] == 'mysql' or items[0] == 'performance_schema' or items[
0] == 'performance_schema':
if items[0] == 'information_schema' or items[0] == 'mysql' or items[0] == 'performance_schema':
continue

dic = {
Expand Down
Loading

0 comments on commit e373b90

Please sign in to comment.