mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
update
This commit is contained in:
@@ -241,7 +241,7 @@ class config_api:
|
|||||||
backup_path = request.form.get('backup_path', '')
|
backup_path = request.form.get('backup_path', '')
|
||||||
|
|
||||||
if domain != '':
|
if domain != '':
|
||||||
reg = "^([\w\-\*]{1,100}\.){1,4}(\w{1,10}|\w{1,10}\.\w{1,10})$"
|
reg = "^([\\w\\-\\*]{1,100}\\.){1,4}(\\w{1,10}|\\w{1,10}\\.\\w{1,10})$"
|
||||||
if not re.match(reg, domain):
|
if not re.match(reg, domain):
|
||||||
return mw.returnJson(False, '主域名格式不正确')
|
return mw.returnJson(False, '主域名格式不正确')
|
||||||
|
|
||||||
@@ -303,7 +303,7 @@ class config_api:
|
|||||||
return mw.returnJson(False, '安全入口地址长度不能小于6位!')
|
return mw.returnJson(False, '安全入口地址长度不能小于6位!')
|
||||||
if admin_path in admin_path_checks:
|
if admin_path in admin_path_checks:
|
||||||
return mw.returnJson(False, '该入口已被面板占用,请使用其它入口!')
|
return mw.returnJson(False, '该入口已被面板占用,请使用其它入口!')
|
||||||
if not re.match("^/[\w\./-_]+$", admin_path):
|
if not re.match("^/[\\w\\./-_]+$", admin_path):
|
||||||
return mw.returnJson(False, '入口地址格式不正确,示例: /mw_rand')
|
return mw.returnJson(False, '入口地址格式不正确,示例: /mw_rand')
|
||||||
# else:
|
# else:
|
||||||
# domain = mw.readFile('data/bind_domain.pl')
|
# domain = mw.readFile('data/bind_domain.pl')
|
||||||
@@ -447,9 +447,9 @@ class config_api:
|
|||||||
else:
|
else:
|
||||||
conf = mw.readFile(panel_ssl)
|
conf = mw.readFile(panel_ssl)
|
||||||
if conf:
|
if conf:
|
||||||
rep = "\n\s*#HTTP_TO_HTTPS_START(.|\n){1,300}#HTTP_TO_HTTPS_END"
|
rep = "\n\\s*#HTTP_TO_HTTPS_START(.|\n){1,300}#HTTP_TO_HTTPS_END"
|
||||||
conf = re.sub(rep, '', conf)
|
conf = re.sub(rep, '', conf)
|
||||||
rep = "\s+if.+server_port.+\n.+\n\s+\s*}"
|
rep = "\\s+if.+server_port.+\n.+\n\\s+\\s*}"
|
||||||
conf = re.sub(rep, '', conf)
|
conf = re.sub(rep, '', conf)
|
||||||
mw.writeFile(panel_ssl, conf)
|
mw.writeFile(panel_ssl, conf)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1772,7 +1772,7 @@ def getSSHPort():
|
|||||||
try:
|
try:
|
||||||
file = '/etc/ssh/sshd_config'
|
file = '/etc/ssh/sshd_config'
|
||||||
conf = readFile(file)
|
conf = readFile(file)
|
||||||
rep = "(#*)?Port\s+([0-9]+)\s*\n"
|
rep = "(#*)?Port\\s+([0-9]+)\\s*\n"
|
||||||
port = re.search(rep, conf).groups(0)[1]
|
port = re.search(rep, conf).groups(0)[1]
|
||||||
return int(port)
|
return int(port)
|
||||||
except:
|
except:
|
||||||
|
|||||||
Reference in New Issue
Block a user