|
|
@ -53,7 +53,7 @@ def checkArgs(data, ck=[]): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def getConf(): |
|
|
|
def getConf(): |
|
|
|
return mw.getServerDir() + '/web_conf/nginx/vhost/phpmyadmin.conf' |
|
|
|
return mw.getServerDir() + '/web_conf/nginx/vhost/pgadmin.conf' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def getConfInc(): |
|
|
|
def getConfInc(): |
|
|
@ -225,19 +225,17 @@ def delPort(): |
|
|
|
return True |
|
|
|
return True |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def start(): |
|
|
|
def initReplace(): |
|
|
|
initCfg() |
|
|
|
|
|
|
|
openPort() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pma_dir = getServerDir() + "/phpmyadmin" |
|
|
|
pma_dir = getServerDir() + "/pgadmin" |
|
|
|
if os.path.exists(pma_dir): |
|
|
|
if os.path.exists(pma_dir): |
|
|
|
rand_str = mw.getRandomString(6) |
|
|
|
rand_str = mw.getRandomString(6) |
|
|
|
rand_str = rand_str.lower() |
|
|
|
rand_str = rand_str.lower() |
|
|
|
pma_dir_dst = pma_dir + "_" + rand_str |
|
|
|
pma_dir_dst = pma_dir + "_" + rand_str |
|
|
|
mw.execShell("mv " + pma_dir + " " + pma_dir_dst) |
|
|
|
mw.execShell("mv " + pma_dir + " " + pma_dir_dst) |
|
|
|
setCfg('path', 'phpmyadmin_' + rand_str) |
|
|
|
setCfg('path', 'pgadmin_' + rand_str) |
|
|
|
|
|
|
|
|
|
|
|
file_tpl = getPluginDir() + '/conf/phpmyadmin.conf' |
|
|
|
file_tpl = getPluginDir() + '/conf/pgadmin.conf' |
|
|
|
file_run = getConf() |
|
|
|
file_run = getConf() |
|
|
|
if not os.path.exists(file_run): |
|
|
|
if not os.path.exists(file_run): |
|
|
|
centent = mw.readFile(file_tpl) |
|
|
|
centent = mw.readFile(file_tpl) |
|
|
@ -253,17 +251,24 @@ def start(): |
|
|
|
setCfg('password', password) |
|
|
|
setCfg('password', password) |
|
|
|
mw.writeFile(pma_path, pass_cmd) |
|
|
|
mw.writeFile(pma_path, pass_cmd) |
|
|
|
|
|
|
|
|
|
|
|
tmp = getServerDir() + "/" + getCfg()["path"] + '/tmp' |
|
|
|
# systemd |
|
|
|
if not os.path.exists(tmp): |
|
|
|
systemDir = mw.systemdCfgDir() |
|
|
|
os.mkdir(tmp) |
|
|
|
systemService = systemDir + '/pgadmin.service' |
|
|
|
mw.execShell("chown -R www:www " + tmp) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
conf_run = getServerDir() + "/" + getCfg()["path"] + '/config.inc.php' |
|
|
|
if os.path.exists(systemDir) and not os.path.exists(systemService): |
|
|
|
if not os.path.exists(conf_run): |
|
|
|
systemServiceTpl = getPluginDir() + '/init.d/pgadmin.service.tpl' |
|
|
|
conf_tpl = getPluginDir() + '/conf/config.inc.php' |
|
|
|
service_path = mw.getServerDir() |
|
|
|
centent = mw.readFile(conf_tpl) |
|
|
|
content = mw.readFile(systemServiceTpl) |
|
|
|
centent = contentReplace(centent) |
|
|
|
content = content.replace('{$VERSION}', version) |
|
|
|
mw.writeFile(conf_run, centent) |
|
|
|
content = content.replace('{$SERVER_PATH}', service_path) |
|
|
|
|
|
|
|
mw.writeFile(systemService, se_content) |
|
|
|
|
|
|
|
mw.execShell('systemctl daemon-reload') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def start(): |
|
|
|
|
|
|
|
initCfg() |
|
|
|
|
|
|
|
openPort() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
initReplace() |
|
|
|
|
|
|
|
|
|
|
|
log_a = accessLog() |
|
|
|
log_a = accessLog() |
|
|
|
log_e = errorLog() |
|
|
|
log_e = errorLog() |
|
|
|