Skip to content
Permalink
Browse files
bug fix: increase size of external app
  • Loading branch information
usmannasir committed Mar 6, 2020
1 parent 74070be commit 5b263d6853762b3fa3323ab035f571b71bbb2458
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 11 deletions.
@@ -1552,6 +1552,14 @@ def imunify(self):
else:
return ACLManager.loadError()

return render(self.request, 'firewall/imunify.html', {})
ipFile = "/etc/cyberpanel/machineIP"
f = open(ipFile)
ipData = f.read()
ipAddress = ipData.split('\n', 1)[0]

data = {}
data['ipAddress'] = ipAddress

return render(self.request, 'firewall/imunify.html', data)
except BaseException as msg:
return HttpResponse(str(msg))
@@ -1,6 +1,6 @@
{% extends "baseTemplate/index.html" %}
{% load i18n %}
{% block title %}{% trans "CloudLinux - CyberPanel" %}{% endblock %}
{% block title %}{% trans "Imunify - CyberPanel" %}{% endblock %}
{% block content %}

{% load static %}
@@ -10,20 +10,20 @@

<div class="container">
<div id="page-title">
<h2>{% trans "CloudLinux" %}</h2>
<p>{% trans "Access LVEManager" %}</p>
<h2>{% trans "Imunify" %}</h2>
<p>{% trans "Access Imunify" %}</p>
</div>

<div class="panel">
<div class="panel-body">
<h3 class="title-hero">
{% trans "CloudLinux" %}
{% trans "Imunify" %}
</h3>
<div class="example-box-wrapper">

<p>{% trans "CloudLinux is now integrated via their new API. You can manage CageFS and Package limits directly from LVEManager by clicking below. You can use your server root credentials to access LVEManager." %}</p>
<p>{% trans "Imunify is now integrated via their new API. You can manage Imunify by clicking below. You can use your server root credentials to access Imunify." %}</p>
<br>
<a target="_blank" href="http://{{ ipAddress }}:9000">
<a target="_blank" href="http://{{ ipAddress }}:8090/imunify">
<button class="btn btn-primary">Access Now
</button>
</a>
@@ -0,0 +1,67 @@
{% extends "baseTemplate/index.html" %}
{% load i18n %}
{% block title %}{% trans "Not available - CyberPanel" %}{% endblock %}
{% block content %}

{% load static %}
{% get_current_language as LANGUAGE_CODE %}
<!-- Current language: {{ LANGUAGE_CODE }} -->


<div class="container">
<div id="page-title">
<h2>{% trans "Not available" %}</h2>
<p>{% trans "Either Imunify is not installed or you are not on CloudLinux OS." %}</p>
</div>

{% if not CL %}

<div class="row">
<div class="col-sm-12">
<div class="alert alert-danger">
<p>{% trans "CloudLinux is not installed on your server." %} <a target="_blank"
href="https://go.cyberpanel.net/CLConvert">Click
Here</a> {% trans " for conversion details." %}</p>
</div>
</div>
</div>

{% else %}

<div ng-controller="installCageFS" class="panel">
<div class="panel-body">
<h3 class="title-hero">
{% trans "Activate Now" %} <img ng-hide="installDockerStatus"
src="{% static 'images/loading.gif' %}">
</h3>
<div class="example-box-wrapper">

<p>{% trans "CloudLinux is installed, but not activated." %}</p>
<!------ LSWS Switch box ----------------->

<div style="margin-top: 2%" ng-hide="installBoxGen" class="col-md-12">

<form action="/" id="" class="form-horizontal bordered-row">
<div class="form-group">
<div style="margin-top: 2%;" class="col-sm-12">
<textarea ng-model="requestData" rows="15"
class="form-control">{{ requestData }}</textarea>
</div>
</div>
</form>
</div>


<!----- LSWS Switch box ----------------->
<br>
<button ng-hide="dockerInstallBTN" class="btn btn-primary" ng-click="submitCageFSInstall()">Activate Now</button>

</div>
</div>
</div>

{% endif %}

</div>
{% endblock %}

@@ -597,6 +597,11 @@ def applyLoginSystemMigrations():
except:
pass

try:
cursor.execute("ALTER TABLE websiteFunctions_websites MODIFY externalApp varchar(30)")
except:
pass


try:
cursor.execute("ALTER TABLE loginSystem_acl ADD COLUMN listUsers INT DEFAULT 0;")
@@ -16,7 +16,7 @@ class Websites(models.Model):
phpSelection = models.CharField(max_length=10)
ssl = models.IntegerField()
state = models.IntegerField(default=1)
externalApp = models.CharField(max_length=10, default=None)
externalApp = models.CharField(max_length=30, default=None)

class ChildDomains(models.Model):
master = models.ForeignKey(Websites,on_delete=models.CASCADE)
@@ -173,14 +173,13 @@ def submitWebsiteCreation(self, userID=None, data=None):

loggedUser = Administrator.objects.get(pk=userID)
newOwner = Administrator.objects.get(userName=websiteOwner)

if ACLManager.currentContextPermission(currentACL, 'createWebsite') == 0:
return ACLManager.loadErrorJson('createWebSiteStatus', 0)

if ACLManager.checkOwnerProtection(currentACL, loggedUser, newOwner) == 0:
return ACLManager.loadErrorJson('createWebSiteStatus', 0)



if not validators.domain(domain):
data_ret = {'status': 0, 'createWebSiteStatus': 0, 'error_message': "Invalid domain."}
json_data = json.dumps(data_ret)
@@ -223,6 +222,7 @@ def submitWebsiteCreation(self, userID=None, data=None):

import pwd
counter = 0

while 1:
try:
pwd.getpwnam(externalApp)
@@ -233,7 +233,7 @@ def submitWebsiteCreation(self, userID=None, data=None):

## Create Configurations

execPath = "sudo /usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/plogical/virtualHostUtilities.py"
execPath = "/usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/plogical/virtualHostUtilities.py"
execPath = execPath + " createVirtualHost --virtualHostName " + domain + \
" --administratorEmail " + adminEmail + " --phpVersion '" + phpSelection + \
"' --virtualHostUser " + externalApp + " --ssl " + str(data['ssl']) + " --dkimCheck " \

0 comments on commit 5b263d6

Please sign in to comment.