This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository x2gobroker.

commit 9926360628ce222b3a4e634d07511c99f0515985
Author: Mike Gabriel <mike.gabr...@das-netzwerkteam.de>
Date:   Mon Jan 22 22:21:15 2024 +0100

    mini/: Complete x2gobroker-ssh-mini implementation and provide it as DEB 
package.
---
 COPYING.GPL-2+                                     | 339 +++++++++++++++++++++
 debian/changelog                                   |   2 +
 debian/control                                     |  23 ++
 debian/copyright                                   |   4 +
 debian/x2gobroker-ssh-mini.dirs                    |   2 +
 debian/x2gobroker-ssh-mini.docs                    |   1 +
 debian/x2gobroker-ssh-mini.install                 |   1 +
 debian/x2gobroker-ssh-mini.manpages                |   1 +
 debian/x2gobroker-ssh-mini.postinst                |  43 +++
 debian/x2gobroker-ssh-mini.postrm                  |  36 +++
 debian/x2gobroker-ssh-mini.prerm                   |  39 +++
 mini/README.md                                     |  31 ++
 mini/default.session                               |  25 ++
 .../x2gobroker-ssh-mini                            |  44 +--
 mini/x2gobroker-ssh-mini.8                         | 103 +++++++
 15 files changed, 672 insertions(+), 22 deletions(-)

diff --git a/COPYING.GPL-2+ b/COPYING.GPL-2+
new file mode 100644
index 0000000..d159169
--- /dev/null
+++ b/COPYING.GPL-2+
@@ -0,0 +1,339 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                            NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program 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 General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/debian/changelog b/debian/changelog
index 4947dcd..0735ff0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,8 @@ x2gobroker (0.0.4.4-0x2go1) UNRELEASED; urgency=medium
     - setup.py: Don't run setup.py with use_2to3 anymore.
     - x2gobroker/defaults.py: Gracefully handle API documentation builds during
       offline builds.
+    - mini/: Complete x2gobroker-ssh-mini implementation and provide it as DEB
+      package.
 
  -- Mike Gabriel <sunwea...@debian.org>  Mon, 15 Nov 2021 15:33:29 +0100
 
diff --git a/debian/control b/debian/control
index 74d6788..5b92ea8 100644
--- a/debian/control
+++ b/debian/control
@@ -342,3 +342,26 @@ Description: X2Go Session Broker (SSH broker)
  This add-on package provides fully-featured SSH brokerage
  support (with access to broker agents on remote X2Go
  Servers).
+
+Package: x2gobroker-ssh-mini
+Architecture: all
+Depends:
+ ${shlibs:Depends},
+ ${misc:Depends},
+ gawk,
+Description: X2Go Mini Broker (SSH broker)
+ X2Go is a server based computing environment with
+    - session resuming
+    - low bandwidth support
+    - session brokerage support
+    - client side mass storage mounting support
+    - client side printing support
+    - audio support
+    - authentication by smartcard and USB stick
+ .
+ The session broker is a server tool for X2Go that tells your X2Go Client
+ application in a terminal server cluster what servers and session types are
+ most appropriate for the user in front of the X2Go terminal.
+ .
+ This package provides a minimal X2Go SSH Broker implemented as a single
+ shell script.
diff --git a/debian/copyright b/debian/copyright
index eb41114..86f7877 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -22,6 +22,10 @@ Copyright: 2012-2019, Mike Gabriel 
<mike.gabr...@das-netzwerkteam.de>
            2012, Oleksandr Shneyder <oleksandr.schney...@obviously-nice.de>
 License: AGPL-3+
 
+Files: mini/*
+Copyright: 2018-2020, Stefan Baur <x2go-m...@baur-itcs.de>
+License: GPL-2+
+
 Files: debian/*
 Copyright: 2012-2019, Mike Gabriel <mike.gabr...@das-netzwerkteam.de>
 License: AGPL-3+
diff --git a/debian/x2gobroker-ssh-mini.dirs b/debian/x2gobroker-ssh-mini.dirs
new file mode 100644
index 0000000..11e5dd8
--- /dev/null
+++ b/debian/x2gobroker-ssh-mini.dirs
@@ -0,0 +1,2 @@
+etc/x2go/x2gobroker-ssh-mini/users/
+etc/x2go/x2gobroker-ssh-mini/groups/
diff --git a/debian/x2gobroker-ssh-mini.docs b/debian/x2gobroker-ssh-mini.docs
new file mode 100644
index 0000000..153c57d
--- /dev/null
+++ b/debian/x2gobroker-ssh-mini.docs
@@ -0,0 +1 @@
+mini/README.md
diff --git a/debian/x2gobroker-ssh-mini.install 
b/debian/x2gobroker-ssh-mini.install
new file mode 100644
index 0000000..b78c47f
--- /dev/null
+++ b/debian/x2gobroker-ssh-mini.install
@@ -0,0 +1 @@
+mini/x2gobroker-ssh-mini usr/bin/
diff --git a/debian/x2gobroker-ssh-mini.manpages 
b/debian/x2gobroker-ssh-mini.manpages
new file mode 100644
index 0000000..d635f98
--- /dev/null
+++ b/debian/x2gobroker-ssh-mini.manpages
@@ -0,0 +1 @@
+mini/x2gobroker-ssh-mini.8
diff --git a/debian/x2gobroker-ssh-mini.postinst 
b/debian/x2gobroker-ssh-mini.postinst
new file mode 100755
index 0000000..3fca25f
--- /dev/null
+++ b/debian/x2gobroker-ssh-mini.postinst
@@ -0,0 +1,43 @@
+#!/bin/sh
+# postinst script for x2gobroker-ssh-mini
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# Source debconf library.
+. '/usr/share/debconf/confmodule'
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <postinst> `abort-remove'
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see https://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+case "${1}" in
+       'configure')
+               if ! [ -d /etc/x2go/x2gobroker-ssh-mini/defaultsessions/ ]; then
+                       mkdir -p /etc/x2go/x2gobroker-ssh-mini/defaultsessions/
+                       ln -s /usr/share/x2gobroker-ssh-mini/default.session 
/etc/x2go/x2gobroker-ssh-mini/defaultsessions/default.session
+               fi
+               ;;
+       'abort-upgrade'|'abort-remove'|'abort-deconfigure')
+               ;;
+       *)
+               echo "postinst called with unknown argument '${1}'" >&2
+               exit '1'
+               ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit '0'
diff --git a/debian/x2gobroker-ssh-mini.postrm 
b/debian/x2gobroker-ssh-mini.postrm
new file mode 100755
index 0000000..49cb275
--- /dev/null
+++ b/debian/x2gobroker-ssh-mini.postrm
@@ -0,0 +1,36 @@
+#! /bin/sh
+# postrm script for x2gobroker-ssh-mini
+
+set -e
+
+# see: dh_installdeb(1)
+# summary of how this script can be called:
+#        * <postrm> `remove'
+#        * <postrm> `purge'
+#        * <old-postrm> `upgrade' <new-version>
+#        * <new-postrm> `failed-upgrade' <old-version>
+#        * <new-postrm> `abort-install'
+#        * <new-postrm> `abort-install' <old-version>
+#        * <new-postrm> `abort-upgrade' <old-version>
+#        * <disappearer's-postrm> `disappear' <overwriter>
+#          <overwriter-version>
+# for details, see /usr/share/doc/packaging-manual/
+
+case "${1}" in
+       'purge')
+               rm -Rf '/etc/x2go/x2gobroker-ssh-mini'
+               ;;
+       
'remove'|'upgrade'|'failed-upgrade'|'abort-install'|'abort-upgrade'|'disappear')
+               ;;
+       *)
+               echo "postrm called with unknown argument '${1}'" >&2
+               exit '1'
+               ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit '0'
diff --git a/debian/x2gobroker-ssh-mini.prerm b/debian/x2gobroker-ssh-mini.prerm
new file mode 100755
index 0000000..98d7737
--- /dev/null
+++ b/debian/x2gobroker-ssh-mini.prerm
@@ -0,0 +1,39 @@
+#! /bin/sh
+# prerm script for x2gobroker-ssh-mini
+
+set -e
+
+# see: dh_installdeb(1)
+# summary of how this script can be called:
+#        * <prerm> `remove'
+#        * <old-prerm> `upgrade' <new-version>
+#        * <new-prerm> `failed-upgrade' <old-version>
+#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+#        * <deconfigured's-prerm> `deconfigure' `in-favour'
+#          <package-being-installed> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see https://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+case "${1}" in
+       'remove')
+               # The package is being removed in its own right.
+               if test -L 
'/etc/x2go/x2gobroker-ssh-mini/defaultsessions/default.session'; then
+                       rm -f 
'/etc/x2go/x2gobroker-ssh-mini/defaultsessions/default.session'
+               fi
+               ;;
+       'deconfigure'|'upgrade'|'failed-upgrade')
+               :
+               ;;
+       *)
+               echo "${0}: didn't understand being called with '${1}'" 1>&2
+               exit '1'
+               ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit '0'
diff --git a/mini/README.md b/mini/README.md
new file mode 100644
index 0000000..bc05544
--- /dev/null
+++ b/mini/README.md
@@ -0,0 +1,31 @@
+# x2gobroker-ssh-mini
+
+Test/Dev/Unstable playground for x2gobroker-ssh-mini
+
+depends: bash, coreutils, gawk, grep, sed, x2goserver
+
+file locations:
+
+default.session -> /usr/share/x2gobroker-ssh-mini/default.session
+
+x2gobroker-ssh-mini -> /usr/bin/x2gobroker-ssh-mini
+
+gzip x2gobroker-ssh-mini.man.8 -> /usr/share/man/man8/x2gobroker-ssh-mini.8.gz
+
+```
+# postinst:
+if ! [ -d /etc/x2go/x2gobroker-ssh-mini/defaultsessions/ ]; then
+    mkdir -p /etc/x2go/x2gobroker-ssh-mini/defaultsessions/
+    ln -s /usr/share/x2gobroker-ssh-mini/default.session 
/etc/x2go/x2gobroker-ssh-mini/defaultsessions/default.session
+fi
+
+if ! [ -d /etc/x2go/x2gobroker-ssh-mini/users/ ]; then
+    mkdir -p /etc/x2go/x2gobroker-ssh-mini/users
+    chmod 755 /etc/x2go/x2gobroker-ssh-mini/users
+fi
+
+if ! [ -d /etc/x2go/x2gobroker-ssh-mini/groups/ ]; then
+    mkdir -p /etc/x2go/x2gobroker-ssh-mini/groups
+    chmod 755 /etc/x2go/x2gobroker-ssh-mini/groups
+fi
+```
diff --git a/mini/default.session b/mini/default.session
new file mode 100644
index 0000000..0122915
--- /dev/null
+++ b/mini/default.session
@@ -0,0 +1,25 @@
+speed=4
+pack=16m-jpeg
+quality=9
+fstunnel=true
+iconvto=UTF-8
+iconvfrom=ISO8859-1
+dpi=96
+setdpi=true
+xinerama=true
+usekbd=true
+sound=true
+soundsystem=pulse
+startsoundsystem=true
+soundtunnel=true
+defsndport=true
+sndport=4713
+print=true
+name=Published Applications
+icon=:/img/icons/128x128/x2gosession.png
+published=true
+command=PUBLISHED
+usesshproxy=false
+krbdelegation=false
+clipboard=both
+autologin=true
diff --git a/contrib/x2go-mini-sshbroker b/mini/x2gobroker-ssh-mini
similarity index 83%
rename from contrib/x2go-mini-sshbroker
rename to mini/x2gobroker-ssh-mini
index 59798bc..72ae898 100644
--- a/contrib/x2go-mini-sshbroker
+++ b/mini/x2gobroker-ssh-mini
@@ -3,21 +3,21 @@
 # This file is part of the  X2Go Project - http://www.x2go.org
 # Copyright (C) 2018-2020 by Stefan Baur <x2go-m...@baur-itcs.de>
 #
-# X2Go Mini SSH 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
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
-# X2Go Mini SSH Session Broker is distributed in the hope that it will be 
useful,
+# This program 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.
+# GNU General Public License for more details.
 #
-# You should have received a copy of the GNU Affero General Public License
+# You should have received a copy of the GNU 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.
-
+#
 # Features and Limitations
 # You can add sessions as for-everyone (defaultsessions), per-group, and 
per-user
 # You cannot add sessions based on IP range
@@ -30,9 +30,9 @@
 #   public/private key authentication and autologin is used.)
 
 # Config goes here - always only one session per file!
-# /etc/x2go/x2go-mini-sshbroker/defaultsessions/*.session
-# /etc/x2go/x2go-mini-sshbroker/${USER}/*.session
-# /etc/x2go/x2go-mini-sshbroker/groups/${GROUP}/*.session
+# /etc/x2go/x2gobroker-ssh-mini/defaultsessions/*.session
+# /etc/x2go/x2gobroker-ssh-mini/${USER}/*.session
+# /etc/x2go/x2gobroker-ssh-mini/groups/${GROUP}/*.session
 
 ### init ###
 # make a list of the parameters we received on the command line
@@ -54,8 +54,8 @@ if (echo -e "$PARAMLIST" | grep -q -- '--task listsessions'); 
then
        fi
 
        # fetch default sessions
-       if [ -d /etc/x2go/x2go-mini-sshbroker/defaultsessions ]; then
-               for SINGLESESSIONFILE in 
/etc/x2go/x2go-mini-sshbroker/defaultsessions/*.session ; do
+       if [ -d /etc/x2go/x2gobroker-ssh-mini/defaultsessions ]; then
+               for SINGLESESSIONFILE in 
/etc/x2go/x2gobroker-ssh-mini/defaultsessions/*.session ; do
                        # add session file name to the list of sessionfiles
                        SESSIONFILES+="$SINGLESESSIONFILE\n"
                        # figure out what the name of the session should be, 
based on the filename
@@ -72,8 +72,8 @@ if (echo -e "$PARAMLIST" | grep -q -- '--task listsessions'); 
then
        fi
 
        # fetch user-specific sessions
-       if [ -d /etc/x2go/x2go-mini-sshbroker/$USER ]; then
-               for SINGLESESSIONFILE in 
/etc/x2go/x2go-mini-sshbroker/$USER/*.session ; do
+       if [ -d /etc/x2go/x2gobroker-ssh-mini/$USER ]; then
+               for SINGLESESSIONFILE in 
/etc/x2go/x2gobroker-ssh-mini/$USER/*.session ; do
                        # add session file name to the list of sessionfiles
                        SESSIONFILES+="$SINGLESESSIONFILE\n"
                        # figure out what the name of the session should be, 
based on the filename
@@ -90,11 +90,11 @@ if (echo -e "$PARAMLIST" | grep -q -- '--task 
listsessions'); then
        fi
 
        # fetch group-specific sessions
-       if [ -d /etc/x2go/x2go-mini-sshbroker/groups ]; then
+       if [ -d /etc/x2go/x2gobroker-ssh-mini/groups ]; then
                # determine groups for this user and work through the list
                for SINGLEGROUP in $(id -Gn $USER) ; do
-                       if [ -d 
/etc/x2go/x2go-mini-sshbroker/groups/$SINGLEGROUP ]; then
-                               for SINGLESESSIONFILE in 
/etc/x2go/x2go-mini-sshbroker/groups/$SINGLEGROUP/*.session ; do
+                       if [ -d 
/etc/x2go/x2gobroker-ssh-mini/groups/$SINGLEGROUP ]; then
+                               for SINGLESESSIONFILE in 
/etc/x2go/x2gobroker-ssh-mini/groups/$SINGLEGROUP/*.session ; do
                                        # add session file name to the list of 
sessionfiles
                                        SESSIONFILES+="$SINGLESESSIONFILE\n"
                                        # figure out what the name of the 
session should be, based on the filename
@@ -133,9 +133,9 @@ elif (echo -e "$PARAMLIST" | grep -q -- '--task 
selectsession'); then
                SERVER=$(awk -F '=' '$1 == "host" { print $2 }' $SESSIONFILE)
                PORT=$(awk -F '=' '$1 == "sshport" { print $2 }' $SESSIONFILE)
                # if this failed, set default values
-               if [ -z "$SERVER" ] && [ -f 
/etc/x2go/x2go-mini-sshbroker/defaulthost ]; then
+               if [ -z "$SERVER" ] && [ -f 
/etc/x2go/x2gobroker-ssh-mini/defaulthost ]; then
                        # determine default hostname/IP
-                       read DEFAULTHOST 
</etc/x2go/x2go-mini-sshbroker/defaulthost
+                       read DEFAULTHOST 
</etc/x2go/x2gobroker-ssh-mini/defaulthost
                        SERVER=$DEFAULTHOST
                fi
 
@@ -151,16 +151,16 @@ elif (echo -e "$PARAMLIST" | grep -q -- '--task 
selectsession'); then
                # NOTE: at present, this only checks for local sessions 
(X2GoBroker==X2GoServer)
                # to make this work with a separate X2GoServer, we would need 
something like
                #if [ -z "$SESSIONLIST" ] && [ -n "$SSH_AUTH_SOCK" ]; then
-               #       # very hackish and not safe! Try to add hosts to a 
shared known_hosts file in advance, and place it in 
/etc/x2go/x2go-mini-sshbroker/
+               #       # very hackish and not safe! Try to add hosts to a 
shared known_hosts file in advance, and place it in 
/etc/x2go/x2gobroker-ssh-mini/
                #       # then point UserKnownHostsFile at that and get rid of 
the StrictHostKeyChecking=false
                #       SESSIONLIST=$(ssh -oStrictHostKeyChecking=false 
-oUserKnownHostsFile=/dev/null -p $PORT -A $USER@$SERVER x2golistsessions 
2>/dev/null)
                #fi
                # but the problem is, that it seems SSH_AUTH_SOCK is not set by 
the broker when logging in
-               # one way around this might be an ssh private key stored in 
/etc/x2go/x2go-mini-sshbroker/, that is added as a limited key with
+               # one way around this might be an ssh private key stored in 
/etc/x2go/x2gobroker-ssh-mini/, that is added as a limited key with
                # "forced-command=x2golistsessions_root" to 
/root/.ssh/authorized_keys to all servers - the output would then have to be 
filtered for the
                # username in question, as _root shows the data of all users on 
that particular host
                if [ -n "$SESSIONLIST" ]; then
                        echo "SESSION_INFO:$SESSIONLIST"
                fi
 fi
-# DEBUG echo "$@" >>/tmp/x2go-mini-sshbroker-commands
+# DEBUG echo "$@" >>/tmp/x2gobroker-ssh-mini-commands
diff --git a/mini/x2gobroker-ssh-mini.8 b/mini/x2gobroker-ssh-mini.8
new file mode 100644
index 0000000..3bc2a5e
--- /dev/null
+++ b/mini/x2gobroker-ssh-mini.8
@@ -0,0 +1,103 @@
+'\" -*- coding: utf-8 -*-
+'\" vim:fenc=utf-8
+.if \n(.g .ds T< \\FC
+.if \n(.g .ds T> \\F[\n[.fam]]
+.de URL
+\\$2 \(la\\$1\(ra\\$3
+..
+.if \n(.g .mso www.tmac
+.TH x2gobroker-ssh-mini 8 "Apr 2020" "Version 0.0.4.x" "X2Go Session Broker"
+.SH NAME
+x2gobroker-ssh-mini \- A Minimalistic SSH Session Broker for X2Go
+.SH SYNOPSIS
+'nh
+.fi
+.ad l
+\fBx2gobroker-ssh-mini\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-ssh-mini\fR is a minimalistic SSH session broker for X2Go.
+It can be used as a simple testing aid for the code parts in X2GoClient that 
interact with a session broker, but it can also be used as a tool for central 
session configuration deployment in a single-server production environment.
+Its main advantage is that it does not require a shared session database 
(postgres/MySQL), nor shared homedirectories (like NFS), nor central 
authentication (like LDAP), as would be the case in a multi-server setup - 
instead, it runs directly on an X2Go server.
+Its main disadvantage is that it is limited to exactly one X2Go server, so 
there is no load balancing capability built into its code.
+There might be ways to extend it so it can handle more than one server, but 
they all seem very hackish.
+Also, it does not have all the fancy ACL features the larger brokers have.
+It does, however, support some basic ACLs based on user account and group 
membership - and it might be possible to add support for source-IP based ACLs.
+.SH GENERAL OPTIONS
+\fBx2gobroker-ssh-mini\fR, when run from the command line or via SSH, 
accepts/requires these options:
+.TP
+\*(T<\fB\-\-sid SESSIONID\fR\*(T>
+Used together with \-\-task selectsession to specify the particular session.  
This parameter is optional.
+.TP
+\*(T<\fB\-\-task {listsessions, selectsession}\fR\*(T>
+Specify one of the known broker tasks (listsessions, selectsession).  This 
parameter is mandatory, the command execution will fail if it is omitted.
+.TP
+\*(T<\fB\-\-user USERNAME\fR\*(T>
+This parameter is currently not implemented.  See source code for details.
+.SH CONFIGURATION
+.TP
+\*(T<\fB/etc/x2go/x2gobroker-ssh-mini/defaulthost\fR\*(T>
+This file is optional.  \fBx2gobroker-ssh-mini\fR does a pretty good job at 
guessing its own FQDN/IP and port on the network it is connected to, so you can 
simply omit the "host=" and "port=" fields in your session files (note that if 
they are present, they will take precedence over the automatic detection).  
However, if you are using NAT/portforwarding to access the server, then you 
will either have to set "host=" and "port=" to the public FQDN/IP and the 
forwarded port in each of your  [...]
+.TP
+\*(T<\fB/etc/x2go/x2gobroker-ssh-mini/defaultsessions/\fR\*(T>
+Session files for sessions that are meant to be available to all users should 
be placed in this directory.
+Depending on your distribution, you may find a symlink pointing at 
/usr/share/x2gobroker-ssh-mini/default.session in this directory.  If you wish 
to keep it, but want to make changes to it, please remove the symlink and 
replace it with an actual copy of the file, or else your changes will be 
overwritten with each update of this package.
+.TP
+\*(T<\fB/etc/x2go/x2gobroker-ssh-mini/groups/GROUPNAME/\fR\*(T>
+To limit visibility of one or more sessions to users belonging to a particular 
group, create a directory with the group's name in 
/etc/x2go/x2gobroker-ssh-mini/groups/ and place the corresponding session files 
there.
+.TP
+\*(T<\fB/etc/x2go/x2gobroker-ssh-mini/users/USERNAME/\fR\*(T>
+To limit visibility of one or more sessions to a particular user, create a 
directory with the user's name in /etc/x2go/x2gobroker-ssh-mini/users/ and 
place the corresponding session files there.
+.SH SECURITY CONSIDERATIONS
+Make sure the individual /etc/x2go/x2gobroker-ssh-mini/users/USERNAME and 
/etc/x2go/x2gobroker-ssh-mini/groups/GROUPNAME directories are chmod'ed 755 
when owned by root so users can access them, but cannot alter them.
+Same goes for all session files, which should be chmod'ed 644 when owned by 
root.
+You can restrict visibility of session files further by changing the ownership 
of the USERNAME directories and the files within to root:USERNAME and the 
ownership of the GROUPNAME directories and the files within to root:GROUPNAME.  
When doing so, you can use chmod 750 for the directories and chmod 640 for the 
session files.
+.SH SESSION FILE CREATION
+.TP
+Session files can be created from scratch, based on the default.session sample 
file (see section FILES below), or based on a regular user's 
~/.x2goclient/sessions file.  The main differences, compared to a regular 
sessions file, are:
+.TP
+Only one session per file.
+.TP
+The numeric session ID, along with its square brackets, needs to be removed.
+.TP
+The "user=" field will always be overridden with the user that established the 
broker connection, so this field is entirely optional.
+.TP
+The "host=" and "port=" fields are optional as well.  They will be used if 
present, but will be filled with what \fBx2gobroker-ssh-mini\fR believes to be 
correct if absent.  See section CONFIGURATION on how to override 
\fBx2gobroker-ssh-mini\fR's guesses.
+.TP
+When saving the file, you should use a file name like 
<someuniquesessionname>.session, but note that the display name is not 
generated from the file name.  Instead, it is read from the value of the field 
"name=" in the file itself.
+.SH USAGE
+.TP
+Assuming you have at least one valid session file (the file 
/usr/share/x2gobroker-ssh-mini/default.session, symlinked or copied into 
/etc/x2go/x2gobroker-ssh-mini/defaultsessions/, will do just fine), you can now 
start X2GoClient on a client and connect to the broker like so:
+.TP
+x2goclient 
--broker-url=ssh://USERNAME@SERVER[:PORT]/usr/bin/x2gobroker-ssh-mini 
[--broker-autologin]
+.PP
+.SH "FILES"
+/etc/x2go/x2gobroker-ssh-mini/defaulthost - Optional configuration file 
containing FQDN/IP and port.
+.br
+/etc/x2go/x2gobroker-ssh-mini/defaultsessions - The directory where session 
files that everyone should have access to are stored.
+.br
+/etc/x2go/x2gobroker-ssh-mini/groups/GROUPNAME - The directory where session 
files that only the members of group GROUPNAME should see are stored.
+.br
+/etc/x2go/x2gobroker-ssh-mini/users/USERNAME - The directory where session 
files that only user USERNAME should see are stored.
+.br
+/usr/bin/x2gobroker-ssh-mini - This is the actual executable.
+.br
+/usr/share/x2gobroker-ssh-mini/default.session - This file contains a sample 
session configuration for Published Applications.
+.SH TODO
+.TP
+Currently, there's no regular nor debug logging code present in 
\fBx2gobroker-ssh-mini\fR.  This should be changed so it logs either to a 
dedicated file and/or to syslog.
+.TP
+It might make sense to change the shebang line to "#!/bin/bash -e".  However, 
this needs further testing (are there any conditions where we're currently 
ignoring a presumably harmless failure)?
+.TP
+The code could probably be simplified/cleaned up by turning recurring blocks 
of code into functions.
+.TP
+It should be possible to add a sessions ACL based on the IP/IP range the 
connection is being made from.  This needs parsing of first field of the 
SSH_CONNECTION environment variable and some tinkering with the grepcidr 
command.
+.SH AUTHOR
+This manual has been written for the X2Go project by Stefan Baur 
<x2go-m...@baur-itcs.de>.
\ No newline at end of file

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on 
/srv/git/code.x2go.org/x2gobroker.git
_______________________________________________
x2go-commits mailing list
x2go-commits@lists.x2go.org
https://lists.x2go.org/listinfo/x2go-commits

Reply via email to