mirror of
https://github.com/dkmstr/openuds.git
synced 2024-12-23 17:34:17 +03:00
fixing up stuff
This commit is contained in:
parent
ad4ea61613
commit
f409b2986c
@ -82,4 +82,6 @@ class PublicProvider(handler.Handler):
|
|||||||
return self._service._clientsPool.screenshot() # pylint: disable=protected-access
|
return self._service._clientsPool.screenshot() # pylint: disable=protected-access
|
||||||
|
|
||||||
def get_uuid(self) -> typing.Any:
|
def get_uuid(self) -> typing.Any:
|
||||||
return self._service._cfg.own_token # pylint: disable=protected-access
|
if self._service.isManaged():
|
||||||
|
return self._service._cfg.own_token # pylint: disable=protected-access
|
||||||
|
return ''
|
||||||
|
@ -42,6 +42,7 @@ class Handler(socketserver.BaseRequestHandler):
|
|||||||
return
|
return
|
||||||
|
|
||||||
logger.debug('Connected! Tunnel open %r -> %r -> %r', self.request.getpeername(), chan.getpeername(), (self.chain_host, self.chain_port))
|
logger.debug('Connected! Tunnel open %r -> %r -> %r', self.request.getpeername(), chan.getpeername(), (self.chain_host, self.chain_port))
|
||||||
|
# self.ssh_transport.set_keepalive(10) # Keep alive every 10 seconds...
|
||||||
try:
|
try:
|
||||||
while self.event.is_set() is False:
|
while self.event.is_set() is False:
|
||||||
r, _w, _x = select.select([self.request, chan], [], [], 1) # pylint: disable=unused-variable
|
r, _w, _x = select.select([self.request, chan], [], [], 1) # pylint: disable=unused-variable
|
||||||
|
@ -607,8 +607,8 @@ class UserServiceManager:
|
|||||||
|
|
||||||
if self.checkUuid(userService) is False: # The service is not the expected one
|
if self.checkUuid(userService) is False: # The service is not the expected one
|
||||||
serviceNotReadyCode = 0x0004
|
serviceNotReadyCode = 0x0004
|
||||||
log.doLog(userService, log.WARN, "User service is not accessible (ip {0})".format(ip), log.TRANSPORT)
|
log.doLog(userService, log.WARN, "User service is not accessible due to invalid UUID (ip {0})".format(ip), log.TRANSPORT)
|
||||||
logger.debug('Transport is not ready for user service %s', userService)
|
logger.debug('UUID check failed for user service %s', userService)
|
||||||
else:
|
else:
|
||||||
events.addEvent(userService.deployed_service, events.ET_ACCESS, username=userName, srcip=srcIp, dstip=ip, uniqueid=userService.unique_id)
|
events.addEvent(userService.deployed_service, events.ET_ACCESS, username=userName, srcip=srcIp, dstip=ip, uniqueid=userService.unique_id)
|
||||||
if ip:
|
if ip:
|
||||||
|
@ -102,7 +102,7 @@ def checkUuid(userService: 'UserService') -> bool:
|
|||||||
'''
|
'''
|
||||||
try:
|
try:
|
||||||
uuid = _requestActor(userService, 'uuid')
|
uuid = _requestActor(userService, 'uuid')
|
||||||
if uuid != userService.uuid:
|
if uuid and uuid != userService.uuid: # Empty UUID means "no check this, fixed pool machine"
|
||||||
logger.info('Machine %s do not have expected uuid %s, instead has %s', userService.friendly_name, userService.uuid, uuid)
|
logger.info('Machine %s do not have expected uuid %s, instead has %s', userService.friendly_name, userService.uuid, uuid)
|
||||||
return False
|
return False
|
||||||
except NoActorComms:
|
except NoActorComms:
|
||||||
|
@ -62,7 +62,7 @@ def guacamole(request: HttpRequest, tunnelId: str) -> HttpResponse:
|
|||||||
|
|
||||||
response = dict2resp(val)
|
response = dict2resp(val)
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.error('Invalid guacamole ticket (F5 on client?): %s', tunnelId)
|
# logger.error('Invalid guacamole ticket (F5 on client?): %s', tunnelId)
|
||||||
return HttpResponse(ERROR, content_type=CONTENT_TYPE)
|
return HttpResponse(ERROR, content_type=CONTENT_TYPE)
|
||||||
|
|
||||||
return HttpResponse(response, content_type=CONTENT_TYPE)
|
return HttpResponse(response, content_type=CONTENT_TYPE)
|
||||||
|
Loading…
Reference in New Issue
Block a user