diff --git a/plugins/acme_pandominassl_apply/index.py b/plugins/acme_pandominassl_apply/index.py index 6e31800bc..1679e0bf9 100755 --- a/plugins/acme_pandominassl_apply/index.py +++ b/plugins/acme_pandominassl_apply/index.py @@ -131,7 +131,7 @@ def status(): def contentReplace(content): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$SERVER_APP}', service_path + '/redis') content = content.replace('{$REDIS_PASS}', mw.getRandomString(10)) diff --git a/plugins/alist/index.py b/plugins/alist/index.py index 7399dcf7e..1d0ded778 100755 --- a/plugins/alist/index.py +++ b/plugins/alist/index.py @@ -107,7 +107,7 @@ def status(): def contentReplace(content): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$SERVER_APP}', service_path + '/'+getPluginName()) return content diff --git a/plugins/cloudreve/index.py b/plugins/cloudreve/index.py index c89d411a4..8f26a8e82 100755 --- a/plugins/cloudreve/index.py +++ b/plugins/cloudreve/index.py @@ -107,7 +107,7 @@ def status(): def contentReplace(content): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$SERVER_APP}', service_path + '/'+getPluginName()) return content diff --git a/plugins/docker/index.py b/plugins/docker/index.py index 128498d9a..252cd678b 100755 --- a/plugins/docker/index.py +++ b/plugins/docker/index.py @@ -438,7 +438,7 @@ def dockerRemoveImage(): def getImageListFunc(dbname=''): - bkDir = mw.getRootDir() + '/backup/docker' + bkDir = mw.getFatherDir() + '/backup/docker' blist = os.listdir(bkDir) r = [] @@ -452,13 +452,13 @@ def getImageListFunc(dbname=''): def dockerImagePickDir(): - bkDir = mw.getRootDir() + '/backup/docker' + bkDir = mw.getFatherDir() + '/backup/docker' return mw.returnJson(True, 'ok', bkDir) def dockerImagePickList(): - bkDir = mw.getRootDir() + '/backup/docker' + bkDir = mw.getFatherDir() + '/backup/docker' if not os.path.exists(bkDir): os.mkdir(bkDir) @@ -490,7 +490,7 @@ def dockerImagePickSave(): if not data[0]: return data[1] - bkDir = mw.getRootDir() + '/backup/docker/' + bkDir = mw.getFatherDir() + '/backup/docker/' images = args['images'] try: file_name = bkDir + \ diff --git a/plugins/fail2ban/index.py b/plugins/fail2ban/index.py index a1aa4e003..4d478ab10 100755 --- a/plugins/fail2ban/index.py +++ b/plugins/fail2ban/index.py @@ -123,7 +123,7 @@ def status(): def contentReplace(content): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) return content diff --git a/plugins/gitea/index.py b/plugins/gitea/index.py index 40305aa35..b263398ac 100755 --- a/plugins/gitea/index.py +++ b/plugins/gitea/index.py @@ -119,7 +119,7 @@ export HOME=%s && ''' % ( getRunUser(), getHomeDir()) def contentReplace(content): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$RUN_USER}', getRunUser()) content = content.replace('{$HOME_DIR}', getHomeDir()) @@ -686,7 +686,7 @@ def projectScriptLoad(): commit_tpl = getPluginDir() + '/hook/commit.tpl' commit = path + '/custom_hooks/commit' - codeDir = mw.getRootDir() + '/git' + codeDir = mw.getFatherDir() + '/git' cc_content = mw.readFile(commit_tpl) diff --git a/plugins/gogs/index.py b/plugins/gogs/index.py index 20c7bc69e..e4643edb8 100755 --- a/plugins/gogs/index.py +++ b/plugins/gogs/index.py @@ -119,7 +119,7 @@ export HOME=%s && ''' % ( getRunUser(), getHomeDir()) def contentReplace(content): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$RUN_USER}', getRunUser()) content = content.replace('{$HOME_DIR}', getHomeDir()) @@ -688,7 +688,7 @@ def projectScriptLoad(): commit_tpl = getPluginDir() + '/hook/commit.tpl' commit = path + '/custom_hooks/commit' - codeDir = mw.getRootDir() + '/git' + codeDir = mw.getFatherDir() + '/git' cc_content = mw.readFile(commit_tpl) diff --git a/plugins/gorse/index.py b/plugins/gorse/index.py index 21465ef60..090c48576 100755 --- a/plugins/gorse/index.py +++ b/plugins/gorse/index.py @@ -140,7 +140,7 @@ def initRedisConf(): def contentReplace(content): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$CONFIG_ADMIN}', mw.getRandomString(6)) content = content.replace('{$CONFIG_PASS}', mw.getRandomString(10)) diff --git a/plugins/haproxy/index.py b/plugins/haproxy/index.py index 675ba84d0..843ac5090 100755 --- a/plugins/haproxy/index.py +++ b/plugins/haproxy/index.py @@ -99,7 +99,7 @@ def readConfigTpl(): def contentReplace(content): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$HA_USER}', mw.getRandomString(8)) content = content.replace('{$HA_PWD}', mw.getRandomString(10)) diff --git a/plugins/imail/index.py b/plugins/imail/index.py index a61ac5f3f..6fa0c4758 100755 --- a/plugins/imail/index.py +++ b/plugins/imail/index.py @@ -104,7 +104,7 @@ class App: def contentReplace(self, content): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$RUN_USER}', self.getRunUser()) content = content.replace('{$HOME_DIR}', self.getHomeDir()) diff --git a/plugins/mariadb/index.py b/plugins/mariadb/index.py index ea61704bb..01f895af1 100755 --- a/plugins/mariadb/index.py +++ b/plugins/mariadb/index.py @@ -139,7 +139,7 @@ def getInitdTpl(version=''): def contentReplace(content): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$SERVER_APP_PATH}', service_path + '/mariadb') server_id = int(time.time()) @@ -890,7 +890,7 @@ def importDbExternalProgressBar(): file = args['file'] name = args['name'] - import_dir = mw.getRootDir() + '/backup/import/' + import_dir = mw.getFatherDir() + '/backup/import/' file_path = import_dir + file if not os.path.exists(file_path): diff --git a/plugins/mariadb/scripts/backup.py b/plugins/mariadb/scripts/backup.py index a70445a28..a6177cc38 100755 --- a/plugins/mariadb/scripts/backup.py +++ b/plugins/mariadb/scripts/backup.py @@ -40,7 +40,7 @@ class backupTools: "----------------------------------------------------------------------------") return - backup_path = mw.getRootDir() + '/backup/database/mariadb' + backup_path = mw.getFatherDir() + '/backup/database/mariadb' if not os.path.exists(backup_path): mw.execShell("mkdir -p " + backup_path) @@ -52,7 +52,7 @@ class backupTools: my_conf_path = db_path + '/etc/my.cnf' content = mw.readFile(my_conf_path) - rep = "\[mysqldump\]\nuser=root" + rep = r"\[mysqldump\]\nuser=root" sea = "[mysqldump]\n" subStr = sea + "user=root\npassword=" + mysql_root + "\n" content = content.replace(sea, subStr) diff --git a/plugins/migration_api/index.py b/plugins/migration_api/index.py index 425806cc5..061deca92 100755 --- a/plugins/migration_api/index.py +++ b/plugins/migration_api/index.py @@ -379,7 +379,7 @@ class classApi: # 创建目录 self.send('/files/create_dir', {"path": dpath}) - backup_path = mw.getRootDir() + '/backup' + backup_path = mw.getFatherDir() + '/backup' if not os.path.exists(backup_path): os.makedirs(backup_path, 384) @@ -701,7 +701,7 @@ class classApi: root = self.getDbConn('mysql', 'config').where( 'id=?', (1,)).getField('mysql_root') - backup_path = mw.getRootDir() + '/backup' + backup_path = mw.getFatherDir() + '/backup' if not os.path.exists(backup_path): os.makedirs(backup_path, 384) diff --git a/plugins/mongodb/index.py b/plugins/mongodb/index.py index 62c1d4ff5..07a1b5a3c 100755 --- a/plugins/mongodb/index.py +++ b/plugins/mongodb/index.py @@ -1204,7 +1204,7 @@ def replClose(): return mw.returnJson(True, '关闭副本同步成功!') def getDbBackupListFunc(dbname=''): - bkDir = mw.getRootDir() + '/backup/database' + bkDir = mw.getBackupDir() + '/database' blist = os.listdir(bkDir) r = [] @@ -1223,7 +1223,7 @@ def getDbBackupList(): return data[1] r = getDbBackupListFunc(args['name']) - bkDir = mw.getRootDir() + '/backup/database' + bkDir = mw.getBackupDir() + '/database' rr = [] for x in range(0, len(r)): p = bkDir + '/' + r[x] @@ -1245,7 +1245,7 @@ def getDbBackupList(): def getDbBackupImportList(): - bkImportDir = mw.getRootDir() + '/backup/mongodb_import' + bkImportDir = mw.getBackupDir() + '/mongodb_import' if not os.path.exists(bkImportDir): os.mkdir(bkImportDir) @@ -1283,7 +1283,7 @@ def deleteDbBackup(): path = args['path'] full_file = "" - bkDir = mw.getRootDir() + '/backup/database' + bkDir = mw.getBackupDir() + '/database' full_file = bkDir + '/' + args['filename'] if path != "": full_file = path + "/" + args['filename'] @@ -1303,7 +1303,7 @@ def setDbBackup(): def getListBson(dbname=''): - bkDir = mw.getRootDir() + '/backup/mongodb_import/'+dbname + bkDir = mw.getBackupDir() + '/mongodb_import/'+dbname blist = os.listdir(bkDir) r = [] @@ -1327,7 +1327,7 @@ def importDbExternal(): file = args['file'] name = args['name'] - import_dir = mw.getRootDir() + '/backup/mongodb_import/' + import_dir = mw.getBackupDir() + '/mongodb_import/' mg_root = pSqliteDb('config').where('id=?', (1,)).getField('mg_root') port = getConfPort() @@ -1535,8 +1535,7 @@ def installPreInspection(version): if sys[1] != '': return '暂时不支持该系统' - sys_id = mw.execShell( - "cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F '\"' '{print $2}'") + sys_id = mw.execShell("cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F '\"' '{print $2}'") sysName = sys[0].strip().lower() sysId = sys_id[0].strip() diff --git a/plugins/mongodb/scripts/backup.py b/plugins/mongodb/scripts/backup.py index 77a9ed0d6..12a887353 100644 --- a/plugins/mongodb/scripts/backup.py +++ b/plugins/mongodb/scripts/backup.py @@ -131,7 +131,7 @@ def mongdbClient(): class backupTools: def getDbBackupList(self,dbname=''): - bkDir = mw.getRootDir() + '/backup/database' + bkDir = mw.getFatherDir() + '/backup/database' blist = os.listdir(bkDir) r = [] diff --git a/plugins/mysql-apt/index.py b/plugins/mysql-apt/index.py index 09e79f3fc..73a46e8a5 100755 --- a/plugins/mysql-apt/index.py +++ b/plugins/mysql-apt/index.py @@ -135,7 +135,7 @@ def getAuthPolicy(): def contentReplace(content): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$SERVER_APP_PATH}', service_path + '/' + getPluginName()) @@ -932,7 +932,7 @@ def importDbExternalProgressBar(): file = args['file'] name = args['name'] - import_dir = mw.getRootDir() + '/backup/import/' + import_dir = mw.getFatherDir() + '/backup/import/' file_path = import_dir + file if not os.path.exists(file_path): diff --git a/plugins/mysql-apt/scripts/backup.py b/plugins/mysql-apt/scripts/backup.py index 992219655..55603de19 100755 --- a/plugins/mysql-apt/scripts/backup.py +++ b/plugins/mysql-apt/scripts/backup.py @@ -44,7 +44,7 @@ class backupTools: "----------------------------------------------------------------------------") return - backup_path = mw.getRootDir() + '/backup/database/mysql-apt' + backup_path = mw.getFatherDir() + '/backup/database/mysql-apt' if not os.path.exists(backup_path): mw.execShell("mkdir -p " + backup_path) @@ -56,7 +56,7 @@ class backupTools: my_conf_path = db_path + '/etc/my.cnf' mycnf = mw.readFile(my_conf_path) - rep = "\[mysqldump\]\nuser=root" + rep = r"\[mysqldump\]\nuser=root" sea = "[mysqldump]\n" subStr = sea + "user=root\npassword=" + mysql_root + "\n" mycnf = mycnf.replace(sea, subStr) diff --git a/plugins/mysql-yum/index.py b/plugins/mysql-yum/index.py index 470dfdaeb..7c85d1afb 100755 --- a/plugins/mysql-yum/index.py +++ b/plugins/mysql-yum/index.py @@ -152,7 +152,7 @@ def getAuthPolicy(): def contentReplace(content): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$SERVER_APP_PATH}',service_path + '/' + getPluginName()) @@ -930,7 +930,7 @@ def importDbExternalProgressBar(): file = args['file'] name = args['name'] - import_dir = mw.getRootDir() + '/backup/import/' + import_dir = mw.getFatherDir() + '/backup/import/' file_path = import_dir + file if not os.path.exists(file_path): diff --git a/plugins/mysql-yum/scripts/backup.py b/plugins/mysql-yum/scripts/backup.py index 1c4dd3cc0..e958f182b 100755 --- a/plugins/mysql-yum/scripts/backup.py +++ b/plugins/mysql-yum/scripts/backup.py @@ -44,7 +44,7 @@ class backupTools: "----------------------------------------------------------------------------") return - backup_path = mw.getRootDir() + '/backup/database/mysql-yum' + backup_path = mw.getFatherDir() + '/backup/database/mysql-yum' if not os.path.exists(backup_path): mw.execShell("mkdir -p " + backup_path) @@ -58,7 +58,7 @@ class backupTools: mw.backFile(my_cnf) content = mw.readFile(my_cnf) - rep = "\[mysqldump\]\nuser=root" + rep = r"\[mysqldump\]\nuser=root" sea = "[mysqldump]\n" subStr = sea + "user=root\npassword=" + mysql_root + "\n" content = content.replace(sea, subStr) diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index 4181c93cc..b53a42ecc 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -139,7 +139,7 @@ def getInitdTpl(version=''): def contentReplace(content): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$SERVER_APP_PATH}', service_path + '/mysql') @@ -1011,7 +1011,7 @@ def importDbExternal(): file = args['file'] name = args['name'] - import_dir = mw.getRootDir() + '/backup/import/' + import_dir = mw.getFatherDir() + '/backup/import/' file_path = import_dir + file if not os.path.exists(file_path): @@ -1096,7 +1096,7 @@ def importDbExternalProgressBar(): file = args['file'] name = args['name'] - import_dir = mw.getRootDir() + '/backup/import/' + import_dir = mw.getFatherDir() + '/backup/import/' file_path = import_dir + file if not os.path.exists(file_path): @@ -1159,11 +1159,11 @@ def importDbBackup(): file = args['file'] name = args['name'] - file_path = mw.getRootDir() + '/backup/database/' + file - file_path_sql = mw.getRootDir() + '/backup/database/' + file.replace('.gz', '') + file_path = mw.getFatherDir() + '/backup/database/' + file + file_path_sql = mw.getFatherDir() + '/backup/database/' + file.replace('.gz', '') if not os.path.exists(file_path_sql): - cmd = 'cd ' + mw.getRootDir() + '/backup/database && gzip -d ' + file + cmd = 'cd ' + mw.getFatherDir() + '/backup/database && gzip -d ' + file mw.execShell(cmd) local_mode = recognizeDbMode() @@ -1210,11 +1210,11 @@ def importDbBackupProgressBar(): file = args['file'] name = args['name'] - file_path = mw.getRootDir() + '/backup/database/' + file - file_path_sql = mw.getRootDir() + '/backup/database/' + file.replace('.gz', '') + file_path = mw.getFatherDir() + '/backup/database/' + file + file_path_sql = mw.getFatherDir() + '/backup/database/' + file.replace('.gz', '') if not os.path.exists(file_path_sql): - cmd = 'cd ' + mw.getRootDir() + '/backup/database && gzip -d ' + file + cmd = 'cd ' + mw.getFatherDir() + '/backup/database && gzip -d ' + file mw.execShell(cmd) local_mode = recognizeDbMode() @@ -1241,7 +1241,7 @@ def deleteDbBackup(): path = args['path'] full_file = "" - bkDir = mw.getRootDir() + '/backup/database' + bkDir = mw.getFatherDir() + '/backup/database' full_file = bkDir + '/' + args['filename'] if path != "": full_file = path + "/" + args['filename'] @@ -1256,7 +1256,7 @@ def getDbBackupList(): return data[1] r = getDbBackupListFunc(args['name']) - bkDir = mw.getRootDir() + '/backup/database' + bkDir = mw.getFatherDir() + '/backup/database' rr = [] for x in range(0, len(r)): p = bkDir + '/' + r[x] @@ -1279,7 +1279,7 @@ def getDbBackupList(): def getDbBackupImportList(): - bkImportDir = mw.getRootDir() + '/backup/import' + bkImportDir = mw.getFatherDir() + '/backup/import' if not os.path.exists(bkImportDir): os.mkdir(bkImportDir) diff --git a/plugins/nezha/index.py b/plugins/nezha/index.py index 0fa578c8c..d79ad4bc2 100755 --- a/plugins/nezha/index.py +++ b/plugins/nezha/index.py @@ -119,7 +119,7 @@ class App: def contentReplace(self, content): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$RUN_USER}', self.getRunUser()) content = content.replace('{$HOME_DIR}', self.getHomeDir()) diff --git a/plugins/op_load_balance/index.py b/plugins/op_load_balance/index.py index 622c3025b..262a20b04 100755 --- a/plugins/op_load_balance/index.py +++ b/plugins/op_load_balance/index.py @@ -77,7 +77,7 @@ def writeConf(data): def contentReplace(content): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$APP_PATH}', app_path) return content diff --git a/plugins/op_waf/index.py b/plugins/op_waf/index.py index f6db7a141..92698b3e9 100755 --- a/plugins/op_waf/index.py +++ b/plugins/op_waf/index.py @@ -249,7 +249,7 @@ def contentReplace(content): service_path = mw.getServerDir() waf_root = getServerDir() waf_path = waf_root + "/waf" - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$WAF_PATH}', waf_path) content = content.replace('{$WAF_ROOT}', waf_root) diff --git a/plugins/pgadmin/index.py b/plugins/pgadmin/index.py index 526f5f145..85984f5d6 100755 --- a/plugins/pgadmin/index.py +++ b/plugins/pgadmin/index.py @@ -88,7 +88,7 @@ def contentReplace(content): cfg = getCfg() service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$APP_PATH}', service_path+'/'+getPluginName()+'/data') diff --git a/plugins/php-apt/index.py b/plugins/php-apt/index.py index b5abc0efb..d6146bfac 100755 --- a/plugins/php-apt/index.py +++ b/plugins/php-apt/index.py @@ -85,7 +85,7 @@ def status(version): def contentReplace(content, version): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$PHP_VERSION}', version) content = content.replace('{$LOCAL_IP}', mw.getLocalIp()) @@ -739,7 +739,7 @@ def getPhpinfo(version): return 'PHP[' + version + ']未启动,不可访问!!!' sock_file = getFpmAddress(version) - root_dir = mw.getRootDir() + '/phpinfo' + root_dir = mw.getFatherDir() + '/phpinfo' mw.execShell("rm -rf " + root_dir) mw.execShell("mkdir -p " + root_dir) diff --git a/plugins/php-apt/index_php_apt.py b/plugins/php-apt/index_php_apt.py index 2562967a4..c6b4301b0 100755 --- a/plugins/php-apt/index_php_apt.py +++ b/plugins/php-apt/index_php_apt.py @@ -118,7 +118,7 @@ def getPhpinfo(version): sock_file = getFpmAddress(version) # print(sock_file) - root_dir = mw.getRootDir() + '/phpinfo' + root_dir = mw.getFatherDir() + '/phpinfo' mw.execShell("rm -rf " + root_dir) mw.execShell("mkdir -p " + root_dir) diff --git a/plugins/php-yum/index.py b/plugins/php-yum/index.py index fefbed017..153addc64 100755 --- a/plugins/php-yum/index.py +++ b/plugins/php-yum/index.py @@ -77,7 +77,7 @@ def status(version): def contentReplace(content, version): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$PHP_VERSION}', version) content = content.replace('{$LOCAL_IP}', mw.getLocalIp()) @@ -88,15 +88,15 @@ def contentReplace(content, version): content = content.replace('{$PHP_USER}', 'nobody') content = content.replace('{$PHP_GROUP}', 'nobody') - rep = 'listen.owner\s*=\s*(.+)\r?\n' + rep = r'listen.owner\s*=\s*(.+)\r?\n' val = ';listen.owner = nobody\n' content = re.sub(rep, val, content) - rep = 'listen.group\s*=\s*(.+)\r?\n' + rep = r'listen.group\s*=\s*(.+)\r?\n' val = ';listen.group = nobody\n' content = re.sub(rep, val, content) - rep = 'user\s*=\s*(.+)\r?\n' + rep = r'user\s*=\s*(.+)\r?\n' val = ';user = nobody\n' content = re.sub(rep, val, content) @@ -742,7 +742,7 @@ def getPhpinfo(version): return 'PHP[' + version + ']未启动,不可访问!!!' sock_file = getFpmAddress(version) - root_dir = mw.getRootDir() + '/phpinfo' + root_dir = mw.getFatherDir() + '/phpinfo' mw.execShell("rm -rf " + root_dir) mw.execShell("mkdir -p " + root_dir) diff --git a/plugins/php-yum/index_php_yum.py b/plugins/php-yum/index_php_yum.py index 11ea23240..17bae712b 100755 --- a/plugins/php-yum/index_php_yum.py +++ b/plugins/php-yum/index_php_yum.py @@ -97,7 +97,7 @@ def getPhpinfo(version): return 'PHP[' + version + ']未启动,不可访问!!!' sock_file = getFpmAddress(version) - root_dir = mw.getRootDir() + '/phpinfo' + root_dir = mw.getFatherDir() + '/phpinfo' mw.execShell("rm -rf " + root_dir) mw.execShell("mkdir -p " + root_dir) diff --git a/plugins/php/index.py b/plugins/php/index.py index f08c86485..761a33902 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -119,7 +119,7 @@ def status(version): def contentReplace(content, version): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$PHP_VERSION}', version) content = content.replace('{$LOCAL_IP}', mw.getLocalIp()) @@ -913,7 +913,7 @@ def getPhpinfo(version): return 'PHP[' + version + ']未启动,不可访问!!!' sock_file = getFpmAddress(version) - root_dir = mw.getRootDir() + '/phpinfo' + root_dir = mw.getFatherDir() + '/phpinfo' mw.execShell("rm -rf " + root_dir) mw.execShell("mkdir -p " + root_dir) diff --git a/plugins/php/index_php.py b/plugins/php/index_php.py index 617613b1e..06a90a9c4 100755 --- a/plugins/php/index_php.py +++ b/plugins/php/index_php.py @@ -111,7 +111,7 @@ def getPhpinfo(version): return 'PHP[' + version + ']未启动,不可访问!!!' sock_file = getFpmAddress(version) - root_dir = mw.getRootDir() + '/phpinfo' + root_dir = mw.getFatherDir() + '/phpinfo' mw.execShell("rm -rf " + root_dir) mw.execShell("mkdir -p " + root_dir) diff --git a/plugins/phpmyadmin/index.py b/plugins/phpmyadmin/index.py index 5e8df07eb..884ef2f34 100755 --- a/plugins/phpmyadmin/index.py +++ b/plugins/phpmyadmin/index.py @@ -122,7 +122,7 @@ def contentReplace(content): blowfish_secret = tmp[0].strip() # print php_ver php_conf_dir = mw.getServerDir() + '/web_conf/php/conf' - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$PHP_CONF_PATH}', php_conf_dir) content = content.replace('{$PHP_VER}', php_ver) diff --git a/plugins/postgresql/index.py b/plugins/postgresql/index.py index 22dfc7fff..6ce89e219 100755 --- a/plugins/postgresql/index.py +++ b/plugins/postgresql/index.py @@ -147,7 +147,7 @@ def getInitdTpl(version=''): def contentReplace(content): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$APP_PATH}', service_path + '/postgresql') return content @@ -721,8 +721,7 @@ def importDbBackup(): pwd = pSqliteDb('config').where('id=?', (1,)).getField('pg_root') - mysql_cmd = mw.getRootDir() + '/server/mysql/bin/mysql -uroot -p' + pwd + \ - ' ' + name + ' < ' + file_path_sql + mysql_cmd = mw.getFatherDir() + '/server/mysql/bin/mysql -uroot -p' + pwd + ' ' + name + ' < ' + file_path_sql # print(mysql_cmd) os.system(mysql_cmd) diff --git a/plugins/pureftp/index.py b/plugins/pureftp/index.py index 909f71ab9..15d6535ed 100755 --- a/plugins/pureftp/index.py +++ b/plugins/pureftp/index.py @@ -80,7 +80,7 @@ def status(): def contentReplace(content): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) return content diff --git a/plugins/redis/index.py b/plugins/redis/index.py index 3d451c02e..494064594 100755 --- a/plugins/redis/index.py +++ b/plugins/redis/index.py @@ -122,7 +122,7 @@ def status(): def contentReplace(content): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$SERVER_APP}', service_path + '/'+getPluginName()) content = content.replace('{$REDIS_PASS}', mw.getRandomString(10)) diff --git a/plugins/simpleping/index.py b/plugins/simpleping/index.py index 176536c90..dcc6853f0 100755 --- a/plugins/simpleping/index.py +++ b/plugins/simpleping/index.py @@ -135,7 +135,7 @@ def status(): def contentReplace(content): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$SERVER_APP}', service_path + '/simpleping') return content diff --git a/plugins/sphinx/index.py b/plugins/sphinx/index.py index 9a04a5d22..515d94a0a 100755 --- a/plugins/sphinx/index.py +++ b/plugins/sphinx/index.py @@ -98,7 +98,7 @@ def readConfigTpl(): def contentReplace(content): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$SERVER_APP}', service_path + '/sphinx') return content diff --git a/plugins/sys-opt/index.py b/plugins/sys-opt/index.py index 26a7a7bb0..a9a66c583 100755 --- a/plugins/sys-opt/index.py +++ b/plugins/sys-opt/index.py @@ -52,7 +52,7 @@ def checkArgs(data, ck=[]): def contentReplace(content): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$SERVER_APP}', service_path + '/sys-opt') return content diff --git a/plugins/varnish/index.py b/plugins/varnish/index.py index 050e842a0..5336dc01a 100755 --- a/plugins/varnish/index.py +++ b/plugins/varnish/index.py @@ -50,7 +50,7 @@ def getInitDTpl(): def contentReplace(content): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$SERVER_APP}', service_path + '/varnish') return content diff --git a/plugins/xhprof/index.py b/plugins/xhprof/index.py index 7bd54ee70..a2861b17a 100755 --- a/plugins/xhprof/index.py +++ b/plugins/xhprof/index.py @@ -97,7 +97,7 @@ def contentReplace(content): service_path = mw.getServerDir() php_ver = getCachePhpVer() # print php_ver - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$PHP_VER}', php_ver) return content @@ -106,7 +106,7 @@ def contentReplace(content): def contentReplacePHP(content, version): service_path = mw.getServerDir() # print php_ver - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$PHP_VER}', version) return content diff --git a/plugins/zabbix/index.py b/plugins/zabbix/index.py index 06ea20e96..167c85669 100755 --- a/plugins/zabbix/index.py +++ b/plugins/zabbix/index.py @@ -97,7 +97,7 @@ def getInstallVerion(): def contentReplace(content): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$ZABBIX_ROOT}', '/usr/share/zabbix') content = content.replace('{$ZABBIX_PORT}', '18888') diff --git a/plugins/zabbix_agent/index.py b/plugins/zabbix_agent/index.py index 797a1f6b2..c015c1ecd 100755 --- a/plugins/zabbix_agent/index.py +++ b/plugins/zabbix_agent/index.py @@ -83,7 +83,7 @@ def status(): def contentReplace(content): service_path = mw.getServerDir() - content = content.replace('{$ROOT_PATH}', mw.getRootDir()) + content = content.replace('{$ROOT_PATH}', mw.getFatherDir()) content = content.replace('{$SERVER_PATH}', service_path) return content