From 9ba42343134667e2d5ee28a64cee918df78ac3f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Fri, 2 Jul 2021 11:06:23 +0200 Subject: [PATCH] Removed NX --- server/src/uds/transports/NX/__init__.py | 42 -- server/src/uds/transports/NX/nx.png | Bin 4583 -> 0 bytes server/src/uds/transports/NX/nxbase.py | 74 ---- server/src/uds/transports/NX/nxfile.py | 220 ----------- server/src/uds/transports/NX/nxpassword.py | 110 ------ server/src/uds/transports/NX/nxtransport.py | 243 ------------ .../uds/transports/NX/nxtunneltransport.py | 359 ------------------ .../uds/transports/NX/scripts/linux/direct.py | 23 -- .../NX/scripts/linux/direct.py.signature | 1 - .../uds/transports/NX/scripts/linux/tunnel.py | 36 -- .../NX/scripts/linux/tunnel.py.signature | 1 - .../transports/NX/scripts/macosx/direct.py | 21 - .../NX/scripts/macosx/direct.py.signature | 1 - .../transports/NX/scripts/macosx/tunnel.py | 34 -- .../NX/scripts/macosx/tunnel.py.signature | 1 - .../transports/NX/scripts/windows/direct.py | 26 -- .../NX/scripts/windows/direct.py.signature | 1 - .../transports/NX/scripts/windows/tunnel.py | 41 -- .../NX/scripts/windows/tunnel.py.signature | 1 - 19 files changed, 1235 deletions(-) delete mode 100644 server/src/uds/transports/NX/__init__.py delete mode 100644 server/src/uds/transports/NX/nx.png delete mode 100644 server/src/uds/transports/NX/nxbase.py delete mode 100644 server/src/uds/transports/NX/nxfile.py delete mode 100644 server/src/uds/transports/NX/nxpassword.py delete mode 100644 server/src/uds/transports/NX/nxtransport.py delete mode 100644 server/src/uds/transports/NX/nxtunneltransport.py delete mode 100644 server/src/uds/transports/NX/scripts/linux/direct.py delete mode 100644 server/src/uds/transports/NX/scripts/linux/direct.py.signature delete mode 100644 server/src/uds/transports/NX/scripts/linux/tunnel.py delete mode 100644 server/src/uds/transports/NX/scripts/linux/tunnel.py.signature delete mode 100644 server/src/uds/transports/NX/scripts/macosx/direct.py delete mode 100644 server/src/uds/transports/NX/scripts/macosx/direct.py.signature delete mode 100644 server/src/uds/transports/NX/scripts/macosx/tunnel.py delete mode 100644 server/src/uds/transports/NX/scripts/macosx/tunnel.py.signature delete mode 100644 server/src/uds/transports/NX/scripts/windows/direct.py delete mode 100644 server/src/uds/transports/NX/scripts/windows/direct.py.signature delete mode 100644 server/src/uds/transports/NX/scripts/windows/tunnel.py delete mode 100644 server/src/uds/transports/NX/scripts/windows/tunnel.py.signature diff --git a/server/src/uds/transports/NX/__init__.py b/server/src/uds/transports/NX/__init__.py deleted file mode 100644 index 25aee70c..00000000 --- a/server/src/uds/transports/NX/__init__.py +++ /dev/null @@ -1,42 +0,0 @@ -# -*- coding: utf-8 -*- - -# -# Copyright (c) 2012-2021 Virtual Cable S.L.U. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, -# are permitted provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# * Neither the name of Virtual Cable S.L. nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -""" -@author: Adolfo Gómez, dkmaster at dkmon dot com -""" -# Disabled OLD NX. Will be removed soon - -# from django.utils.translation import ugettext_noop as _ -# from uds.core.managers.user_preferences import UserPrefsManager, CommonPrefs -# from uds.core.util.config import Config -# from .nxtransport import NXTransport -# from .nxtunneltransport import TSNXTransport - -# Config.section('NX').value('downloadUrl', 'http://sourceforge.net/projects/opennx/files/opennx/CI-win32/OpenNX-0.16.0.725-Setup.exe/download').get() -# Config.section('NX').value('downloadUrlMACOS', 'http://opennx.net/download.html').get() diff --git a/server/src/uds/transports/NX/nx.png b/server/src/uds/transports/NX/nx.png deleted file mode 100644 index ede29ebedcd85aa32463d2ea36e267ed1bc2f664..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4583 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 R bool: - """ - Checks if the transport is available for the requested destination ip - Override this in yours transports - """ - logger.debug('Checking availability for %s', ip) - ready = self.cache.get(ip) - if not ready: - # Check again for readyness - if self.testServer(userService, ip, self._listenPort) is True: - self.cache.put(ip, 'Y', READY_CACHE_TIMEOUT) - return True - self.cache.put(ip, 'N', READY_CACHE_TIMEOUT) - return ready == 'Y' - - def getScript(self, scriptNameTemplate: str, osName: str, params: typing.Dict[str, typing.Any]) -> typing.Tuple[str, str, typing.Dict[str, typing.Any]]: - # Reads script - scriptNameTemplate = scriptNameTemplate.format(osName) - with open(os.path.join(os.path.dirname(__file__), scriptNameTemplate)) as f: - script = f.read() - # Reads signature - with open(os.path.join(os.path.dirname(__file__), scriptNameTemplate + '.signature')) as f: - signature = f.read() - return script, signature, params diff --git a/server/src/uds/transports/NX/nxfile.py b/server/src/uds/transports/NX/nxfile.py deleted file mode 100644 index dc4302a3..00000000 --- a/server/src/uds/transports/NX/nxfile.py +++ /dev/null @@ -1,220 +0,0 @@ -# -*- coding: utf-8 -*- - -# -# Copyright (c) 2012-2019 Virtual Cable S.L. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, -# are permitted provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# * Neither the name of Virtual Cable S.L. nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -""" -Created on Jul 29, 2011 - -@author: Adolfo Gómez, dkmaster at dkmon dot com - -""" -from .nxpassword import NXPassword - -EMPTY_PASSWORD = "EMPTY_PASSWORD" - -NXTEMPLATE = ( - "\n" - "\n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - "" -) - - -class NXFile: - fullScreen: bool = False - width: int = 800 - height: int = 600 - cachemem: str = '4' - cachedisk: str = '32' - keyboardLayout: str = '' - linkSpeed: str = 'wan' - host: str = '' - port: str = '' - username: str = '' - password: str = '' - desktop: str = 'gnome' - - def __init__(self, username: str = '', password: str = '', width: int = 1024, height: int = 768): - self.fullScreen = width == -1 or height == -1 - self.width = int(width) - self.height = int(height) - self.username = username - self.password = password - - @property - def as_file(self): - return self.get() - - @property - def as_file_for_format(self): - return self.get(True) - - def get(self, processPassword=False): - rememberPass = 'true' - password = NXPassword.scrambleString(self.password) - if processPassword: - password = password.replace('{', '{{') - password = password.replace('}', '}}') - - if password == '': - rememberPass = "false" - password = EMPTY_PASSWORD - - resolution = '{}x{}'.format(self.width, self.height) - if self.fullScreen: - resolution = "fullscreen" - - return NXTEMPLATE.format( - CACHEMEM=self.cachemem, - CACHEDISK=self.cachedisk, - KEYLAYOUT=self.keyboardLayout, - LINKSPEED=self.linkSpeed, - REMEMBERPASS=rememberPass, - RESOLUTION=resolution, - WIDTH=self.width, - HEIGHT=self.height, - HOST=self.host, - PORT=self.port, - DESKTOP=self.desktop, - USERNAME=self.username, - PASSWORD=password - ) diff --git a/server/src/uds/transports/NX/nxpassword.py b/server/src/uds/transports/NX/nxpassword.py deleted file mode 100644 index 6699f3fa..00000000 --- a/server/src/uds/transports/NX/nxpassword.py +++ /dev/null @@ -1,110 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (c) 2012-2021 Virtual Cable S.L.U. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, -# are permitted provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# * Neither the name of Virtual Cable S.L. nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -""" -Created on Apr 20, 2015 - -@author: Adolfo Gómez, dkmaster at dkmon dot com - -""" - -class NXPassword: # pylint: disable=too-few-public-methods - # Encoding method extracted from nomachine web site: - # http://www.nomachine.com/ar/view.php?ar_id=AR01C00125 - - dummyString = "{{{{" - numValidCharList = 85 - validCharList = [ - '!', '#', '$', '%', '&', '(', ')', '*', '+', '-', - '.', '0', '1', '2', '3', '4', '5', '6', '7', '8', - '9', ':', ';', '<', '>', '?', '@', 'A', 'B', 'C', - 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', - 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', - 'X', 'Y', 'Z', '[', ']', '_', 'a', 'b', 'c', 'd', - 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', - 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', - 'y', 'z', '{', '|', '}' - ] - - @staticmethod - def _encodePassword(p): - sPass = ':' - - if p == '': - return '' - - for i, ch in enumerate(p): - sPass += '{}:'.format(ord(ch) + i + 1) - - return sPass - - @staticmethod - def _findCharInList(c): - try: - return NXPassword.validCharList.index(c) - except ValueError: - return -1 - - @staticmethod - def _getRandomValidCharFromList(): - # k = random.randint(0, NXPassword.numValidCharList) - k = 0 - return NXPassword.validCharList[k] - - @staticmethod - def scrambleString(s): - if s is None or s == '': - return '' - - _str = NXPassword._encodePassword(s) - - if len(_str) < 32: - _str += NXPassword.dummyString - - password = _str[::-1] # Reversed string - - if len(password) < 32: - password += NXPassword.dummyString - - startChar = NXPassword._getRandomValidCharFromList() - l = ord(startChar) + len(password) - 2 - - pw = startChar - - for i1, ch in enumerate(password): - j = NXPassword._findCharInList(ch) - if j == -1: - return s - - i = (j + l * (i1 + 2)) % NXPassword.numValidCharList - pw += NXPassword.validCharList[i] - - pw += chr(ord(NXPassword._getRandomValidCharFromList()) + 2) - - return pw.replace('&', '&').replace('<', '<').replace('"', '"').replace('\'', ''') # .replace('$', '\\$') diff --git a/server/src/uds/transports/NX/nxtransport.py b/server/src/uds/transports/NX/nxtransport.py deleted file mode 100644 index 5975eea4..00000000 --- a/server/src/uds/transports/NX/nxtransport.py +++ /dev/null @@ -1,243 +0,0 @@ -# -*- coding: utf-8 -*- - -# -# Copyright (c) 2012-2019 Virtual Cable S.L. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, -# are permitted provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# * Neither the name of Virtual Cable S.L. nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -""" -Created on Jul 29, 2011 - -@author: Adolfo Gómez, dkmaster at dkmon dot com -""" -import logging -import typing - -from django.utils.translation import ugettext_noop as _, ugettext_lazy -from uds.core.managers.user_preferences import CommonPrefs -from uds.core.ui import gui -from uds.core import transports -from uds.core.util import os_detector as OsDetector - -from .nxbase import BaseNXTransport -from .nxfile import NXFile - -# Not imported at runtime, just for type checking -if typing.TYPE_CHECKING: - from uds.core import Module - from uds import models - from django.http import HttpRequest # pylint: disable=ungrouped-imports - - -logger = logging.getLogger(__name__) - -READY_CACHE_TIMEOUT = 30 - - -class NXTransport(BaseNXTransport): - """ - Provides access via NX to service. - This transport can use an domain. If username processed by authenticator contains '@', it will split it and left-@-part will be username, and right password - """ - typeName = _('NX v3.5 (DEPRECATED)') - typeType = 'NXTransport' - typeDescription = _('NX Protocol v3.5. Direct connection.') - iconFile = 'nx.png' - protocol = transports.protocols.NX - - useEmptyCreds = gui.CheckBoxField(label=_('Empty creds'), order=1, tooltip=_('If checked, the credentials used to connect will be emtpy'), tab=gui.CREDENTIALS_TAB) - fixedName = gui.TextField(label=_('Username'), order=2, tooltip=_('If not empty, this username will be always used as credential'), tab=gui.CREDENTIALS_TAB) - fixedPassword = gui.PasswordField(label=_('Password'), order=3, tooltip=_('If not empty, this password will be always used as credential'), tab=gui.CREDENTIALS_TAB) - listenPort = gui.NumericField(label=_('Listening port'), length=5, order=4, tooltip=_('Listening port of NX (ssh) at client machine'), defvalue='22') - connection = gui.ChoiceField( - label=_('Connection'), - order=6, - tooltip=_('Connection speed for this transport (quality)'), - values=[ - {'id': 'modem', 'text': 'modem'}, - {'id': 'isdn', 'text': 'isdn'}, - {'id': 'adsl', 'text': 'adsl'}, - {'id': 'wan', 'text': 'wan'}, - {'id': 'lan', 'text': 'lan'} - ], - tab=gui.PARAMETERS_TAB - ) - session = gui.ChoiceField( - label=_('Session'), - order=7, - tooltip=_('Desktop session'), - values=[ - {'id': 'gnome', 'text': 'gnome'}, - {'id': 'kde', 'text': 'kde'}, - {'id': 'cde', 'text': 'cde'}, - ], - tab=gui.PARAMETERS_TAB - ) - cacheDisk = gui.ChoiceField( - label=_('Disk Cache'), - order=8, - tooltip=_('Cache size en Mb stored at disk'), - values=[ - {'id': '0', 'text': '0 Mb'}, - {'id': '32', 'text': '32 Mb'}, - {'id': '64', 'text': '64 Mb'}, - {'id': '128', 'text': '128 Mb'}, - {'id': '256', 'text': '256 Mb'}, - {'id': '512', 'text': '512 Mb'}, - ], - tab=gui.PARAMETERS_TAB - ) - cacheMem = gui.ChoiceField( - label=_('Memory Cache'), - order=9, - tooltip=_('Cache size en Mb kept at memory'), - values=[ - {'id': '4', 'text': '4 Mb'}, - {'id': '8', 'text': '8 Mb'}, - {'id': '16', 'text': '16 Mb'}, - {'id': '32', 'text': '32 Mb'}, - {'id': '64', 'text': '64 Mb'}, - {'id': '128', 'text': '128 Mb'}, - ], - tab=gui.PARAMETERS_TAB - ) - screenSize = gui.ChoiceField( - label=_('Screen size'), - order=10, - tooltip=_('Screen size'), - defvalue=CommonPrefs.SZ_FULLSCREEN, - values=[ - {'id': CommonPrefs.SZ_640x480, 'text': '640x480'}, - {'id': CommonPrefs.SZ_800x600, 'text': '800x600'}, - {'id': CommonPrefs.SZ_1024x768, 'text': '1024x768'}, - {'id': CommonPrefs.SZ_1366x768, 'text': '1366x768'}, - {'id': CommonPrefs.SZ_1920x1080, 'text': '1920x1080'}, - {'id': CommonPrefs.SZ_FULLSCREEN, 'text': ugettext_lazy('Full Screen')} - ], - tab=gui.PARAMETERS_TAB - ) - - _useEmptyCreds: bool = False - _fixedName: str = '' - _fixedPassword: str = '' - _listenPort: str = '' - _connection: str = '' - _session: str = '' - _cacheDisk: str = '' - _cacheMem: str = '' - _screenSize: str = '' - - - def initialize(self, values: 'Module.ValuesType'): - if values: - self._useEmptyCreds = gui.strToBool(values['useEmptyCreds']) - self._fixedName = values['fixedName'] - self._fixedPassword = values['fixedPassword'] - self._listenPort = values['listenPort'] - self._connection = values['connection'] - self._session = values['session'] - self._cacheDisk = values['cacheDisk'] - self._cacheMem = values['cacheMem'] - self._screenSize = values['screenSize'] - - def marshal(self) -> bytes: - """ - Serializes the transport data so we can store it in database - """ - return str.join('\t', [ - 'v2', gui.boolToStr(self._useEmptyCreds), self._fixedName, self._fixedPassword, self._listenPort, - self._connection, self._session, self._cacheDisk, self._cacheMem, self._screenSize - ]).encode('utf8') - - def unmarshal(self, data: bytes) -> None: - values = data.decode('utf8').split('\t') - if values[0] in ('v1', 'v2'): - self._useEmptyCreds = gui.strToBool(values[1]) - self._fixedName, self._fixedPassword, self._listenPort, self._connection, self._session, self._cacheDisk, self._cacheMem = values[2:9] - self._screenSize = values[9] if values[0] == 'v2' else CommonPrefs.SZ_FULLSCREEN - - def valuesDict(self) -> gui.ValuesDictType: - return { - 'useEmptyCreds': gui.boolToStr(self._useEmptyCreds), - 'fixedName': self._fixedName, - 'fixedPassword': self._fixedPassword, - 'listenPort': self._listenPort, - 'connection': self._connection, - 'session': self._session, - 'cacheDisk': self._cacheDisk, - 'cacheMem': self._cacheMem - } - - def getUDSTransportScript( # pylint: disable=too-many-locals - self, - userService: 'models.UserService', - transport: 'models.Transport', - ip: str, - os: typing.Dict[str, str], - user: 'models.User', - password: str, - request: 'HttpRequest' - ) -> typing.Tuple[str, str, typing.Mapping[str, typing.Any]]: - username = user.getUsernameForAuth() - proc = username.split('@') - username = proc[0] - - if self._fixedName: - username = self._fixedName - if self._fixedPassword: - password = self._fixedPassword - if self._useEmptyCreds: - username, password = '', '' - - # We have the credentials right now, let os manager - - width, height = CommonPrefs.getWidthHeight(self._screenSize) - - # Fix username/password acording to os manager - username, password = userService.processUserPassword(username, password) - - r = NXFile(username=username, password=password, width=width, height=height) - r.host = ip - r.port = self._listenPort - r.linkSpeed = self._connection - r.desktop = self._session - r.cachedisk = self._cacheDisk - r.cachemem = self._cacheMem - - osName = { - OsDetector.Windows: 'windows', - OsDetector.Linux: 'linux', - OsDetector.Macintosh: 'macosx' - - }.get(os['OS']) - - if osName is None: - return super().getUDSTransportScript(userService, transport, ip, os, user, password, request) - - sp = { - 'as_file': r.as_file, - } - - return self.getScript('scripts/{}/direct.py', osName, sp) diff --git a/server/src/uds/transports/NX/nxtunneltransport.py b/server/src/uds/transports/NX/nxtunneltransport.py deleted file mode 100644 index fb807afa..00000000 --- a/server/src/uds/transports/NX/nxtunneltransport.py +++ /dev/null @@ -1,359 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (c) 2012-2021 Virtual Cable S.L.U. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, -# are permitted provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# * Neither the name of Virtual Cable S.L. nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -""" -Created on Jul 29, 2011 - -@author: Adolfo Gómez, dkmaster at dkmon dot com -""" -import random -import string -import logging -import typing - -from django.utils.translation import ugettext_noop as _, ugettext_lazy - -from uds.core.managers.user_preferences import CommonPrefs -from uds.core.ui import gui -from uds.core import transports -from uds.models import TicketStore -from uds.core.util import os_detector as OsDetector - -from .nxfile import NXFile -from .nxbase import BaseNXTransport - - -logger = logging.getLogger(__name__) - -# Not imported at runtime, just for type checking -if typing.TYPE_CHECKING: - from uds.core import Module - from uds import models - from django.http import HttpRequest # pylint: disable=ungrouped-imports - - -class TSNXTransport(BaseNXTransport): - """ - Provides access via NX to service. - This transport can use an domain. If username processed by authenticator contains '@', it will split it and left-@-part will be username, and right password - """ - - typeName = _('NX v3.5 (DEPRECATED)') - typeType = 'TSNXTransport' - typeDescription = _('NX protocol v3.5. Tunneled connection.') - iconFile = 'nx.png' - protocol = transports.protocols.NX - group = transports.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, - ) - - tunnelWait = gui.NumericField( - length=3, - label=_('Tunnel wait time'), - defvalue='30', - minValue=5, - maxValue=3600 * 24, - order=2, - tooltip=_('Maximum time to wait before closing the tunnel listener'), - required=True, - tab=gui.TUNNEL_TAB, - ) - - verifyCertificate = gui.CheckBoxField( - label=_('Force SSL certificate verification'), - order=23, - tooltip=_( - 'If enabled, the certificate of tunnel server will be verified (recommended).' - ), - defvalue=gui.FALSE, - tab=gui.TUNNEL_TAB, - ) - - useEmptyCreds = gui.CheckBoxField( - label=_('Empty creds'), - order=3, - tooltip=_('If checked, the credentials used to connect will be emtpy'), - tab=gui.CREDENTIALS_TAB, - ) - fixedName = gui.TextField( - label=_('Username'), - order=4, - tooltip=_('If not empty, this username will be always used as credential'), - tab=gui.CREDENTIALS_TAB, - ) - fixedPassword = gui.PasswordField( - label=_('Password'), - order=5, - tooltip=_('If not empty, this password will be always used as credential'), - tab=gui.CREDENTIALS_TAB, - ) - listenPort = gui.NumericField( - label=_('Listening port'), - length=5, - order=6, - tooltip=_('Listening port of NX (ssh) at client machine'), - defvalue='22', - ) - connection = gui.ChoiceField( - label=_('Connection'), - order=7, - tooltip=_('Connection speed for this transport (quality)'), - values=[ - {'id': 'modem', 'text': 'modem'}, - {'id': 'isdn', 'text': 'isdn'}, - {'id': 'adsl', 'text': 'adsl'}, - {'id': 'wan', 'text': 'wan'}, - {'id': 'lan', 'text': 'lan'}, - ], - tab=gui.PARAMETERS_TAB, - ) - session = gui.ChoiceField( - label=_('Session'), - order=8, - tooltip=_('Desktop session'), - values=[ - {'id': 'gnome', 'text': 'gnome'}, - {'id': 'kde', 'text': 'kde'}, - {'id': 'cde', 'text': 'cde'}, - ], - tab=gui.PARAMETERS_TAB, - ) - cacheDisk = gui.ChoiceField( - label=_('Disk Cache'), - order=9, - tooltip=_('Cache size en Mb stored at disk'), - values=[ - {'id': '0', 'text': '0 Mb'}, - {'id': '32', 'text': '32 Mb'}, - {'id': '64', 'text': '64 Mb'}, - {'id': '128', 'text': '128 Mb'}, - {'id': '256', 'text': '256 Mb'}, - {'id': '512', 'text': '512 Mb'}, - ], - tab=gui.PARAMETERS_TAB, - ) - cacheMem = gui.ChoiceField( - label=_('Memory Cache'), - order=10, - tooltip=_('Cache size en Mb kept at memory'), - values=[ - {'id': '4', 'text': '4 Mb'}, - {'id': '8', 'text': '8 Mb'}, - {'id': '16', 'text': '16 Mb'}, - {'id': '32', 'text': '32 Mb'}, - {'id': '64', 'text': '64 Mb'}, - {'id': '128', 'text': '128 Mb'}, - ], - tab=gui.PARAMETERS_TAB, - ) - screenSize = gui.ChoiceField( - label=_('Screen size'), - order=10, - tooltip=_('Screen size'), - defvalue=CommonPrefs.SZ_FULLSCREEN, - values=[ - {'id': CommonPrefs.SZ_640x480, 'text': '640x480'}, - {'id': CommonPrefs.SZ_800x600, 'text': '800x600'}, - {'id': CommonPrefs.SZ_1024x768, 'text': '1024x768'}, - {'id': CommonPrefs.SZ_1366x768, 'text': '1366x768'}, - {'id': CommonPrefs.SZ_1920x1080, 'text': '1920x1080'}, - {'id': CommonPrefs.SZ_FULLSCREEN, 'text': ugettext_lazy('Full Screen')}, - ], - tab=gui.PARAMETERS_TAB, - ) - - _tunnelServer: str = '' - _tunnelCheckServer: str = '' - _useEmptyCreds: bool = False - _fixedName: str = '' - _fixedPassword: str = '' - _listenPort: str = '' - _connection: str = '' - _session: str = '' - _cacheDisk: str = '' - _cacheMem: str = '' - _screenSize: str = '' - _tunnelWait: int = 30 - _verifyCertificate: bool = False - - def initialize(self, values: 'Module.ValuesType'): - if values: - if values['tunnelServer'].find(':') == -1: - raise transports.Transport.ValidationException( - _('Must use HOST:PORT in Tunnel Server Field') - ) - self._tunnelServer = values['tunnelServer'] - self._tunnelWait = int(values['tunnelWait']) - self._verifyCertificate = gui.strToBool(values['verifyCertificate']) - self._tunnelCheckServer = '' - self._useEmptyCreds = gui.strToBool(values['useEmptyCreds']) - self._fixedName = values['fixedName'] - self._fixedPassword = values['fixedPassword'] - self._listenPort = values['listenPort'] - self._connection = values['connection'] - self._session = values['session'] - self._cacheDisk = values['cacheDisk'] - self._cacheMem = values['cacheMem'] - self._screenSize = values['screenSize'] - - def marshal(self) -> bytes: - """ - Serializes the transport data so we can store it in database - """ - val = str.join( - '\t', - [ - 'v3', - gui.boolToStr(self._useEmptyCreds), - self._fixedName, - self._fixedPassword, - self._listenPort, - self._connection, - self._session, - self._cacheDisk, - self._cacheMem, - self._tunnelServer, - self._tunnelCheckServer, - self._screenSize, - str(self._tunnelWait), - gui.boolToStr(self._verifyCertificate), - ], - ) - logger.debug('Values: %s', val) - return val.encode('utf8') - - def unmarshal(self, data: bytes) -> None: - values = data.decode('utf8').split('\t') - if values[0] in ('v1', 'v2', 'v3'): - self._useEmptyCreds = gui.strToBool(values[1]) - ( - self._fixedName, - self._fixedPassword, - self._listenPort, - self._connection, - self._session, - self._cacheDisk, - self._cacheMem, - self._tunnelServer, - self._tunnelCheckServer, - ) = values[2:11] - self._screenSize = ( - values[11] if values[0] == 'v2' else CommonPrefs.SZ_FULLSCREEN - ) - if values[0] == 'v3': - self._tunnelWait, self._verifyCertificate = ( - int(values[12]), - gui.strToBool(values[13]), - ) - - def valuesDict(self) -> gui.ValuesDictType: - return { - 'useEmptyCreds': gui.boolToStr(self._useEmptyCreds), - 'fixedName': self._fixedName, - 'fixedPassword': self._fixedPassword, - 'listenPort': self._listenPort, - 'connection': self._connection, - 'session': self._session, - 'cacheDisk': self._cacheDisk, - 'cacheMem': self._cacheMem, - 'tunnelServer': self._tunnelServer, - 'tunnelWait': str(self._tunnelWait), - 'verifyCertificate': gui.boolToStr(self._verifyCertificate), - } - - def getUDSTransportScript( # pylint: disable=too-many-locals - self, - userService: 'models.UserService', - transport: 'models.Transport', - ip: str, - os: typing.Dict[str, str], - user: 'models.User', - password: str, - request: 'HttpRequest', - ) -> typing.Tuple[str, str, typing.Mapping[str, typing.Any]]: - prefs = self.screenSize.value - - username = user.getUsernameForAuth() - proc = username.split('@') - username = proc[0] - if self._fixedName is not '': - username = self._fixedName - if self._fixedPassword is not '': - password = self._fixedPassword - if self._useEmptyCreds is True: - usernamsizerd = '', '' - - ticket = TicketStore.create_for_tunnel( - userService=userService, - port=int(self._listenPort), - validity=self._tunnelWait + 60, # Ticket overtime - ) - - tunHost, tunPort = self.tunnelServer.value.split(':') - - width, height = CommonPrefs.getWidthHeight(prefs) - # Fix username/password acording to os manager - username, password = userService.processUserPassword(username, password) - - r = NXFile(username=username, password=password, width=width, height=height) - r.host = '{address}' - r.port = '{port}' - r.linkSpeed = self._connection - r.desktop = self._session - r.cachedisk = self._cacheDisk - r.cachemem = self._cacheMem - - osName = { - OsDetector.Windows: 'windows', - OsDetector.Linux: 'linux', - OsDetector.Macintosh: 'macosx', - }.get(os['OS']) - - if osName is None: - return super().getUDSTransportScript( - userService, transport, ip, os, user, password, request - ) - - sp = { - 'ip': ip, - 'tunHost': tunHost, - 'tunPort': tunPort, - 'tunWait': self._tunnelWait, - 'tunChk': self._verifyCertificate, - 'ticket': ticket, - 'as_file_for_format': r.as_file_for_format, - } - - return self.getScript('scripts/{}/tunnel.py', osName, sp) diff --git a/server/src/uds/transports/NX/scripts/linux/direct.py b/server/src/uds/transports/NX/scripts/linux/direct.py deleted file mode 100644 index 32a4e9b4..00000000 --- a/server/src/uds/transports/NX/scripts/linux/direct.py +++ /dev/null @@ -1,23 +0,0 @@ -# This is a template -# Saved as .py for easier editing -from __future__ import unicode_literals - -# pylint: disable=import-error, no-name-in-module, undefined-variable -import subprocess - -from uds import tools # type: ignore - - -try: - cmd = tools.findApp('nxclient', ['/usr/NX/bin/']) - if cmd is None: - raise Exception() - -except Exception: - raise Exception('''

You need to have installed NX Client version 3.5 in order to connect to this UDS service.

-

Please, install appropriate package for your system.

-''') - -filename = tools.saveTempFile(sp['as_file']) # type: ignore -tools.addTaskToWait(subprocess.Popen([cmd, '--session', filename])) -tools.addFileToUnlink(filename) diff --git a/server/src/uds/transports/NX/scripts/linux/direct.py.signature b/server/src/uds/transports/NX/scripts/linux/direct.py.signature deleted file mode 100644 index 0ebc679c..00000000 --- a/server/src/uds/transports/NX/scripts/linux/direct.py.signature +++ /dev/null @@ -1 +0,0 @@ -DyRlBsF1FK0/lXx/GVmKZNpnXh4sS0sdQJ4eKKDbEvzUeU1OKAAyONpvtpk9SKYHDKcvriiynp+kAE690XFYjPnaVrYc8BenjLVqcvlv7hLzc1kvNVmJve9RtVYOfIFCPfQN3sGseREV4aQ7JBuN4T+Paw8j+6YmeborIAfrmfFUhtx5IdUjF5SUnLAok+3aaJCOpKItRIxg4zxp9VfGdnF39KqTWLrgscX9mxe5YEc9DzQTpUm6bw7eUjG4OiloeMwXTxK3/tXEsEDTFF40w0NlSMOOmIQSWTUfhjDzwx9dJX4mE8mtOOO2U//cxGQ4DOQDoRHLIjwC0auKumjKrvdMzYU8H2tLmJwarRS43fu58Ir0NRydolB9vuRSA7aGziK+TtwYpKOUlge/7BY26lIANlCsnGnPvyT52UZXxILUkmHGCt98lMnJ2I+zXYIkjj8jvP02/eQuCdYWIS55ou1JJKGTazgn5Nu6cPMn6mAL20vWd3t8eUwU5F8KNavCcal903tDn2gen6QRf28ZVEWmEVc7vl4p9+iDkAZT855tVHHt4gz45C8XrwMBFBNZ1iiJtnzCiRsWAfoALJfJH9+gyKywZa67lQZWlmUnEDBqj/WT61+NJHPIFO+74xgdTEyfbeLWJjz6ecFa+TQcAiTGIqdTZmzu640kthQYBfs= \ No newline at end of file diff --git a/server/src/uds/transports/NX/scripts/linux/tunnel.py b/server/src/uds/transports/NX/scripts/linux/tunnel.py deleted file mode 100644 index 787f3314..00000000 --- a/server/src/uds/transports/NX/scripts/linux/tunnel.py +++ /dev/null @@ -1,36 +0,0 @@ -# This is a template -# Saved as .py for easier editing -from __future__ import unicode_literals - -# pylint: disable=import-error, no-name-in-module, undefined-variable -import subprocess -from uds.tunnel import forward # type: ignore - -from uds import tools # type: ignore - -try: - cmd = tools.findApp('nxclient', ['/usr/NX/bin/']) - if cmd is None: - raise Exception() -except Exception: - raise Exception('''

You need to have installed NX Client version 3.5 in order to connect to this UDS service.

-

Please, install appropriate package for your system.

-''') - -# Open tunnel -fs = forward(remote=(sp['tunHost'], int(sp['tunPort'])), ticket=sp['ticket'], timeout=sp['tunWait'], check_certificate=sp['tunChk']) # type: ignore - -# Check that tunnel works.. -if fs.check() is False: - raise Exception('

Could not connect to tunnel server.

Please, check your network settings.

') - -theFile = sp['as_file_for_format'].format( # type: ignore - address='127.0.0.1', - port=fs.server_address[1] -) - -filename = tools.saveTempFile(theFile) - -cmd = cmd.replace('%1', filename) -tools.addTaskToWait(subprocess.Popen([cmd, '--session', filename])) -tools.addFileToUnlink(filename) diff --git a/server/src/uds/transports/NX/scripts/linux/tunnel.py.signature b/server/src/uds/transports/NX/scripts/linux/tunnel.py.signature deleted file mode 100644 index 8750295f..00000000 --- a/server/src/uds/transports/NX/scripts/linux/tunnel.py.signature +++ /dev/null @@ -1 +0,0 @@ -EFxcQ0pD5IdbGBhlBdULIIPckwR0BlC2XQpWmxUngQlK/qe2s9CleQBjTcGyp6SSzy7uc6osweHA1b9N4o4opodLI0mD5X3H5+cP/92HsKcBT1QPRh1S8i+hGyGa5WO/fxdpeIM0rco9OcFDx9iloRbxCN0op3GJe3X0DwtS89r0MwaMs3rz7A913geshVGmJ/5oZM+EXf/kD6oGTRVkRagqeNkpB+Aup0LxhVET5EO6tY5TBDd2TvgCSBOqOkcA5vtavcxxb5As20lgl5/UsYDpCXuz7gGyq4EKn0nDSYHYiFeqsyJgaXWqdWW9rVQpGl8qjbm/Ndc2bC3s/3Q8bDgEjev0EQjKQ6oMUtdOJNJ89fP9TEd8Y0UKocBZRsGMxvQdcFN4Q5jMzplPcP9F3VuaCvA9W+uLZ/b1EvFPFdLrDBLhUsgUiWNoEQCqpG7FG+qz3dy0oVkmAZs9ewI6/oOxE+KaTs7uJv1mIbWpJEWhvLwzMg6j6jPSsV4bu9kbtjr3dBFwTNI5EsaW9vP9NeEg2hqD6vBOrlw4PB9SWIPBdFX0tPsT4tAgJxaUx13OepO7DWTItzA6EjT/be3BIUSJPoJuCJA7nxGj/ZOFqN4grmAlMKa8JXq8L/6++Jtqf+iSNgZjD+5cxC5j9M4yRlsBTFQaQhf+OnawjxAd1a4= \ No newline at end of file diff --git a/server/src/uds/transports/NX/scripts/macosx/direct.py b/server/src/uds/transports/NX/scripts/macosx/direct.py deleted file mode 100644 index 2a22b0fd..00000000 --- a/server/src/uds/transports/NX/scripts/macosx/direct.py +++ /dev/null @@ -1,21 +0,0 @@ -# This is a template -# Saved as .py for easier editing -from __future__ import unicode_literals - -# pylint: disable=import-error, no-name-in-module, too-many-format-args, undefined-variable, invalid-sequence-index -import subprocess -import os - -from uds import tools # type: ignore - - -cmd = '/Applications/OpenNX/OpenNX.app/Contents/MacOS/OpenNXapp' -if os.path.isfile(cmd) is False: - raise Exception('''

You need to have installed Open NX Client in order to connect to this UDS service.

-

Please, install appropriate package for your system from here.

-''') - - -filename = tools.saveTempFile(sp['as_file']) # type: ignore -tools.addTaskToWait(subprocess.Popen([cmd, '--session={{}}'.format(filename), '--autologin', '--killerrors'])) # type: ignore -tools.addFileToUnlink(filename) diff --git a/server/src/uds/transports/NX/scripts/macosx/direct.py.signature b/server/src/uds/transports/NX/scripts/macosx/direct.py.signature deleted file mode 100644 index 1dfae0f1..00000000 --- a/server/src/uds/transports/NX/scripts/macosx/direct.py.signature +++ /dev/null @@ -1 +0,0 @@ -hgPD0KnclF5OpaW4tIs+6pWX5tLeactCv1MGI1bk942nHoS4c/Nm87qd5dkHek51UMm1s8o2eB7xdrkJ6CVi/eOf2jnEs63luF+etmdwccHQU9BcQZjev1aId4q0q7HiQCXjXaS2vorIevH9uvf1NWl6AyPABynYhC7zvWb9nz/GTNBXO7TAqfVarGJLRXwY2KHpBXqUKEPB0H46+h3S9AWD2pHxfZnVBKdjoGgrD5/pt905aI2lrl1yCE14LFENkpssH/dBxYnaEMMYiWTuAe3lAP8MQEFlWmHBT63G7xMhDR3wc2sqC2eh8RQieEj1EoqCPLJFwMoxA1SZfS+JLhppskdJi06o+pqiJ4bzO0Is47plGn+KBodBAT+5/dOgOK/lKv+7Q8j3MS59TQUFty4TkybS6Ujk40SjlOlCwofVb6awKMSUSny853K20yKClt0gGhUjykstex3/eaXmU7hWLBBbDsFmY5W7Xhvxi1vPmrJ3uJ2M+R9WIeCM4xygLQPcMkZbY2k1bonv3NhK+AlapmY36y3IBbziL1Xv4agjRAykls3y+qrxMjE4Lx4ZUAI0OdX7COqdz7Ix7baYpMHrLgROjtkp/EJqVIfhvRSvJqMWLsZxbqCjoswNSI4zlyWFR980y4ITHhBsbP95X0yJnoRsgcN+wARNolxVL7o= \ No newline at end of file diff --git a/server/src/uds/transports/NX/scripts/macosx/tunnel.py b/server/src/uds/transports/NX/scripts/macosx/tunnel.py deleted file mode 100644 index 72b32b18..00000000 --- a/server/src/uds/transports/NX/scripts/macosx/tunnel.py +++ /dev/null @@ -1,34 +0,0 @@ -# This is a template -# Saved as .py for easier editing -from __future__ import unicode_literals - -# pylint: disable=import-error, no-name-in-module, too-many-format-args, undefined-variable, invalid-sequence-index -import subprocess -from uds.tunnel import forward # type: ignore -import os - -from uds import tools # type: ignore - - -cmd = '/Applications/OpenNX/OpenNX.app/Contents/MacOS/OpenNXapp' -if os.path.isfile(cmd) is False: - raise Exception('''

You need to have installed Open NX Client in order to connect to this UDS service.

-

Please, install appropriate package for your system from here.

-''') - -# Open tunnel -fs = forward(remote=(sp['tunHost'], int(sp['tunPort'])), ticket=sp['ticket'], timeout=sp['tunWait'], check_certificate=sp['tunChk']) # type: ignore - -# Check that tunnel works.. -if fs.check() is False: - raise Exception('

Could not connect to tunnel server.

Please, check your network settings.

') - -theFile = sp['as_file_for_format'].format( # type: ignore - address='127.0.0.1', - port=fs.server_address[1] -) - -filename = tools.saveTempFile(theFile) - -tools.addTaskToWait(subprocess.Popen([cmd, '--session={}'.format(filename), '--autologin', '--killerrors'])) -tools.addFileToUnlink(filename) diff --git a/server/src/uds/transports/NX/scripts/macosx/tunnel.py.signature b/server/src/uds/transports/NX/scripts/macosx/tunnel.py.signature deleted file mode 100644 index e6a5df95..00000000 --- a/server/src/uds/transports/NX/scripts/macosx/tunnel.py.signature +++ /dev/null @@ -1 +0,0 @@ -lsChjBOL2LNJeEjnFSXjK3y9F8uPfz/j6ZlHg511XyQxakyrxPKhEnrAJ9DT7X7Py99D1SQqrMmn+A9B/lH658LmXyCLaQMKFVNLZxc1WH/0Ytl4int6ZJA3uTrt/bHYMNh91OxMsS6WPWjN8g2aCkGhgZIKHehP4oKlQmxOnI4EXSoWtHwl/aN2JaWV6pltiVDKMiyVxMHCnRm0L1KSVaOsC5OxW76DvsUWcYELXiue+bMlBx96lQN0/g4xd9UJKJFqRmA+tPnUhKYdm/gt1804xsdGQ2v2IdPiJjhBvN4riFUffkls0T67HFOEedNdoV7ox/lz8RmamlAGbs36Qz84U/hYdeEwpOZfzHvVKuq8M1EZQciboqdlaRDPDbF+o7mZHQsOCSzRTp6qBqb46pzcELuXBH4/jod/tAX9iyvz7BBxrQsTmhivHIwu3VOdjClN3bw2GrNSyhKxSYsb7wq/YiABfHWHJkHzMZnwxGOpYuYSHNNew2liH3zE3gZPX6rGnyFn7rv80rIGvbLmQV9hJmAluyzU6hQivHYqZnpnfQN1cKT5SKbDiZVCnAC9c8uPGD7VsHJZpaGR3Hi4bB/J2qyVG+zbfVVsLyRh/wDfGfucCBxt9ecY/xcZ6aebzabrEnyluhEmrehu6Ovp1lsWJQPb3mUzSHC0muN4M3s= \ No newline at end of file diff --git a/server/src/uds/transports/NX/scripts/windows/direct.py b/server/src/uds/transports/NX/scripts/windows/direct.py deleted file mode 100644 index 9b52dbaf..00000000 --- a/server/src/uds/transports/NX/scripts/windows/direct.py +++ /dev/null @@ -1,26 +0,0 @@ -# This is a template -# Saved as .py for easier editing -from __future__ import unicode_literals - -# pylint: disable=import-error, no-name-in-module -try: - import winreg as wreg -except ImportError: # Python 2.7 fallback - import _winreg as wreg # type: ignore -import subprocess - -from uds import tools # type: ignore - -try: - k = wreg.OpenKey(wreg.HKEY_CURRENT_USER, 'Software\\Classes\\NXClient.session\\shell\\open\\command') # @UndefinedVariable - cmd = wreg.QueryValue(k, '') # type: ignore - wreg.CloseKey(k) -except Exception: - raise Exception('''

You need to have installed NX Client version 3.5 in order to connect to this UDS service.

-

Please, install appropriate package for your system.

-''') - -filename = tools.saveTempFile(sp['as_file']) # type: ignore -cmd = cmd.replace('%1', filename) -tools.addTaskToWait(subprocess.Popen(cmd)) -tools.addFileToUnlink(filename) diff --git a/server/src/uds/transports/NX/scripts/windows/direct.py.signature b/server/src/uds/transports/NX/scripts/windows/direct.py.signature deleted file mode 100644 index a6cc67e9..00000000 --- a/server/src/uds/transports/NX/scripts/windows/direct.py.signature +++ /dev/null @@ -1 +0,0 @@ -isXacHwak7jQEx9QFKLUaVUTG75t5ogtWFiV7m7eMDttzBTkkS1/0hVLX1avLdaMOBCY60JTfTrPcHcd8XESfSzR3w92i1BzfccHmpV3g67lbeESZqpjsJTWC3F9kCpZHsj6DHXQICQjPPeW++tchJj8bAoETc6MyH5IHSJ/KOmbgLOBM+2x9crnX1ZWHrwF2xQyMaLn5rgntklvSX2KmOS6z0WC0C5DLFpVzZvSsDwMyfhhxd4fGNWCxUW4v5f5S1GUCM1AfzXWZEPYAWbRFgOzG2MKB2dhHasxVt25VtjeKgrD+Q5A28ihQBUkh5vZRmOtAWjtneF6K6bOM59ZL0vzjGIL1/y/6oysjyeOAG4YvagekMRAZT0folf7d4prUb1tN+8jvabZszGCxjvb0kYjfiT6zN53lxDSExLuvjBEwHkWM3CPCTkPLJ7UWiRT6Fyd8c3vJw860WhnohPYg+4q2udjf/ZgdDiyVPEyOB5AKpDnHB3HfsQr7upw+WqWUH56ylF2myWyP0uSmOrLJnUyFX1FFVx2R+/Rc0AjPmM+VE9UwPUkSSpFaRdKPP2nJxDYrReZwk/kfFmRvIqLAUz+rwSIH2JJqEB6NT//tMdxRu4lAKrpX29nqDSWCiMvew3D21OQYafzGGJ9GTn2n+Mwki3cbKpxLXxLxlCh0S8= \ No newline at end of file diff --git a/server/src/uds/transports/NX/scripts/windows/tunnel.py b/server/src/uds/transports/NX/scripts/windows/tunnel.py deleted file mode 100644 index 158ae366..00000000 --- a/server/src/uds/transports/NX/scripts/windows/tunnel.py +++ /dev/null @@ -1,41 +0,0 @@ -# This is a template -# Saved as .py for easier editing -from __future__ import unicode_literals - -# pylint: disable=import-error, no-name-in-module, undefined-variable -try: - import winreg as wreg -except ImportError: # Python 2.7 fallback - import _winreg as wreg # type: ignore - -import subprocess -from uds.tunnel import forward # type: ignore - -from uds import tools # type: ignore - -try: - k = wreg.OpenKey(wreg.HKEY_CURRENT_USER, 'Software\\Classes\\NXClient.session\\shell\\open\\command') - cmd = wreg.QueryValue(k, '') - wreg.CloseKey(k) -except Exception: - raise Exception('''

You need to have installed NX Client version 3.5 in order to connect to this UDS service.

-

Please, install appropriate package for your system.

-''') - -# Open tunnel -fs = forward(remote=(sp['tunHost'], int(sp['tunPort'])), ticket=sp['ticket'], timeout=sp['tunWait'], check_certificate=sp['tunChk']) # type: ignore - -# Check that tunnel works.. -if fs.check() is False: - raise Exception('

Could not connect to tunnel server.

Please, check your network settings.

') - -theFile = sp['as_file_for_format'].format( # type: ignore - address='127.0.0.1', - port=fs.server_address[1] -) - -filename = tools.saveTempFile(theFile) - -cmd = cmd.replace('%1', filename) -tools.addTaskToWait(subprocess.Popen(cmd)) -tools.addFileToUnlink(filename) diff --git a/server/src/uds/transports/NX/scripts/windows/tunnel.py.signature b/server/src/uds/transports/NX/scripts/windows/tunnel.py.signature deleted file mode 100644 index 18045c5f..00000000 --- a/server/src/uds/transports/NX/scripts/windows/tunnel.py.signature +++ /dev/null @@ -1 +0,0 @@ -o+152nwWH5xKg7nrK4ffYSeGjzitZS5LxvkC9Z0aa86J2D9gEIsUqDAQjh2ljuO+g4ik2s72T7Yb5HiZizhHfRfjwe22yjIj+NtK1Xoeh/VW3773bq5VCXAjfMbVU6GuGnNMndQOn4qrS/l12YLDhxXFKUkpwNU1TjRGo33ns1DFPNTf0dT7W/WpQkf/75Jlt6bMnGxFWDWYhc1wLySmwlVPj7GOKQTD9pS9MaB7eqpq/GO9gADNGWcTbz3GGs8iO8N5dxBHTnyHxO7P29aQL9bOvtrY0rxAopfy+TTcuE03qNDI6pCBjhYxCqL+GqiRrzmLJq9ZtvhNxvQ5+kvDDrw3ErFZbXoBOF4f7SeP6Tr9A6aOkLG579czsqNGSpHqkUPgvb38xXfSPv983pDvzhi3lo2GzNhAu4ZYM+/Z/Q32ssYBfst4joHAC9mcHmP37ZTKRiMfRz3hafkJlSmm2RQf5/OPYCz5ha8AAcs2CvqYMlOiJhP9Zx8AwtB9oxVlFPS+ZUJ9h/0waRVFBKQm1m70Z7odjJqT0ThTTJQEjuedfnNuxW1V5GtCi62NcwskulWOL2fXjmf9eh0u5PPn1tdqLIUmZXa9eqGU+LjZqA52w7V3sHHWoMYvfEC4SG9HXfZxd6YZdfPx12z6WYh4PnJLNUqd7bgfl4YswALJyaA= \ No newline at end of file