This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch brokerclient in repository pyhoca-cli. from 4d64798 Continue development... new dcaa9c9 Start work on broker client implementation for PyHoca-CLI. new 8985b74 whitespace fixes new 715f739 Move --list-profiles code into PyHocaCLI instance. The 3 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: man/man1/pyhoca-cli.1 | 39 +++++++++++++++++++++++++++++++--- pyhoca-cli | 55 ++++++++++++++++++------------------------------ pyhoca/cli/frontend.py | 28 ++++++++++++++++++++++-- 3 files changed, 82 insertions(+), 40 deletions(-) -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/pyhoca-cli.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch brokerclient in repository pyhoca-cli. commit dcaa9c90a6c7c9f0b3a429a6862fcb87cd4c0a04 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Mar 3 12:46:40 2014 +0100 Start work on broker client implementation for PyHoca-CLI. --- man/man1/pyhoca-cli.1 | 39 ++++++++++++++++++++++++++++++++++++--- pyhoca-cli | 7 ++++++- pyhoca/cli/frontend.py | 2 +- 3 files changed, 43 insertions(+), 5 deletions(-) diff --git a/man/man1/pyhoca-cli.1 b/man/man1/pyhoca-cli.1 index f87985d..dc67cb5 100644 --- a/man/man1/pyhoca-cli.1 +++ b/man/man1/pyhoca-cli.1 @@ -144,9 +144,42 @@ Share mode for X2Go desktop sharing (0: view-only, 1: full access). Number of interactive authentication attempts in case authentication with the server fails (wrong password?). A value that equals 0 disables interactive authentication completely and requires that a private SSH key has been given on the command line or in the session profile or that the \-\-password command line option is used. -.SH LDAP OPTIONS -LDAP support is planned to be added into \fBpyhoca-cli\fR in the near future. So stay tuned... -.PP + +.SH BROKER OPTIONS +In case you want to retrieve \fBx2goclient\fR session profiles from an X2Go Session Broker use the following options: +.TP +\*(T<\fB\-\-broker-url=<URL>\fR\*(T> +Specify the <URL> of the X2Go Session Broker. X2Go Client can access http:// and ssh:// style URLs. + +Syntax of <URL> for HTTP brokerage: + +http(s)://<user>:<password>@<hostname>:<port>/path/to/broker + +Syntax of <URL> for SSH brokerage: + +ssh://<user>:<password>@<hostname>:<port>/usr/bin/x2gobroker (or any executable that +provides the broker via SSH). + +.TP +\*(T<\fB\-\-broker-cacertfile=</path/to/cafile.crt>\fR\*(T> +Specify a special (self-signed) root-CACert file that shall get used when connecting to an X2Go Session Broker via https (SSL). (Not implemented, yet). +.TP +\*(T<\fB\-\-broker-noauth\fR\*(T> +The X2Go Session Broker is accessible without authentication. (Not implemented, yet). +.TP +\*(T<\fB\-\-auth-id=<USERNAME>\fR\*(T> +Use this <USERNAME> for authenticating against the X2Go Session Broker. This option mostly makes sense together +with \fI--broker-autologin\fR or \fI--broker-ssh-key\fR. (Not implemented, yet). +.TP +\*(T<\fB\-\-broker-autologin\fR\*(T> +For SSH based X2Go Session Brokers. If an SSH agent is available or default key files exist then +try those for authentication against the X2Go Session Broker. (Not implemented, yet). +.TP +\*(T<\fB\-\-broker-ssh-key=<SSHPRIVKEY>\fR\*(T> +For SSH based X2Go Session Brokers. Full path to a valid SSH private key file. (Not implemented, yet). +.TP +\*(T<\fB\-\-broker-name=<NAME>\fR\*(T> +not implemented .SH NX OPTIONS (Version 3) .TP \*(T<\fB\-g, \-\-geometry\fR \fI{<WIDTH>x<HEIGHT>|fullscreen|maximize}\fR\*(T> diff --git a/pyhoca-cli b/pyhoca-cli index 122a590..9e6aaa5 100755 --- a/pyhoca-cli +++ b/pyhoca-cli @@ -174,6 +174,10 @@ print_options = [ {'args':['--printer'], 'default': None, 'help': 'target CUPS print queue for incoming X2Go print jobs (default: CUPS default printer); this option selects \'--print-action CUPS\'',}, {'args':['--print-cmd'], 'default': None, 'help': 'print command including cmd line arguments (default: \'%s\'); this option selects \'--print-action PRINTCMD\'' % DEFAULT_PRINTCMD_CMD,}, ] +broker_options = [ + {'args':['-B','--broker-url'], 'default': None, 'help': 'retrieve session profiles via an X2Go Session Broker under the given URL', }, + ] + nx_options = [ {'args':['-g','--geometry'], 'default': '800x600','help': 'screen geometry: \'<width>x<height>\' or \'fullscreen\' (default: \'800x600\')',}, {'args':['-q','--link'], 'default': 'adsl', 'choices': ('modem','isdn','adsl','wan','lan'), 'help': 'link quality (default: \'adsl\')',}, @@ -219,10 +223,11 @@ Possible values for the --pack NX option are: p_debugopts = p.add_argument_group('debug options') p_x2goopts = p.add_argument_group('X2Go options') p_printopts = p.add_argument_group('X2Go print options') + p_brokeropts = p.add_argument_group('X2Go Session Broker client options') p_nxopts = p.add_argument_group('NX options') p_compatopts = p.add_argument_group('compatibility options') - for (p_group, opts) in ((p_x2goopts, x2go_options), (p_printopts, print_options), (p_actionopts, action_options), (p_debugopts, debug_options), (p_nxopts, nx_options), (p_compatopts, compat_options)): + for (p_group, opts) in ((p_x2goopts, x2go_options), (p_printopts, print_options), (p_brokeropts, broker_options), (p_actionopts, action_options), (p_debugopts, debug_options), (p_nxopts, nx_options), (p_compatopts, compat_options)): required = False for opt in opts: diff --git a/pyhoca/cli/frontend.py b/pyhoca/cli/frontend.py index 1c296e9..443d608 100644 --- a/pyhoca/cli/frontend.py +++ b/pyhoca/cli/frontend.py @@ -333,7 +333,7 @@ class PyHocaCLI(x2go.X2GoClient): # initialize the X2GoClient context and start the connection to the X2Go server self._pyhoca_logger('preparing requested X2Go session', loglevel=x2go.loglevel_NOTICE, ) - x2go.X2GoClient.__init__(self, logger=liblogger) + x2go.X2GoClient.__init__(self, broker_url=self.args.broker_url, logger=liblogger) _profiles = self._X2GoClient__get_profiles() if self.args.session_profile and not _profiles.has_profile(self.args.session_profile): -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/pyhoca-cli.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch brokerclient in repository pyhoca-cli. commit 715f739fc5bb6bfc4fa874abaa6ca1abdb4229ea Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Mar 4 13:56:01 2014 +0100 Move --list-profiles code into PyHocaCLI instance. --- pyhoca-cli | 32 ++++++-------------------------- pyhoca/cli/frontend.py | 26 +++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/pyhoca-cli b/pyhoca-cli index 93e06ad..71ac0c6 100755 --- a/pyhoca-cli +++ b/pyhoca-cli @@ -391,32 +391,12 @@ if __name__ == '__main__': try: - if args.list_profiles: - - _session_profiles = x2go.X2GoSessionProfiles() - # retrieve a session list - print - print "Available X2Go session profiles" - print "===============================" - print "configuration files: %s" % _session_profiles.config_files - print "user configuration file: %s" % _session_profiles.user_config_file - print - for _profile_id in _session_profiles.profile_ids: - _profile_config = _session_profiles.get_profile_config(_profile_id) - _session_params = _session_profiles.to_session_params(_profile_id) - print 'Profile ID: %s' % _profile_id - print 'Profile Name: %s' % _session_params['profile_name'] - pprint.pprint(_session_params) - print - - else: - - # initialize the X2GoClient context and start the connection to the X2Go server - logger('preparing requested X2Go session', x2go.loglevel_NOTICE, ) - - thisPyHocaCLI = PyHocaCLI(args, logger=logger, liblogger=liblogger) - thisPyHocaCLI.authenticate() - thisPyHocaCLI.MainLoop() + # initialize the X2GoClient context and start the connection to the X2Go server + logger('preparing requested X2Go session', x2go.loglevel_NOTICE, ) + + thisPyHocaCLI = PyHocaCLI(args, logger=logger, liblogger=liblogger) + thisPyHocaCLI.authenticate() + thisPyHocaCLI.MainLoop() sys.exit(0) diff --git a/pyhoca/cli/frontend.py b/pyhoca/cli/frontend.py index 443d608..f559428 100644 --- a/pyhoca/cli/frontend.py +++ b/pyhoca/cli/frontend.py @@ -341,7 +341,31 @@ class PyHocaCLI(x2go.X2GoClient): self.auth_attempts = int(self.args.auth_attempts) - if self.args.session_profile: + + if args.list_profiles: + + _session_profiles = self._X2GoClient__get_profiles() + # retrieve a session list + print + print "Available X2Go session profiles" + print "===============================" + if _session_profiles.config_files is not None: + print "configuration files: %s" % _session_profiles.config_files + if _session_profiles.user_config_file is not None: + print "user configuration file: %s" % _session_profiles.user_config_file + print + for _profile_id in _session_profiles.profile_ids: + _profile_config = _session_profiles.get_profile_config(_profile_id) + _session_params = _session_profiles.to_session_params(_profile_id) + print 'Profile ID: %s' % _profile_id + print 'Profile Name: %s' % _session_params['profile_name'] + pprint.pprint(_session_params) + print + + # done + sys.exit(0) + + elif self.args.session_profile: _cmdlineopt_to_sessionopt = { 'command': 'cmd', -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/pyhoca-cli.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch brokerclient in repository pyhoca-cli. commit 8985b746f5b977b05ffeefb6f0444bc400d14fa4 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Mar 3 12:55:03 2014 +0100 whitespace fixes --- pyhoca-cli | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pyhoca-cli b/pyhoca-cli index 9e6aaa5..93e06ad 100755 --- a/pyhoca-cli +++ b/pyhoca-cli @@ -126,7 +126,7 @@ liblogger = x2go.X2GoLogger() ### # exclusive client control options -action_options = [ +action_options = [ {'args':['-N','--new'], 'default': False, 'action': 'store_true', 'help': 'start a new X2Go session on server (default)', }, {'args':['-R','--resume'], 'default': None, 'metavar': 'SESSION_NAME', 'help': 'resume a suspended X2Go session with name SESSION_NAME', }, {'args':['-D','--share-desktop'], 'default': None, 'metavar': 'USER@DISPLAY', 'help': 'share an X2Go session on server specified by USER@DISPLAY', }, @@ -143,7 +143,7 @@ if _X2GOCLIENT_OS == "Linux": ) # debug options... -debug_options = [ +debug_options = [ {'args':['-d','--debug'], 'default': False, 'action': 'store_true', 'help': 'enable application debugging code', }, {'args':['--quiet'], 'default': False, 'action': 'store_true', 'help': 'disable any kind of log output', }, {'args':['--libdebug'], 'default': False, 'action': 'store_true', 'help': 'enable debugging code of the underlying Python X2Go module', }, @@ -151,7 +151,7 @@ debug_options = [ {'args':['-V', '--version'], 'default': False, 'action': 'store_true', 'help': 'print version number and exit', }, ] # possible programme options are -x2go_options = [ +x2go_options = [ # NOT IMPLEMENTED {'args':['--config'], 'default': '~/.x2goclient/sessions', 'help': 'x2goclient config file containing x2go session settings (default: ~/.x2goclient/sessions)', }, {'args':['-c','--command'], 'default': 'TERMINAL', 'help': 'command to run with -R mode on server (default: xterm)', }, {'args':['-u','--username'], 'default': None, 'help': 'username for the session (default: current user)', }, @@ -167,7 +167,7 @@ x2go_options = [ {'args':['--terminate-on-ctrl-c'], 'default': False, 'action': 'store_true', 'help': 'terminate the connected session when pressing CTRL+C (instead of suspending the session)', }, {'args':['--auth-attempts'], 'default': 3, 'help': 'number of authentication attempts before authentication fails (default: 3)', }, ] -print_options = [ +print_options = [ {'args':['--print-action'], 'default': 'PDFVIEW', 'choices': PRINT_ACTIONS, 'help': 'action to be performed for incoming X2Go print jobs (default: \'PDFVIEW\')', }, {'args':['--pdfview-cmd'], 'default': None, 'help': 'PDF viewer command for displaying incoming X2Go print jobs (default: \'%s\'); this option selects \'--print-action PDFVIEW\'' % DEFAULT_PDFVIEW_CMD,}, {'args':['--save-to-folder'], 'default': None, 'metavar': 'PRINT_DEST', 'help': 'save print jobs as PDF files to folder PRINT_DEST (default: \'%s\'); this option selects \'--print-action PDFSAVE\'' % DEFAULT_PDFSAVE_LOCATION,}, @@ -178,7 +178,7 @@ broker_options = [ {'args':['-B','--broker-url'], 'default': None, 'help': 'retrieve session profiles via an X2Go Session Broker under the given URL', }, ] -nx_options = [ +nx_options = [ {'args':['-g','--geometry'], 'default': '800x600','help': 'screen geometry: \'<width>x<height>\' or \'fullscreen\' (default: \'800x600\')',}, {'args':['-q','--link'], 'default': 'adsl', 'choices': ('modem','isdn','adsl','wan','lan'), 'help': 'link quality (default: \'adsl\')',}, {'args':['-t','--session-type'], 'default': 'application', 'choices': ('desktop', 'application'), 'help': 'session type (default: \'application\')', }, @@ -186,7 +186,7 @@ nx_options = [ {'args':['--kbd-layout'], 'default': 'us', 'help': 'use keyboard layout (default: \'us\')',}, {'args':['--kbd-type'], 'default': 'pc105/us', 'help': 'set Keyboard type (default: \'pc105/us\')',}, ] -compat_options = [ +compat_options = [ {'args':['--port'], 'default': None, 'help': 'compatibility option, synonymous to --remote-ssh-port PORT', }, {'args':['--ssh-key'], 'default': None, 'help': 'compatibility option, synonymous to --ssh-privkey SSH_KEY', }, {'args':['--use-sound'], 'default': None, 'choices': ('yes', 'no'), 'help': 'compatibility option, synonymous to --sound {pulse|none}', }, @@ -212,7 +212,7 @@ def parseargs(): p = argparse.ArgumentParser(description='X2Go command line client implemented in Python.',\ epilog=""" -Possible values for the --pack NX option are: +Possible values for the --pack NX option are: %s """ % x2go.defaults.pack_methods_nx3_formatted, \ formatter_class=argparse.RawDescriptionHelpFormatter, \ @@ -323,7 +323,7 @@ Possible values for the --pack NX option are: ### take care of compatibility options # option --use-sound yes as synonomyn for --sound - if a.use_sound is not None: + if a.use_sound is not None: if a.use_sound == 'yes': a.sound = 'pulse' if a.use_sound == 'no': a.sound = 'none' @@ -407,7 +407,7 @@ if __name__ == '__main__': print 'Profile ID: %s' % _profile_id print 'Profile Name: %s' % _session_params['profile_name'] pprint.pprint(_session_params) - print + print else: -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/pyhoca-cli.git