diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index ba41b1d37..aa935f395 100755
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -30,8 +30,8 @@
-
-
+
+
@@ -44,57 +44,229 @@
-
+
-
-
+
+
-
-
-
-
-
-
+
+
+
-
+
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -111,16 +283,6 @@
- Backups
- schedule
- schedulebackups
- 1.8
- .py
- not goo
- websitesTo
- websitesToBeBacked
- remote
- remoteTransfer
scheduleBac
cyberpanelLoading
allChecked
@@ -141,6 +303,16 @@
1.9.0
/usr/local/CyberCP/public/rainloop/rainloop/v/1.12.1/include.php
CLManager
+ IncBackups
+ chmod
+ stat.
+ destination
+ firewalld
+ addRule
+ downloadAndUpgrade
+ /usr/local/CyberCP
+ setupVirtualEnv
+ os.remove
admin.api == 1
@@ -169,8 +341,6 @@
-
-
+
@@ -234,6 +405,7 @@
+
@@ -244,26 +416,12 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
@@ -448,17 +606,18 @@
+
-
+
-
+
-
+
@@ -539,17 +698,6 @@
-
-
-
-
-
-
-
-
-
-
-
@@ -945,15 +1093,10 @@
-
+
-
-
-
-
-
-
-
+
+
@@ -978,17 +1121,89 @@
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
@@ -1036,7 +1251,6 @@
-
@@ -1096,51 +1310,67 @@
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/IncBackups/views.py b/IncBackups/views.py
index 1bc582a6e..2425be9bd 100644
--- a/IncBackups/views.py
+++ b/IncBackups/views.py
@@ -16,6 +16,7 @@ from random import randint
import time
from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
from loginSystem.views import loadLoginPage
+import stat
# Create your views here.
@@ -117,13 +118,15 @@ def addDestination(request):
tmpFile = '/home/cyberpanel/sshconfig'
writeToFile = open(tmpFile, 'w')
- writeToFile.write(currentConfig)
+ if currentConfig.find('cat') == -1:
+ writeToFile.write(currentConfig)
content = """Host %s
- IdentityFile ~/.ssh/cyberpanel
- Port %s
- """ % (ipAddress, port)
- writeToFile.write(content)
+ IdentityFile ~/.ssh/cyberpanel
+ Port %s
+""" % (ipAddress, port)
+ if currentConfig.find(ipAddress) == -1:
+ writeToFile.write(content)
writeToFile.close()
@@ -159,6 +162,8 @@ def addDestination(request):
writeToFile.write(AWS_SECRET_ACCESS_KEY)
writeToFile.close()
+ os.chmod(awsFile, stat.S_IRUSR | stat.S_IWUSR)
+
final_dic = {'status': 1}
final_json = json.dumps(final_dic)
return HttpResponse(final_json)
diff --git a/install/install.py b/install/install.py
index da748a247..b5924b7d3 100755
--- a/install/install.py
+++ b/install/install.py
@@ -3721,12 +3721,12 @@ milter_default_action = accept
data = open(cronTab, 'r').read()
if data.find('IncScheduler') == -1:
- cronJob = '0 12 * * * root /usr/local/CyberCP/bin/python2 /usr/local/CyberCP/IncBackups/IncScheduler.py Daily'
+ cronJob = '0 12 * * * root /usr/local/CyberCP/bin/python2 /usr/local/CyberCP/IncBackups/IncScheduler.py Daily\n'
writeToFile = open(cronTab, 'a')
writeToFile.writelines(cronJob)
- cronJob = '0 0 * * 0 root /usr/local/CyberCP/bin/python2 /usr/local/CyberCP/IncBackups/IncScheduler.py Daily'
+ cronJob = '0 0 * * 0 root /usr/local/CyberCP/bin/python2 /usr/local/CyberCP/IncBackups/IncScheduler.py Daily\n'
writeToFile.writelines(cronJob)
writeToFile.close()
diff --git a/plogical/upgrade.py b/plogical/upgrade.py
index dd03b1142..733c9466c 100755
--- a/plogical/upgrade.py
+++ b/plogical/upgrade.py
@@ -435,10 +435,10 @@ class Upgrade:
##
command = "pip install --ignore-installed -r /usr/local/CyberCP/requirments.txt"
- Upgrade.executioner(command, 'CyberPanel requirements', 1)
+ Upgrade.executioner(command, 'CyberPanel requirements', 0)
command = "virtualenv --system-site-packages /usr/local/CyberCP"
- Upgrade.executioner(command, 'Setting up VirtualEnv [Two]', 1)
+ Upgrade.executioner(command, 'Setting up VirtualEnv [Two]', 0)
Upgrade.stdOut('Virtual enviroment for CyberPanel successfully installed.')
except OSError, msg:
@@ -1276,9 +1276,6 @@ class Upgrade:
Upgrade.stdOut("Settings file backed up.")
- if os.path.exists('/usr/local/CyberCP/bin'):
- shutil.rmtree('/usr/local/CyberCP/bin')
-
## Extract Latest files
# command = "tar zxf CyberPanel.1.7.4.tar.gz"
@@ -1617,7 +1614,6 @@ class Upgrade:
command = 'cp /usr/local/lsws/lsphp71/bin/php /usr/bin/'
Upgrade.executioner(command, 'Set default PHP 7.0, 0')
-
@staticmethod
def someDirectories():
command = "mkdir -p /usr/local/lscpd/admin/"
@@ -1838,12 +1834,12 @@ failovermethod=priority
data = open(cronTab, 'r').read()
if data.find('IncScheduler') == -1:
- cronJob = '0 12 * * * root /usr/local/CyberCP/bin/python2 /usr/local/CyberCP/IncBackups/IncScheduler.py Daily'
+ cronJob = '0 12 * * * root /usr/local/CyberCP/bin/python2 /usr/local/CyberCP/IncBackups/IncScheduler.py Daily\n'
writeToFile = open(cronTab, 'a')
writeToFile.writelines(cronJob)
- cronJob = '0 0 * * 0 root /usr/local/CyberCP/bin/python2 /usr/local/CyberCP/IncBackups/IncScheduler.py Daily'
+ cronJob = '0 0 * * 0 root /usr/local/CyberCP/bin/python2 /usr/local/CyberCP/IncBackups/IncScheduler.py Daily\n'
writeToFile.writelines(cronJob)
writeToFile.close()
diff --git a/preUpgrade.sh b/preUpgrade.sh
new file mode 100644
index 000000000..9463d6019
--- /dev/null
+++ b/preUpgrade.sh
@@ -0,0 +1,9 @@
+if [ ! -d "/usr/local/CyberPanel" ]; then
+ virtualenv --system-site-packages /usr/local/CyberPanel
+ source /usr/local/CyberPanel/bin/activate
+ rm -rf requirments.txt
+ wget https://raw.githubusercontent.com/usmannasir/cyberpanel/1.8.0/requirments.txt
+ pip install --ignore-installed -r requirments.txt
+ virtualenv --system-site-packages /usr/local/CyberPanel
+fi
+
diff --git a/serverLogs/views.py b/serverLogs/views.py
old mode 100644
new mode 100755