mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-08 06:16:08 +01:00
finalize pre_main_global https://app.clickup.com/t/866atra07
This commit is contained in:
@@ -935,6 +935,11 @@
|
||||
<li><a href="{% url 'liteSpeedTuning' %}"
|
||||
title="{% trans 'LiteSpeed Tuning' %}"><span>{% trans "LiteSpeed Tuning" %}</span></a>
|
||||
</li>
|
||||
{% if serverCheck == 1 %}
|
||||
<li><a href="{% url 'litespeed_ent_conf' %}"
|
||||
title="{% trans 'LiteSpeed Ent Global Conf' %}"><span>{% trans "LiteSpeed Ent Global Conf" %}</span></a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li><a href="{% url 'phpTuning' %}"
|
||||
title="{% trans 'PHP Tuning' %}"><span>{% trans "PHP Tuning" %}</span></a>
|
||||
</li>
|
||||
@@ -1044,11 +1049,6 @@
|
||||
<li><a href="{% url 'modSecRulesPacks' %}"
|
||||
title="{% trans 'ModSecurity Rules Packs' %}"><span>{% trans "ModSecurity Rules Packs" %}</span></a>
|
||||
</li>
|
||||
{% if serverCheck == 1 %}
|
||||
<li><a href="{% url 'litespeed_ent_conf' %}"
|
||||
title="{% trans 'Litespeed ent conf' %}"><span>{% trans "Litespeed ent conf" %}</span></a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li><a href="{% url 'csf' %}"
|
||||
title="{% trans 'ConfigServer Security & Firewall (CSF)' %}"><span>{% trans "CSF" %}</span></a>
|
||||
</li>
|
||||
|
||||
@@ -1690,7 +1690,6 @@ class FirewallManager:
|
||||
|
||||
|
||||
def saveLitespeed_conf(self, userID = None, data = None):
|
||||
from urllib.parse import unquote
|
||||
try:
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
||||
@@ -1701,15 +1700,23 @@ class FirewallManager:
|
||||
|
||||
file_path = "/usr/local/lsws/conf/pre_main_global.conf"
|
||||
|
||||
command = f'rm -f {file_path}'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
currentLitespeed_conf = data['modSecRules']
|
||||
|
||||
tempRulesPath = '/home/cyberpanel/pre_main_global.conf'
|
||||
|
||||
WriteToFile = open(tempRulesPath, 'w')
|
||||
WriteToFile.write(currentLitespeed_conf)
|
||||
WriteToFile.close()
|
||||
|
||||
# Use sed to replace content in the file
|
||||
command = f"echo '{currentLitespeed_conf}' > '{file_path}'"
|
||||
logging.CyberCPLogFileWriter.writeToFile(str(command))
|
||||
command = f'mv {tempRulesPath} {file_path}'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
command = f'chmod 644 {file_path} && chown lsadm:lsadm {file_path}'
|
||||
ProcessUtilities.executioner(command, None, True)
|
||||
|
||||
|
||||
command = f'cat {file_path}'
|
||||
|
||||
|
||||
@@ -10,14 +10,14 @@
|
||||
|
||||
<div class="container">
|
||||
<div id="page-title">
|
||||
<h2>{% trans "litespeed Ent Conf!" %} - <a target="_blank" href="http://go.cyberpanel.net/modsec-docs" style="height: 23px;line-height: 21px;" class="btn btn-border btn-alt border-red btn-link font-red" title=""><span>{% trans "litespeed Ent Conf Docs" %}</span></a> </h2>
|
||||
<p>{% trans "On this page you can add/delete litespeed Ent Conf." %}</p>
|
||||
<h2>{% trans "LiteSpeed Enterprise Global Conf!" %} </h2>
|
||||
<p>{% trans "Any rewrite rules or server-level configurations added here will be applicable to all virtual hosts/websites. This information is valid for LiteSpeed Enterprise edition exclusively." %}</p>
|
||||
</div>
|
||||
|
||||
<div ng-controller="litespeed_ent_conf" class="example-box-wrapper">
|
||||
<div class="panel panel-body">
|
||||
<h3 class="content-box-header">
|
||||
{% trans "litespeed Ent Conf" %} <img ng-hide="modsecLoading" src="/static/images/loading.gif">
|
||||
{% trans "Litespeed Enterprise Conf (/usr/local/lsws/conf/pre_main_global.conf)" %} <img ng-hide="modsecLoading" src="/static/images/loading.gif">
|
||||
</h3>
|
||||
|
||||
<div class="content-box-wrapper">
|
||||
|
||||
Reference in New Issue
Block a user