BT关闭常用端口提示
BT关闭常用端口提示

BT关闭常用端口提示

宝塔端口非法修改文件

# 端口不合法,请勿使用常用端
# /www/server/panel/class/panelSite.py


not_used_ports = ('21', '25', '443', '888', '8443')
# not_used_ports = ('21', '25', '443', '888', '8888', '8443')
if get.port in not_used_ports:
    res_domains.append({"name": get.domain, "status": False, "msg": '端口不合法,请勿使用常用端口,例如:ssh的22端口等'})




# 端口不能为常用端口21、25、443、888、8888、8443
# /www/server/panel/class/public.py
def checkPort(port):
    if not re.match("^\d+$", port): return False
    ports = ['21', '25', '443', '8080', '888', '8443']
    # ports = ['21', '25', '443', '8080', '888', '8888', '8443']
    if port in ports: return False
    intport = int(port)
    if intport < 1 or intport > 65535: return False
    return True