1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-23 17:34:17 +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']))
request.ip = ''
# request.ip = ''
logger.debug('Detected proxies: %s', proxies)

View File

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

View File

@ -55,7 +55,7 @@ class Proxy:
@staticmethod
def _getUdsUrl(cfg: config.ConfigurationType, ticket: bytes, msg: str) -> typing.MutableMapping[str, typing.Any]:
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'})
if not r.ok:
raise Exception(r.content)