Skip to content

Commit

Permalink
bug fix: increase size of external app
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Mar 6, 2020
1 parent 74070be commit 5b263d6
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 11 deletions.
10 changes: 9 additions & 1 deletion firewall/firewallManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
12 changes: 6 additions & 6 deletions firewall/templates/firewall/imunify.html
Original file line number Diff line number Diff line change
@@ -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 %}
Expand All @@ -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>
Expand Down
67 changes: 67 additions & 0 deletions firewall/templates/firewall/notAvailable.html
Original file line number Diff line number Diff line change
@@ -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 %}

5 changes: 5 additions & 0 deletions plogical/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -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;")
Expand Down
2 changes: 1 addition & 1 deletion websiteFunctions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions websiteFunctions/website.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -223,6 +222,7 @@ def submitWebsiteCreation(self, userID=None, data=None):

import pwd
counter = 0

while 1:
try:
pwd.getpwnam(externalApp)
Expand All @@ -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 " \
Expand Down

0 comments on commit 5b263d6

Please sign in to comment.