Skip to content

Commit

Permalink
putting back csf, ref #1328
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Oct 3, 2024
1 parent c32ac4b commit 13e51d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 3 additions & 4 deletions plogical/csf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/local/CyberCP/bin/python
import sys

sys.path.append('/usr/local/CyberCP')
from plogical import CyberCPLogFileWriter as logging
import subprocess
Expand Down Expand Up @@ -51,10 +52,8 @@ def installCSF():

os.chdir('csf')


### manually update csf views.py because it does not load CyberPanel properly in default configurations


content = '''
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
Expand Down Expand Up @@ -417,10 +416,8 @@ def configservercsfiframe(request):
command = 'csf -ra'
ProcessUtilities.normalExecutioner(command)


##### update csf views file


logging.CyberCPLogFileWriter.statusWriter(CSF.installLogPath, 'CSF successfully Installed.[200]\n', 1)

try:
Expand All @@ -435,6 +432,8 @@ def configservercsfiframe(request):
'sed -i "s/import signals/import configservercsf.signals/g" /usr/local/CyberCP/configservercsf/apps.py',
'sed -i "s/url(r\'^$\'/path(\'\'/g" /usr/local/CyberCP/configservercsf/urls.py',
'sed -i "s|url(r\'^iframe/$\'|path(\'iframe/\'|g" /usr/local/CyberCP/configservercsf/urls.py',
'sed -i -E "s/from.*, response/from plogical.httpProc import httpProc/g" /usr/local/CyberCP/configservercsf/views.py'
'''sed -i -E "s#^(\s*)return render.*index\.html.*#\1proc = httpProc(request, 'configservercsf/index.html', None, 'admin')\n\1return proc.render()#g" /usr/local/CyberCP/configservercsf/views.py'''
'killall lswsgi'
]

Expand Down
2 changes: 2 additions & 0 deletions plogical/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -3552,6 +3552,8 @@ def upgrade(branch):
'sed -i "s/import signals/import configservercsf.signals/g" /usr/local/CyberCP/configservercsf/apps.py',
'sed -i "s/url(r\'^$\'/path(\'\'/g" /usr/local/CyberCP/configservercsf/urls.py',
'sed -i "s|url(r\'^iframe/$\'|path(\'iframe/\'|g" /usr/local/CyberCP/configservercsf/urls.py',
'sed -i -E "s/from.*, response/from plogical.httpProc import httpProc/g" /usr/local/CyberCP/configservercsf/views.py'
'''sed -i -E "s#^(\s*)return render.*index\.html.*#\1proc = httpProc(request, 'configservercsf/index.html', None, 'admin')\n\1return proc.render()#g" /usr/local/CyberCP/configservercsf/views.py'''
'killall lswsgi'
]

Expand Down

0 comments on commit 13e51d7

Please sign in to comment.