pull/632/head
Mr Chen 5 months ago
parent 6ebc7a1514
commit 50a96b198a
  1. 10
      plugins/acme_pandominassl_apply/index.py
  2. 2
      plugins/acme_pandominassl_apply/tool_cron.py
  3. 6
      plugins/backup_ftp/index.py
  4. 4
      plugins/gdrive/index.py
  5. 4
      plugins/mariadb/index.py
  6. 2
      plugins/migration_api/index.py
  7. 4
      plugins/msonedrive/index.py
  8. 6
      plugins/mysql-apt/index.py
  9. 6
      plugins/mysql-yum/index.py
  10. 6
      plugins/mysql/index.py
  11. 2
      plugins/op_waf/tool_task.py

@ -563,7 +563,7 @@ def runHookPy(domain,path):
# print(domain,path)
run_log = runLog()
hook_file = getConf()
cmd = 'cd '+mw.getRunDir()
cmd = 'cd '+mw.getPanelDir()
cmd += ' && python3 '+hook_file + ' ' + domain + ' ' + path
cmd += ' >> '+ run_log
print(cmd)
@ -644,7 +644,7 @@ def getHookIdCmd():
if not data[0]:
return data[1]
cmd = "cd "+mw.getRunDir()+" "
cmd = "cd "+mw.getPanelDir()+" "
cmd += '&& python3 plugins/acme_pandominassl_apply/index.py run_hook_id 1.0 {"id":"'+args['id']+'"}'
return mw.returnJson(True, 'ok',cmd)
@ -661,7 +661,7 @@ def runHookId():
return 'run hook '+args['id']+' end'
def runHookCmd():
cmd = "cd "+mw.getRunDir()+" "
cmd = "cd "+mw.getPanelDir()+" "
cmd += '&& python3 plugins/acme_pandominassl_apply/index.py run_hook'
return mw.returnJson(True, 'ok',cmd)
@ -738,7 +738,7 @@ def runSyncCfData():
return ''
def runSyncCfCmd():
cmd = "cd "+mw.getRunDir()+" "
cmd = "cd "+mw.getPanelDir()+" "
cmd += '&& python3 plugins/acme_pandominassl_apply/index.py run_sync_cf_data'
return mw.returnJson(True, 'ok',cmd)
@ -791,7 +791,7 @@ def runSyncDnsPodData():
return ''
def runSyncDnsPodCmd():
cmd = "cd "+mw.getRunDir()+" "
cmd = "cd "+mw.getPanelDir()+" "
cmd += '&& python3 plugins/acme_pandominassl_apply/index.py run_sync_dnspod_data'
return mw.returnJson(True, 'ok',cmd)

@ -72,7 +72,7 @@ def createBgTaskByName(name):
import crontab_api
api = crontab_api.crontab_api()
mw_dir = mw.getRunDir()
mw_dir = mw.getPanelDir()
cmd = '''
mw_dir=%s
rname=%s

@ -188,7 +188,7 @@ def findPathName(path, filename):
return l
def backupAllFunc(stype):
os.chdir(mw.getRunDir())
os.chdir(mw.getPanelDir())
name = sys.argv[2]
num = sys.argv[3]
@ -230,11 +230,11 @@ def backupAllFunc(stype):
'type=? and pid=?', ('1', pid)).field('id,filename').select()
args = stype + " " + name + " " + num
cmd = 'python3 ' + mw.getRunDir() + '/scripts/backup.py ' + args
cmd = 'python3 ' + mw.getPanelDir() + '/scripts/backup.py ' + args
if stype.find('database_') > -1:
plugin_name = stype.replace('database_', '')
args = "database " + name + " " + num
cmd = 'python3 ' + mw.getRunDir() + '/plugins/' + plugin_name + \
cmd = 'python3 ' + mw.getPanelDir() + '/plugins/' + plugin_name + \
'/scripts/backup.py ' + args
os.system(cmd)

@ -203,9 +203,9 @@ def backupAllFunc(stype):
mw.echoInfo("未授权API,无法使用!!!")
return ''
os.chdir(mw.getRunDir())
os.chdir(mw.getPanelDir())
backup_dir = mw.getBackupDir()
run_dir = mw.getRunDir()
run_dir = mw.getPanelDir()
stype = sys.argv[1]
name = sys.argv[2]

@ -2478,7 +2478,7 @@ def trySlaveSyncBugfix(version=''):
return mw.returnJson(True, '修复成功!')
def getSlaveSyncCmd(version=''):
root = mw.getRunDir()
root = mw.getPanelDir()
cmd = 'cd ' + root + ' && python3 ' + root + \
'/plugins/mariadb/index.py do_full_sync {"db":"all","sign":""}'
return mw.returnJson(True, 'ok', cmd)
@ -3027,7 +3027,7 @@ def fullSync(version=''):
status_file = asyncTmpfile()
if args['begin'] == '1':
cmd = 'cd ' + mw.getRunDir() + ' && python3 ' + \
cmd = 'cd ' + mw.getPanelDir() + ' && python3 ' + \
getPluginDir() + \
'/index.py do_full_sync {"db":"' + args['db'] + '","sign":"' + sign + '"} &'
# print(cmd)

@ -384,7 +384,7 @@ class classApi:
zip_file = backup_path + \
"/psync_tmp_{}.tar.gz".format(os.path.basename(spath))
zip_dst = mw.getRunDir() + '/tmp/psync_tmp_{}.tar.gz'.format(
zip_dst = mw.getPanelDir() + '/tmp/psync_tmp_{}.tar.gz'.format(
os.path.basename(dpath))
write_log("|-正在压缩目录[{}]...".format(spath))
self.write_speed('done', '正在压缩')

@ -217,9 +217,9 @@ def backupAllFunc(stype):
mw.echoInfo("未授权API,无法使用!!!")
return ''
os.chdir(mw.getRunDir())
os.chdir(mw.getPanelDir())
backup_dir = mw.getBackupDir()
run_dir = mw.getRunDir()
run_dir = mw.getPanelDir()
stype = sys.argv[1]
name = sys.argv[2]

@ -831,7 +831,7 @@ def setDbBackup():
if not data[0]:
return data[1]
scDir = getPluginDir() + '/scripts/backup.py'
scDir = getPanelDir() + '/scripts/backup.py'
cmd = 'python3 ' + scDir + ' database ' + args['name'] + ' 3'
os.system(cmd)
return mw.returnJson(True, 'ok')
@ -2569,7 +2569,7 @@ def trySlaveSyncBugfix(version=''):
def getSlaveSyncCmd(version=''):
root = mw.getRunDir()
root = mw.getPanelDir()
cmd = 'cd ' + root + ' && python3 ' + root + \
'/plugins/mysql/index.py do_full_sync {"db":"all","sign":""}'
return mw.returnJson(True, 'ok', cmd)
@ -3450,7 +3450,7 @@ def fullSync(version=''):
status_file = asyncTmpfile()
if args['begin'] == '1':
cmd = 'cd ' + mw.getRunDir() + ' && python3 ' + getPluginDir() + \
cmd = 'cd ' + mw.getPanelDir() + ' && python3 ' + getPluginDir() + \
'/index.py do_full_sync {"db":"' + \
args['db'] + '","sign":"' + sign + '"} &'
# print(cmd)

@ -830,7 +830,7 @@ def setDbBackup():
if not data[0]:
return data[1]
scDir = getPluginDir() + '/scripts/backup.py'
scDir = getPanelDir() + '/scripts/backup.py'
cmd = 'python3 ' + scDir + ' database ' + args['name'] + ' 3'
os.system(cmd)
return mw.returnJson(True, 'ok')
@ -2551,7 +2551,7 @@ def trySlaveSyncBugfix(version=''):
def getSlaveSyncCmd(version=''):
root = mw.getRunDir()
root = mw.getPanelDir()
cmd = 'cd ' + root + ' && python3 ' + root + \
'/plugins/mysql/index.py do_full_sync {"db":"all"}'
return mw.returnJson(True, 'ok', cmd)
@ -3433,7 +3433,7 @@ def fullSync(version=''):
status_file = asyncTmpfile()
if args['begin'] == '1':
cmd = 'cd ' + mw.getRunDir() + ' && python3 ' + getPluginDir() + \
cmd = 'cd ' + mw.getPanelDir() + ' && python3 ' + getPluginDir() + \
'/index.py do_full_sync {"db":"' + \
args['db'] + '","sign":"' + sign + '"} &'
# print(cmd)

@ -973,7 +973,7 @@ def setDbBackup():
if not data[0]:
return data[1]
scDir = mw.getRunDir() + '/scripts/backup.py'
scDir = mw.getPanelDir() + '/scripts/backup.py'
cmd = 'python3 ' + scDir + ' database ' + args['name'] + ' 3'
os.system(cmd)
return mw.returnJson(True, 'ok')
@ -2780,7 +2780,7 @@ def trySlaveSyncBugfix(version=''):
def getSlaveSyncCmd(version=''):
root = mw.getRunDir()
root = mw.getPanelDir()
cmd = 'cd ' + root + ' && python3 ' + root + \
'/plugins/mysql/index.py do_full_sync {"db":"all","sign",""}'
return mw.returnJson(True, 'ok', cmd)
@ -3728,7 +3728,7 @@ def fullSync(version=''):
status_file = asyncTmpfile()
if args['begin'] == '1':
cmd = 'cd ' + mw.getRunDir() + ' && python3 ' + getPluginDir() + \
cmd = 'cd ' + mw.getPanelDir() + ' && python3 ' + getPluginDir() + \
'/index.py do_full_sync {"db":"' + \
args['db'] + '","sign":"' + sign + '"} &'
# print(cmd)

@ -93,7 +93,7 @@ def createBgTaskByName(name, args):
_where1 = args['minute-n']
_minute = ''
mw_dir = mw.getRunDir()
mw_dir = mw.getPanelDir()
cmd = '''
mw_dir=%s
rname=%s

Loading…
Cancel
Save