fixing up stuff

This commit is contained in:
Adolfo Gómez García 2020-05-04 14:12:36 +02:00
parent ad4ea61613
commit f409b2986c
5 changed files with 8 additions and 5 deletions

View File

@ -82,4 +82,6 @@ class PublicProvider(handler.Handler):
return self._service._clientsPool.screenshot() # pylint: disable=protected-access
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 ''

View File

@ -42,6 +42,7 @@ class Handler(socketserver.BaseRequestHandler):
return
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:
while self.event.is_set() is False:
r, _w, _x = select.select([self.request, chan], [], [], 1) # pylint: disable=unused-variable

View File

@ -607,8 +607,8 @@ class UserServiceManager:
if self.checkUuid(userService) is False: # The service is not the expected one
serviceNotReadyCode = 0x0004
log.doLog(userService, log.WARN, "User service is not accessible (ip {0})".format(ip), log.TRANSPORT)
logger.debug('Transport is not ready for user service %s', userService)
log.doLog(userService, log.WARN, "User service is not accessible due to invalid UUID (ip {0})".format(ip), log.TRANSPORT)
logger.debug('UUID check failed for user service %s', userService)
else:
events.addEvent(userService.deployed_service, events.ET_ACCESS, username=userName, srcip=srcIp, dstip=ip, uniqueid=userService.unique_id)
if ip:

View File

@ -102,7 +102,7 @@ def checkUuid(userService: 'UserService') -> bool:
'''
try:
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)
return False
except NoActorComms:

View File

@ -62,7 +62,7 @@ def guacamole(request: HttpRequest, tunnelId: str) -> HttpResponse:
response = dict2resp(val)
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(response, content_type=CONTENT_TYPE)