Skip to content

Commit 5b263d6

Browse files
committed
bug fix: increase size of external app
1 parent 74070be commit 5b263d6

6 files changed

Lines changed: 91 additions & 11 deletions

File tree

firewall/firewallManager.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1552,6 +1552,14 @@ def imunify(self):
15521552
else:
15531553
return ACLManager.loadError()
15541554

1555-
return render(self.request, 'firewall/imunify.html', {})
1555+
ipFile = "/etc/cyberpanel/machineIP"
1556+
f = open(ipFile)
1557+
ipData = f.read()
1558+
ipAddress = ipData.split('\n', 1)[0]
1559+
1560+
data = {}
1561+
data['ipAddress'] = ipAddress
1562+
1563+
return render(self.request, 'firewall/imunify.html', data)
15561564
except BaseException as msg:
15571565
return HttpResponse(str(msg))

firewall/templates/firewall/imunify.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% extends "baseTemplate/index.html" %}
22
{% load i18n %}
3-
{% block title %}{% trans "CloudLinux - CyberPanel" %}{% endblock %}
3+
{% block title %}{% trans "Imunify - CyberPanel" %}{% endblock %}
44
{% block content %}
55

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

1111
<div class="container">
1212
<div id="page-title">
13-
<h2>{% trans "CloudLinux" %}</h2>
14-
<p>{% trans "Access LVEManager" %}</p>
13+
<h2>{% trans "Imunify" %}</h2>
14+
<p>{% trans "Access Imunify" %}</p>
1515
</div>
1616

1717
<div class="panel">
1818
<div class="panel-body">
1919
<h3 class="title-hero">
20-
{% trans "CloudLinux" %}
20+
{% trans "Imunify" %}
2121
</h3>
2222
<div class="example-box-wrapper">
2323

24-
<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>
24+
<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>
2525
<br>
26-
<a target="_blank" href="http://{{ ipAddress }}:9000">
26+
<a target="_blank" href="http://{{ ipAddress }}:8090/imunify">
2727
<button class="btn btn-primary">Access Now
2828
</button>
2929
</a>
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{% extends "baseTemplate/index.html" %}
2+
{% load i18n %}
3+
{% block title %}{% trans "Not available - CyberPanel" %}{% endblock %}
4+
{% block content %}
5+
6+
{% load static %}
7+
{% get_current_language as LANGUAGE_CODE %}
8+
<!-- Current language: {{ LANGUAGE_CODE }} -->
9+
10+
11+
<div class="container">
12+
<div id="page-title">
13+
<h2>{% trans "Not available" %}</h2>
14+
<p>{% trans "Either Imunify is not installed or you are not on CloudLinux OS." %}</p>
15+
</div>
16+
17+
{% if not CL %}
18+
19+
<div class="row">
20+
<div class="col-sm-12">
21+
<div class="alert alert-danger">
22+
<p>{% trans "CloudLinux is not installed on your server." %} <a target="_blank"
23+
href="https://go.cyberpanel.net/CLConvert">Click
24+
Here</a> {% trans " for conversion details." %}</p>
25+
</div>
26+
</div>
27+
</div>
28+
29+
{% else %}
30+
31+
<div ng-controller="installCageFS" class="panel">
32+
<div class="panel-body">
33+
<h3 class="title-hero">
34+
{% trans "Activate Now" %} <img ng-hide="installDockerStatus"
35+
src="{% static 'images/loading.gif' %}">
36+
</h3>
37+
<div class="example-box-wrapper">
38+
39+
<p>{% trans "CloudLinux is installed, but not activated." %}</p>
40+
<!------ LSWS Switch box ----------------->
41+
42+
<div style="margin-top: 2%" ng-hide="installBoxGen" class="col-md-12">
43+
44+
<form action="/" id="" class="form-horizontal bordered-row">
45+
<div class="form-group">
46+
<div style="margin-top: 2%;" class="col-sm-12">
47+
<textarea ng-model="requestData" rows="15"
48+
class="form-control">{{ requestData }}</textarea>
49+
</div>
50+
</div>
51+
</form>
52+
</div>
53+
54+
55+
<!----- LSWS Switch box ----------------->
56+
<br>
57+
<button ng-hide="dockerInstallBTN" class="btn btn-primary" ng-click="submitCageFSInstall()">Activate Now</button>
58+
59+
</div>
60+
</div>
61+
</div>
62+
63+
{% endif %}
64+
65+
</div>
66+
{% endblock %}
67+

plogical/upgrade.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,11 @@ def applyLoginSystemMigrations():
597597
except:
598598
pass
599599

600+
try:
601+
cursor.execute("ALTER TABLE websiteFunctions_websites MODIFY externalApp varchar(30)")
602+
except:
603+
pass
604+
600605

601606
try:
602607
cursor.execute("ALTER TABLE loginSystem_acl ADD COLUMN listUsers INT DEFAULT 0;")

websiteFunctions/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Websites(models.Model):
1616
phpSelection = models.CharField(max_length=10)
1717
ssl = models.IntegerField()
1818
state = models.IntegerField(default=1)
19-
externalApp = models.CharField(max_length=10, default=None)
19+
externalApp = models.CharField(max_length=30, default=None)
2020

2121
class ChildDomains(models.Model):
2222
master = models.ForeignKey(Websites,on_delete=models.CASCADE)

websiteFunctions/website.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,13 @@ def submitWebsiteCreation(self, userID=None, data=None):
173173

174174
loggedUser = Administrator.objects.get(pk=userID)
175175
newOwner = Administrator.objects.get(userName=websiteOwner)
176+
176177
if ACLManager.currentContextPermission(currentACL, 'createWebsite') == 0:
177178
return ACLManager.loadErrorJson('createWebSiteStatus', 0)
178179

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

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

224223
import pwd
225224
counter = 0
225+
226226
while 1:
227227
try:
228228
pwd.getpwnam(externalApp)
@@ -233,7 +233,7 @@ def submitWebsiteCreation(self, userID=None, data=None):
233233

234234
## Create Configurations
235235

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

0 commit comments

Comments
 (0)