mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-09 14:56:10 +01:00
bug fix: git manager
This commit is contained in:
@@ -126,14 +126,12 @@ class IncScheduler():
|
|||||||
data = {}
|
data = {}
|
||||||
data['domain'] = website
|
data['domain'] = website
|
||||||
data['folder'] = finalPath
|
data['folder'] = finalPath
|
||||||
data['commitMessage'] = 'Auto commit by CyberPanel %s cron on %s.' % (type, time.strftime('%m.%d.%Y_%H-%M-%S'))
|
data['commitMessage'] = 'Auto commit by CyberPanel %s cron on %s' % (type, time.strftime('%m-%d-%Y_%H-%M-%S'))
|
||||||
|
|
||||||
|
|
||||||
if gitConf['autoCommit'] == type:
|
if gitConf['autoCommit'] == type:
|
||||||
|
|
||||||
wm = WebsiteManager()
|
wm = WebsiteManager()
|
||||||
resp = wm.commitChanges(1, data)
|
resp = wm.commitChanges(1, data)
|
||||||
logging.writeToFile(resp.content)
|
|
||||||
resp = json.loads(resp.content)
|
resp = json.loads(resp.content)
|
||||||
|
|
||||||
message = 'Folder: %s, Status: %s' % (finalPath, resp['commandStatus'])
|
message = 'Folder: %s, Status: %s' % (finalPath, resp['commandStatus'])
|
||||||
|
|||||||
@@ -2912,6 +2912,8 @@ StrictHostKeyChecking no
|
|||||||
|
|
||||||
def folderCheck(self):
|
def folderCheck(self):
|
||||||
|
|
||||||
|
try:
|
||||||
|
|
||||||
domainPath = '/home/%s/public_html' % (self.domain)
|
domainPath = '/home/%s/public_html' % (self.domain)
|
||||||
vhRoot = '/home/%s' % (self.domain)
|
vhRoot = '/home/%s' % (self.domain)
|
||||||
vmailPath = '/home/vmail/%s' % (self.domain)
|
vmailPath = '/home/vmail/%s' % (self.domain)
|
||||||
@@ -2996,6 +2998,8 @@ StrictHostKeyChecking no
|
|||||||
|
|
||||||
if self.folder == dbPath:
|
if self.folder == dbPath:
|
||||||
return 1
|
return 1
|
||||||
|
except BaseException as msg:
|
||||||
|
logging.CyberCPLogFileWriter.writeToFile('%s. [folderCheck:3002]' % (str(msg)))
|
||||||
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
@@ -3355,12 +3359,13 @@ StrictHostKeyChecking no
|
|||||||
else:
|
else:
|
||||||
return ACLManager.loadErrorJson()
|
return ACLManager.loadErrorJson()
|
||||||
|
|
||||||
|
|
||||||
# security check
|
# security check
|
||||||
|
|
||||||
if ACLManager.validateInput(self.commitMessage):
|
if ACLManager.validateInput(self.commitMessage):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
return ACLManager.loadErrorJson('status', 'Invalid characters in your input.')
|
return ACLManager.loadErrorJson()
|
||||||
|
|
||||||
## Check if remote exists
|
## Check if remote exists
|
||||||
|
|
||||||
@@ -3371,13 +3376,13 @@ StrictHostKeyChecking no
|
|||||||
commandStatus = ProcessUtilities.outputExecutioner(command)
|
commandStatus = ProcessUtilities.outputExecutioner(command)
|
||||||
|
|
||||||
if commandStatus.find('nothing to commit') == -1:
|
if commandStatus.find('nothing to commit') == -1:
|
||||||
|
|
||||||
|
try:
|
||||||
gitConfFolder = '/home/cyberpanel/git/%s' % (self.masterDomain)
|
gitConfFolder = '/home/cyberpanel/git/%s' % (self.masterDomain)
|
||||||
finalFile = '%s/%s' % (gitConfFolder, self.folder.split('/')[-1])
|
finalFile = '%s/%s' % (gitConfFolder, self.folder.split('/')[-1])
|
||||||
|
|
||||||
gitConf = json.loads(open(finalFile, 'r').read())
|
gitConf = json.loads(open(finalFile, 'r').read())
|
||||||
|
|
||||||
try:
|
|
||||||
|
|
||||||
if gitConf['commands'] != 'NONE':
|
if gitConf['commands'] != 'NONE':
|
||||||
|
|
||||||
GitLogs(owner=self.masterWebsite, type='INFO', message='Running commands after successful git commit..').save()
|
GitLogs(owner=self.masterWebsite, type='INFO', message='Running commands after successful git commit..').save()
|
||||||
|
|||||||
Reference in New Issue
Block a user