mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 01:39:25 +08:00
@@ -0,0 +1,38 @@
|
|||||||
|
global
|
||||||
|
daemon
|
||||||
|
pidfile /tmp/haproxy.pid
|
||||||
|
maxconn 4000
|
||||||
|
user haproxy
|
||||||
|
group haproxy
|
||||||
|
|
||||||
|
|
||||||
|
defaults
|
||||||
|
mode http
|
||||||
|
log global
|
||||||
|
option httplog
|
||||||
|
timeout connect 10s
|
||||||
|
timeout client 15s
|
||||||
|
timeout server 15s
|
||||||
|
|
||||||
|
|
||||||
|
listen stats
|
||||||
|
mode http
|
||||||
|
bind *:10800
|
||||||
|
stats enable
|
||||||
|
stats refresh 10
|
||||||
|
stats uri /haproxy
|
||||||
|
stats realm Haproxy\ Statistics
|
||||||
|
stats auth {$HA_USER}:{$HA_PWD}
|
||||||
|
|
||||||
|
|
||||||
|
frontend rdp_frontend
|
||||||
|
bind *:3389
|
||||||
|
mode tcp
|
||||||
|
option tcplog
|
||||||
|
default_backend rdp_backend
|
||||||
|
|
||||||
|
backend rdp_backend
|
||||||
|
mode tcp
|
||||||
|
server rdp1 192.168.1.100:3389 check
|
||||||
|
|
||||||
|
|
||||||
@@ -119,9 +119,9 @@ def requestCheck():
|
|||||||
if basic_user != basic_auth['basic_user'] or basic_pwd != basic_auth['basic_pwd']:
|
if basic_user != basic_auth['basic_user'] or basic_pwd != basic_auth['basic_pwd']:
|
||||||
return sendAuthenticated()
|
return sendAuthenticated()
|
||||||
|
|
||||||
domain_check = mw.checkDomainPanel()
|
# domain_check = mw.checkDomainPanel()
|
||||||
if domain_check:
|
# if domain_check:
|
||||||
return domain_check
|
# return domain_check
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -496,6 +496,9 @@ def checkDomainPanel():
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
ip = getHostAddr()
|
ip = getHostAddr()
|
||||||
|
if isVaildIpV6(ip):
|
||||||
|
return False
|
||||||
|
|
||||||
if domain == '':
|
if domain == '':
|
||||||
if ip in ['127.0.0.1', 'localhost', '::1']:
|
if ip in ['127.0.0.1', 'localhost', '::1']:
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user