1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-24 21:34:41 +03:00

Removed requests "tests" and updated tunnel to use an authId

This commit is contained in:
Adolfo Gómez García 2021-06-28 13:12:49 +02:00
parent 2ee4a7bcaa
commit 25736f61b8
3 changed files with 5 additions and 3 deletions

View File

@ -139,10 +139,10 @@ class GlobalRequestMiddleware:
] ]
) )
) )
proxies = list(reversed(['172.27.0.8', '172.27.0.128', '172.27.0.1'])) # proxies = list(reversed(['172.27.0.8', '172.27.0.128', '172.27.0.1']))
# proxies = list(reversed(['172.27.0.12', '172.27.0.1'])) # proxies = list(reversed(['172.27.0.12', '172.27.0.1']))
# proxies = list(reversed(['172.27.0.12'])) # proxies = list(reversed(['172.27.0.12']))
request.ip = '' # request.ip = ''
logger.debug('Detected proxies: %s', proxies) logger.debug('Detected proxies: %s', proxies)

View File

@ -58,6 +58,7 @@ class ConfigurationType(typing.NamedTuple):
ssl_dhparam: str ssl_dhparam: str
uds_server: str uds_server: str
uds_auth: str
secret: str secret: str
allow: typing.Set[str] allow: typing.Set[str]
@ -104,6 +105,7 @@ def read() -> ConfigurationType:
ssl_ciphers=uds.get('ssl_ciphers'), ssl_ciphers=uds.get('ssl_ciphers'),
ssl_dhparam=uds.get('ssl_dhparam'), ssl_dhparam=uds.get('ssl_dhparam'),
uds_server=uds_server, uds_server=uds_server,
uds_auth=uds.get('uds_auth', 'unauthorized'),
secret=secret, secret=secret,
allow=set(uds.get('allow', '127.0.0.1').split(',')), allow=set(uds.get('allow', '127.0.0.1').split(',')),
) )

View File

@ -55,7 +55,7 @@ class Proxy:
@staticmethod @staticmethod
def _getUdsUrl(cfg: config.ConfigurationType, ticket: bytes, msg: str) -> typing.MutableMapping[str, typing.Any]: def _getUdsUrl(cfg: config.ConfigurationType, ticket: bytes, msg: str) -> typing.MutableMapping[str, typing.Any]:
try: try:
url = cfg.uds_server + '/' + ticket.decode() + '/' + msg url = cfg.uds_server + '/' + ticket.decode() + '/' + msg + '/' + cfg.uds_auth
r = requests.get(url, headers={'content-type': 'application/json'}) r = requests.get(url, headers={'content-type': 'application/json'})
if not r.ok: if not r.ok:
raise Exception(r.content) raise Exception(r.content)