This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository x2gobroker. from 19a66ae x2gobroker.spec: change all python-pampy references to python-pam on non-SUSE systems. new 0e792e0 Don't check for running/suspended session if the session profile will request a shadowing session. new e91c34c Mention "usebrokerpass" session profile option in x2gobroker-sessionprofiles.conf. new e96c88a Disabled broker agent calls and load-balancing for session profiles that will request shadowing sessions. new d8e4194 Provide desktop sharing (shadow session) example in x2gobroker-sessionprofiles.conf. The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: debian/changelog | 8 +++ etc/broker/x2gobroker-sessionprofiles.conf | 9 +++ x2gobroker/brokers/base_broker.py | 90 +++++++++++++++++++++------- 3 files changed, 84 insertions(+), 23 deletions(-) -- Alioth's /srv/git/code.x2go.org/x2gobroker.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2gobroker.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2gobroker. commit 0e792e061b7a64f5a0fead1139f57cf26ef2aac5 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Mar 19 02:14:03 2015 +0100 Don't check for running/suspended session if the session profile will request a shadowing session. --- debian/changelog | 2 + x2gobroker/brokers/base_broker.py | 77 +++++++++++++++++++++++++++---------- 2 files changed, 58 insertions(+), 21 deletions(-) diff --git a/debian/changelog b/debian/changelog index 46229ae..c40a4be 100644 --- a/debian/changelog +++ b/debian/changelog @@ -222,6 +222,8 @@ x2gobroker (0.0.3.0-0x2go1) UNRELEASED; urgency=low if the <hostname> is a valid address on the local network (broker <-> <server> communication), but the host address is valid for clients (client <-> server communication). + - Don't check for running/suspended session if the session profile will + request a shadowing session. * debian/control: + Provide separate bin:package for SSH brokerage: x2gobroker-ssh. + Replace LDAP support with session brokerage support in LONG_DESCRIPTION. diff --git a/x2gobroker/brokers/base_broker.py b/x2gobroker/brokers/base_broker.py index 49042ec..bddca67 100644 --- a/x2gobroker/brokers/base_broker.py +++ b/x2gobroker/brokers/base_broker.py @@ -1039,6 +1039,40 @@ class X2GoBroker(object): return remote_agent + def is_shadow_profile(self, profile_id): + """\ + Detect from the session profile, if it defines a desktop sharing (shadow) + session. + + @param profile_id: ID of a valid session profile + @type profile_id: C{unicode} + + return: C{True} if the session profile defines a desktop sharing (shadow) session + rtype: C{bool} + + """ + profile = self.get_profile(profile_id) + return profile['command'] == "SHADOW" + + def check_for_sessions(self, profile_id): + """\ + Detect from the session profile, if we should query the remote broker + agent for running or suspended sessions. + + @param profile_id: ID of a valid session profile + @type profile_id: C{unicode} + + return: C{True} if the remote broker agent should be queried for running/suspended sessions + rtype: C{bool} + + """ + do_check = True + + # do check, for all commands except the "SHADOW" command + do_check = do_check and self.is_shadow_profile(profile_id) + + return do_check + def get_profile_for_user(self, profile_id, username, broker_frontend=None): """\ Expect a profile id and perform some checks and preparations to @@ -1088,29 +1122,30 @@ class X2GoBroker(object): remote_agent = self.get_remote_agent(profile_id) agent_query_mode = ( remote_agent == u'LOCAL') and u'LOCAL' or u'SSH' - if remote_agent: - try: - success, running_sessions, suspended_sessions = x2gobroker.agent.has_sessions(username, remote_agent=remote_agent) - if running_sessions: - logger_broker.debug('base_broker.X2GoBroker.get_profile_for_user(): found running sessions on host(s): {hosts}'.format(hosts=', '.join(running_sessions))) - if suspended_sessions: - logger_broker.debug('base_broker.X2GoBroker.get_profile_for_user(): found running sessions on host(s): {hosts}'.format(hosts=', '.join(suspended_sessions))) - suspended_matching_hostnames = x2gobroker.utils.matching_hostnames(profile['host'], suspended_sessions) - running_matching_hostnames = x2gobroker.utils.matching_hostnames(profile['host'], running_sessions) - if suspended_matching_hostnames: - profile['status'] = u'S' - profile['host'] = [suspended_matching_hostnames[0]] - elif running_matching_hostnames: - profile['status'] = u'R' - profile['host'] = [running_matching_hostnames[0]] - else: - profile['host'] = [profile['host'][0]] + if self.check_for_sessions(profile_id): + if remote_agent: + try: + success, running_sessions, suspended_sessions = x2gobroker.agent.has_sessions(username, remote_agent=remote_agent) + if running_sessions: + logger_broker.debug('base_broker.X2GoBroker.get_profile_for_user(): found running sessions on host(s): {hosts}'.format(hosts=', '.join(running_sessions))) + if suspended_sessions: + logger_broker.debug('base_broker.X2GoBroker.get_profile_for_user(): found running sessions on host(s): {hosts}'.format(hosts=', '.join(suspended_sessions))) + suspended_matching_hostnames = x2gobroker.utils.matching_hostnames(profile['host'], suspended_sessions) + running_matching_hostnames = x2gobroker.utils.matching_hostnames(profile['host'], running_sessions) + if suspended_matching_hostnames: + profile['status'] = u'S' + profile['host'] = [suspended_matching_hostnames[0]] + elif running_matching_hostnames: + profile['status'] = u'R' + profile['host'] = [running_matching_hostnames[0]] + else: + profile['host'] = [profile['host'][0]] - if profile.has_key('status') and profile['status']: - logger_broker.debug('base_broker.X2GoBroker.get_profile_for_user(): marking session profile {name} as {status}'.format(name=profile['name'], status=profile['status'])) + if profile.has_key('status') and profile['status']: + logger_broker.debug('base_broker.X2GoBroker.get_profile_for_user(): marking session profile {name} as {status}'.format(name=profile['name'], status=profile['status'])) - except x2gobroker.x2gobroker_exceptions.X2GoBrokerAgentException: - pass + except x2gobroker.x2gobroker_exceptions.X2GoBrokerAgentException: + pass else: profile['host'] = [profile['host'][0]] -- Alioth's /srv/git/code.x2go.org/x2gobroker.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2gobroker.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2gobroker. commit e91c34ce3abd6ba29e22ff1dbfb0fa05c4edda57 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Mar 19 02:14:44 2015 +0100 Mention "usebrokerpass" session profile option in x2gobroker-sessionprofiles.conf. --- debian/changelog | 2 ++ etc/broker/x2gobroker-sessionprofiles.conf | 2 ++ 2 files changed, 4 insertions(+) diff --git a/debian/changelog b/debian/changelog index c40a4be..1913c1a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -224,6 +224,8 @@ x2gobroker (0.0.3.0-0x2go1) UNRELEASED; urgency=low (client <-> server communication). - Don't check for running/suspended session if the session profile will request a shadowing session. + - Mention "usebrokerpass" session profile option in + x2gobroker-sessionprofiles.conf. * debian/control: + Provide separate bin:package for SSH brokerage: x2gobroker-ssh. + Replace LDAP support with session brokerage support in LONG_DESCRIPTION. diff --git a/etc/broker/x2gobroker-sessionprofiles.conf b/etc/broker/x2gobroker-sessionprofiles.conf index 522e917..e9bf560 100644 --- a/etc/broker/x2gobroker-sessionprofiles.conf +++ b/etc/broker/x2gobroker-sessionprofiles.conf @@ -67,11 +67,13 @@ user=BROKER_USER name=KDE - localhost host=localhost command=KDE +usebrokerpass=true [localhost-mate] name=MATE - localhost host=localhost command=MATE +usebrokerpass=true ### EXAMPLES: Below you find some config examples. Adapt them to your needs or ### simply write your own session profiles and remove the examples below. -- Alioth's /srv/git/code.x2go.org/x2gobroker.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2gobroker.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2gobroker. commit e96c88abd29df78d6082b3cb6b16006a83c3938f Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Mar 19 02:25:58 2015 +0100 Disabled broker agent calls and load-balancing for session profiles that will request shadowing sessions. --- debian/changelog | 2 ++ x2gobroker/brokers/base_broker.py | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1913c1a..8beb1d0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -224,6 +224,8 @@ x2gobroker (0.0.3.0-0x2go1) UNRELEASED; urgency=low (client <-> server communication). - Don't check for running/suspended session if the session profile will request a shadowing session. + - Disabled broker agent calls and load-balancing for session profiles that + will request shadowing sessions. - Mention "usebrokerpass" session profile option in x2gobroker-sessionprofiles.conf. * debian/control: diff --git a/x2gobroker/brokers/base_broker.py b/x2gobroker/brokers/base_broker.py index bddca67..793da39 100644 --- a/x2gobroker/brokers/base_broker.py +++ b/x2gobroker/brokers/base_broker.py @@ -995,6 +995,10 @@ class X2GoBroker(object): """ remote_agent = None + # no remote agent needed for shadow sessions + if self.is_shadow_profile(profile_id): + return remote_agent + agent_query_mode = self.get_agent_query_mode(profile_id).upper() if agent_query_mode == u'SSH' and x2gobroker.agent.has_remote_broker_agent_setup(): @@ -1375,8 +1379,13 @@ class X2GoBroker(object): # detect best X2Go server for this user if load balancing is configured elif len(server_list) >= 2: - # no remote broker agent or no username? Let's play roulette then... - server_name = random.choice(server_list) + if self.is_shadow_profile(profile_id): + # we will ignore load-balancing for desktop sharing profiles + server_list = [server_list[0]] + server_name = server_list[0] + else: + # no remote broker agent or no username? Let's play roulette then... + server_name = random.choice(server_list) ### ### by now we should know the proper host to connect to... -- Alioth's /srv/git/code.x2go.org/x2gobroker.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2gobroker.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2gobroker. commit d8e41949ffc84354b0f8ce41ca23fc1a8bf895ff Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Mar 19 02:28:28 2015 +0100 Provide desktop sharing (shadow session) example in x2gobroker-sessionprofiles.conf. --- debian/changelog | 2 ++ etc/broker/x2gobroker-sessionprofiles.conf | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index 8beb1d0..07186ae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -228,6 +228,8 @@ x2gobroker (0.0.3.0-0x2go1) UNRELEASED; urgency=low will request shadowing sessions. - Mention "usebrokerpass" session profile option in x2gobroker-sessionprofiles.conf. + - Provide desktop sharing (shadow session) example in + x2gobroker-sessionprofiles.conf. * debian/control: + Provide separate bin:package for SSH brokerage: x2gobroker-ssh. + Replace LDAP support with session brokerage support in LONG_DESCRIPTION. diff --git a/etc/broker/x2gobroker-sessionprofiles.conf b/etc/broker/x2gobroker-sessionprofiles.conf index e9bf560..6973d65 100644 --- a/etc/broker/x2gobroker-sessionprofiles.conf +++ b/etc/broker/x2gobroker-sessionprofiles.conf @@ -75,6 +75,13 @@ host=localhost command=MATE usebrokerpass=true +[localhost-shadow] +name=SHADOW - localhost +# don't even try load-balancing here... it makes not sense and won't work (first given host will be used!) +host=localhost +command=SHADOW +usebrokerpass=true + ### EXAMPLES: Below you find some config examples. Adapt them to your needs or ### simply write your own session profiles and remove the examples below. -- Alioth's /srv/git/code.x2go.org/x2gobroker.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2gobroker.git