forked from shaba/openuds
* Updated linux agents to include "udsvapp"
* Fixed reloading of master key, to do it "less sensitive" to database connection errros * Removed nonsense info log from storage * Added "customCmd" for UDS vApp on linux
This commit is contained in:
parent
81dd4e3b8c
commit
d8db218c6d
@ -69,12 +69,14 @@ install-udsactor:
|
|||||||
cp scripts/udsactor $(BINDIR)
|
cp scripts/udsactor $(BINDIR)
|
||||||
cp scripts/UDSActorConfig-pkexec $(SBINDIR)
|
cp scripts/UDSActorConfig-pkexec $(SBINDIR)
|
||||||
cp scripts/UDSActorTool-startup $(BINDIR)
|
cp scripts/UDSActorTool-startup $(BINDIR)
|
||||||
|
cp scripts/udsvapp ${BINDIR}
|
||||||
|
|
||||||
# Policy to run as administrator
|
# Policy to run as administrator
|
||||||
cp policy/org.openuds.pkexec.UDSActorConfig.policy $(POLKITDIR)
|
cp policy/org.openuds.pkexec.UDSActorConfig.policy $(POLKITDIR)
|
||||||
|
|
||||||
# Fix permissions
|
# Fix permissions
|
||||||
chmod 755 $(BINDIR)/udsactor
|
chmod 755 $(BINDIR)/udsactor
|
||||||
|
chmod 755 $(BINDIR)/udsvapp
|
||||||
chmod 755 $(BINDIR)/UDSActorTool-startup
|
chmod 755 $(BINDIR)/UDSActorTool-startup
|
||||||
chmod 755 $(SBINDIR)/UDSActorConfig-pkexec
|
chmod 755 $(SBINDIR)/UDSActorConfig-pkexec
|
||||||
chmod 755 $(LIBDIR)/UDSActorConfig.py
|
chmod 755 $(LIBDIR)/UDSActorConfig.py
|
||||||
|
5
actors/linux/scripts/udsvapp
Executable file
5
actors/linux/scripts/udsvapp
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
/usr/bin/udsactor login "$USER"
|
||||||
|
$@
|
||||||
|
/usr/bin/udsactor logout "$USER"
|
@ -60,6 +60,7 @@ This package provides the required components to allow this machine to work on a
|
|||||||
/etc/init.d/udsactor
|
/etc/init.d/udsactor
|
||||||
/usr/bin/UDSActorTool-startup
|
/usr/bin/UDSActorTool-startup
|
||||||
/usr/bin/udsactor
|
/usr/bin/udsactor
|
||||||
|
/usr/bin/udsvapp
|
||||||
/usr/bin/UDSActorTool
|
/usr/bin/UDSActorTool
|
||||||
/usr/sbin/UDSActorConfig
|
/usr/sbin/UDSActorConfig
|
||||||
/usr/sbin/UDSActorConfig-pkexec
|
/usr/sbin/UDSActorConfig-pkexec
|
||||||
|
@ -45,7 +45,6 @@ from uds.REST import Handler
|
|||||||
from uds.REST import RequestError
|
from uds.REST import RequestError
|
||||||
from uds.models import UserService
|
from uds.models import UserService
|
||||||
|
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import six
|
import six
|
||||||
|
|
||||||
@ -53,7 +52,6 @@ import logging
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
# Actor key, configurable in Security Section of administration interface
|
# Actor key, configurable in Security Section of administration interface
|
||||||
actorKey = Config.Config.section(Config.SECURITY_SECTION).value('Master Key',
|
actorKey = Config.Config.section(Config.SECURITY_SECTION).value('Master Key',
|
||||||
cryptoManager().uuid(datetime.datetime.now()).replace('-', ''),
|
cryptoManager().uuid(datetime.datetime.now()).replace('-', ''),
|
||||||
@ -100,8 +98,8 @@ class Actor(Handler):
|
|||||||
'''
|
'''
|
||||||
# Ensures that key is first parameter
|
# Ensures that key is first parameter
|
||||||
# Here, path will be .../actor/ACTION/KEY (probably /rest/actor/KEY/...)
|
# Here, path will be .../actor/ACTION/KEY (probably /rest/actor/KEY/...)
|
||||||
logger.debug('{} == {}'.format(self._params.get('key'), actorKey.get(True)))
|
# logger.debug('{} == {}'.format(self._params.get('key'), actorKey.get()))
|
||||||
if self._params.get('key') != actorKey.get(True):
|
if self._params.get('key') != actorKey.get():
|
||||||
return Actor.result(_('Invalid key'), error=ERR_INVALID_KEY)
|
return Actor.result(_('Invalid key'), error=ERR_INVALID_KEY)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -34,7 +34,6 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext as _
|
||||||
|
|
||||||
|
|
||||||
from uds.models import Service, UserService, Tag
|
from uds.models import Service, UserService, Tag
|
||||||
|
|
||||||
from uds.core.services import Service as coreService
|
from uds.core.services import Service as coreService
|
||||||
@ -93,7 +92,7 @@ class Services(DetailHandler): # pylint: disable=too-many-public-methods
|
|||||||
'type': item.data_type,
|
'type': item.data_type,
|
||||||
'type_name': _(itemType.name()),
|
'type_name': _(itemType.name()),
|
||||||
'deployed_services_count': item.deployedServices.count(),
|
'deployed_services_count': item.deployedServices.count(),
|
||||||
'user_services_count': UserService.objects.filter(deployed_service__service=item).exclude(state__in=(State.REMOVED, State.ERROR)).count(),
|
'user_services_count': UserService.objects.filter(deployed_service__service=item).exclude(state__in=State.INFO_STATES).count(),
|
||||||
'maintenance_mode': item.provider.maintenance_mode,
|
'maintenance_mode': item.provider.maintenance_mode,
|
||||||
'permission': perm
|
'permission': perm
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,7 @@ class ServicesPools(ModelHandler):
|
|||||||
'cache_l1_srvs': item.cache_l1_srvs,
|
'cache_l1_srvs': item.cache_l1_srvs,
|
||||||
'cache_l2_srvs': item.cache_l2_srvs,
|
'cache_l2_srvs': item.cache_l2_srvs,
|
||||||
'max_srvs': item.max_srvs,
|
'max_srvs': item.max_srvs,
|
||||||
'user_services_count': item.userServices.count(),
|
'user_services_count': item.userServices.exclude(state__in=State.INFO_STATES).count(),
|
||||||
'user_services_in_preparation': item.userServices.filter(state=State.PREPARING).count(),
|
'user_services_in_preparation': item.userServices.filter(state=State.PREPARING).count(),
|
||||||
'restrained': item.isRestrained(),
|
'restrained': item.isRestrained(),
|
||||||
'show_transports': item.show_transports,
|
'show_transports': item.show_transports,
|
||||||
|
@ -150,7 +150,6 @@ class Storage(object):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def delete(owner=None):
|
def delete(owner=None):
|
||||||
logger.info("Deleting storage items")
|
|
||||||
if owner is None:
|
if owner is None:
|
||||||
objects = dbStorage.objects.all() # @UndefinedVariable
|
objects = dbStorage.objects.all() # @UndefinedVariable
|
||||||
else:
|
else:
|
||||||
|
@ -47,14 +47,14 @@ import six
|
|||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
__updated__ = '2017-10-09'
|
__updated__ = '2017-12-14'
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
READY_CACHE_TIMEOUT = 30
|
READY_CACHE_TIMEOUT = 30
|
||||||
SSH_KEY_LENGTH = 1024
|
SSH_KEY_LENGTH = 1024
|
||||||
|
|
||||||
|
|
||||||
class BaseX2GOTransport(Transport):
|
class BaseX2GOTransport(Transport):
|
||||||
'''
|
'''
|
||||||
Provides access via RDP to service.
|
Provides access via RDP to service.
|
||||||
@ -88,11 +88,18 @@ class BaseX2GOTransport(Transport):
|
|||||||
# {'id': 'UNITY', 'text': 'Unity (see docs)'},
|
# {'id': 'UNITY', 'text': 'Unity (see docs)'},
|
||||||
{'id': 'gnome-session-cinnamon', 'text': 'Cinnamon 1.4 (see docs)'},
|
{'id': 'gnome-session-cinnamon', 'text': 'Cinnamon 1.4 (see docs)'},
|
||||||
{'id': 'gnome-session-cinnamon2d', 'text': 'Cinnamon 2.2 (see docs)'},
|
{'id': 'gnome-session-cinnamon2d', 'text': 'Cinnamon 2.2 (see docs)'},
|
||||||
{'id': '/usr/bin/udsvapp', 'text': 'UDS vAPP'},
|
{'id': 'UDSVAPP', 'text': 'UDS vAPP'},
|
||||||
], tab=gui.PARAMETERS_TAB)
|
], tab=gui.PARAMETERS_TAB)
|
||||||
|
|
||||||
sound = gui.CheckBoxField(
|
customCmd = gui.TextField(
|
||||||
order=12,
|
order=12,
|
||||||
|
label=_('vAPP'),
|
||||||
|
tooltip=_('If UDS vAPP is selected as "Desktop", the FULL PATH of the app to be executed. If UDS vAPP is not selected, this field will be ignored.'),
|
||||||
|
tab=gui.PARAMETERS_TAB
|
||||||
|
)
|
||||||
|
|
||||||
|
sound = gui.CheckBoxField(
|
||||||
|
order=13,
|
||||||
label=_('Enable sound'),
|
label=_('Enable sound'),
|
||||||
tooltip=_('If checked, sound will be available'),
|
tooltip=_('If checked, sound will be available'),
|
||||||
defvalue=gui.TRUE,
|
defvalue=gui.TRUE,
|
||||||
@ -100,7 +107,7 @@ class BaseX2GOTransport(Transport):
|
|||||||
)
|
)
|
||||||
|
|
||||||
exports = gui.CheckBoxField(
|
exports = gui.CheckBoxField(
|
||||||
order=13,
|
order=14,
|
||||||
label=_('Redirect root folder'),
|
label=_('Redirect root folder'),
|
||||||
tooltip=_('If checked, user home folder will be redirected'),
|
tooltip=_('If checked, user home folder will be redirected'),
|
||||||
defvalue=gui.FALSE,
|
defvalue=gui.FALSE,
|
||||||
@ -109,7 +116,7 @@ class BaseX2GOTransport(Transport):
|
|||||||
|
|
||||||
speed = gui.ChoiceField(
|
speed = gui.ChoiceField(
|
||||||
label=_('Speed'),
|
label=_('Speed'),
|
||||||
order=14,
|
order=15,
|
||||||
tooltip=_('Connection speed'),
|
tooltip=_('Connection speed'),
|
||||||
defvalue='3',
|
defvalue='3',
|
||||||
values=[
|
values=[
|
||||||
@ -154,8 +161,6 @@ class BaseX2GOTransport(Transport):
|
|||||||
length=1, defvalue='6', minValue=1, maxValue=9, required=True,
|
length=1, defvalue='6', minValue=1, maxValue=9, required=True,
|
||||||
tab=gui.ADVANCED_TAB)
|
tab=gui.ADVANCED_TAB)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def isAvailableFor(self, userService, ip):
|
def isAvailableFor(self, userService, ip):
|
||||||
'''
|
'''
|
||||||
Checks if the transport is available for the requested destination ip
|
Checks if the transport is available for the requested destination ip
|
||||||
|
@ -41,12 +41,11 @@ from uds.models import TicketStore
|
|||||||
from .BaseX2GOTransport import BaseX2GOTransport
|
from .BaseX2GOTransport import BaseX2GOTransport
|
||||||
from . import x2gofile
|
from . import x2gofile
|
||||||
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import random
|
import random
|
||||||
import string
|
import string
|
||||||
|
|
||||||
__updated__ = '2017-01-30'
|
__updated__ = '2017-12-14'
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -66,6 +65,7 @@ class TX2GOTransport(BaseX2GOTransport):
|
|||||||
fixedName = BaseX2GOTransport.fixedName
|
fixedName = BaseX2GOTransport.fixedName
|
||||||
# fullScreen = BaseX2GOTransport.fullScreen
|
# fullScreen = BaseX2GOTransport.fullScreen
|
||||||
desktopType = BaseX2GOTransport.desktopType
|
desktopType = BaseX2GOTransport.desktopType
|
||||||
|
customCmd = BaseX2GOTransport.customCmd
|
||||||
sound = BaseX2GOTransport.sound
|
sound = BaseX2GOTransport.sound
|
||||||
exports = BaseX2GOTransport.exports
|
exports = BaseX2GOTransport.exports
|
||||||
speed = BaseX2GOTransport.speed
|
speed = BaseX2GOTransport.speed
|
||||||
@ -75,7 +75,6 @@ class TX2GOTransport(BaseX2GOTransport):
|
|||||||
pack = BaseX2GOTransport.pack
|
pack = BaseX2GOTransport.pack
|
||||||
quality = BaseX2GOTransport.quality
|
quality = BaseX2GOTransport.quality
|
||||||
|
|
||||||
|
|
||||||
def initialize(self, values):
|
def initialize(self, values):
|
||||||
if values is not None:
|
if values is not None:
|
||||||
if values['tunnelServer'].count(':') != 1:
|
if values['tunnelServer'].count(':') != 1:
|
||||||
@ -91,7 +90,9 @@ class TX2GOTransport(BaseX2GOTransport):
|
|||||||
|
|
||||||
width, height = CommonPrefs.getWidthHeight(prefs)
|
width, height = CommonPrefs.getWidthHeight(prefs)
|
||||||
|
|
||||||
logger.debug('')
|
desktop = self.desktopType.value
|
||||||
|
if desktop == "UDSVAPP":
|
||||||
|
desktop = "/usr/bin/udsvapp " + self.customCmd.value
|
||||||
|
|
||||||
xf = x2gofile.getTemplate(
|
xf = x2gofile.getTemplate(
|
||||||
speed=self.speed.value,
|
speed=self.speed.value,
|
||||||
@ -99,7 +100,7 @@ class TX2GOTransport(BaseX2GOTransport):
|
|||||||
quality=self.quality.value,
|
quality=self.quality.value,
|
||||||
sound=self.sound.isTrue(),
|
sound=self.sound.isTrue(),
|
||||||
soundSystem=self.sound.value,
|
soundSystem=self.sound.value,
|
||||||
windowManager=self.desktopType.value,
|
windowManager=desktop,
|
||||||
exports=self.exports.isTrue(),
|
exports=self.exports.isTrue(),
|
||||||
width=width,
|
width=width,
|
||||||
height=height,
|
height=height,
|
||||||
|
@ -40,7 +40,7 @@ from . import x2gofile
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
__updated__ = '2017-01-30'
|
__updated__ = '2017-12-14'
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -57,6 +57,7 @@ class X2GOTransport(BaseX2GOTransport):
|
|||||||
fixedName = BaseX2GOTransport.fixedName
|
fixedName = BaseX2GOTransport.fixedName
|
||||||
# fullScreen = BaseX2GOTransport.fullScreen
|
# fullScreen = BaseX2GOTransport.fullScreen
|
||||||
desktopType = BaseX2GOTransport.desktopType
|
desktopType = BaseX2GOTransport.desktopType
|
||||||
|
customCmd = BaseX2GOTransport.customCmd
|
||||||
sound = BaseX2GOTransport.sound
|
sound = BaseX2GOTransport.sound
|
||||||
exports = BaseX2GOTransport.exports
|
exports = BaseX2GOTransport.exports
|
||||||
speed = BaseX2GOTransport.speed
|
speed = BaseX2GOTransport.speed
|
||||||
@ -75,13 +76,17 @@ class X2GOTransport(BaseX2GOTransport):
|
|||||||
|
|
||||||
width, height = CommonPrefs.getWidthHeight(prefs)
|
width, height = CommonPrefs.getWidthHeight(prefs)
|
||||||
|
|
||||||
|
desktop = self.desktopType.value
|
||||||
|
if desktop == "UDSVAPP":
|
||||||
|
desktop = "/usr/bin/udsvapp " + self.customCmd.value
|
||||||
|
|
||||||
xf = x2gofile.getTemplate(
|
xf = x2gofile.getTemplate(
|
||||||
speed=self.speed.value,
|
speed=self.speed.value,
|
||||||
pack=self.pack.value,
|
pack=self.pack.value,
|
||||||
quality=self.quality.value,
|
quality=self.quality.value,
|
||||||
sound=self.sound.isTrue(),
|
sound=self.sound.isTrue(),
|
||||||
soundSystem=self.sound.value,
|
soundSystem=self.sound.value,
|
||||||
windowManager=self.desktopType.value,
|
windowManager=desktop,
|
||||||
exports=self.exports.isTrue(),
|
exports=self.exports.isTrue(),
|
||||||
width=width,
|
width=width,
|
||||||
height=height,
|
height=height,
|
||||||
|
Loading…
Reference in New Issue
Block a user