1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-22 13:34:04 +03:00

Added timeout to RDP Tranpsort & little fix for OpenNebula access using SPICE

This commit is contained in:
Adolfo Gómez García 2017-02-08 11:23:52 +01:00
parent afa6f62daa
commit ace11fd77a
5 changed files with 13 additions and 9 deletions

View File

@ -40,7 +40,7 @@ from uds.core.ui import gui
import logging
__updated__ = '2017-01-17'
__updated__ = '2017-02-02'
logger = logging.getLogger(__name__)
@ -88,7 +88,7 @@ class LiveService(Service):
# : Types of deploys (services in cache and/or assigned to users)
deployedType = LiveDeployment
allowedProtocols = protocols.GENERIC
allowedProtocols = protocols.GENERIC + (protocols.SPICE,)
servicesTypeProvided = (serviceTypes.VDI,)
# Now the form part

View File

@ -48,7 +48,7 @@ import logging
import random
import string
__updated__ = '2017-01-25'
__updated__ = '2017-02-05'
logger = logging.getLogger(__name__)
@ -69,7 +69,10 @@ class TRDPTransport(BaseRDPTransport):
group = TUNNELED_GROUP
tunnelServer = gui.TextField(label=_('Tunnel server'), order=1, tooltip=_('IP or Hostname of tunnel server sent to client device ("public" ip) and port. (use HOST:PORT format)'), tab=gui.TUNNEL_TAB)
tunnelCheckServer = gui.TextField(label=_('Tunnel host check'), order=2, tooltip=_('If not empty, this server will be used to check if service is running before assigning it to user. (use HOST:PORT format)'), tab=gui.TUNNEL_TAB)
# tunnelCheckServer = gui.TextField(label=_('Tunnel host check'), order=2, tooltip=_('If not empty, this server will be used to check if service is running before assigning it to user. (use HOST:PORT format)'), tab=gui.TUNNEL_TAB)
tunnelWait = gui.NumericField(length=3, label=_('Tunnel wait time'), defvalue='10', minValue=1, maxValue=65536, order=2, tooltip=_('Maximum time to wait before closing the tunnel listener'), required=True, tab=gui.TUNNEL_TAB)
useEmptyCreds = BaseRDPTransport.useEmptyCreds
fixedName = BaseRDPTransport.fixedName
@ -133,6 +136,7 @@ class TRDPTransport(BaseRDPTransport):
'tunPass': tunpass,
'tunHost': sshHost,
'tunPort': sshPort,
'tunWait': self.tunnelWait.num(),
'username': username,
'password': password,
'hasCredentials': username != '' and password != '',

View File

@ -61,7 +61,7 @@ if app is None or fnc is None:
''')
else:
# Open tunnel
forwardThread, port = forward('{m.tunHost}', '{m.tunPort}', '{m.tunUser}', '{m.tunPass}', '{m.ip}', 3389)
forwardThread, port = forward('{m.tunHost}', '{m.tunPort}', '{m.tunUser}', '{m.tunPass}', '{m.ip}', 3389, {m.tunnelWait}) # @UndefinedVariable
if forwardThread.status == 2:
raise Exception('Unable to open tunnel')

View File

@ -3,7 +3,7 @@
from __future__ import unicode_literals
# pylint: disable=import-error, no-name-in-module, too-many-format-args, undefined-variable, invalid-sequence-index
from PyQt4 import QtCore, QtGui
from PyQt4 import QtCore, QtGui # @UnresolvedImport
import subprocess
import os
import urllib
@ -56,7 +56,7 @@ if executable is None:
''', QtGui.QMessageBox.Ok)
forwardThread, port = forward('{m.tunHost}', '{m.tunPort}', '{m.tunUser}', '{m.tunPass}', '{m.ip}', 3389)
forwardThread, port = forward('{m.tunHost}', '{m.tunPort}', '{m.tunUser}', '{m.tunPass}', '{m.ip}', 3389, {m.tunnelWait}) # @UndefinedVariable
if forwardThread.status == 2:
raise Exception('Unable to open tunnel')

View File

@ -4,7 +4,7 @@ from __future__ import unicode_literals
# pylint: disable=import-error, no-name-in-module, too-many-format-args, undefined-variable
from PyQt4 import QtCore, QtGui
from PyQt4 import QtCore, QtGui # @UnresolvedImport
import win32crypt # @UnresolvedImport
import os
import subprocess
@ -14,7 +14,7 @@ from uds import tools # @UnresolvedImport
import six
forwardThread, port = forward('{m.tunHost}', '{m.tunPort}', '{m.tunUser}', '{m.tunPass}', '{m.ip}', 3389)
forwardThread, port = forward('{m.tunHost}', '{m.tunPort}', '{m.tunUser}', '{m.tunPass}', '{m.ip}', 3389, {m.tunnelWait}) # @UndefinedVariable
if forwardThread.status == 2:
raise Exception('Unable to open tunnel')