chore: настройка панелей
This commit is contained in:
1 parent
8532557ef6
commit
96213e182e
16 files changed
+529
-64
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import ipaddress
|
||||
import re
|
||||
from urllib.parse import urlsplit
|
||||
|
||||
import serverus
|
||||
from Telegram.interfaces import Interface, command, register, state, text
|
||||
|
||||
from .. import services, tasks
|
||||
@@ -22,7 +22,6 @@ POINT_REINSTALL = 'point.reinstall'
|
||||
|
||||
DRAFT_CREDENTIALS = {DRAFT_SERVER: 'server', DRAFT_MASK: 'mask'}
|
||||
DOMAIN_RE = re.compile(r'^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$')
|
||||
PROXY_SCHEMES = ('http', 'https', 'socks5')
|
||||
HTML = 'HTML'
|
||||
|
||||
|
||||
@@ -42,10 +41,10 @@ def is_domain(value: str) -> bool:
|
||||
|
||||
def is_proxy_url(value: str) -> bool:
|
||||
try:
|
||||
url = urlsplit(value)
|
||||
return url.scheme in PROXY_SCHEMES and bool(url.hostname) and bool(url.port)
|
||||
serverus.parse_proxy(value)
|
||||
except ValueError:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
@register
|
||||
|
||||
Reference in new issue
Block a user