diff --git a/CLScript/CLMain.py b/CLScript/CLMain.py
index 4761b01c5..492207f48 100644
--- a/CLScript/CLMain.py
+++ b/CLScript/CLMain.py
@@ -4,8 +4,8 @@ class CLMain():
def __init__(self):
self.path = '/usr/local/CyberCP/version.txt'
#versionInfo = json.loads(open(self.path, 'r').read())
- self.version = '2.1'
- self.build = '2'
+ self.version = '2.3'
+ self.build = '1'
ipFile = "/etc/cyberpanel/machineIP"
f = open(ipFile)
diff --git a/CyberCP/secMiddleware.py b/CyberCP/secMiddleware.py
index 39de0f2c6..47fd6a4bd 100755
--- a/CyberCP/secMiddleware.py
+++ b/CyberCP/secMiddleware.py
@@ -72,7 +72,7 @@ class secMiddleware:
final_json = json.dumps(final_dic)
return HttpResponse(final_json)
- if request.build_absolute_uri().find('api/verifyConn') > -1 or request.build_absolute_uri().find('webhook') > -1 or request.build_absolute_uri().find('saveSpamAssassinConfigurations') > -1 or request.build_absolute_uri().find('docker') > -1 or request.build_absolute_uri().find('cloudAPI') > -1 or request.build_absolute_uri().find('verifyLogin') > -1 or request.build_absolute_uri().find('submitUserCreation') > -1:
+ if request.build_absolute_uri().find('api/remoteTransfer') > -1 or request.build_absolute_uri().find('api/verifyConn') > -1 or request.build_absolute_uri().find('webhook') > -1 or request.build_absolute_uri().find('saveSpamAssassinConfigurations') > -1 or request.build_absolute_uri().find('docker') > -1 or request.build_absolute_uri().find('cloudAPI') > -1 or request.build_absolute_uri().find('verifyLogin') > -1 or request.build_absolute_uri().find('submitUserCreation') > -1:
continue
if key == 'key' or key == 'cert' or key == 'recordContentAAAA' or key == 'backupDestinations' or key == 'ports' \
or key == 'imageByPass' or key == 'passwordByPass' or key == 'cronCommand' \
diff --git a/api/views.py b/api/views.py
index 8c61fa691..257648f27 100755
--- a/api/views.py
+++ b/api/views.py
@@ -435,10 +435,14 @@ def remoteTransfer(request):
## Accounts to transfer is a path to file, containing accounts.
+
execPath = "/usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/plogical/remoteTransferUtilities.py"
- execPath = execPath + " remoteTransfer --ipAddress " + ipAddress + " --dir " + dir + " --accountsToTransfer " + path
+ execPath = execPath + " remoteTransfer --ipAddress " + ipAddress.rstrip('\n') + " --dir " + dir + " --accountsToTransfer " + path
ProcessUtilities.popenExecutioner(execPath)
+ if os.path.exists('/usr/local/CyberCP/debug'):
+ logging.writeToFile('Repor of %s' % repr(execPath))
+
return HttpResponse(json.dumps({"transferStatus": 1, "dir": dir}))
##
diff --git a/backup/backupManager.py b/backup/backupManager.py
index c4bc4a788..c42a80d32 100755
--- a/backup/backupManager.py
+++ b/backup/backupManager.py
@@ -1163,6 +1163,10 @@ class BackupManager:
r = requests.post(url, data=finalData, verify=False)
+ if os.path.exists('/usr/local/CyberCP/debug'):
+ message = 'Remote transfer initiation status: %s' % (r.text)
+ logging.CyberCPLogFileWriter.writeToFile(message)
+
data = json.loads(r.text)
if data['transferStatus'] == 1:
diff --git a/backup/templates/backup/googleDrive.html b/backup/templates/backup/googleDrive.html
index 175a20508..50549d0c7 100755
--- a/backup/templates/backup/googleDrive.html
+++ b/backup/templates/backup/googleDrive.html
@@ -114,7 +114,7 @@
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/baseTemplate/views.py b/baseTemplate/views.py
index 4320fbac0..c1bd9b7f3 100755
--- a/baseTemplate/views.py
+++ b/baseTemplate/views.py
@@ -18,8 +18,8 @@ from plogical.httpProc import httpProc
# Create your views here.
-VERSION = '2.1'
-BUILD = 2
+VERSION = '2.3'
+BUILD = 1
@ensure_csrf_cookie
@@ -120,6 +120,14 @@ def versionManagment(request):
Currentcomt = output.rstrip("\n")
notechk = True;
+
+ command ="git fetch"
+ output = ProcessUtilities.outputExecutioner(command)
+
+ command ="git -C /usr/local/CyberCP/ log %s..%s --pretty=oneline | wc -l" % ( Currentcomt, latestcomit)
+ output = ProcessUtilities.outputExecutioner(command)
+
+ numCommits = output.rstrip("\n")
if(Currentcomt == latestcomit):
notechk = False;
@@ -127,7 +135,7 @@ def versionManagment(request):
template = 'baseTemplate/versionManagment.html'
finalData = {'build': currentBuild, 'currentVersion': currentVersion, 'latestVersion': latestVersion,
- 'latestBuild': latestBuild, 'latestcomit': latestcomit, "Currentcomt": Currentcomt, "Notecheck" : notechk }
+ 'latestBuild': latestBuild, 'latestcomit': latestcomit, "Currentcomt": Currentcomt, "Notecheck" : notechk, "numCommits": numCommits }
proc = httpProc(request, template, finalData, 'versionManagement')
diff --git a/cyberpanel.sh b/cyberpanel.sh
index 9e059731f..052bb20d6 100644
--- a/cyberpanel.sh
+++ b/cyberpanel.sh
@@ -1635,13 +1635,13 @@ echo " Panel password: ***** "
else
echo " Panel password: $Admin_Pass "
fi
-echo " Visit: https://$Server_IP:7080 "
-echo " WebAdmin console username: admin "
-echo " WebAdmin console password: $Webadmin_Pass "
-echo " "
-echo " Visit: https://$Server_IP:8090/rainloop/?admin "
-echo " Rainloop Admin username: admin "
-echo " Rainloop Admin password: $RainloopAdminPass "
+#echo " Visit: https://$Server_IP:7080 "
+#echo " WebAdmin console username: admin "
+#echo " WebAdmin console password: $Webadmin_Pass "
+#echo " "
+#echo " Visit: https://$Server_IP:8090/rainloop/?admin "
+#echo " Rainloop Admin username: admin "
+#echo " Rainloop Admin password: $RainloopAdminPass "
echo " "
echo -e " Run \e[31mcyberpanel help\e[39m to get FAQ info"
echo -e " Run \e[31mcyberpanel upgrade\e[39m to upgrade it to latest version."
diff --git a/filemanager/views.py b/filemanager/views.py
index f8b8657b5..8eaedcaeb 100755
--- a/filemanager/views.py
+++ b/filemanager/views.py
@@ -224,7 +224,8 @@ def FileManagerRoot(request):
if(Status == 1):
template = 'baseTemplate/FileManager.html'
else:
- return redirect("https://cyberpanel.net/adons")
+ return redirect("https://cyberpanel.net/cyberpanel-addons")
+
except BaseException as msg:
template = 'baseTemplate/FileManager.html'
diff --git a/install/install.py b/install/install.py
index 3268e8b21..33f398537 100755
--- a/install/install.py
+++ b/install/install.py
@@ -14,8 +14,8 @@ from os.path import *
from stat import *
import stat
-VERSION = '2.1'
-BUILD = 2
+VERSION = '2.3'
+BUILD = 1
char_set = {'small': 'abcdefghijklmnopqrstuvwxyz', 'nums': '0123456789', 'big': 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'}
@@ -2047,6 +2047,8 @@ milter_default_action = accept
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
command = 'yum install -y restic'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
+ command = 'restic self-update'
+ preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
else:
command = 'apt-get update -y'
@@ -2054,6 +2056,9 @@ milter_default_action = accept
command = 'apt-get install restic -y'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
+
+ command = 'restic self-update'
+ preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
except:
pass
diff --git a/loginSystem/views.py b/loginSystem/views.py
index 1917960a2..eac0b4d08 100644
--- a/loginSystem/views.py
+++ b/loginSystem/views.py
@@ -18,8 +18,8 @@ from django.http import HttpResponse
from django.utils import translation
# Create your views here.
-VERSION = '2.1'
-BUILD = 2
+VERSION = '2.3'
+BUILD = 1
def verifyLogin(request):
diff --git a/plogical/IncScheduler.py b/plogical/IncScheduler.py
index 30e786647..3ac383c5b 100644
--- a/plogical/IncScheduler.py
+++ b/plogical/IncScheduler.py
@@ -1,11 +1,9 @@
#!/usr/local/CyberCP/bin/python
import os.path
import sys
-
sys.path.append('/usr/local/CyberCP')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CyberCP.settings")
import django
-
django.setup()
from IncBackups.IncBackupsControl import IncJobs
from IncBackups.models import BackupJob
@@ -24,7 +22,6 @@ import requests
import socket
from websiteFunctions.models import NormalBackupJobs, NormalBackupJobLogs
from boto3.s3.transfer import TransferConfig
-
try:
from s3Backups.models import BackupPlan, BackupLogs
import boto3
@@ -235,6 +232,11 @@ class IncScheduler(multi.Thread):
@staticmethod
def runGoogleDriveBackups(type):
+ ipFile = "/etc/cyberpanel/machineIP"
+ f = open(ipFile)
+ ipData = f.read()
+ ipAddress = ipData.split('\n', 1)[0]
+
backupRunTime = time.strftime("%m.%d.%Y_%H-%M-%S")
backupLogPath = "/usr/local/lscp/logs/local_backup_log." + backupRunTime
@@ -252,10 +254,11 @@ class IncScheduler(multi.Thread):
drive.files().list(pageSize=10, fields="files(id, name)").execute()
except BaseException as msg:
try:
-
+ import requests
finalData = json.dumps({'refresh_token': gDriveData['refresh_token']})
r = requests.post("https://platform.cyberpersons.com/refreshToken", data=finalData
)
+
gDriveData['token'] = json.loads(r.text)['access_token']
credentials = google.oauth2.credentials.Credentials(gDriveData['token'],
@@ -280,11 +283,6 @@ class IncScheduler(multi.Thread):
folderIDIP = gDriveData['folderIDIP']
except:
- ipFile = "/etc/cyberpanel/machineIP"
- f = open(ipFile)
- ipData = f.read()
- ipAddress = ipData.split('\n', 1)[0]
-
## Create CyberPanel Folder
file_metadata = {
@@ -349,6 +347,7 @@ class IncScheduler(multi.Thread):
try:
drive.files().create(body=file_metadata, media_body=media, fields='id').execute()
except:
+ import requests
finalData = json.dumps({'refresh_token': gDriveData['refresh_token']})
r = requests.post("https://platform.cyberpersons.com/refreshToken", data=finalData
)
@@ -381,7 +380,7 @@ class IncScheduler(multi.Thread):
print("job com[leted")
- logging.writeToFile('job completed')
+ #logging.writeToFile('job completed')
url = "https://platform.cyberpersons.com/CyberpanelAdOns/Adonpermission"
data = {
@@ -461,8 +460,6 @@ class IncScheduler(multi.Thread):
except BaseException as msg:
logging.writeToFile('job not completed [ERROR:]..%s'%msg)
-
-
except BaseException as msg:
GDriveJobLogs(owner=items, status=backupSchedule.ERROR,
message='[Completely] Job failed, Error message: %s.' % (str(msg))).save()
diff --git a/plogical/adminPass.py b/plogical/adminPass.py
index 278b39611..27f72503d 100755
--- a/plogical/adminPass.py
+++ b/plogical/adminPass.py
@@ -12,8 +12,8 @@ from plogical.acl import ACLManager
from packages.models import Package
from baseTemplate.models import version
-VERSION = '2.1'
-BUILD = 2
+VERSION = '2.3'
+BUILD = 1
if not os.geteuid() == 0:
sys.exit("\nOnly root can run this script\n")
diff --git a/plogical/backupSchedule.py b/plogical/backupSchedule.py
index c0efe9427..919bb2d1a 100755
--- a/plogical/backupSchedule.py
+++ b/plogical/backupSchedule.py
@@ -89,8 +89,21 @@ class backupSchedule:
ifRunning = ProcessUtilities.outputExecutioner('ps aux')
+ if os.path.exists('/usr/local/CyberCP/debug'):
+ message = 'Output of px aux when running remote backup status check: %s' % (ifRunning)
+ logging.CyberCPLogFileWriter.writeToFile(message)
+
+
if (ifRunning.find('startBackup') > -1 or ifRunning.find('BackupRoot') > -1) and ifRunning.find('/%s/' % (backupDomain)):
+ if os.path.exists('/usr/local/CyberCP/debug'):
+ message = 'If running found.'
+ logging.CyberCPLogFileWriter.writeToFile(message)
+
if os.path.exists(status):
+ if os.path.exists('/usr/local/CyberCP/debug'):
+ message = 'If running found. and status file exists'
+ logging.CyberCPLogFileWriter.writeToFile(message)
+
status = open(status, 'r').read()
time.sleep(2)
@@ -115,6 +128,9 @@ class backupSchedule:
return 1, tempStoragePath
elif status.find("[5009]") > -1:
+ if os.path.exists('/usr/local/CyberCP/debug'):
+ message = 'If running found. status file exists but error'
+ logging.CyberCPLogFileWriter.writeToFile(message)
## removing status file, so that backup can re-run
try:
command = 'sudo rm -f ' + status
@@ -150,6 +166,9 @@ class backupSchedule:
return 0, tempStoragePath
elif os.path.exists(schedulerPath):
+ if os.path.exists('/usr/local/CyberCP/debug'):
+ message = 'If running found. status file exists, scheduler path also exists hence killed'
+ logging.CyberCPLogFileWriter.writeToFile(message)
backupSchedule.remoteBackupLogging(backupLogPath, 'Backup process killed. Error: %s' % (
open(schedulerPath, 'r').read()),
backupSchedule.ERROR)
@@ -157,8 +176,15 @@ class backupSchedule:
command = 'rm -rf %s' % (tempStoragePath)
ProcessUtilities.normalExecutioner(command)
return 0, 'Backup process killed.'
+
else:
+ if os.path.exists('/usr/local/CyberCP/debug'):
+ message = 'If running not found.'
+ logging.CyberCPLogFileWriter.writeToFile(message)
if os.path.exists(status):
+ if os.path.exists('/usr/local/CyberCP/debug'):
+ message = 'if running not found, Status file exists'
+ logging.CyberCPLogFileWriter.writeToFile(message)
status = open(status, 'r').read()
time.sleep(2)
@@ -182,6 +208,11 @@ class backupSchedule:
pass
return 1, tempStoragePath
elif os.path.exists(schedulerPath):
+
+ if os.path.exists('/usr/local/CyberCP/debug'):
+ message = 'if running not found, Status file exists, scheduler path exists thus killed.'
+ logging.CyberCPLogFileWriter.writeToFile(message)
+
backupSchedule.remoteBackupLogging(backupLogPath, 'Backup process killed. Error: %s' % (open(schedulerPath, 'r').read()),
backupSchedule.ERROR)
os.remove(schedulerPath)
@@ -189,13 +220,23 @@ class backupSchedule:
ProcessUtilities.normalExecutioner(command)
return 0, 'Backup process killed.'
else:
+ if os.path.exists('/usr/local/CyberCP/debug'):
+ message = 'Status file does not exists.'
+ logging.CyberCPLogFileWriter.writeToFile(message)
if killCounter == 1:
+ if os.path.exists('/usr/local/CyberCP/debug'):
+ message = 'if running not found, Status file does not exists, kill counter 1, thus killed'
+ logging.CyberCPLogFileWriter.writeToFile(message)
+
command = 'rm -rf %s' % (tempStoragePath)
ProcessUtilities.normalExecutioner(command)
return 0, 'Backup process killed without reporting any error. [184]'
elif os.path.exists(schedulerPath):
+ if os.path.exists('/usr/local/CyberCP/debug'):
+ message = 'if running not found, Status file does not exists, scheduler path found thus killed'
+ logging.CyberCPLogFileWriter.writeToFile(message)
backupSchedule.remoteBackupLogging(backupLogPath, 'Backup process killed. Error: %s' % (
open(schedulerPath, 'r').read()),
backupSchedule.ERROR)
diff --git a/plogical/backupUtilities.py b/plogical/backupUtilities.py
index 23127abcf..2eaab56c9 100755
--- a/plogical/backupUtilities.py
+++ b/plogical/backupUtilities.py
@@ -48,8 +48,8 @@ try:
except:
pass
-VERSION = '2.1'
-BUILD = 2
+VERSION = '2.3'
+BUILD = 1
## I am not the monster that you think I am..
@@ -645,7 +645,7 @@ class backupUtilities:
dbName = database.find('dbName').text
- if VERSION == '2.1' and int(BUILD) >= 1:
+ if (VERSION == '2.1' or VERSION == '2.3') and int(BUILD) >= 1:
logging.CyberCPLogFileWriter.writeToFile('Backup version 2.1.1+ detected..')
databaseUsers = database.findall('databaseUsers')
@@ -912,7 +912,7 @@ class backupUtilities:
dbName = database.find('dbName').text
- if VERSION == '2.1' and int(BUILD) >= 1:
+ if (VERSION == '2.1' or VERSION == '2.3') and int(BUILD) >= 1:
logging.CyberCPLogFileWriter.writeToFile('Backup version 2.1.1+ detected..')
@@ -963,6 +963,7 @@ class backupUtilities:
# /home/backup/backup-example.com-02.13.2018_10-24-52/public_html.tar.gz
## Moving above v2.0.0 extracting webhome data is not required, thus commenting below lines
+
if not twoPointO:
tar = tarfile.open(pathToCompressedHome)
tar.extractall(websiteHome)
diff --git a/plogical/processUtilities.py b/plogical/processUtilities.py
index 406a770f3..2a3cd62ca 100755
--- a/plogical/processUtilities.py
+++ b/plogical/processUtilities.py
@@ -225,7 +225,8 @@ class ProcessUtilities(multi.Thread):
command = 'sudo %s' % (command)
if os.path.exists(ProcessUtilities.debugPath):
- logging.writeToFile(ProcessUtilities.token + command)
+ if command.find('cat') == -1:
+ logging.writeToFile(ProcessUtilities.token + command)
if dir == None:
sock.sendall((ProcessUtilities.token + command).encode('utf-8'))
@@ -238,8 +239,11 @@ class ProcessUtilities(multi.Thread):
else:
command = '%s-u %s -d %s %s' % (ProcessUtilities.token, user, dir, command)
command = command.replace('sudo', '')
+
+
if os.path.exists(ProcessUtilities.debugPath):
- logging.writeToFile(command)
+ if command.find('cat') == -1:
+ logging.writeToFile(command)
sock.sendall(command.encode('utf-8'))
diff --git a/plogical/upgrade.py b/plogical/upgrade.py
index a103c14ac..581f2a61d 100755
--- a/plogical/upgrade.py
+++ b/plogical/upgrade.py
@@ -16,8 +16,8 @@ from CyberCP import settings
import random
import string
-VERSION = '2.1'
-BUILD = 2
+VERSION = '2.3'
+BUILD = 1
CENTOS7 = 0
CENTOS8 = 1
@@ -2341,6 +2341,8 @@ echo $oConfig->Save() ? 'Done' : 'Error';
if Upgrade.installedOutput.find('restic') == -1:
command = 'yum install restic -y'
Upgrade.executioner(command, 'Install Restic')
+ command = 'restic self-update'
+ Upgrade.executioner(command, 'Install Restic')
else:
if Upgrade.installedOutput.find('restic/bionic,now 0.8') == -1:
@@ -2349,6 +2351,9 @@ echo $oConfig->Save() ? 'Done' : 'Error';
command = 'apt-get install restic -y'
Upgrade.executioner(command, 'Install Restic')
+
+ command = 'restic self-update'
+ Upgrade.executioner(command, 'Install Restic')
@staticmethod
def UpdateMaxSSLCons():
diff --git a/serverStatus/views.py b/serverStatus/views.py
index d71dbca11..87fe564d7 100755
--- a/serverStatus/views.py
+++ b/serverStatus/views.py
@@ -25,8 +25,8 @@ EXPIRE = 3
### Version
-VERSION = '2.1'
-BUILD = 2
+VERSION = '2.3'
+BUILD = 1
def serverStatusHome(request):
proc = httpProc(request, 'serverStatus/index.html',
diff --git a/version.txt b/version.txt
index bec35f025..010d8ea9e 100644
--- a/version.txt
+++ b/version.txt
@@ -1 +1 @@
-{"version":"2.1","build":1}
\ No newline at end of file
+{"version":"2.3","build":1}
\ No newline at end of file