The branch, master has been updated via bf53dfab0b17eb1ab474fddccf7220dd14c1ba81 (commit) from 1bcff08085a4d7816d8258bb972ead1688b068e5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit bf53dfab0b17eb1ab474fddccf7220dd14c1ba81 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Jan 29 06:07:58 2013 +0100 add cmdline switch --debug, only enable http GET method in debugging mode ----------------------------------------------------------------------- Summary of changes: sbin/x2gobroker | 3 +++ x2gobroker/defaults.py | 5 +++++ x2gobroker/web/plain.py | 5 ++++- 3 files changed, 12 insertions(+), 1 deletion(-) The diff of changes is: diff --git a/sbin/x2gobroker b/sbin/x2gobroker index a9c79ad..822f18d 100755 --- a/sbin/x2gobroker +++ b/sbin/x2gobroker @@ -41,6 +41,7 @@ if __name__ == "__main__": daemon_options = [ {'args':['-C','--config-file'], 'default': None, 'metavar': 'CONFIG_FILE', 'help': 'Specify a special configuration file name, default is: {default}'.format(default=x2gobroker.defaults.X2GOBROKER_CONFIG), }, {'args':['-b', '--bind'], 'default': '127.0.0.1:8080', 'metavar': 'BIND_ADDRESS', 'help': 'The [address:]port that the web.py http-engine shall bind to (default: 127.0.0.1:8080)', }, + {'args':['-d','--debug'], 'default': False, 'action': 'store_true', 'help': 'enable debugging code; also: allow testing in web browser (make http\'s POST method available as GET method, as well)', }, ] p = argparse.ArgumentParser(description='X2Go Session Broker (Standalone Daemon)',\ formatter_class=argparse.RawDescriptionHelpFormatter, \ @@ -57,6 +58,8 @@ if __name__ == "__main__": if cmdline_args.config_file is not None: x2gobroker.defaults.X2GOBROKER_CONFIG = cmdline_args.config_file + x2gobroker.defaults.X2GOBROKER_DEBUG = cmdline_args.debug + # import classes serving the different web.py URLs from x2gobroker.web.plain import * diff --git a/x2gobroker/defaults.py b/x2gobroker/defaults.py index 81dc346..a285938 100644 --- a/x2gobroker/defaults.py +++ b/x2gobroker/defaults.py @@ -36,6 +36,11 @@ if os.environ.has_key('X2GOBROKER_SESSIONPROFILES'): else: X2GOBROKER_SESSIONPROFILES="/etc/x2go/broker/x2gobroker-sessionprofiles.conf" +if os.environ.has_key('X2GOBROKER_DEBUG'): + X2GOBROKER_DEBUG=bool(os.environ['X2GOBROKER_DEBUG']) +else: + X2GOBROKER_DEBUG=False + if os.environ.has_key('X2GOBROKER_AGENT_CMD'): X2GOBROKER_AGENT_CMD=os.environ['X2GOBROKER_AGENT_CMD'] else: diff --git a/x2gobroker/web/plain.py b/x2gobroker/web/plain.py index 36afe63..49d471e 100644 --- a/x2gobroker/web/plain.py +++ b/x2gobroker/web/plain.py @@ -26,6 +26,7 @@ import types # Python X2Go Broker modules from x2gobroker.defaults import X2GOBROKER_DEFAULT_BACKEND as _X2GOBROKER_DEFAULT_BACKEND +from x2gobroker.defaults import X2GOBROKER_DEBUG as _X2GOBROKER_DEBUG class X2GoBrokerWebPlain: @@ -40,7 +41,9 @@ class X2GoBrokerWebPlain: web.header(http_header_item, self.http_header_items[http_header_item]) def GET(self, backend): - return self.POST(backend) + if _X2GOBROKER_DEBUG: + return self.POST(backend) + return web.notfound() def POST(self, backend): hooks/post-receive -- x2gobroker.git (HTTP(S) Session broker for X2Go) This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "x2gobroker.git" (HTTP(S) Session broker for X2Go).