This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository x2gobroker. from 700270b drop obsolete function parameter 'query_mode' when calling agent tasks new 84fe80f JSON webUI: run pre and post auth scripts also via this backend. new 170800f bin/x2gobroker: typo fix new aef86cd x2gobroker-daemon: become wrapper script, enable --mode HTTP by default. 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: Makefile | 2 ++ bin/x2gobroker | 2 +- bin/x2gobroker-daemon | 25 ++++++++++++++++++++++++- debian/changelog | 2 ++ debian/x2gobroker-daemon.manpages | 1 + init/x2gobroker-daemon.init | 2 +- man/man1/x2gobroker.1 | 15 +++++++++++++-- rpm/x2gobroker-daemon.init | 2 +- sbin/x2gobroker-daemon-debug | 4 ++-- x2gobroker.spec | 1 + x2gobroker/web/json.py | 25 +++++++++++++++++++++++++ 11 files changed, 73 insertions(+), 8 deletions(-) mode change 120000 => 100755 bin/x2gobroker-daemon -- Alioth's /srv/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 170800fd2a2075f4d1ae1d1e8e1704d8096c11fe Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Mar 31 22:41:07 2014 +0200 bin/x2gobroker: typo fix --- bin/x2gobroker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/x2gobroker b/bin/x2gobroker index b1f8258..4fc4f2c 100755 --- a/bin/x2gobroker +++ b/bin/x2gobroker @@ -106,7 +106,7 @@ if __name__ == "__main__": setproctitle.setproctitle(os.path.basename(sys.argv[0])) general_options = [ - {'args':['-M','--mode'], 'default': 'SSH', 'metavar': 'BROKER_MODE', 'help': 'Mode of the X2Go Session Broker to run ins (available: SSH, HTTP)', }, + {'args':['-M','--mode'], 'default': 'SSH', 'metavar': 'BROKER_MODE', 'help': 'Mode of the X2Go Session Broker to run in (available: SSH, HTTP)', }, {'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':['-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)', }, {'args':['-i','--debug-interactively'], 'default': False, 'action': 'store_true', 'help': 'force output of log message to the stderr (rather than to the log files)', }, -- Alioth's /srv/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 aef86cda9191731610c29e55ef11221de74928a4 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Mar 31 22:50:08 2014 +0200 x2gobroker-daemon: become wrapper script, enable --mode HTTP by default. --- Makefile | 2 ++ bin/x2gobroker-daemon | 25 ++++++++++++++++++++++++- debian/changelog | 1 + debian/x2gobroker-daemon.manpages | 1 + init/x2gobroker-daemon.init | 2 +- man/man1/x2gobroker.1 | 15 +++++++++++++-- rpm/x2gobroker-daemon.init | 2 +- sbin/x2gobroker-daemon-debug | 4 ++-- x2gobroker.spec | 1 + 9 files changed, 46 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index c7a14e0..4a56aaf 100755 --- a/Makefile +++ b/Makefile @@ -117,6 +117,8 @@ install: "${DESTDIR}/etc/logrotate.d/" mkdir -p "${DESTDIR}${BINDIR}" "${DESTDIR}${SBINDIR}" \ "${DESTDIR}${MANDIR}/man8" + ${INSTALL_FILE} man/man1/x2gobroker-daemon.1* \ + "${DESTDIR}${MANDIR}/man1" ${INSTALL_FILE} man/man8/x2gobroker-daemon-debug.8* \ "${DESTDIR}${MANDIR}/man8" ${INSTALL_PROGRAM} bin/x2gobroker-daemon \ diff --git a/bin/x2gobroker-daemon b/bin/x2gobroker-daemon deleted file mode 120000 index cd340c3..0000000 --- a/bin/x2gobroker-daemon +++ /dev/null @@ -1 +0,0 @@ -x2gobroker \ No newline at end of file diff --git a/bin/x2gobroker-daemon b/bin/x2gobroker-daemon new file mode 100755 index 0000000..54ce585 --- /dev/null +++ b/bin/x2gobroker-daemon @@ -0,0 +1,24 @@ +#!/bin/bash +# -*- coding: utf-8 -*- + +# This file is part of the X2Go Project - http://www.x2go.org +# Copyright (C) 2011-2014 by Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> +# Copyright (C) 2011-2014 by Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> +# Copyright (C) 2012-2014 by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> +# +# X2Go Session Broker is free software; you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# X2Go Session Broker is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +x2gobroker -M http $@ \ No newline at end of file diff --git a/debian/changelog b/debian/changelog index f244175..fe523f7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -117,6 +117,7 @@ x2gobroker (0.0.3.0-0x2go1) UNRELEASED; urgency=low - Fix broker crashes when no session status is available for certain session profiles. - JSON webUI: run pre and post auth scripts also via this backend. + - x2gobroker-daemon: become wrapper script, enable --mode HTTP by default. * debian/control: + Replace LDAP support with session brokerage support in LONG_DESCRIPTION. + Fix SYNOPSIS texts. diff --git a/debian/x2gobroker-daemon.manpages b/debian/x2gobroker-daemon.manpages index 1f0ca68..4053510 100644 --- a/debian/x2gobroker-daemon.manpages +++ b/debian/x2gobroker-daemon.manpages @@ -1 +1,2 @@ +man/man1/x2gobroker-daemon.1 man/man8/x2gobroker-daemon-debug.8 \ No newline at end of file diff --git a/init/x2gobroker-daemon.init b/init/x2gobroker-daemon.init index b00c638..4b9bbb2 100755 --- a/init/x2gobroker-daemon.init +++ b/init/x2gobroker-daemon.init @@ -92,7 +92,7 @@ case "${1:-}" in if is_true $START_BROKER; then log_daemon_msg "Starting X2Go Session Broker standalone daemon" "$(basename $DAEMON)" set +e - start-stop-daemon --chuid $X2GOBROKER_DAEMON_USER -b -m -S -p $PIDFILE_BROKER -x $DAEMON -- --mode HTTP -b $DAEMON_BIND_ADDRESS + start-stop-daemon --chuid $X2GOBROKER_DAEMON_USER -b -m -S -p $PIDFILE_BROKER -x $DAEMON -- -b $DAEMON_BIND_ADDRESS log_end_msg $? set -e fi diff --git a/man/man1/x2gobroker.1 b/man/man1/x2gobroker.1 index 1ae8420..6a925d1 100644 --- a/man/man1/x2gobroker.1 +++ b/man/man1/x2gobroker.1 @@ -7,7 +7,7 @@ .if \n(.g .mso www.tmac .TH x2gobroker 1 "Feb 2014" "Version 0.0.3.x" "X2Go Session Broker" .SH NAME -x2gobroker \- Session Broker for X2Go +x2gobroker,x2gobroker-daemon \- Session Broker for X2Go .SH SYNOPSIS 'nh .fi @@ -20,6 +20,16 @@ x2gobroker \- Session Broker for X2Go ] 'in \n(.iu-\nxu .ad b +.PP +.ad l +\fBx2gobroker-daemon\fR \kx +.if (\nx>(\n(.l/2)) .nr x (\n(.l/5) +'in \n(.iu+\nxu +[ +\fIoptions\fR +] +'in \n(.iu-\nxu +.ad b 'hy .SH DESCRIPTION \fBx2gobroker\fR is a Python Tornado based implementation of the X2Go Session Broker API. @@ -31,7 +41,8 @@ See the included README and TODO for further information on \fBx2gobroker\fR. \fBx2gobroker\fR accepts the following common options: .TP \*(T<\fB\-M, \-\-mode {HTTP|SSH}\fR\*(T> -Set X2Go Session Broker into HTTP or SSH mode. If this option is omitted, then SSH is the default mode.\fR. +Set X2Go Session Broker into HTTP or SSH mode. If this option is omitted, then SSH is the default mode. +If \fBx2gobroker-daemon\fR is used as executable name, then the default mode is HTTP(S). .TP \*(T<\fB\-C, \-\-config FILENAME\fR\*(T> Specify an alternative configuration file name, default is: \fI/etc/x2go/x2gobroker.conf\fR. diff --git a/rpm/x2gobroker-daemon.init b/rpm/x2gobroker-daemon.init index 39c75e0..df6fda3 100755 --- a/rpm/x2gobroker-daemon.init +++ b/rpm/x2gobroker-daemon.init @@ -69,7 +69,7 @@ export X2GOBROKER_SSL_KEYFILE exec=$DAEMON prog=$(basename $DAEMON) config=$DEFAULTCONFIG_DAEMON -OPTS="--mode HTTP -D -P \"$PIDFILE_BROKER\" -b \"$DAEMON_BIND_ADDRESS\"" +OPTS="-D -P \"$PIDFILE_BROKER\" -b \"$DAEMON_BIND_ADDRESS\"" lockfile=/var/lock/subsys/x2gobroker-daemon diff --git a/sbin/x2gobroker-daemon-debug b/sbin/x2gobroker-daemon-debug index 8426ecb..3a82453 100755 --- a/sbin/x2gobroker-daemon-debug +++ b/sbin/x2gobroker-daemon-debug @@ -35,7 +35,7 @@ if [ -e /etc/default/x2gobroker-daemon ]; then fi if [ -n "$DAEMON_BIND_ADDRESS" ]; then - su - x2gobroker -c "X2GOBROKER_SSL_CERTFILE=\"$X2GOBROKER_SSL_CERTFILE\" X2GOBROKER_SSL_KEYFILE=\"$X2GOBROKER_SSL_KEYFILE\" DAEMON_BIND_ADDRESS=\"$DAEMON_BIND_ADDRESS\" x2gobroker-daemon -M http -b $DAEMON_BIND_ADDRESS -i $@" + su - x2gobroker -c "X2GOBROKER_SSL_CERTFILE=\"$X2GOBROKER_SSL_CERTFILE\" X2GOBROKER_SSL_KEYFILE=\"$X2GOBROKER_SSL_KEYFILE\" DAEMON_BIND_ADDRESS=\"$DAEMON_BIND_ADDRESS\" x2gobroker-daemon -b $DAEMON_BIND_ADDRESS -i $@" else - su - x2gobroker -c "X2GOBROKER_SSL_CERTFILE=\"$X2GOBROKER_SSL_CERTFILE\" X2GOBROKER_SSL_KEYFILE=\"$X2GOBROKER_SSL_KEYFILE\" x2gobroker-daemon -M http -i $@" + su - x2gobroker -c "X2GOBROKER_SSL_CERTFILE=\"$X2GOBROKER_SSL_CERTFILE\" X2GOBROKER_SSL_KEYFILE=\"$X2GOBROKER_SSL_KEYFILE\" x2gobroker-daemon -i $@" fi diff --git a/x2gobroker.spec b/x2gobroker.spec index 0be602f..127f923 100644 --- a/x2gobroker.spec +++ b/x2gobroker.spec @@ -410,6 +410,7 @@ fi; %config %_sysconfdir/default/x2gobroker-daemon %endif %_sbindir/x2gobroker-daemon-debug +%_mandir/man1/x2gobroker-daemon.1* %_mandir/man8/x2gobroker-daemon-debug.8* %files wsgi -- Alioth's /srv/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 84fe80fa063d18085d4359901073ebc781aa7a6d Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Mar 31 22:34:57 2014 +0200 JSON webUI: run pre and post auth scripts also via this backend. --- debian/changelog | 1 + x2gobroker/web/json.py | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/debian/changelog b/debian/changelog index ee2b51d..f244175 100644 --- a/debian/changelog +++ b/debian/changelog @@ -116,6 +116,7 @@ x2gobroker (0.0.3.0-0x2go1) UNRELEASED; urgency=low - Fully rewrite agent.py. - Fix broker crashes when no session status is available for certain session profiles. + - JSON webUI: run pre and post auth scripts also via this backend. * debian/control: + Replace LDAP support with session brokerage support in LONG_DESCRIPTION. + Fix SYNOPSIS texts. diff --git a/x2gobroker/web/json.py b/x2gobroker/web/json.py index 77facf3..08cb973 100644 --- a/x2gobroker/web/json.py +++ b/x2gobroker/web/json.py @@ -125,10 +125,35 @@ class X2GoBrokerWeb(_RequestHandler): 'task': task, } + if len(global_config['pre_auth_scripts']) != 0: + for script in global_config['pre_auth_scripts']: + try: + post_auth_script=None + exec("import x2gobroker.optional_scripts.{script}_script".format(script=script)) + exec("pre_auth_script = x2gobroker.optional_scripts.{script}_script.X2GoBrokerOptionalScript()".format(script=script)) + logger_broker.debug ('Calling pre-auth script {script} with username: {username}, password: {password}, task: {task}, profile_id: {profile_id}, ip: {ip}, cookie: {cookie}'.format(script=script,username=username, password='XXXXX', task=task, profile_id=profile_id, ip=ip, cookie=cookie)) + username, password, task, profile_id, ip, cookie = pre_auth_script.run_me(username=username, password=password, task=task, profile_id=profile_id, ip=ip, cookie=cookie) + logger_broker.debug ('Pre-auth script {script} finished with username: {username}, password: {password}, task: {task}, profile_id: {profile_id}, ip: {ip}, cookie: {cookie}'.format(script=script,username=username, password='XXXXX', task=task, profile_id=profile_id, ip=ip, cookie=cookie)) + except ImportError: + logger_error.error('No such optional script \'{script}\''.format(script=script)) + logger_broker.debug ('username: {username}, password: {password}, task: {task}, profile_id: {profile_id}, cookie: {cookie}'.format(username=username, password='XXXXX', task=task, profile_id=profile_id, cookie=cookie)) access, next_cookie = broker_backend.check_access(username=username, password=password, ip=ip, cookie=cookie) + if access: + if len(global_config['post_auth_scripts']) != 0: + for script in global_config['post_auth_scripts']: + try: + post_auth_script=None + exec("import x2gobroker.optional_scripts.{script}_script".format(script=script)) + exec("post_auth_script = x2gobroker.optional_scripts.{script}_script.X2GoBrokerOptionalScript()".format(script=script)) + logger_broker.debug ('Calling post-auth script {script} with username: {username}, password: {password}, task: {task}, profile_id: {profile_id}, ip: {ip}, cookie: {cookie}'.format(script=script,username=username, password='XXXXX', task=task, profile_id=profile_id, ip=ip, cookie=cookie)) + username, password, task, profile_id, ip, cookie = post_auth_script.run_me(username=username, password=password, task=task, profile_id=profile_id, ip=ip, cookie=cookie) + logger_broker.debug ('Post-auth script {script} finished with username: {username}, password: {password}, task: {task}, profile_id: {profile_id}, ip: {ip}, cookie: {cookie}'.format(script=script,username=username, password='XXXXX', task=task, profile_id=profile_id, ip=ip, cookie=cookie)) + except ImportError: + logger_error.error('No such optional script \'{script}\''.format(script=script)) + ### ### CONFIRM SUCCESSFUL AUTHENTICATION FIRST ### -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2gobroker.git