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