bug fix: issues

This commit is contained in:
Usman Nasir
2022-03-08 19:26:11 +05:00
parent 3b195c4081
commit 4ef2004abd
8 changed files with 49 additions and 62 deletions

View File

@@ -145,22 +145,22 @@ if __name__ == "__main__":
writeToFile.write(str(os.getpid()))
writeToFile.close()
SSHServer.findSSHPort()
http_server = tornado.httpserver.HTTPServer(application, ssl_options={
"certfile": "/usr/local/lscp/conf/cert.pem",
"keyfile": "/usr/local/lscp/conf/key.pem",
}, )
ADDR = '0.0.0.0'
http_server.listen(5678, ADDR)
print('*** Websocket Server Started at %s***' % ADDR)
import signal
def close_sig_handler(signal, frame):
http_server.stop()
sys.exit()
signal.signal(signal.SIGINT, close_sig_handler)
tornado.ioloop.IOLoop.instance().start()
# SSHServer.findSSHPort()
#
# http_server = tornado.httpserver.HTTPServer(application, ssl_options={
# "certfile": "/usr/local/lscp/conf/cert.pem",
# "keyfile": "/usr/local/lscp/conf/key.pem",
# }, )
#
# ADDR = '0.0.0.0'
# http_server.listen(5678, ADDR)
# print('*** Websocket Server Started at %s***' % ADDR)
#
# import signal
# def close_sig_handler(signal, frame):
# http_server.stop()
# sys.exit()
#
# signal.signal(signal.SIGINT, close_sig_handler)
#
# tornado.ioloop.IOLoop.instance().start()

View File

@@ -653,4 +653,5 @@ app.controller('versionManagment', function ($scope, $http, $timeout) {
};
});
});

View File

@@ -736,21 +736,21 @@
<li class="header"><span>{% trans "Server" %}</span></li>
<li>
<a href="#" title="{% trans 'Terminal' %}">
<i class="glyph-icon icon-linecons-fire"></i>
<span>{% trans "Web Terminal" %}</span>
<span class="bs-label badge-yellow">{% trans "NEW" %}</span>
</a>
<div class="sidebar-submenu">
<ul>
<li><a href="{% url 'terminal' %}"
title="{% trans 'Web Based Terminal' %}"><span>{% trans "Terminal" %}</span></a>
</li>
</ul>
</div><!-- .sidebar-submenu -->
</li>
{# <li>#}
{# <a href="#" title="{% trans 'Terminal' %}">#}
{# <i class="glyph-icon icon-linecons-fire"></i>#}
{# <span>{% trans "Web Terminal" %}</span>#}
{# <span class="bs-label badge-yellow">{% trans "NEW" %}</span>#}
{# </a>#}
{# <div class="sidebar-submenu">#}
{##}
{# <ul>#}
{# <li><a href="{% url 'terminal' %}"#}
{# title="{% trans 'Web Based Terminal' %}"><span>{% trans "Terminal" %}</span></a>#}
{# </li>#}
{# </ul>#}
{# </div><!-- .sidebar-submenu -->#}
{# </li>#}
<li>
<a href="#" title="{% trans 'CloudLinux' %}">

View File

@@ -34,6 +34,7 @@ def getAdminStatus(request):
val = request.session['userID']
currentACL = ACLManager.loadedACL(val)
if os.path.exists('/home/cyberpanel/postfix'):
currentACL['emailAsWhole'] = 1
else:

View File

@@ -141,8 +141,8 @@ class EmailMarketingManager:
if emACL.checkIfEMEnabled(admin.userName) == 0:
return ACLManager.loadErrorJson()
em = EM('createEmailList', extraArgs)
em.start()
# em = EM('createEmailList', extraArgs)
# em.start()
time.sleep(2)

View File

@@ -546,9 +546,11 @@ class FileManager:
finalData = {}
finalData['status'] = 1
tempPath = "/home/cyberpanel/" + str(randint(1000, 9999))
self.data['home'] = '/home/%s' % (self.data['domainName'])
ACLManager.CreateSecureDir()
tempPath = '%s/%s' % ('/usr/local/CyberCP/tmp', str(randint(1000, 9999)))
domainName = self.data['domainName']
website = Websites.objects.get(domain=domainName)
@@ -556,31 +558,13 @@ class FileManager:
writeToFile.write(self.data['fileContent'].encode('utf-8'))
writeToFile.close()
command = 'ls -la %s' % (self.data['fileName'])
output = ProcessUtilities.outputExecutioner(command)
if output.find('lrwxrwxrwx') > -1 and output.find('->') > -1:
return self.ajaxPre(0, 'File exists and is symlink.')
if ACLManager.commandInjectionCheck(self.data['fileName']) == 1:
return self.ajaxPre(0, 'Not allowed to move in this path, please choose location inside home!')
if self.data['fileName'].find(self.data['home']) == -1 or self.data['fileName'].find('..') > -1:
return self.ajaxPre(0, 'Not allowed to move in this path, please choose location inside home!')
command = 'stat -c "%%a" %s' % (self.returnPathEnclosed(self.data['fileName']))
currentMode = ProcessUtilities.outputExecutioner(command).strip('\n')
command = 'mv ' + tempPath + ' ' + self.returnPathEnclosed(self.data['fileName'])
command = 'chown %s:%s %s' % (website.externalApp, website.externalApp, tempPath)
ProcessUtilities.executioner(command)
command = 'chown %s:%s %s' % (website.externalApp, website.externalApp, self.data['fileName'])
ProcessUtilities.executioner(command)
command = 'cp %s %s' % (tempPath, self.returnPathEnclosed(self.data['fileName']))
ProcessUtilities.executioner(command, website.externalApp)
command = 'chmod %s %s' % (currentMode, self.returnPathEnclosed(self.data['fileName']))
ProcessUtilities.executioner(command)
self.changeOwner(self.data['fileName'])
os.remove(tempPath)
json_data = json.dumps(finalData)
return HttpResponse(json_data)

View File

@@ -2660,7 +2660,7 @@ vmail
command = 'csf -uf'
Upgrade.executioner(command, 'fix csf if there', 0)
command = 'systemctl start cpssh'
command = 'systemctl stop cpssh'
Upgrade.executioner(command, 'fix csf if there', 0)
Upgrade.AutoUpgradeAcme()
Upgrade.installCLScripts()

View File

@@ -653,4 +653,5 @@ app.controller('versionManagment', function ($scope, $http, $timeout) {
};
});
});