pyhoca-cli-0.6.1.3/ChangeLog0000644000000000000000000010316114471055441012356 0ustar 2019-11-22 12:50:39 +0100 Mihai Moldovan * misc: copyright update. (HEAD -> master) 2019-11-22 11:18:30 +0100 X2Go Release Manager (3849938) * Continue development 2019-11-20 08:12:07 +0100 Mike Gabriel (64284cc) * release 0.6.1.0 (HEAD -> master, tag: 0.6.1.0) 2019-07-19 19:47:58 +0200 Mike Gabriel (aa880ab) * pyhoca/cli/frontend.py: Use Python X2Go's new auto-detection code for the graphical proxy/rendering backend (NXv3 vs. KDrive). 2019-07-19 19:47:06 +0200 Mike Gabriel (5518cab) * pyhoca-cli.spec: Bump requirement for pyhoca-cli) on python(3)-x2go to 0.6.1.0. 2019-07-19 19:46:05 +0200 Mike Gabriel (bd5faaa) * debian/control: Bump D (pyhoca-cli) on python3-x2go to 0.6.1.0. 2019-07-19 19:02:00 +0200 Mike Gabriel (e0e6620) * Set master session only once we know for sure that the session has successfully come up. 2018-12-03 04:51:13 +0100 X2Go Release Manager (3078366) * Continue development 2018-12-03 02:22:19 +0100 X2Go Release Manager (45b662f) * release 0.6.0.1 (tag: 0.6.0.1) 2018-12-03 01:20:46 +0100 Mihai Moldovan (755ae8f) * man/man1/pyhoca-cli.1: pre-release date update. 2018-12-03 01:19:14 +0100 Mihai Moldovan (d398725) * misc: copyright update. 2018-12-01 11:57:31 +0100 Mike Gabriel (20a1cc9) * Catch HOOK_no_such_command and bail out if the server does not know how to execute the given session command. 2018-11-26 10:30:23 +0100 Mike Gabriel (192ee99) * pyhoca/cli/frontend.py: rephrase auth success message slightly. 2018-11-26 10:28:59 +0100 Mike Gabriel (7585c67) * pyhoca/cli/frontend.py: Be more real-time realistic and user friendly with notice log messages after authentication. 2018-11-10 22:06:27 +0000 Mike Gabriel (0adac3b) * debian/control: Bump versioned D on python3-x2go to (>= 0.6.0.2-0~). 2018-11-10 22:05:17 +0000 Mike Gabriel (5dcd563) * pyhoca/cli/frontend.py: Check directly after authentication, if the remote host has the X2Go Server software installed. 2018-11-11 11:27:38 +0100 Mihai Moldovan (3fbced2) * pyhoca-cli.spec: fully own %{python2_sitelib}/pyhoca directory. 2018-11-10 16:05:59 +0000 Mike Gabriel (e86021e) * Fix failing password-only authentication. 2018-11-10 17:05:08 +0100 Mihai Moldovan (14eba70) * pyhoca-cli.spec: also pick files matching PyHoca_CLI* in the site-lib directory. 2018-11-10 15:14:59 +0100 Mihai Moldovan (1bb1d2a) * pyhoca-cli.spec: pick the files correctly. 2018-11-10 14:30:35 +0100 Mihai Moldovan (4b69e61) * pyhoca-cli.spec: include python2_sitelib for CentOS, python3_sitelib otherwise. 2018-11-10 13:54:55 +0100 Mihai Moldovan (b5d0ec9) * setup.py: need to import the sys module, not just version_info into global namespace. 2018-11-10 13:47:11 +0100 Mihai Moldovan (0d50466) * setup.py: we actually also need the version information, so import it. 2018-11-10 13:39:46 +0100 Mihai Moldovan (6ebecc4) * pyhoca-cli.spec: Build-Require python-rpm-macros for OpenSuSE builds. 2018-11-10 13:35:57 +0100 Mihai Moldovan (4f98092) * setup.py: backport Python 2 support via io.open. 2018-11-10 13:16:47 +0100 Mihai Moldovan (b050d3e) * pyhoca-cli.spec: use modern python build and install macros. 2018-11-10 12:57:57 +0100 Mihai Moldovan (55d4bfc) * pyhoca-cli.spec: either EL6 or EL7, not both at the same time. 2018-11-10 11:58:04 +0100 Mihai Moldovan (b8bf324) * pyhoca-cli.spec: it's still %endif, not %fi. 2018-11-10 09:40:59 +0100 Mihai Moldovan (1b3cd85) * pyhoca-cli.spec: build with Python 2 on CentOS, drop python3-argparse dependency (part of stdlib). 2018-11-10 09:45:51 +0100 Mihai Moldovan (716fd7c) * debian/changelog: fix for current version. 2018-11-10 09:39:21 +0100 Mihai Moldovan (15298b5) * debian/changelog: fix for previous version. 2018-09-19 15:22:01 +0200 Mike Gabriel (c716bec) * pyhoca-cli.spec: Adjust python3-x2go versioned dependency. 2018-09-19 15:22:19 +0200 Mike Gabriel (70aa4a6) * Continue development... 2018-09-19 15:16:55 +0200 Mike Gabriel (3ba796c) * debian/control: Set Section: from "python" to "x11". More appropriate. 2018-09-18 21:17:06 +0200 Mike Gabriel (db47d5d) * release 0.6.0.0 (tag: 0.6.0.0) 2018-09-18 21:07:26 +0200 Mike Gabriel (2a3460f) * Update cmdline options in man page. 2018-09-18 21:02:41 +0200 Mike Gabriel (cea4d39) * Fix --list-profiles action. Regresion after we introduced the a.host positional argument. 2018-09-18 18:42:27 +0200 Mike Gabriel (61199c5) * debian/control: The fix for --share-local-folders requires a fixed Python X2Go (>= 0.6.0.1). 2018-09-18 18:41:38 +0200 Mike Gabriel (e8dacb1) * Fix --share-local-folders (aka -F) option and really mount shared folders. (Fixes: #984). 2018-09-18 16:39:29 +0000 Mike Gabriel (75f53ca) * Set specific 'Passphrase: ' prompt (not 'Password: ') when we query for SSH key passphrases. 2018-09-18 16:37:21 +0000 Mike Gabriel (dadb385) * Switch from time.sleep() to gevent.sleep(). 2018-09-18 11:53:38 +0000 Mike Gabriel (1191860) * pyhoca-cli: Extract username from host parameter, if an @ is in the host string. 2018-09-18 11:49:23 +0000 Mike Gabriel (0171816) * pyhoca-cli: Fake SSH like login with additional [host] as positional argument. 2018-09-18 11:33:43 +0000 Mike Gabriel (0dabf4e) * pyhoca-cli: Add -i as alias for --ssh-privkey. Just like in OpenSSH. 2018-09-18 11:32:36 +0000 Mike Gabriel (56fc651) * pyhoca-clI: Reserve -l as username option. Just like in OpenSSH. 2018-09-18 13:10:40 +0200 Mike Gabriel (34715b3) * Entirely rewrite PyHocaCLI.authenticate() function. (Fixes: #1308). 2018-09-18 09:12:46 +0200 Mike Gabriel (bee1402) * debian/changelog: Add closure for #1287. 2018-09-18 09:12:18 +0200 Mike Gabriel (d417c62) * Add --forward-sshagent / -A cmdline option for enabling SSH agent forwarding. 2018-05-16 08:46:51 +0000 Mike Gabriel (ac94526) * update debian/changelog 2018-05-16 08:45:01 +0000 Mike Gabriel (48793e7) * pyhoca-cli main programme: Check for DISPLAY env var being set and having a usable / expectable value. 2018-05-15 15:50:13 +0200 Mike Gabriel (6984ba6) * update debian/changelog 2018-05-15 15:49:35 +0200 Mike Gabriel (4de6570) * keyboard handling: Switch to kbd-type auto and kbd-layout null. Should auto-detect the client-side keyboard in the X2Go session just fine. 2018-05-14 16:28:38 +0200 Mike Gabriel (2bc1ab0) * Add --xinerama (or -x) command line option. 2018-05-14 14:54:23 +0200 Mike Gabriel (bda4775) * pyhoca/cli/frontend.py: Fix for previous commit (2). 2018-05-14 14:53:31 +0200 Mike Gabriel (ca983f4) * pyhoca/cli/frontend.py: Fix for previous commit. 2018-05-14 14:51:52 +0200 Mike Gabriel (3a620cc) * Fix duplicate password prompt. Regression fix. 2018-05-14 11:53:01 +0200 Mike Gabriel (849181b) * update debian/changelog 2018-05-14 11:51:18 +0200 Mike Gabriel (afcf64f) * debian/control: Drop D (pyhoca-cli): python3-argparse. Part of stdlib in Python3 these days. 2018-05-14 09:59:55 +0200 Mike Gabriel (de1d266) * setup.py: Fix version string detection. (Copy+paste flaw...). 2018-05-13 18:31:27 +0000 Mike Gabriel (341fe80) * debian/rules: Ignore failures during dh_auto_clean. Helps with build envs that don't have python3-setuptools installed when building source packages. 2018-05-12 22:46:30 +0200 Mike Gabriel (e2dedb1) * Add --try-resume cmd line option and feature. Bump version to 0.5.99.1. 2018-05-12 22:46:11 +0200 Mike Gabriel (252bb31) * pyhoca-cli.1: Rephrase info for --from-stdin slightly. 2018-03-07 12:55:44 +0100 Mike Gabriel (4e61d8d) * man page: Add --force-password option. 2018-03-06 21:24:09 +0100 Mike Gabriel (aa43e5a) * debian/changelog 2018-03-06 20:17:50 +0000 Mike Gabriel (835cd53) * pyhoca-cli: Add --force-password command line switch to override SSH key detection code. 2018-03-06 20:59:30 +0100 Mike Gabriel (c1ff8d4) * Enforce Python3 build, fix FTBFS. (debian/rules: Switch to pybuild DH build system.) 2017-09-25 13:49:05 +0200 Mike Gabriel (957fb1a) * debian/rules: Typo fix in WITH_PYTHON3 variable assignment. 2017-09-25 12:52:50 +0200 Mike Gabriel (b427400) * pyhoca-cli.spec: Adapt to PyHoca-CLI's Python3 port. 2017-09-25 12:50:45 +0200 Mike Gabriel (b851c91) * debian/changelog: Update from Git history 2017-09-22 14:13:52 +0200 Mike Gabriel (adba562) * Bump upstream version to 0.5.99.0. 2017-09-22 14:12:47 +0200 Mike Gabriel (04eabd5) * debian/rules: Build for Python3, not Python2. 2017-09-22 14:12:24 +0200 Mike Gabriel (e344f92) * debian/control: Fix src:pkg header part. 2017-09-22 12:11:16 +0200 Mike Gabriel (eb844a1) * debian/control: Switch to python3-* dependencies. 2017-09-22 12:06:12 +0200 Mike Gabriel (2d88f3d) * debian/control: White-space fix. 2017-09-22 12:05:58 +0200 Mike Gabriel (13503d9) * debian/control: Bump versioned D (pyhoca-cli): python-x2go (>= 0.5.99.0). 2017-09-22 12:05:24 +0200 Mike Gabriel (ff718bc) * debian/{control,compat}: Bump to DH version level 9. 2017-09-22 12:03:34 +0200 Mike Gabriel (568f71f) * Port to Python3. 2017-09-24 10:50:59 +0200 X2Go Release Manager (1db41fe) * Continue development 2017-09-24 09:55:55 +0200 X2Go Release Manager (87b6c71) * release 0.5.0.4 (tag: 0.5.0.4) 2016-08-07 18:49:11 +0200 Mihai Moldovan (9428156) * man/man1/pyhoca-cli.1: drop incorrect short option -p as an alias for --pack. Fixes: #1062. 2016-06-28 04:14:47 +0200 Mihai Moldovan (1cb6ec7) * debian/changelog: add entry for last change. 2016-06-27 04:09:19 +0200 Mihai Moldovan (f727fb8) * debian/control: add myself as uploader. 2016-06-15 19:41:56 +0200 Mihai Moldovan (183ad74) * pyhoca-cli.spec: SLE support: add --prefix to setup.py install call. 2016-06-15 19:29:30 +0200 Mihai Moldovan (8d36f31) * pyhoca-cli.spec: add support for EPEL5 and (older) SLE versions by using the BuildRoot tag. 2016-06-08 08:59:05 +0200 Mihai Moldovan (e67cb2a) * debian/control: maintainer change in package: X2Go Developers . 2016-01-28 21:24:54 +0100 X2Go Release Manager (b0940ee) * Continue development... 2016-01-28 20:49:47 +0100 X2Go Release Manager (934cf1c) * release 0.5.0.3 (tag: 0.5.0.3) 2016-01-28 20:46:44 +0100 X2Go Release Manager (a1e7fa3) * debian/changelog: move dh-python change to where it actually belongs to - version 0.5.0.3. 2016-01-28 20:43:29 +0100 X2Go Release Manager (405343f) * Continue development... 2016-01-28 20:37:06 +0100 X2Go Release Manager (97fc86d) * Revert "release 0.5.0.2" 2016-01-28 20:01:54 +0100 X2Go Release Manager (611970a) * release 0.5.0.2 2016-01-28 16:42:41 +0100 Mihai Moldovan (e734f01) * misc: whitespace only. 2016-01-28 15:34:07 +0100 Mihai Moldovan (9e78e00) * common: update copyright notices. Happy new year! 2016-01-26 20:56:15 +0100 Mihai Moldovan (623267e) * debian/changelog: add contributor name. 2016-01-26 20:55:08 +0100 Mihai Moldovan (3fb126a) * debian/control: switch python-support to build dependency, add dh-python alternative. 2016-01-26 20:23:34 +0100 Mihai Moldovan (8541c41) * debian/control: whitespace only. 2015-01-25 13:34:04 +0100 Mike Gabriel (9b4a11e) * release 0.5.0.2 (tag: 0.5.0.2) 2015-01-08 19:34:22 +0100 Mihai Moldovan (f1cb3d9) * common: update copyright notices. Happy new year! 2014-12-17 16:21:52 +0100 Mike Gabriel (7120e88) * Handle SSHException 'No authentication methods available' for key-only authentication attempts gracefully. 2014-12-17 16:07:00 +0100 Mike Gabriel (730b0e1) * Handle SSHException 'Incompatible ssh peer (no acceptable kex algorithm)' gracefully. 2014-10-21 09:17:08 +0200 Mike Gabriel (12f8ff9) * debian/changelog: typo fix 2014-10-21 09:16:51 +0200 Mike Gabriel (e1e9076) * debian/copyright: Relicense packaging files under same license as the actual code files. 2014-10-20 23:29:18 +0200 Mike Gabriel (358bea3) * debian/control: Bump Standards: to 3.9.6. No changes needed. 2014-10-20 23:28:45 +0200 Mike Gabriel (7241829) * Continue development... 2014-10-20 22:14:46 +0200 Mike Gabriel (e175bc5) * release 0.5.0.1 (tag: 0.5.0.1) 2014-10-20 22:19:05 +0200 Mike Gabriel (18dd0e9) * man page: Mark not-yet-implemented cmdline options as such. More cmdline option support for brokerage is a TODO for pyhoca-cli. 2014-10-20 22:12:53 +0200 Mike Gabriel (a864f7d) * pyhoca-cli.spec: Versioned R (pyhoca-cli): python-x2go (>= 0.5.0.0). 2014-10-20 22:11:45 +0200 Mike Gabriel (be0f42a) * debian/control: Raise versioned D (pyhoca-cli): python-x2go (>= 0.5.0.0). 2014-10-20 22:09:07 +0200 Mike Gabriel (3bbfdec) * debian/control: Add to S (pyhoca-cli): mteleplayer-clientside. 2014-10-20 22:08:37 +0200 Mike Gabriel (a832dac) * Update README and TODO files. 2014-10-20 21:32:17 +0200 Mike Gabriel (bb9e964) * Continue development... 2014-10-20 21:30:27 +0200 Mike Gabriel (e6e6937) * happy new year 2014 (belated) 2014-10-20 13:08:56 +0200 Mike Gabriel (422ea20) * release 0.5.0.0 (tag: 0.5.0.0) 2014-10-20 13:08:28 +0200 Mike Gabriel (b8c600e) * formalistic code cleanup using pyflakes 2014-10-14 21:12:54 +0200 Mike Gabriel (275b7f1) * pyhoca-cli: Avoid duplicate files in openSUSE/SLES. 2014-10-14 21:09:10 +0200 Mike Gabriel (682d0e4) * pyhoca-cli.spec: Adapt to building on openSUSE/SLES. 2014-08-22 23:13:19 +0200 Mike Gabriel (81951cf) * Add cmdline options --backend-<*> to enforce usage of certain Python X2Go backends for session profile, settings, control session, terminal session, etc. 2014-08-22 23:11:45 +0200 Mike Gabriel (5b53cc7) * fix for last commit 2014-07-09 20:02:14 +0200 Mike Gabriel (77e16d2) * Rename LICENSE.txt to COPYING. 2014-05-06 11:34:36 +0200 Mike Gabriel (8e160bd) * Fix description of --from-stdin option on man page. (Fixes: #485). 2014-03-18 10:36:25 +0100 Mike Gabriel (51f28fc) * remove broker param from man page, that will not be implemented for pyhoca-cli 2014-03-17 13:50:56 +0100 Mike Gabriel (4a246c4) * debian/changelog: mention the new broker feature explicitly 2014-03-17 13:50:13 +0100 Mike Gabriel (544b38a) * Add cmdline option --broker-password. Masquerade broker password in process list (Linux/Mac only). 2014-03-17 13:49:27 +0100 Mike Gabriel (110424c) * Update man page with (future) broker options. Some man page fixes (mentioning X2Go Client where it should name PyHoca-CLI). 2014-03-17 13:47:27 +0100 Mike Gabriel (70c61ab) * ~When --list-profiles is invoked: Don't crash if a session profile backend does not rely on config files. Show the session broker URL if a broker session profile backend is in use. 2014-03-10 15:58:00 +0100 Mike Gabriel (817cb9b) * If a user name can neither be detected from the session profile, nor from the command line option, try the username used for the broker authentication. 2014-03-04 13:56:01 +0100 Mike Gabriel (715f739) * Move --list-profiles code into PyHocaCLI instance. 2014-03-03 12:55:03 +0100 Mike Gabriel (8985b74) * whitespace fixes 2014-03-03 12:46:40 +0100 Mike Gabriel (dcaa9c9) * Start work on broker client implementation for PyHoca-CLI. 2014-01-08 21:28:16 +0100 Mike Gabriel (4d64798) * Continue development... 2014-01-08 21:12:43 +0100 Mike Gabriel (3c27e63) * release 0.4.0.2 (tag: 0.4.0.2) 2013-12-17 11:16:52 +0100 Mike Gabriel (8606bf9) * Add to BR: python-argparse. 2013-12-10 20:47:15 +0100 Mike Gabriel (5e24a92) * pyhoca-cli.spec: Ship pyhoca-cli.spec (RPM package definitions) in upstream project. (Thanks to the Fedora package maintainers). 2013-11-29 13:07:07 +0100 Mike Gabriel (01b9ccf) * change versioning scheme 2013-11-27 14:56:28 +0100 Mike Gabriel (5c6fdd4) * debian/source/format: Switch to format 1.0. 2013-09-04 00:52:53 +0200 Mike Gabriel (3837d52) * Versioned Depends: on python-x2go (>= 0.4.0.9-0~). 2013-09-04 00:51:12 +0200 Mike Gabriel (b4c962f) * /debian/control: Replace "LDAP support" with "session brokerage support" in LONG_DESCRIPTION. 2013-09-04 00:50:38 +0200 Mike Gabriel (e47ed0a) * Add support for unlocking encrypted SSH private key files. 2013-02-12 20:45:19 +0100 Mike Gabriel (0cfcb3e) * Continue development... 2013-02-12 20:43:55 +0100 Mike Gabriel (eb0e526) * release 0.4.0.1 (tag: 0.4.0.1) 2013-02-12 20:43:43 +0100 Mike Gabriel (60a878d) * Bump egg version to 0.4.0.1 2013-02-12 20:35:55 +0100 Mike Gabriel (d549b95) * release 0.4.0.0 (tag: 0.4.0.0) 2013-01-14 00:00:44 +0100 Mike Gabriel (96d89e9) * update changelog 2013-01-13 23:50:46 +0100 Mike Gabriel (eef50e9) * fix all occurences of X2go -> X2Go, also in class identifiers 2012-12-20 09:20:05 +0100 Mike Gabriel (462a868) * fix changelog entry 2012-12-20 09:12:50 +0100 Mike Gabriel (98c7d71) * Thanks to Orion's patch in bug #91 we can drop build dependency on python-x2go. 2012-12-20 09:06:37 +0100 Mike Gabriel (98e1f92) * add os import to setup.py 2012-12-20 08:57:12 +0100 Orion Poplawski (a13a51e) * Importing all of pyhoca.wxgui in setup.py causes rpmbuild problems due to DISPLAY not being set. It is overkill as well, causing extra dependencies to be installed at build time. (Fixes: #91). 2012-12-16 15:29:22 +0100 Mike Gabriel (7f73477) * remove referrals to bugs in old BTS (Whups/Horde) 2012-12-13 13:34:16 +0100 Mike Gabriel (2ebe70d) * Continue development... 2012-12-10 14:52:10 +0100 Mike Gabriel (5130c68) * release 0.2.1.0 (tag: 0.2.1.0) 2012-11-12 11:34:20 +0100 Mike Gabriel (2840032) * fix typo in changelog 2012-11-12 09:06:14 +0100 Mike Gabriel (ee08a8e) * Remove cmdline option --time-to-wait, Python X2Go now offers a progress status for session startup/resumption. So we query this status instead. 2012-11-12 08:59:05 +0100 Mike Gabriel (0030b69) * Depend on python-x2go (>= 0.2.0.1). 2012-11-10 21:43:46 +0100 Mike Gabriel (63934b8) * swap password and session comand around 2012-11-10 20:54:54 +0100 Mike Gabriel (dd6a9ef) * update version+date in man page 2012-11-10 20:53:50 +0100 Mike Gabriel (410289b) * update man page 2012-11-10 20:42:38 +0100 Mike Gabriel (825b509) * do not hint to STRG-C functionality with --from-stdin option set 2012-11-10 20:05:33 +0100 Mike Gabriel (d8f6548) * typo 2012-11-10 20:03:48 +0100 Mike Gabriel (e047a76) * make unpacking of stdin values more robust 2012-11-10 19:54:07 +0100 Mike Gabriel (7deba53) * When finishing the application Update session status before reporting back to the user what happened to the session. 2012-11-10 19:48:32 +0100 Mike Gabriel (fd23c68) * fix for last commit 2012-11-10 19:41:47 +0100 Mike Gabriel (be31a06) * make --from-stdin IPv6 capable 2012-11-10 17:16:51 +0100 Mike Gabriel (506e2e7) * The option ,,password'' is not allowed for session registration. 2012-11-10 16:13:39 +0100 Mike Gabriel (7feaee0) * bump version to 0.2.1.0 2012-11-10 16:10:02 +0100 Mike Gabriel (ec4d9d6) * remove debug code 2012-11-09 17:51:56 +0100 Mike Gabriel (03eb816) * Add cmdline option --from-stdin that facilitates lightdm remote login session startup. 2012-09-27 16:53:15 +0200 Mike Gabriel (49aa9fe) * /debian/rules: Allow package build on systems with missing dh_python2. 2012-09-25 20:19:21 +0200 Mike Gabriel (84999ab) * Reduce python version in Build-Depends to allow build on Ubuntu 10.04. 2012-09-15 21:28:29 +0200 Mike Gabriel (83a392d) * /debian/control: fix typo in longdescs 2012-09-15 20:06:49 +0200 Mike Gabriel (f1fa7df) * Maintainer change in package: X2Go Developers . 2012-08-17 16:39:07 +0200 Mike Gabriel (6aae7a9) * Contine development... 2012-08-17 16:36:53 +0200 Mike Gabriel (0bea148) * release 0.2.0.4 (tag: 0.2.0.4) 2012-08-15 15:20:34 +0200 Mike Gabriel (62b7ec3) * typo in debian/changelog 2012-08-15 15:20:12 +0200 Mike Gabriel (75c3ba8) * version increment for pyhoca-cli python egg. 2012-08-15 15:09:44 +0200 Mike Gabriel (d09ebd3) * fix for commit 6702eae0 2012-08-15 15:03:30 +0200 Mike Gabriel (81f02d0) * Declare pyhoca namespace in setup.py. 2012-08-15 15:02:57 +0200 Mike Gabriel (6702eae) * Import packaging files from Debian package. 2012-07-24 02:45:13 +0200 Mike Gabriel (c65c703) * release 0.2.0.3 (tag: 0.2.0.3) 2012-07-24 02:41:34 +0200 Mike Gabriel (7b7cf8c) * Fix license header of setup.py file. 2012-07-23 22:23:47 +0200 Mike Gabriel (a2f536f) * Continue development... 2012-07-23 21:42:44 +0200 Mike Gabriel (406d0b9) * release 0.2.0.2 (tag: 0.2.0.2) 2012-07-23 21:42:30 +0200 Mike Gabriel (391558b) * Do not fail if HOME dir is read-only, needed for building with sbuild. 2012-06-11 07:49:01 +0200 Mike Gabriel (14c601f) * Continue development... 2012-06-08 23:45:12 +0200 Mike Gabriel (1ff2562) * release 0.2.0.1 (tag: 0.2.0.1) 2012-06-08 23:44:27 +0200 Mike Gabriel (3603cde) * increment __init__.py version 2012-06-08 23:43:57 +0200 Mike Gabriel (7cd1568) * Fix minus sign / hyphen mismatch in man page. 2012-06-08 23:14:30 +0200 Mike Gabriel (b91f7d8) * release 0.2.0.0 (tag: 0.2.0.0) 2012-06-08 23:14:04 +0200 Mike Gabriel (3816f7d) * changelog cleanup 2012-06-08 23:13:34 +0200 Mike Gabriel (a7e4fe0) * Depend on Python X2Go (>= 0.2.0.2). 2012-06-08 23:12:45 +0200 Mike Gabriel (1bcc08f) * bump upstream version to 0.2.0.0 2012-06-08 23:12:00 +0200 Mike Gabriel (b7fa23b) * Add __doc__ strings to __init__.py and frontend.py. 2012-04-12 11:24:42 +0200 Mike Gabriel (9f561fa) * lintian issue fixed: extra-license-file 2012-04-12 02:42:40 +0200 Mike Gabriel (fe3fea0) * add AGPLv3+ full text license 2012-04-12 01:08:30 +0200 Mike Gabriel (c522c0a) * license change to AGPLv3+ 2012-04-12 00:43:44 +0200 Mike Gabriel (9c63db3) * fix file permissions (x-bit) 2012-04-12 00:43:07 +0200 Mike Gabriel (c912754) * happy new year, license change to AGPLv3+ 2012-04-11 10:04:43 +0200 Mike Gabriel (844198f) * Add code to redirect stdout and stderr when frozen with py2exe. 2012-01-31 23:38:38 +0100 Mike Gabriel (a928969) * Replace non-code strings ,,X2go'' by ,,X2Go''. 2011-12-27 02:54:18 +0100 Mike Gabriel (d33f863) * Add proper license to copyright file. 2011-12-27 02:53:53 +0100 Mike Gabriel (c989f61) * Add python-suport (>=0.90) as dependency. Fix project name in control file. 2011-09-07 20:33:44 +0200 Mike Gabriel (9f2b5bd) * version increment 2011-09-07 20:19:43 +0200 Mike Gabriel (6225f29) * Release version 0.1.4.2 (tag: 0.1.4.2) 2011-09-07 20:16:04 +0200 Mike Gabriel (473364d) * Add cmd line option --auth-attempts. 2011-08-17 02:28:02 +0200 Mike Gabriel (d5c1ff7) * Update+rearrange man page. 2011-08-17 02:27:57 +0200 Mike Gabriel (1d7da12) * Add cmd line option --terminate-on-ctrl-c. 2011-08-17 02:07:09 +0200 Mike Gabriel (37ba4e6) * man page update 2011-08-17 02:03:22 +0200 Mike Gabriel (3e307a9) * Multiple achievements with this commit... 2011-07-26 14:27:52 +0200 Mike Gabriel (cde819a) * provide helper Makefile.docupload for uploading html man pages to code.x2go.org 2011-07-26 14:03:39 +0200 Mike Gabriel (efdb589) * remove html man pages as they are part of the build process 2011-07-06 22:18:30 +0200 Mike Gabriel (ba599ba) * version increment 2011-07-06 22:11:47 +0200 Mike Gabriel (47aa48b) * release of 0.1.4.1 (tag: 0.1.4.1) 2011-07-05 21:49:39 +0200 Mike Gabriel (0ec13f5) * Add --quiet option to disable any kind of log output. 2011-07-05 21:23:16 +0200 Mike Gabriel (2f472c5) * Fix for Ctrl-C comment when sharing a desktop. 2011-07-04 20:11:23 +0200 Mike Gabriel (4470716) * Depend on Python X2go 0.1.1.2. 2011-07-01 14:53:27 +0200 Mike Gabriel (09acccc) * README/TODO update, version increment. 2011-06-26 22:58:01 +0200 Mike Gabriel (30b1249) * React to bug #627990, prefer man2html-base over man2html. (tag: 0.1.4.0) 2011-06-24 17:16:35 +0200 Mike Gabriel (9e668c5) * egg version increment 2011-06-24 17:08:54 +0200 Mike Gabriel (7d859c5) * Terminate shared desktop sessions of Ctrl-C (instead of suspending them. 2011-06-13 23:49:34 +0200 Mike Gabriel (976a7bf) * Add X2go desktop sharing support. 2011-05-30 11:14:25 +0200 Mike Gabriel (094def2) * re-arranged man file locations and man2html build script 2011-05-26 12:06:49 +0200 Mike Gabriel (b285999) * type fix 2011-05-26 12:05:53 +0200 Mike Gabriel (edfc1f2) * changelog update 2011-05-26 12:04:55 +0200 Mike Gabriel (5c1b9d4) * fixes build sequence 2011-05-26 08:12:44 +0200 Mike Gabriel (1fe7fab) * version increment (tag: 0.1.3.3) 2011-05-25 20:01:32 +0200 Mike Gabriel (1ca4ece) * depends on new Python X2go version, updates dh dependency 2011-05-22 21:47:52 +0200 Mike Gabriel (c33d3ca) * man page update 2011-05-22 21:47:00 +0200 Mike Gabriel (678d0db) * updates html version of man page 2011-05-22 21:45:52 +0200 Mike Gabriel (4b41d82) * adds --session-profile option to man page 2011-05-22 20:57:44 +0200 Mike Gabriel (7d7b57a) * adds man2html build (so that we have readable man pages in Git) 2011-05-22 00:35:25 +0200 Mike Gabriel (c27646d) * typo fix in control file 2011-05-22 00:19:05 +0200 Mike Gabriel (0a74a70) * typo fix in man page 2011-05-22 00:18:04 +0200 Mike Gabriel (ce9b702) * man page version/date update 2011-05-22 00:16:59 +0200 Mike Gabriel (cacadc9) * explanation update for compat options (man page fix) 2011-05-22 00:15:17 +0200 Mike Gabriel (b5a8ddd) * --pack-type is actually only called --pack in pyhoca-cli (man page fix) 2011-05-22 00:13:46 +0200 Mike Gabriel (59fa51a) * update for --clean-sessions option in man page 2011-05-22 00:12:28 +0200 Mike Gabriel (b1947e2) * removes --import option from man page 2011-05-22 00:09:55 +0200 Mike Gabriel (85cab1f) * another typo in man page 2011-05-22 00:07:55 +0200 Mike Gabriel (f95573d) * typo in man page 2011-05-19 09:07:40 +0200 Mike Gabriel (9f0fba9) * adds VCS information to control file 2011-05-17 19:19:33 +0200 Mike Gabriel (382289d) * new FSF address 2011-05-17 13:08:02 +0200 Mike Gabriel (2b78360) * bugfix for --password rewrite code (tag: 0.1.3.2) 2011-05-17 13:06:30 +0200 Mike Gabriel (35b726c) * catching ValueError if --password is not given 2011-05-17 12:16:57 +0200 Mike Gabriel (1c38b7f) * man page update (tag: 0.1.3.1) 2011-05-17 12:08:32 +0200 Mike Gabriel (28ad6d7) * new line at end of file 2011-05-17 12:08:07 +0200 Mike Gabriel (013b280) * removed old build script 2011-05-17 12:07:52 +0200 Mike Gabriel (90090ef) * version increment, debian changelog entry 2011-05-17 11:50:50 +0200 Mike Gabriel (bdf71da) * moving setproctitle stanze further up, fixed typo 2011-05-17 11:47:52 +0200 Mike Gabriel (3ec0c5d) * reintroducing the --password option secured by setproctitle 2011-05-17 11:47:02 +0200 Mike Gabriel (970d692) * interpuctation beautification 2011-05-17 11:18:55 +0200 Mike Gabriel (73823b6) * adds setproctitle support 2011-05-17 10:33:45 +0200 Mike Gabriel (49946e4) * fixes list sessions output, depends on newest python-x2go code 2011-05-17 10:23:12 +0200 Mike Gabriel (ec91855) * fixed exitcode 2011-05-17 10:22:34 +0200 Mike Gabriel (004f5fc) * explicit logon failure after 3 attempts 2011-05-17 10:19:23 +0200 Mike Gabriel (f6b634b) * fail interactive authentication after 3 attempts 2011-05-17 10:17:14 +0200 Mike Gabriel (0a743f2) * if SSH privkey is not valid, use interactive auth 2011-05-17 10:10:42 +0200 Mike Gabriel (16f5dc6) * exchange -r option by -p 2011-05-17 10:07:44 +0200 Mike Gabriel (d4bf467) * getting rid of empty lines 2011-05-17 10:06:34 +0200 Mike Gabriel (c76c653) * work-around for Python bug http://bugs.python.org/issue11236 2011-05-17 09:48:36 +0200 Mike Gabriel (0b96e03) * only raising error if session_profile arg was specified 2011-05-17 09:47:51 +0200 Mike Gabriel (9914dc4) * raising a runtime error, if session profile name does not exist 2011-05-17 09:43:08 +0200 Mike Gabriel (d471d3d) * fixes UTF-8 error, session profile usage + password auth now fixed 2011-05-17 09:39:31 +0200 Mike Gabriel (473bfaf) * removal of debug code 2011-05-17 09:24:08 +0200 Mike Gabriel (a777014) * take user name from session profile if --session-profile is used 2011-05-17 09:17:49 +0200 Mike Gabriel (1dcc2cf) * typo fix, adds debug code 2011-05-17 09:16:24 +0200 Mike Gabriel (344e4b5) * change loglevel option from arg to kwarg parameter 2011-05-17 09:05:28 +0200 Mike Gabriel (571313b) * uses touch_file function from python-x2go API 2011-05-17 08:57:31 +0200 Mike Gabriel (7996e52) * fixes --list-sessions option 2011-05-17 06:58:45 +0200 Mike Gabriel (a834627) * updates for python build env 2011-05-17 06:54:50 +0200 Mike Gabriel (39421e5) * switches to native source format 2011-05-12 10:04:35 +0200 Mike Gabriel (8817568) * changeover to four digit version pattern 2011-05-12 10:02:33 +0200 Mike Gabriel (650fec3) * updates control file description 2011-05-12 09:24:12 +0200 Mike Gabriel (50939d1) * updates control file (prep for building on Launchpad) 2011-04-15 00:03:50 +0200 Mike Gabriel (043e167) * fixes the author and his email address 2011-02-03 12:56:29 +0100 Mike Gabriel (5e41b9f) * diverted symlink for development python-x2go code 2010-12-31 21:52:46 +0000 mike (19705a6) * * release: Python X2go 0.0.30 PyHoca-GUI 0.0.20 2010-12-31 01:20:56 +0000 mike (ff3c42c) * * built Debian/Ubuntu Packages - Python X2go 0.0.28 - PyHoca-GUI 0.0.18 - PyHoca-CLI 0.1.3 2010-12-30 23:10:32 +0000 mike (516921e) * * fixing handling of add_to_known_hosts and known_hosts parameters 2010-12-29 14:11:03 +0000 mike (002ed17) * Python X2go 2010-12-10 12:59:15 +0000 mike (7a1e35b) * * modified version string 2010-12-10 12:45:42 +0000 mike (43ae160) * * tagged pyhoca-cli 0.1.2 2010-12-10 12:23:05 +0000 mike (997f572) * * forcing use_cache to False when constructing X2goClient instance 2010-12-10 07:46:59 +0000 mike (57cf611) * * prepared for intermediate release * updated documentation (not readable, full of errors, but epydoc builds doc again) * renamed icons' path * disabling options and profilemanager menu for release builds * next commit will add new files... 2010-12-02 19:25:58 +0000 mike (4db6a85) * * indentation fix 2010-12-02 14:19:13 +0000 mike (6c88a4c) * * added known_host kwarg to X2goClient__register_session * added code that recognizes if we are running from development dir or from /usr/bin * some minor changes 2010-11-22 19:52:07 +0000 mike (4cc2161) * * disabled password on the command line (as it can be a security issue, the command line can be seen in the process view) * tasbar icon is not a sub-object of chooser any more 2010-11-21 18:14:38 +0000 mike (14cc8a3) * * fix for .ssh path creation 2010-11-21 13:56:12 +0000 mike (34ba3c7) * * added SSH rootdir variable to Python X2go 2010-11-21 13:43:28 +0000 mike (6a252cc) * * creating .ssh directory if not present 2010-11-21 13:36:17 +0000 mike (d63d6c9) * * move _touch_file further up in the code 2010-11-21 13:33:13 +0000 mike (a711bdc) * * added support for retrieving current local user from x2go module 2010-11-20 02:45:12 +0000 mike (0625392) * * pyhoca-cli build script 2010-11-19 22:28:09 +0000 mike (3e09aa9) * * wrong copyright header * removed Replaces:-line in control file 2010-11-13 21:25:23 +0000 mike (95b44ad) * * PyHocaCLI class and its X2goClient parent class now have separate loggers * X2goSessionExceptions are now caught more globally * allowing session profile option override from the command line 2010-11-11 09:02:25 +0000 mike (a99ff62) * * fixing name tag whe logging (to distinguish X2goClient instance logging and PyHocaCLI class logging) 2010-11-10 14:51:29 +0000 mike (7e59b3d) * * improved error handling for crash X2go session (integration in to PyHoca-CLI) 2010-11-09 22:01:18 +0000 mike (8ca39e2) * * PyHoca-CLI adaptations to changes in Python X2go API 2010-11-09 09:11:03 +0000 mike (e636fd3) * * adapted pyhoca-cli to changes in X2goClient API (strict separation of session profile based methods and session oriented methods) 2010-11-07 01:00:35 +0000 mike (03caa0a) * * added --list-profiles option to PyHoca CLI 2010-11-07 00:34:00 +0000 mike (a077a98) * * added --session-profile option (run a session profile as configured in ~/.x2goclient/sessions) 2010-11-05 23:50:49 +0000 mike (4e17df0) * * intermediate check-in on the way of proper session profile handling 2010-11-01 18:33:04 +0000 mike (7671d39) * * using double underscore method names for core methods in X2goClient 2010-11-01 09:51:07 +0000 mike (64696c5) * * re-added pyhoca-cli symlinks to Python X2go working copy 2010-11-01 09:50:29 +0000 mike (5cf374a) * * fixed pyhoca-cli 2010-10-29 12:21:30 +0000 mike (a492d59) * * pyhoca-cli is currently broken... * temporarily removed symlinks to local Python X2go copy * initial bugfixing 2010-10-28 21:24:00 +0000 mike (e886078) * * remove ppring import * added __doc__ strings that allude that documentation work is still missing 2010-10-28 21:19:05 +0000 mike (052f052) * * completely egg'ified / class'ified PyHocaCLI -> PyHocaCLI(args, logger, liblogger) can now be called from within your programmes 2010-10-28 17:19:51 +0000 mike (8a10b82) * * an example skeleton (not functional yet) for a common file hierarchy for PyHoca CLI+GUI 2010-10-24 16:05:49 +0000 mike (f5102f6) * * added folder for pyhoca-cli based GUI (name may still change) 2010-10-24 15:44:51 +0000 mike (5b39fdf) * * re-importing projects pyhoca-cli-0.6.1.3/COPYING0000644000000000000000000010333314471055441011640 0ustar GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. 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 them 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. Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software. A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public. The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version. An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU Affero General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey 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; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If 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 convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Remote Network Interaction; Use with the GNU General Public License. Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU Affero 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 that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. 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. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 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. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. 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 state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program 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. 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. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements. You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see . pyhoca-cli-0.6.1.3/Makefile.docupload0000644000000000000000000000111414471055441014210 0ustar #!/usr/bin/make -f # Makefile.docupload file - for pyhoca-cli # Copyright 2010-2023 by Mike Gabriel , AGPLv3+ applies to this file VERSION=`head -n1 debian/changelog | sed 's,.*(\(.*\)).*,\1,' | cut -d"-" -f1` DOC_HOST=code.x2go.org DOC_PATH=/srv/sites/x2go.org/packages/doc/pyhoca-cli/man/ DOC_USER=x2go-admin doc: docbuild docupload docbuild: make -f Makefile.man2html build_man2html docupload: ssh -l${DOC_USER} ${DOC_HOST} "{ mkdir -p ${DOC_PATH}; rm -Rfv ${DOC_PATH}/*; }" scp -r .build_man2html/html/* ${DOC_USER}@${DOC_HOST}:${DOC_PATH}/ pyhoca-cli-0.6.1.3/Makefile.man2html0000644000000000000000000000067114471055441013767 0ustar #!/usr/bin/make -f MAN2HTML_BIN = man2html MAN2HTML_SRC = man MAN2HTML_DEST = .build_man2html/html man_pages = `cd $(MAN2HTML_SRC) && find * -type f` all: build build: build_man2html build_man2html: mkdir -p $(MAN2HTML_DEST) for man_page in $(man_pages); do mkdir -p `dirname $(MAN2HTML_DEST)/$$man_page`; done for man_page in $(man_pages); do $(MAN2HTML_BIN) -r $(MAN2HTML_SRC)/$$man_page > $(MAN2HTML_DEST)/$$man_page.html; done pyhoca-cli-0.6.1.3/man/man1/pyhoca-cli.10000644000000000000000000003424514471055441014333 0ustar '\" -*- coding: 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 pyhoca-cli 1 "Aug 2023" "Version 0.6.1.3" "X2Go Application" .SH NAME pyhoca-cli \- X2Go command line client written in Python .SH SYNOPSIS 'nh .fi .ad l \fBpyhoca-cli\fR \kx .if (\nx>(\n(.l/2)) .nr x (\n(.l/5) 'in \n(.iu+\nxu [ \fIoptions\fR ] [[\fI@\fR]\fI\fR] 'in \n(.iu-\nxu .ad b 'hy .SH DESCRIPTION \fBpyhoca-cli\fR aims to be a cross-platform (Windows, Mac OS X, Linux) X2Go command line client written in Python. .PP You can use it for scripting remote X2Go sessions or simply starting, resuming or shadowing X2Go sessions from the command line in a terminal. .PP It supports versatile command line options as well as parsing \fBx2goclient\fR configuration files. .PP See the included README and TODO for further information on \fBpyhoca-cli\fR. .SH COMMON OPTIONS \fBpyhoca-cli\fR accepts the following common options: .TP \*(T<\fB\-h, \-\-help\fR\*(T> Display a help with all available command line options and exit. .TP \*(T<\fB\-V, \-\-version\fR\*(T> Output version information and exit. .TP \*(T<\fB\-\-quiet\fR\*(T> No output to stdout at all! .TP \*(T<\fB\-d, \-\-debug\fR\*(T> Enable debugging output. .TP \*(T<\fB\-\-libdebug\fR\*(T> Enable debugging code of the underlying Python X2Go module. .TP \*(T<\fB\-\-libdebug-sftpxfer\fR\*(T> .TP \*(T<\fB\-\-list\-cmdline\-features\fR\*(T> Print a machine-readable list of client-side features to STDOUT and exit. Enable debugging code of Python X2Go's sFTP server code (very verbose, and it may even reveal promiscuous data). .SH SERVER / SESSION PROFILE You either have to specify a server name or a pre-configured X2GoClient session profile to tell \fBpyhoca-cli\fR to what X2Go server to connect. \fBpyhoca-cli\fR will not start if neither of these two options has been given on the command line. .TP \*(T<\fB\-\-server\fR \fI\fR\*(T> Legacy parameter, still supported, but using positional argument [\fI@\fR]\fI\fR] should become your preferred syntax. .TP \*(T<\fB\-P, \-\-session-profile\fR \fI\fR\*(T> The name of the session profile to be used to make the connection. .TP \*(T<\fB\-\-non\-interactive\fR\*(T> Enforce non-interactive mode. Avoid any TTY interaction during runtime. .SH ACTIONS \fBpyhoca-cli\fR accepts exclusively one of the listed actions: .TP \*(T<\fB\-N, \-\-new\fR\*(T> Start a new X2Go session on server (default mode if no mode is explicitly specified). .TP \*(T<\fB\-\-try\-resume\fR\*(T> When given with \fI\-\-new\fR , try finding and resuming a session originally started with the same command. If that fails, start a new session, finally. .TP \*(T<\fB\-R, \-\-resume\fR \fI\fR\*(T> Resume existing X2Go session on server. Special values for are ,,NEWEST'' (will resume youngest session) or ,,OLDEST'' (resume session with oldest timestamp). .TP \*(T<\fB\-D, \-\-share-desktop\fR \fI@\fR\*(T> Share an X2Go session on the remote server specified by @, whereas can be the same user that is starting the share mode session or any other user that grants X2Go desktop sharing for the current user. .TP \*(T<\fB\-S, \-\-suspend\fR \fI\fR\*(T> Suspend running X2Go session . A special value for is ,,ALL'' (will suspend all sessions of the connected user). .TP \*(T<\fB\-T, \-\-terminate\fR \fI\fR\*(T> Terminate running X2Go session . A special value for is ,,ALL'' (will terminate all sessions of the connected user). .TP \*(T<\fB\-L, \-\-list-sessions\fR\*(T> List user's X2Go sessions on server. .TP \*(T<\fB\-\-list-profiles\fR\*(T> List user's X2Go session profiles configure on this client. .TP \*(T<\fB\-\-from-stdin\fR\*(T> For LightDM remote login integration: read from STDIN' and start a new session, transfer a running session or resume a suspended session. If there are several sessions running/suspended of the same desktop shell, then the first session found will be transferred/resumed. If there are several sessions running with a different desktop shell as session type (or even rootless sessions) none of these session will be touched unless any of the discovered sessions match in the requested desktop shell (i.e. X2Go session type). This option is only available for the Linux version of \fBpyhoca-cli\fR. .SH ACTION OPTIONS \fBpyhoca-cli\fR actions can be tweaked by these options: .TP \*(T<\fB\-\-clean-sessions\fR\*(T> Clean all of the user's suspended/running sessions before starting a new one on the named X2Go server. .TP \*(T<\fB\-\-terminate-on-ctrl-c\fR\*(T> Terminate the connected session when pressing CTRL+C (instead of suspending the session). .SH X2GO OPTIONS .TP \*(T<\fB\-c, \-\-command\fR \fI\fR\*(T> Command to run with \fB\-\-new\fR mode on server (default: xterm). .TP \*(T<\fB\-l, \-u, \-\-username\fR \fI\fR\*(T> Username for the session (default: currently logged in user). .TP \*(T<\fB\-\-password\fR \fI\fR\*(T> User password for this session. If a matching private SSH key is available this one will be preferred for authentication. The cleartext password that has been specified at the command line will be masqueraded in the systems process list (Linux, MacOS). On Windows systems the usage of the \-\-password option is forbidden. .TP \*(T<\fB\-\-force-password\fR\*(T> Enforce authentication with username and password, prohibit SSH public/private key authentication. .TP \*(T<\fB\-p, \-\-remote-ssh-port\fR \fI\fR\*(T> Remote X2Go server's SSH port (default: 22). .TP \*(T<\fB\-i, \-k, \-\-ssh-privkey\fR \fI\fR\*(T> Use file as private key for SSH connections (default: ~/.ssh/id_rsa). .TP \*(T<\fB\-\-add\-to\-known\-hosts\fR\*(T> Add RSA/DSA host key to ~/.ssh/known_hosts if authenticity of server can't be established (default: not set). .TP \*(T<\fB\-A, \-\-forward\-sshagent\fR\*(T> Enable SSH agent forwarding. .TP \*(T<\fB\-\-sound\fR \fI{pulse|esd|none}\fR\*(T> X2Go server's sound system (default: 'pulse'). .TP \*(T<\fB\-F, \-\-share-local-folders\fR \fI[,[,...]]\fR\*(T> A comma separated list of local folders that shall be made available in the remote X2Go session. .TP \*(T<\fB\-\-printing\fR\*(T> Use X2Go printing (default: disabled). .TP \*(T<\fB\-\-share-mode\fR \fI{0|1}\fR\*(T> Share mode for X2Go desktop sharing (0: view-only, 1: full access). .TP \*(T<\fB\-\-kdrive\fR\*(T> As graphical backend use the X2Go Kdrive Xserver instead of the default NXv3 Xserver. .TP \*(T<\fB\-\-auth-attempts\fR \fI{0,1,2,3,...}\fR\*(T> 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 BROKER OPTIONS In case you want to retrieve X2Go session profiles from an X2Go Session Broker use the following options: .TP \*(T<\fB\-\-broker-url=\fR\*(T> Specify the of the X2Go Session Broker. \fBpyhoca-cli\fR can access http:// and ssh:// style URLs. Syntax of for HTTP brokerage: http(s)://:@:/path/to/broker Syntax of for SSH brokerage: ssh://:@:/usr/bin/x2gobroker (or any executable that provides the broker via SSH). .TP \*(T<\fB\-\-broker-password \fR\*(T> Session broker password for retrieving session profiles from the X2Go Session Broker. The cleartext password that has been specified at the command line will be masqueraded in the systems process list (Linux, MacOS). On Windows systems the usage of the \-\-broker-password option is forbidden. .TP \*(T<\fB\-\-broker-cacertfile=\fR\*(T> NOT IMPLEMENTED YET: 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> NOT IMPLEMENTED YET: The X2Go Session Broker is accessible without authentication. .TP \*(T<\fB\-\-auth-id=\fR\*(T> NOT IMPLEMENTED YET: Use this 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> NOT IMPLEMENTED YET: 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=\fR\*(T> NOT IMPLEMENTED YET: For SSH based X2Go Session Brokers. Full path to a valid SSH private key file. (Not implemented, yet). .SH SESSION OPTIONS (NXv3 or X2GoKDrive) .TP \*(T<\fB\-g, \-\-geometry\fR \fI{x|fullscreen|maximize}\fR\*(T> Screen geometry (default: '800x600'). .TP \*(T<\fB\-\-dpi\fR \fI\fR\*(T> Launch X2Go session's Xserver with resolution (in dots per inch). .TP \*(T<\fB\-\-xinerama\fR\*(T> Enable Xinerama support for multi-head setups. Requires X2Go Server 4.1.0.0 (or newer). .TP \*(T<\fB\-q, \-\-link\fR \fI{modem|isdn|adsl|wan|lan}\fR\*(T> Link quality (default: 'adsl') .TP \*(T<\fB\-C, \-\-clipboard\-mode\fR \fI{none|server|client|both}\fR\*(T> Clipboard mode (default: \'both\' directions, other allowed values: \'none\' for no clipboard support, \'client\' to server copy+pasting only, \'server\' to client copy+pasting only) .TP \*(T<\fB\-t, \-\-session\-type\fR \fI{desktop|application}\fR\*(T> Session type (default: 'application'). Note: there are also some auto-detection feature for the session type built into the code. It might not always happen what you expect from setting this option. .TP \*(T<\fB\-\-pack\fR \fI\fR\*(T> Compression method (see below for possible values). .TP \*(T<\fB\-\-kbd\-layout\fR \fI{us|de|fr|...}\fR\*(T> Use keyboard layout (default: 'null'). .TP \*(T<\fB\-\-kbd\-type\fR \fI{auto|pc105/us|pc105/de|...}\fR\*(T> Set Keyboard type (default 'auto'). Use \fIauto\fR as value here to enable X2Go's keyboard auto-detection code. .SH BACKEND OPTIONS \fBpyhoca-gui\fR supports transparent use of different data backends. For configuration three backends are common: FILE, GCONF (Linux only) and WINREG (Windows only). The default backend currently is the FILE backend on all platforms. .PP For client-server communication the only yet implemented backend is the STDOUT backend (as X2Go server commands print their execution results to /dev/stdout. (But other communication backends might be possible in the future...). .PP In the same way we are focusing on a successor of the current NX3 agent/proxy tool. A change in the proxy backend will also be implemented as a backend. .TP \*(T<\fB\-\-backend-controlsession \fR\*(T> Force usage of a certain CONTROLSESSION_BACKEND (do not use this unless you know exactly what you are doing). .TP \*(T<\fB\-\-backend-terminalsession \fR\*(T> Force usage of a certain TERMINALSESSION_BACKEND (do not use this unless you know exactly what you are doing). .TP \*(T<\fB\-\-backend-serversessioninfo \fR\*(T> Force usage of a certain SERVERSESSIONINFO_BACKEND (do not use this unless you know exactly what you are doing). .TP \*(T<\fB\-\-backend-serversessionlist \fR\*(T> Force usage of a certain SERVERSESSIONLIST_BACKEND (do not use this unless you know exactly what you are doing). .TP \*(T<\fB\-\-backend-proxy \fR\*(T> Force usage of a certain PROXY_BACKEND (do not use this unless you know exactly what you are doing). .TP \*(T<\fB\-\-backend-sessionprofiles \fR\*(T> Use given backend for accessing session profiles, available backends on Linux: FILES, GCONF; on Windows: FILES, WINREG. .TP \*(T<\fB\-\-backend-clientsettings \fR\*(T> Use given backend for accessing the client settings configuration, available backends on Linux: FILES, GCONF; on Windows: FILES, WINREG. .TP \*(T<\fB\-\-backend-clientprinting \fR\*(T> Use given backend for accessing the client printing configuration, available backends on Linux: FILES, GCONF; on Windows: FILES, WINREG..SH COMPATIBILITY OPTIONS \fBpyhoca-cli\fR aims at being fully compatible with all command line options and session config files of the X2Go project's X2Go command line client \fBx2goclient-cli\fR as well as the \fBx2goclient\fR GUI. This is still work in progress. To achieve this, some compatibility options have already been added: .TP \*(T<\fB\-\-port\fR \fI\fR\*(T> Compatibility option, synonymous to \fB\-\-remote\-ssh\-port\fR \fI\fR. .TP \*(T<\fB\-\-ssh\-key\fR \fI\fR\*(T> Compatibility option, synonymous to \fB\-\-ssh-privkey\fR \fISSH_KEY\fR. .TP \*(T<\fB\-\-use\-sound\fR \fI{yes|no}\fR\*(T> Compatibility option, synonymous to \fB\-\-sound\fR \fI{pulse|none}\fR. .TP \*(T<\fB\-\-client-ssh-port\fR \fI\fR\*(T> Compatibility option for the x2goclient GUI. PyHoca-Cli (resp. Python X2Go) brings its own internal sFTP server. Thus, this option will be ignored. .SH NX COMPRESSION METHODS As NX compression methods (\fB--pack\fR option) the following values are possible. The % character must be replaced by a digit 0-9. .PP nopack, 8, 64, 256, 512, 4k, 32k, 64k, 256k, 2m, 16m 256-rdp, 256-rdp-compressed, 32k-rdp, 32k-rdp-compressed, 64k-rdp 64k-rdp-compressed, 16m-rdp, 16m-rdp-compressed rfb-hextile, rfb-tight, rfb-tight-compressed 8-tight, 64-tight, 256-tight, 512-tight, 4k-tight, 32k-tight 64k-tight, 256k-tight, 2m-tight, 16m-tight 8-jpeg-%, 64-jpeg, 256-jpeg, 512-jpeg, 4k-jpeg, 32k-jpeg 64k-jpeg, 256k-jpeg, 2m-jpeg, 16m-jpeg-% 8-png-jpeg-%, 64-png-jpeg, 256-png-jpeg, 512-png-jpeg, 4k-png-jpeg 32k-png-jpeg, 64k-png-jpeg, 256k-png-jpeg, 2m-png-jpeg, 16m-png-jpeg-% 8-png-%, 64-png, 256-png, 512-png, 4k-png 32k-png, 64k-png, 256k-png, 2m-png, 16m-png-% 16m-rgb-%, 16m-rle-% .SH "SEE ALSO" \fB/usr/share/doc/python-x2go\fR .SH AUTHOR This manual has been written by for the X2Go project (https://www.x2go.org) by Mike Gabriel pyhoca-cli-0.6.1.3/pyhoca-cli0000755000000000000000000007174614471055441012577 0ustar #!/usr/bin/python3 # -*- coding: utf-8 -*- # Copyright (C) 2010-2023 by Mike Gabriel # # PyHoca CLI 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. # # PyHoca CLI 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. # # Contributors to the code of this programme: # 2010 Dick Kniep # 2010 Jörg Sawatzki ### ### module section ### import x2go import sys import os import re PROG_NAME = os.path.basename(sys.argv[0]).replace('.exe', '') PROG_PID = os.getpid() if hasattr(sys, 'frozen') and sys.frozen in ("windows_exe", "console_exe"): class Win32_Logging(object): softspace = 0 _fname = os.path.join(os.environ['AppData'], PROG_NAME, '%s.log' % PROG_NAME) _file = None def __init__(self, filemode='a'): self._filemode = filemode def write(self, text, **kwargs): if self._file is None: try: try: os.mkdir(os.path.dirname(self._fname)) except: pass self._file = open(self._fname, self._filemode) except: pass else: self._file.write(text) self._file.flush() def flush(self): if self._file is not None: self._file.flush() sys.stdout = Win32_Logging(filemode='w+') sys.stderr = Win32_Logging(filemode='a') del Win32_Logging app = sys.argv[0] if app.startswith('./'): sys.path.insert(0, os.getcwd()) os.environ['PYTHONX2GO_LOCAL'] = '1' PROG_OPTIONS = " ".join(sys.argv[1:]).replace("=", " ").split() try: _password_index = PROG_OPTIONS.index('--password')+1 PROG_OPTIONS[_password_index] = "XXXXXXXX" except ValueError: # ignore if --password option is not specified pass try: _broker_password_index = PROG_OPTIONS.index('--broker-password')+1 PROG_OPTIONS[_broker_password_index] = "XXXXXXXX" except ValueError: # ignore if --broker-password option is not specified pass from x2go import X2GOCLIENT_OS as _X2GOCLIENT_OS if _X2GOCLIENT_OS in ('Linux', 'Mac'): import setproctitle setproctitle.setproctitle("%s %s" % (PROG_NAME, " ".join(PROG_OPTIONS))) import argparse import paramiko # Python X2Go provides the current local username (OS independent) from x2go.defaults import CURRENT_LOCAL_USER as current_user from x2go.defaults import X2GO_PRINT_ACTIONS from x2go.defaults import DEFAULT_PDFVIEW_CMD from x2go.defaults import DEFAULT_PDFSAVE_LOCATION from x2go.defaults import DEFAULT_PRINTCMD_CMD from x2go import BACKENDS from pyhoca.cli import current_home, PyHocaCLI, runtime_error # version information from pyhoca.cli import __VERSION__ as _version VERSION=_version VERSION_TEXT=""" %s[%s] - an X2Go command line client written in Python ---------------------------------------------------------------------- developed by Mike Gabriel VERSION: %s """ % (PROG_NAME, PROG_PID, VERSION) PRINT_ACTIONS = X2GO_PRINT_ACTIONS.keys() logger = x2go.X2GoLogger() liblogger = x2go.X2GoLogger() ### ### command line arguments ### # exclusive client control options action_options = [ {'args':['-N','--new'], 'default': False, 'action': 'store_true', 'help': 'start a new X2Go session on server (default)', }, {'args':['--try-resume'], 'default': False, 'action': 'store_true', 'help': 'if given with --new, try to resume a running/suspended session, otherwise start a new session', }, {'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', }, {'args':['-S','--suspend'], 'default': None, 'metavar': 'SESSION_NAME', 'help': 'suspend running X2Go session SESSION_NAME', }, {'args':['-T','--terminate'], 'default': None, 'metavar': 'SESSION_NAME', 'help': 'terminate running X2Go session SESSION_NAME', }, {'args':['-L','--list-sessions'], 'default': False, 'action': 'store_true', 'help': 'list user\'s X2Go sessions on server', }, {'args':['--list-desktops'], 'default': False, 'action': 'store_true', 'help': 'list X2Go desktop sessions that are available for sharing', }, {'args':['--list-profiles'], 'default': False, 'action': 'store_true', 'help': 'list user\'s X2Go pre-configured session profiles', }, {'args':['-P','--session-profile'], 'default': None, 'help': 'load x2goclient session profiles and use the session profile SESSION_PROFILE', }, {'args':['--list-cmdline-features'], 'default': False, 'action': 'store_true', 'help': 'show a list of parseable command line features available in this PyHoca-CLI version', }, {'args':['--non-interactive'], 'default': False, 'action': 'store_true', 'help': 'Prevent PyHoca-CLI from ever interactively asking for a password', }, ] action_features = [ 'NEW', 'TRY_RESUME', 'RESUME', 'SHARE_DESKTOP', 'SUSPEND', 'TERMINATE', 'LIST_SESSIONS', 'LIST_DESKTOPS', 'SESSION_PROFILE', 'LIST_CLIENT_FEATURES', 'NON_INTERACTIVE', ] if _X2GOCLIENT_OS == "Linux": action_options.append( {'args':['--from-stdin'], 'default': False, 'action': 'store_true', 'help': 'for LightDM remote login: read from STDIN', }, ) # 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', }, {'args':['--libdebug-sftpxfer'], 'default': False, 'action': 'store_true', 'help': 'enable debugging code of Python X2Go\'s sFTP server code (very verbose, and even promiscuous)', }, {'args':['-V', '--version'], 'default': False, 'action': 'store_true', 'help': 'print version number and exit', }, ] debug_features = [ 'DEBUG', 'QUIET', 'LIBDEBUG', 'LIBDEBUG_SFTPXFER', ] # possible programme options are 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':['-l', '-u','--username'], 'default': None, 'help': 'username for the session (default: current user)', }, {'args':['--password'], 'default': None, 'help': 'user password for session authentication', }, {'args':['--force-password'], 'default': False, 'action': 'store_true', 'help': 'enforce username/password authentication', }, {'args':['-p','--remote-ssh-port'], 'default': '22', 'help': 'remote SSH port (default: 22)', }, {'args':['-i', '-k','--ssh-privkey'], 'default': None, 'help': 'use file \'SSH_PRIVKEY\' as private key for the SSH connection (e.g. ~/.ssh/id_rsa)', }, {'args':['--ssh-passphrase'], 'default': None, 'help': 'use passphrase to unlock private key \'SSH_PRIVKEY\' for the SSH connection.', }, {'args':['--add-to-known-hosts'], 'default': False, 'action': 'store_true', 'help': 'add RSA host key fingerprint to ~/.ssh/known_hosts if authenticity of server can\'t be established (default: not set)', }, {'args':['--sound'], 'default': 'pulse', 'choices': ('pulse', 'esd', 'none'), 'help': 'X2Go server sound system (default: \'pulse\')', }, {'args':['--printing'], 'default': False, 'action': 'store_true', 'help': 'use X2Go printing (default: disabled)', }, {'args':['--share-mode'], 'default': 0, 'help': 'share mode for X2Go desktop sharing (0: view-only, 1: full access)', }, {'args':['-F', '--share-local-folders'], 'metavar': '[,x\' or \'fullscreen\' (default: \'800x600\')',}, {'args':['-x','--xinerama'], 'default': False, 'action': 'store_true', 'help': 'enable Xinerama support in remote X2Go session',}, {'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\')', }, {'args':['--pack'], 'default': '16m-jpeg-9', 'help': 'compression methods (see below for possible values)', }, {'args':['--kbd-type'], 'default': 'auto', 'help': 'set Keyboard type (default: \'auto\', other allowed options: \'pc105/us\', \'pc105/de\', etc.)',}, {'args':['--kbd-layout'], 'default': 'null', 'help': 'use keyboard layout (default: \'null\', allowed options: \'de\', \'fr\', etc.)',}, {'args':['-C', '--clipboard-mode'], 'default': 'both', 'help': 'configure clipboard mode (default: \'both\' directions, other allowed values: \'none\' for no clipboard support, \'client\' to server copy+pasting only, \'server\' to client copy+pasting only)',}, {'args':['--dpi'], 'default': None, 'help': 'resolution (in dots per inch) to be used by the X2Go session\'s Xserver', }, ] session_features =[ 'GEOMETRY', 'XINERAMA', 'LINK', 'SESSION_TYPE', 'PACK', 'KBD_TYPE', 'KBD_LAYOUT', 'CLIPBOARD_MODE', 'DPI', ] 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}', }, {'args':['--client-ssh-port'], 'default': None, 'help': 'compatibility option for the x2goclient GUI; as Python X2Go brings its own internal SFTP server, this option will be ignored', }, ] _profiles_backend_default = BACKENDS['X2GoSessionProfiles']['default'] _settings_backend_default = BACKENDS['X2GoClientSettings']['default'] _printing_backend_default = BACKENDS['X2GoClientPrinting']['default'] if _X2GOCLIENT_OS == 'Windows': _config_backends = ('FILE', 'WINREG') elif _X2GOCLIENT_OS == 'Linux': _config_backends = ('FILE', 'GCONF') else: _config_backends = ('FILE') backend_options = [ {'args':['--backend-controlsession'], 'default': None, 'metavar': '', 'choices': BACKENDS['X2GoControlSession'].keys(), 'help': 'force usage of a certain CONTROLSESSION_BACKEND (do not use this unless you know exactly what you are doing)', }, {'args':['--backend-terminalsession'], 'default': None, 'metavar': '', 'choices': BACKENDS['X2GoTerminalSession'].keys(), 'help': 'force usage of a certain TERMINALSESSION_BACKEND (do not use this unless you know exactly what you are doing)', }, {'args':['--backend-serversessioninfo'], 'default': None, 'metavar': '', 'choices': BACKENDS['X2GoServerSessionInfo'].keys(), 'help': 'force usage of a certain SERVERSESSIONINFO_BACKEND (do not use this unless you know exactly what you are doing)', }, {'args':['--backend-serversessionlist'], 'default': None, 'metavar': '', 'choices': BACKENDS['X2GoServerSessionList'].keys(), 'help': 'force usage of a certain SERVERSESSIONLIST_BACKEND (do not use this unless you know exactly what you are doing)', }, {'args':['--backend-proxy'], 'default': None, 'metavar': '', 'choices': BACKENDS['X2GoProxy'].keys(), 'help': 'force usage of a certain PROXY_BACKEND (do not use this unless you know exactly what you are doing)', }, {'args':['--backend-sessionprofiles'], 'default': None, 'metavar': '', 'choices': _config_backends, 'help': 'use given backend for accessing session profiles, available backends on your system: %s (default: %s)' % (', '.join(_config_backends), _profiles_backend_default), }, {'args':['--backend-clientsettings'], 'default': None, 'metavar': '', 'choices': _config_backends, 'help': 'use given backend for accessing the client settings configuration, available backends on your system: %s (default: %s)' % (', '.join(_config_backends), _settings_backend_default), }, {'args':['--backend-clientprinting'], 'default': None, 'metavar': '', 'choices': _config_backends, 'help': 'use given backend for accessing the client printing configuration, available backends on your system: %s (default: %s)' % (', '.join(_config_backends), _printing_backend_default), }, ] ### ### beginning of code ### # print version text and exit def version(): print("%s" % VERSION_TEXT) sys.exit(0) def list_features(): feature_list = action_features \ + debug_features \ + x2go_features \ + ssh_features \ + print_features \ + broker_features \ + session_features feature_list.sort() for f in feature_list: print(f) sys.exit(0) def parseargs(): global logger global liblogger p = argparse.ArgumentParser(description='X2Go command line client implemented in Python.',\ epilog=""" Possible values for the --pack NX option are: %s """ % x2go.defaults.pack_methods_nx3_formatted, \ formatter_class=argparse.RawDescriptionHelpFormatter, \ add_help=True, argument_default=None) p_reqargs = p.add_argument_group('X2Go server name is always required') p_reqargs.add_argument('--server', help='server hostname or IP address') p_actionopts = p.add_argument_group('client actions') p_debugopts = p.add_argument_group('debug options') p_x2goopts = p.add_argument_group('X2Go options') p_sshopts = p.add_argument_group('SSH options') p_printopts = p.add_argument_group('X2Go print options') p_brokeropts = p.add_argument_group('X2Go Session Broker client options') p_sessionopts = p.add_argument_group('Session (NXv3 / X2GoKDrive) options') p_backendopts = p.add_argument_group('Python X2Go backend options (for experts only)') p_compatopts = p.add_argument_group('compatibility options') for (p_group, opts) in ((p_x2goopts, x2go_options), (p_sshopts, ssh_options), (p_printopts, print_options), (p_brokeropts, broker_options), (p_actionopts, action_options), (p_debugopts, debug_options), (p_sessionopts, session_options), (p_backendopts, backend_options), (p_compatopts, compat_options)): for opt in opts: args = opt['args'] del opt['args'] p_group.add_argument(*args, **opt) p.add_argument('host', nargs='?', default=None, help='host to connect to (as alternative to --server option)') a = p.parse_args() if a.debug: logger.set_loglevel_debug() if a.libdebug: liblogger.set_loglevel_debug() if a.quiet: logger.set_loglevel_quiet() liblogger.set_loglevel_quiet() if a.libdebug_sftpxfer: liblogger.enable_debug_sftpxfer() if a.password and _X2GOCLIENT_OS == "Windows": runtime_error("The --password option is forbidden on Windows platforms", parser=p, exitcode=222) if a.version: version() if a.list_cmdline_features: list_features() if type(a.host) == str and not a.username and "@" in a.host: a.username = a.host.split('@')[0] a.host = '@'.join(a.host.split('@')[1:]) # if no username is given we use the uid under which this programme is run if a.username is None and not a.session_profile: a.username = current_user if not (a.session_profile or a.list_profiles): if a.host and not a.server: a.server = a.host # the --server (or --session-profile) option is required for most operations if not a.server and not a.from_stdin: runtime_error ("argument --server (or --session-profile) is required", parser=p, exitcode=1) # check for mutual exclusiveness of -N, -R, -S, -T and -L, -N is default if none of them is set if bool(a.new) + bool(a.resume) + bool(a.share_desktop) + bool(a.suspend) + bool(a.terminate) + bool(a.list_sessions) + bool(a.list_desktops) + bool(a.list_profiles)> 1: runtime_error ("modes --new, --resume, --share-desktop, --suspend, --terminate, --list-sessions, --list-desktops and --list-profiles are mutually exclusive", parser=p, exitcode=2) if bool(a.new) + bool(a.resume) + bool(a.share_desktop) + bool(a.suspend) + bool(a.terminate) + bool(a.list_sessions) + bool(a.list_desktops) + bool(a.list_profiles) == 0: a.new = True # check if pack method is available if not x2go.utils.is_in_nx3packmethods(a.pack): runtime_error("unknown pack method '%s'" % args.pack, parser=p, exitcode=10) else: if not (a.resume or a.share_desktop or a.suspend or a.terminate or a.list_sessions or a.list_desktops or a.list_profiles): a.new = True # X2Go printing if ((a.pdfview_cmd and a.printer) or (a.pdfview_cmd and a.save_to_folder) or (a.pdfview_cmd and a.print_cmd) or (a.printer and a.save_to_folder) or (a.printer and a.print_cmd) or (a.print_cmd and a.save_to_folder)): runtime_error("--pdfviewer, --save-to-folder, --printer and --print-cmd options are mutually exclusive", parser=p, exitcode=81) if a.pdfview_cmd: a.print_action = 'PDFVIEW' elif a.save_to_folder: a.print_action = 'PDFSAVE' elif a.printer: a.print_action = 'PRINT' elif a.print_cmd: a.print_action = 'PRINTCMD' if a.pdfview_cmd is None and a.print_action == 'PDFVIEW': a.pdfview_cmd = DEFAULT_PDFVIEW_CMD if a.save_to_folder is None and a.print_action == 'PDFSAVE': a.save_to_folder = DEFAULT_PDFSAVE_LOCATION if a.printer is None and a.print_action == 'PRINT': # None means CUPS default printer... a.printer = None if a.print_cmd is None and a.print_action == 'PRINTCMD': a.print_cmd = DEFAULT_PRINTCMD_CMD a.print_action_args = {} if a.pdfview_cmd: a.print_action_args={'pdfview_cmd': a.pdfview_cmd, } elif a.save_to_folder: a.print_action_args={'save_to_folder': a.save_to_folder, } elif a.printer: a.print_action_args={'printer': a.printer, } elif a.print_cmd: a.print_action_args={'print_cmd': a.print_cmd, } ### take care of compatibility options # option --use-sound yes as synonomyn for --sound if a.use_sound is not None: if a.use_sound == 'yes': a.sound = 'pulse' if a.use_sound == 'no': a.sound = 'none' if a.ssh_key is not None: a.ssh_privkey = a.ssh_key if a.port is not None: a.remote_ssh_port = a.port if a.share_local_folders is not None: a.share_local_folders = a.share_local_folders.split(',') try: _dummy = int(a.auth_attempts) except ValueError: runtime_error ("value for cmd line argument --auth-attempts has to be of type integer", parser=p, exitcode=1) if int(a.auth_attempts) < 1: a.auth_attempts = "1" # --non-interactive option. if a.non_interactive and a.force_password and not a.password: runtime_error ("--non-interactive in combination with --force-password needs --password cmdline option", parser=p, exitcode=1) if a.non_interactive: logger('in case of a authentication failure, pyhoca-cli will *NOT* ' 'interactively ask for a password.', x2go.loglevel_WARN, ) else: logger('in case of a authentication failure, pyhoca-cli will ' 'interactively ask for a password.', x2go.loglevel_WARN, ) if a.server: ##### TODO: ssh_config to be moved into Python X2Go!!!! ### ### initialize SSH context ### # check if SERVER is in .ssh/config file, extract information from there... ssh_config = paramiko.SSHConfig() from pyhoca.cli import ssh_config_filename ssh_config_fileobj = open(ssh_config_filename) ssh_config.parse(ssh_config_fileobj) ssh_host = ssh_config.lookup(a.server) if ssh_host: if 'hostname' in ssh_host.keys(): a.server = ssh_host['hostname'] if 'port' in ssh_host.keys(): a.remote_ssh_port = ssh_host['port'] ssh_config_fileobj.close() # check if ssh priv key exists if a.ssh_privkey and not os.path.isfile(a.ssh_privkey): runtime_error("SSH private key %s file does not exist." % a.ssh_privkey, parser=p, exitcode=30) # only look for ssh keys if no ssh privkey is specified if a.ssh_privkey: a.look_for_keys = False else: a.look_for_keys = True if a.ssh_passphrase and not a.ssh_privkey: runtime_error("--ssh-passphrase can only be used in conjunction with --ssh-privkey.", parser=p, exitcode=1) # hang around the keyboard chaos... a.kbd_type = a.kbd_type.lower() a.kbd_layout = a.kbd_layout.lower() if a.kbd_layout == 'auto': a.kbd_type = 'auto' if a.kbd_type == 'auto': a.kbd_layout = 'null' # input check for --link a.link = a.link.lower() if a.link not in ('modem', 'isdn', 'adsl', 'wan','lan'): runtime_error ("value for cmd line argument --link is not any of 'modem', 'isdn', 'adsl', 'wan' or 'lan'", parser=p, exitcode=1) # input check for --dpi if a.dpi: try: if int(a.dpi) < 20 or int(a.dpi) > 400: runtime_error ("value for cmd line argument --dpi must be between 20 and 400", parser=p, exitcode=1) except ValueError: runtime_error ("value for cmd line argument --dpi must be an positive integer value between 20 and 400", parser=p, exitcode=1) # input check for --clipboard-mode a.clipboard_mode = a.clipboard_mode.lower() if a.clipboard_mode not in ('none', 'both', 'client', 'server'): runtime_error ("value for cmd line argument --clipboard-mode is not any of 'none', 'both', 'client' or 'server'", parser=p, exitcode=1) # lightdm remote login magic takes place here if a.from_stdin: lightdm_remote_login_buffer = sys.stdin.readline() (a.username, a.server, a.command) = lightdm_remote_login_buffer.split()[0:3] a.password = " ".join(lightdm_remote_login_buffer.split()[3:]) if ":" in a.server: a.remote_ssh_port = a.server.split(':')[-1] a.server = ':'.join(a.server.split(':')[:-1]) a.command = a.command.upper() a.geometry = 'fullscreen' return p, a if __name__ == '__main__': # parse command line parser, args = parseargs() args.parser = parser if not os.environ.get('DISPLAY'): logger('the display environment variable is unset, can\'t go on without a DISPLAY...', x2go.loglevel_ERROR, ) logger('exiting pyhoca-cli now.', x2go.loglevel_DEBUG, ) sys.exit(1) elif not re.match("^.*:[0-9]+(|\.[0-9]+)$", os.environ.get('DISPLAY')): logger('the display environment variable\'s value is weird ({val}), can\'t go on with that...'.format(val=os.environ.get('DISPLAY')), x2go.loglevel_ERROR, ) logger('exiting pyhoca-cli now.', x2go.loglevel_DEBUG, ) sys.exit(1) try: # 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() logger('exiting pyhoca-cli now.', x2go.loglevel_DEBUG, ) sys.exit(0) except (KeyboardInterrupt, SystemExit) as e: x2go.x2go_cleanup(e) pyhoca-cli-0.6.1.3/pyhoca/cli/frontend.py0000644000000000000000000011702014471055441015026 0ustar # -*- coding: utf-8 -*- # Copyright (C) 2010-2019 by Mike Gabriel # # PyHoca CLI 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. # # PyHoca CLI 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. # # Contributors to the code of this programme: # 2010 Dick Kniep # 2010 Jörg Sawatzki import x2go import sys import os import copy import getpass from gevent import socket, sleep # for debugging import pprint # use current_home as user home dir current_home = os.path.expanduser("~") from x2go.utils import touch_file as _touch_file # define and create known_hosts file (if not there) ssh_known_hosts_filename = os.path.join(x2go.LOCAL_HOME, x2go.X2GO_SSH_ROOTDIR, 'known_hosts') if not os.path.isfile(ssh_known_hosts_filename): try: _touch_file(ssh_known_hosts_filename) except OSError: pass # define and create ssh_config file (if not there) ssh_config_filename = os.path.join(x2go.LOCAL_HOME, x2go.X2GO_SSH_ROOTDIR, 'config') if not os.path.isfile(ssh_config_filename): try: _touch_file(ssh_config_filename) except OSError: pass # sometimes we have to fail... def runtime_error(m, parser=None, exitcode=-1): """\ STILL UNDOCUMENTED """ if parser is not None: parser.print_usage() sys.stderr.write ("%s: error: %s\n" % (os.path.basename(sys.argv[0]), m)) sys.exit(exitcode) class PyHocaCLI(x2go.X2GoClient): """\ L{PyHocaCLI} is a command-line X2Go Client wrapping around Python X2Go (C{X2GoClient} class). """ x2go_session_hash = None def _runtime_error(self, m, exitcode=-1): runtime_error(m, exitcode=exitcode) def HOOK_no_such_command(self, *args, **kwargs): x2go.X2GoClient.HOOK_no_such_command(self, *args, **kwargs) if len(args) == 0: cmd=kwargs['cmd'] else: cmd=args[0] self._runtime_error("The remote X2Go Server does not know how to execute the command '{cmd}'. Aborting...".format(cmd=cmd)) def list_sessions(self, s_hash): """\ List up server-side available sessions for the logged in user. The list of available session is printed to stdout. @param s_hash: session UUID @type s_hash: C{str} """ # retrieve a session list print() print("Available runing/suspended X2Go sessions") print("========================================") _peername = self._X2GoClient__get_session_server_peername(s_hash) print("Host: %s - [%s]:%s" % (self._X2GoClient__get_session_server_hostname(s_hash), _peername[0], _peername[1])) print("Username: %s" % self._X2GoClient__get_session_username(s_hash)) print() session_infos = self._X2GoClient__list_sessions(s_hash) if session_infos: for session_info in list(session_infos.values()): print("Session Name: %s" % session_info) print("-------------") print("cookie: %s" % session_info.cookie) print("agent PID: %s" % session_info.agent_pid) print("display: %s" % session_info.display) print("status: %s" % session_info.status) print("graphic port: %s" % session_info.graphics_port) print("snd port: %s" % session_info.snd_port) print("sshfs port: %s" % session_info.sshfs_port) print("username: %s" % session_info.username) print("hostname: %s" % session_info.hostname) # TODO: turn into datetime object print("create date: %s" % session_info.date_created) # TODO: turn into datetime object print("suspended since: %s" % session_info.date_suspended) print() else: print("No running/suspended sessions found on X2Go server.") print() def list_desktops(self, s_hash): """\ List up server-side available desktop sessions that are available for sharing to the logged in user. The list of sharable desktop sessions is printed to stdout. @param s_hash: session UUID @type s_hash: C{str} """ # retrieve a desktop list print() print("X2Go desktops available for sharing") print("===================================") _peername = self._X2GoClient__get_session_server_peername(s_hash) print("Host: %s - [%s]:%s" % (self._X2GoClient__get_session_server_hostname(s_hash), _peername[0], _peername[1])) print("Username: %s" % self._X2GoClient__get_session_username(s_hash)) print() desktop_list = self._X2GoClient__list_desktops(s_hash) if desktop_list: for desktop_name in desktop_list: print(desktop_name) else: print("No X2Go desktop sessions found that are available for desktop sharing.") print() def list_profiles(self): """\ List up client-side configured session profile configurations. The list of session profiles is printed to stdout. """ # retrieve a session list print() print("Available X2Go session profiles") print("===============================") _profiles = self._X2GoClient__get_profiles() for _profile_id in _profiles.profile_ids: _profile_config = _profiles.get_profile_config(_profile_id) _session_params = _profiles.to_session_params(_profile_id) print(_profile_config) print(_session_params) print() def clean_sessions(self, s_hash): """\ Clean all running/suspended sessions on the X2Go server that the session with UUID C{s_hash} is connected to. @param s_hash: session UUID @type s_hash: C{str} """ _profiles = self._X2GoClient__get_profiles() if self.args.session_profile and _profiles.has_profile(self.args.session_profile): _server = _profiles.get_session_param(self.args.session_profile, 'server') else: _server = self.args.server # clean all sessions from X2Go server self.logger('cleaning up all running sessions from X2Go server: %s' % _server, loglevel=x2go.loglevel_NOTICE, ) self._X2GoClient__clean_sessions(s_hash) def new_session(self, s_hash): """\ Launch a new X2Go session via the C{X2GoSession} object with session UUID C{s_hash}. @param s_hash: session UUID @type s_hash: C{str} """ # start a new session and run a command self.logger('starting a new X2Go session', loglevel=x2go.loglevel_INFO, ) if self.args.session_profile is None: self.logger('command for new session is: %s' % self.args.command, loglevel=x2go.loglevel_DEBUG, ) else: self.logger('command from session profile to run is: %s' % self.session_registry(self.x2go_session_hash).get_session_cmd(), loglevel=x2go.loglevel_DEBUG, ) self._X2GoClient__start_session(s_hash) def _auto_resume_newest(self, s_hash): session_infos = self._X2GoClient__list_sessions(s_hash) if session_infos: newest_session_name = x2go.utils.session_names_by_timestamp(session_infos)[-1] self._pyhoca_logger("Resuming newest X2Go session %s..." % newest_session_name, loglevel=x2go.loglevel_NOTICE, ) self._X2GoClient__resume_session(s_hash, newest_session_name) return True return False def _auto_resume_oldest(self, s_hash): session_infos = self._X2GoClient__list_sessions(s_hash) if session_infos: oldest_session_name = x2go.utils.session_names_by_timestamp(session_infos)[0] self._pyhoca_logger("Resuming oldest X2Go session %s..." % oldest_session_name, loglevel=x2go.loglevel_NOTICE, ) self._X2GoClient__resume_session(s_hash, oldest_session_name) return True return False def resume_session(self, s_hash): """\ Use C{X2GoSession} object with session UUID C{s_hash} to resume a server-side suspended X2Go session. @param s_hash: session UUID @type s_hash: C{str} """ # resume a running session self.logger('resuming X2Go session: %s' % self.args.resume, loglevel=x2go.loglevel_INFO, ) available_sessions = self._X2GoClient__list_sessions(s_hash) if available_sessions and self.args.resume == 'OLDEST': self._auto_resume_oldest(s_hash) elif available_sessions and self.args.resume == 'NEWEST': self._auto_resume_newest(s_hash) elif self.args.resume in list(available_sessions.keys()): self._X2GoClient__resume_session(s_hash, self.args.resume) else: self._runtime_error('requested session not available on X2Go server [%s]:%s' % (self.args.server, self.args.remote_ssh_port), exitcode=20) def try_resume_session(self, s_hash): """\ Use C{X2GoSession} object with session UUID C{s_hash} to resume a server-side suspended X2Go session or to take over a server-side running X2Go session. @param s_hash: session UUID @type s_hash: C{str} """ self.logger('trying to resume / take over X2Go session with command: %s' % self.args.command, loglevel=x2go.loglevel_INFO, ) available_sessions = self._X2GoClient__list_sessions(s_hash, with_command=self.args.command) if available_sessions: self.logger('matching sessions found: %s' % available_sessions.keys(), loglevel=x2go.loglevel_INFO, ) self.logger('picking the first in list: %s' % list(available_sessions.keys())[0], loglevel=x2go.loglevel_INFO, ) # FIXME: what session do we want to resume really (oldest, newest, etc.)? self._X2GoClient__resume_session(s_hash, list(available_sessions.keys())[0]) return True else: return False def share_desktop_session(self, s_hash): """\ Use C{X2GoSession} object with session UUID C{s_hash} to share a server-side X2Go desktop session that is available for sharing. @param s_hash: session UUID @type s_hash: C{str} """ # start a new session and run a command _desktop = self.args.share_desktop _share_mode = self.args.share_mode self.logger('sharing X2Go session: %s' % _desktop, loglevel=x2go.loglevel_INFO, ) try: self._X2GoClient__share_desktop_session(s_hash, desktop=_desktop, share_mode=_share_mode) except x2go.X2GoDesktopSharingException as e: self._runtime_error('%s' % str(e), exitcode=54) def suspend_session(self, s_hash): """\ Suspend X2Go Session object with session UUID C{s_hash}. @param s_hash: session UUID @type s_hash: C{str} """ # send a suspend request to a session self.logger('requesting X2Go session suspend of session: %s' % self.args.suspend, loglevel=x2go.loglevel_INFO, ) available_sessions = self._X2GoClient__list_sessions(s_hash) if self.args.suspend == "ALL": _session_names = available_sessions else: _session_names = [ self.args.suspend ] for _session_name in _session_names: if _session_name in list(available_sessions.keys()): self._X2GoClient__suspend_session(s_hash, _session_name) self._pyhoca_logger("X2Go session %s has been suspended" % _session_name, loglevel=x2go.loglevel_NOTICE, ) else: _server = self.args.server _remote_ssh_port = self.args.remote_ssh_port if not self.args.server and self.args.session_profile: _server = self.session_profiles.get_value(self.session_profiles.to_profile_id(self.args.session_profile), 'host') _remote_ssh_port = self.session_profiles.get_value(self.session_profiles.to_profile_id(self.args.session_profile), 'sshport') self._runtime_error('session %s not available on X2Go server [%s]:%s' % (_session_name, _server, _remote_ssh_port), exitcode=21) def terminate_session(self, s_hash): """\ Terminate X2Go Session with session UUID C{s_hash}. @param s_hash: session UUID @type s_hash: C{str} """ # send a terminate request to a session self.logger('requesting X2Go session terminate of session: %s' % self.args.terminate, loglevel=x2go.loglevel_INFO, ) available_sessions = self._X2GoClient__list_sessions(s_hash) if self.args.terminate == "ALL": _session_names = available_sessions else: _session_names = [ self.args.terminate ] for _session_name in _session_names: if _session_name in list(available_sessions.keys()): self._X2GoClient__terminate_session(s_hash, _session_name) self._pyhoca_logger("X2Go session %s has been terminated" % _session_name, loglevel=x2go.loglevel_NOTICE, ) else: _server = self.args.server _remote_ssh_port = self.args.remote_ssh_port if not self.args.server and self.args.session_profile: _server = self.session_profiles.get_value(self.session_profiles.to_profile_id(self.args.session_profile), 'host') _remote_ssh_port = self.session_profiles.get_value(self.session_profiles.to_profile_id(self.args.session_profile), 'sshport') self._runtime_error('session %s not available on X2Go server [%s]:%s' % (_session_name, _server, _remote_ssh_port), exitcode=22) def __init__(self, args, logger=None, liblogger=None): """\ L{PyHocaCLI} Class constructor. @param args: a class with properties representing the command-line options that are available to L{PyHocaCLI} instances. @type args: C{argparse.ArgumentParser} (or similar) @param logger: you can pass an L{X2GoLogger} object to the L{PyHocaCLI} constructor for logging application events @type logger: Python X2Go C{X2GoLogger} instance @param liblogger: you can pass an L{X2GoLogger} object to the L{PyHocaCLI} constructor for logging application events, this object is forwarded to the C{X2GoClient} class in Python X2Go @type liblogger: Python X2Go C{X2GoLogger} instance """ self.args = args if logger is None: self._pyhoca_logger = x2go.X2GoLogger(tag='PyHocaCLI') else: self._pyhoca_logger = copy.deepcopy(logger) self._pyhoca_logger.tag = 'PyHocaCLI' _backend_kwargs = {} if self.args.backend_controlsession is not None: _backend_kwargs['control_backend'] = self.args.backend_controlsession if self.args.backend_terminalsession is not None: _backend_kwargs['terminal_backend'] = self.args.backend_terminalsession if self.args.backend_serversessioninfo is not None: _backend_kwargs['info_backend'] = self.args.backend_serversessioninfo if self.args.backend_serversessionlist is not None: _backend_kwargs['list_backend'] = self.args.backend_serversessionlist if self.args.backend_proxy is not None: _backend_kwargs['proxy_backend'] = self.args.backend_proxy else: _backend_kwargs['proxy_backend'] = 'auto-detect' if self.args.backend_sessionprofiles is not None: _backend_kwargs['profiles_backend'] = self.args.backend_sessionprofiles if self.args.backend_clientsettings is not None: _backend_kwargs['settings_backend'] = self.args.backend_clientsettings if self.args.backend_clientprinting is not None: _backend_kwargs['printing_backend'] = self.args.backend_clientprinting # 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, broker_url=self.args.broker_url, broker_password=self.args.broker_password, logger=liblogger, **_backend_kwargs) _profiles = self._X2GoClient__get_profiles() if self.args.session_profile and not _profiles.has_profile(self.args.session_profile): self._runtime_error('no such session profile of name: %s' % (self.args.session_profile), exitcode=31) self.auth_attempts = int(self.args.auth_attempts) self.non_interactive = bool(self.args.non_interactive) if args.list_profiles: _session_profiles = self._X2GoClient__get_profiles() # retrieve a session list print() print("Available X2Go session profiles") print("===============================") if hasattr(_session_profiles, 'config_files') and _session_profiles.config_files is not None: print("configuration files: %s" % _session_profiles.config_files) if hasattr(_session_profiles, 'user_config_file') and _session_profiles.user_config_file is not None: print("user configuration file: %s" % _session_profiles.user_config_file) if hasattr(_session_profiles, 'broker_url') and _session_profiles.broker_url is not None: print("X2Go Session Broker URL: %s" % _session_profiles.broker_url) 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']) print('Profile Configuration:') pprint.pprint(_profile_config) print('Derived session parameters:') pprint.pprint(_session_params) print() # done sys.exit(0) elif self.args.session_profile: _cmdlineopt_to_sessionopt = { 'command': 'cmd', 'kb_layout': 'kblayout', 'kb_type': 'kbtype', 'sound': 'snd_system', 'ssh_privkey': 'key_filename', 'server': 'hostname', 'remote_ssh_port': 'port', } # override session profile options by option values from the arg parser kwargs={} if hasattr(self.args, 'parser'): for a, v in self.args._get_kwargs(): if v != self.args.parser.get_default(a): try: kwargs[_cmdlineopt_to_sessionopt[a]] = v except KeyError: kwargs[a] = v # setup up the session profile based X2Go session self.x2go_session_hash = self._X2GoClient__register_session(profile_name=self.args.session_profile, known_hosts=ssh_known_hosts_filename, **kwargs ) else: xinerama = False if self.args.xinerama: xinerama = self.args.xinerama allow_share_local_folders = bool(self.args.share_local_folders) # setup up the manually configured X2Go session self.x2go_session_hash = self._X2GoClient__register_session(args.server, port=int(self.args.remote_ssh_port), known_hosts=ssh_known_hosts_filename, username=self.args.username, key_filename=self.args.ssh_privkey, add_to_known_hosts=self.args.add_to_known_hosts, profile_name = 'Pyhoca-Client_Session', session_type=self.args.session_type, kdrive=self.args.kdrive, link=self.args.link, dpi=self.args.dpi, xinerama=self.args.xinerama, geometry=self.args.geometry, pack=self.args.pack, cache_type='unix-kde', kblayout=self.args.kbd_layout, kbtype=self.args.kbd_type, snd_system=self.args.sound, printing=self.args.printing, print_action=self.args.print_action, print_action_args=self.args.print_action_args, share_local_folders=self.args.share_local_folders, allow_share_local_folders=allow_share_local_folders, forward_sshagent=self.args.forward_sshagent, clipboard=self.args.clipboard_mode, cmd=self.args.command, look_for_keys=self.args.look_for_keys) def authenticate(self): """\ Authenticate this L{PyHocaCLI} instance with the remote X2Go server. """ connected = False if self.args.password: password = self.args.password self.args.password = None cmdline_password = True force_password_auth = True else: password = None cmdline_password = False force_password_auth = False if self.args.force_password: force_password_auth = True if self.non_interactive: non_interactive = True else: non_interactive = False passphrase = self.args.ssh_passphrase passphrase_unlock_counter = 3 _username = self.args.username or self._X2GoClient__get_session_username(self.x2go_session_hash) # if we still don't have a valid user name, try the broker... if not _username and hasattr(self.session_profiles, 'get_broker_username'): _username = self.session_profiles.get_broker_username() try: _auth_count = self.auth_attempts while not connected and _auth_count: try: # decrement authentication counter... _auth_count -= 1 # show interactive password prompt if force_password_auth and not cmdline_password: if non_interactive: _auth_count -= 1 continue password = getpass.getpass() # workaround for Python bug: https://bugs.python.org/issue11236 try: if password is not None and '\x03' in password: raise KeyboardInterrupt() except KeyboardInterrupt: self._runtime_error('Authentication cancelled by user by hitting Ctrl-C at password prompt', exitcode=-200) if not password: self._pyhoca_logger('password is empty, please re-try... (hit Ctrl-C plus ENTER to cancel)', loglevel=x2go.loglevel_WARN, ) _auth_count += 1 continue # connection attempt with remote X2Go Server self._X2GoClient__connect_session(self.x2go_session_hash, username=_username, password=password, passphrase=passphrase, force_password_auth=force_password_auth) # we succeeeded connected = True # this will end the loop (as connected is set to True) continue except x2go.PasswordRequiredException as e: # x2go.PasswordRequiredException: This exception gets raised if an SSH pubkey is protected by a passphrase if not non_interactive and not force_password_auth and passphrase_unlock_counter >= 1: if passphrase == '': self._pyhoca_logger('empty SSH key passphrase (%s), try again...' % self.args.ssh_privkey, loglevel=x2go.loglevel_WARN, ) self._pyhoca_logger('unlock SSH key file (%s)' % self.args.ssh_privkey, loglevel=x2go.loglevel_NOTICE, ) passphrase = getpass.getpass('Passphrase: ') passphrase_unlock_counter -= 1 # undo auth counter decrement _auth_count += 1 continue if not force_password_auth and _auth_count >= 1: if non_interactive: self._runtime_error('unlocking of SSH key failed.', exitcode=-203) else: self._pyhoca_logger('unlocking of SSH key failed, ' 'proceeding with interactive ' 'login', loglevel=x2go.loglevel_WARN, ) force_password_auth = True password = None passphrase = None _auth_count += 1 continue except x2go.AuthenticationException as e: # x2go.AuthenticationException: This exception gets raised if the authentication failed if force_password_auth: self._pyhoca_logger('password based login for ,,%s\'\' failed [AuthException]' % _username, loglevel=x2go.loglevel_WARN, ) else: self._pyhoca_logger('passwordless login for ,,%s\'\' failed [AuthException]' % _username, loglevel=x2go.loglevel_WARN, ) # if the previous login attempt was pubkey based, enforce interactive login for the next round... if not non_interactive and not password and _auth_count >= 1: self._pyhoca_logger('proceeding to interactive login for user ,,%s\'\'' % _username, loglevel=x2go.loglevel_NOTICE, ) force_password_auth = True # undo auth counter decrement _auth_count += 1 # a password was provided via the command line elif password and cmdline_password and _auth_count >= 1: if not non_interactive: self._pyhoca_logger('cmdline provided password ' 'failed, proceeding to ' 'interactive login for ' 'user ,,%s\'\'' % _username, loglevel=x2go.loglevel_WARN, ) else: self._runtime_error('cmdline provided password ' 'failed.', exitcode=-204) force_password_auth = True cmdline_password = False # else, if the previous attempt was already interactive, offer re-trying elif not non_interactive and force_password_auth and _auth_count >= 1: self._pyhoca_logger('please re-try login for user ,,%s\'\'' % _username, loglevel=x2go.loglevel_NOTICE, ) passphrase = None password = None except x2go.BadHostKeyException: # let's bail out here immediately... self._runtime_error('SSH host key verification for remote host [%s]:%s failed' % (self.args.server, self.args.remote_ssh_port), exitcode=-254) except x2go.SSHException as e: # this bit only captures problems with the SSH key file, other # SSHExceptions are simply ignored and we proceed to # interactive login, if non_interactive is NOT set. if str(e).lower().startswith('could not deserialize key data') \ : # this error gets thrown when the passphrase for unlocking the SSH privkey was wrong if not force_password_auth and passphrase_unlock_counter >= 1: if passphrase is not None and passphrase != '': self._pyhoca_logger('wrong SSH key passphrase (%s), try again...' % self.args.ssh_privkey, loglevel=x2go.loglevel_WARN, ) self._pyhoca_logger('unlock SSH key file (%s)' % self.args.ssh_privkey, loglevel=x2go.loglevel_NOTICE, ) passphrase = getpass.getpass('Passphrase: ') passphrase_unlock_counter -= 1 # undo auth counter decrement _auth_count += 1 continue if not force_password_auth and _auth_count >= 1: if non_interactive: self._runtime_error('unlocking of SSH key failed.', exitcode=-205) else: self._pyhoca_logger('unlocking of SSH key failed, proceeding with interactive login', loglevel=x2go.loglevel_WARN, ) force_password_auth = True password = None passphrase = None _auth_count += 1 continue elif not str(e).lower().startswith('not a valid dsa private key file') and \ not str(e).lower().startswith('not a valid rsa private key file') and \ not str(e).lower().startswith('incompatible ssh peer (no acceptable kex algorithm)') and \ not str(e).lower().startswith('no authentication methods available') \ : if force_password_auth: self._pyhoca_logger('password based login for ,,%s\'\' failed [SSHException]' % _username, loglevel=x2go.loglevel_WARN, ) else: self._pyhoca_logger('passwordless login for ,,%s\'\' failed [SSHException]' % _username, loglevel=x2go.loglevel_WARN, ) # let's bail out here... self._runtime_error(str(e), exitcode=253) else: if non_interactive: self._runtime_error('[SSHException] the following error occured: %s' % str(e), exitcode=-206) else: self._pyhoca_logger('[SSHException] the following error will be ignored: %s' % str(e), loglevel=x2go.loglevel_WARN) self._pyhoca_logger('proceeding to interactive login for user ,,%s\'\'' % _username, loglevel=x2go.loglevel_NOTICE, ) force_password_auth = True password = None passphrase = None _auth_count += 1 if not connected and _auth_count <= 0: if self.auth_attempts >= 2: self._runtime_error('authentication failed, too many failures during interactive login', exitcode=-201) elif self.auth_attempts == 1: self._runtime_error('authentication failed', exitcode=-202) except socket.error as e: self._runtime_error('a socket error occured while establishing the connection: %s' % str(e), exitcode=-245) # drop clear text passwords... password = None passphrase = None if not self.is_x2goserver(self.x2go_session_hash): self._runtime_error('the remote server does not have the X2Go Server software installed', exitcode=1337) self._pyhoca_logger('authentication has been successful', loglevel=x2go.loglevel_NOTICE, ) def MainLoop(self): """\ Start the main loop of this application. """ try: if self.args.clean_sessions: self.clean_sessions(self.x2go_session_hash) # go through the possible X2Go client modes if self.args.list_sessions: # print a beautified session list for the user self.list_sessions(self.x2go_session_hash) sys.exit(0) if self.args.list_desktops: # print a beautified desktop list for the user self.list_desktops(self.x2go_session_hash) sys.exit(0) if self.args.list_profiles: # print a beautified profile list for the user self.list_profiles() sys.exit(0) if self.args.resume or self.args.new: self._pyhoca_logger("give the X2Go session some time to come up...", loglevel=x2go.loglevel_NOTICE, ) if self.args.resume: self.resume_session(self.x2go_session_hash) if self.args.share_desktop: self.share_desktop_session(self.x2go_session_hash) elif self.args.suspend: self.suspend_session(self.x2go_session_hash) elif self.args.terminate: self.terminate_session(self.x2go_session_hash) elif self.args.new and self.args.try_resume and self.try_resume_session(self.x2go_session_hash): # nothing to do here, if resumption attempt was successful pass elif self.args.new: self.new_session(self.x2go_session_hash) if not (self.args.new or self.args.resume or self.args.share_desktop or self.args.session_profile): sys.exit(0) i=0 while 0 < self.get_session(self.x2go_session_hash).get_progress_status() < 100: sleep(1) i+=1 session = self._X2GoClient__get_session(self.x2go_session_hash) if self._X2GoClient__session_ok(self.x2go_session_hash): session.set_master_session() profile_name = self._X2GoClient__get_session_profile_name(self.x2go_session_hash) session_name = self._X2GoClient__get_session_name(self.x2go_session_hash) self._pyhoca_logger("X2Go session is now running, the X2Go client's profile name is: %s" % profile_name, loglevel=x2go.loglevel_INFO, ) self._pyhoca_logger("X2Go session name is: %s" % session_name, loglevel=x2go.loglevel_INFO, ) if not self.args.from_stdin: if self.args.share_desktop: self._pyhoca_logger("Press CTRL+C to end desktop sharing for this session...", loglevel=x2go.loglevel_NOTICE, ) elif self.args.terminate_on_ctrl_c: self._pyhoca_logger("Press CTRL+C to terminate the running session...", loglevel=x2go.loglevel_NOTICE, ) else: self._pyhoca_logger("Press CTRL+C to suspend the running session...", loglevel=x2go.loglevel_NOTICE, ) try: session_duration = 0 while self._X2GoClient__session_ok(self.x2go_session_hash): sleep(2) session_duration +=2 # wait a little while before telling the user what has happened sleep(2) # refresh session status so we can be most accurate on what we report below self._X2GoClient__list_sessions(self.x2go_session_hash) # report about the session status once we get here... if self._X2GoClient__has_session_terminated(self.x2go_session_hash): self._pyhoca_logger("X2Go session %s has terminated" % session_name, loglevel=x2go.loglevel_NOTICE, ) elif self._X2GoClient__is_session_suspended(self.x2go_session_hash): self._pyhoca_logger("X2Go session %s has been suspended" % session_name, loglevel=x2go.loglevel_NOTICE, ) elif self._X2GoClient__is_session_running(self.x2go_session_hash): self._pyhoca_logger("X2Go session %s has been moved to a different screen" % session_name, loglevel=x2go.loglevel_NOTICE, ) except KeyboardInterrupt: if self.args.share_desktop: self._pyhoca_logger("Terminating X2Go shared desktop session %s" % session_name, loglevel=x2go.loglevel_INFO, ) self._X2GoClient__terminate_session(self.x2go_session_hash) sleep(2) self._pyhoca_logger("X2Go session %s has been terminated" % session_name, loglevel=x2go.loglevel_NOTICE, ) elif self.args.terminate_on_ctrl_c: self._pyhoca_logger("Terminating X2Go session %s" % session_name, loglevel=x2go.loglevel_INFO, ) self._X2GoClient__terminate_session(self.x2go_session_hash) # giving nxproxy's SSH tunnel some time to settle sleep(2) self._pyhoca_logger("X2Go session %s has been terminated" % session_name, loglevel=x2go.loglevel_NOTICE, ) else: self._pyhoca_logger("Suspending X2Go session %s" % session_name, loglevel=x2go.loglevel_INFO, ) self._X2GoClient__suspend_session(self.x2go_session_hash) # giving nxproxy's SSH tunnel some time to settle sleep(2) self._pyhoca_logger("X2Go session %s has been suspended" % session_name, loglevel=x2go.loglevel_NOTICE, ) except x2go.X2GoSessionException as e: self._pyhoca_logger("X2GoSessionException occured:", loglevel=x2go.loglevel_ERROR) self._pyhoca_logger("-> %s" % str(e), loglevel=x2go.loglevel_ERROR) pyhoca-cli-0.6.1.3/pyhoca/cli/__init__.py0000644000000000000000000000203514471055441014745 0ustar # -*- coding: utf-8 -*- # Copyright (C) 2010-2023 by Mike Gabriel # # PyHoca CLI 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. # # PyHoca CLI 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. """\ PyHoca-CLI is a simple command-line tool that allows the launching of X2Go sessions. For further information on X2Go, please visit the X2Go wiki: https://wiki.x2go.org """ __VERSION__ = "0.6.1.3" from .frontend import * pyhoca-cli-0.6.1.3/pyhoca/__init__.py0000644000000000000000000000147114471055441014201 0ustar # -*- coding: utf-8 -*- # Copyright (C) 2010-2023 by Mike Gabriel # # PyHoca CLI 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. # # PyHoca CLI 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. pyhoca-cli-0.6.1.3/README0000644000000000000000000000273014471055441011464 0ustar pyhoca-cli - Copyright (C) 2010-2023 by Mike Gabriel Contributors: 2010, Jörg Sawatzki 2010-2016, Dick Kniep Published under the terms of the GNU Affero General Public License. See https://www.gnu.org/licenses/agpl.html for a recent copy. === What is pyhoca-cli? === === Requirements === * the python-x2go module needs to be installed (>= 0.5.0.0) * the python-argparse module needs to be available * with python-setproctitle, the process name gets set from python to pyhoca-cli * you will also need a working version of nxproxy/nxproxy.exe somewhere on your system (if you have X2Go Client installed, everything should be in place) === Current features === * start a new session on an X2Go server * resume a suspended session on an X2Go server * suspend a running session (hit Ctrl+C) * terminate a running session * retrieve a list of running sessions * sound support available * local folder sharing * share an already running desktop session with yourself or another user * use session profiles provide via an X2Go Session Broker * mTelePlayer support with python-x2go (>= 0.5.0.0) === How to use it === Please refer to the man page: man pyhoca-cli === Known issues === Please refer to the TODO file that has been shipped with pyhoca-cli. Thanks in advance for your feedback and contributions, Fleckeby (Germany), 20141020, Mike Gabriel pyhoca-cli-0.6.1.3/setup.py0000755000000000000000000000340414471055441012320 0ustar #!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (C) 2010-2023 by Mike Gabriel # # PyHoca 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. # # PyHoca 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. import os import sys from setuptools import setup # Specifying file encoding at open time only works with Python 3 directly, # but Python >2.6 has some support for this in the IO module. # It's said to be slow, but we can live with that. if sys.version_info[0] < 3: from io import open __VERSION__ = "0.0.0.0" for line in open(os.path.join('pyhoca', 'cli', '__init__.py'),encoding='utf-8').readlines(): if (line.startswith('__VERSION__')): exec(line.strip()) PROGRAM_VERSION = __VERSION__ setup( name = "PyHoca-CLI", version = PROGRAM_VERSION, description = "PyHoca-CLI is a cross-platform (Windows, MacOS X, Linux) X2Go client for the command line.", license = 'AGPLv3+', author = 'Mike Gabriel', url = 'https://www.x2go.org', namespace_packages = [ 'pyhoca', ], packages = [ 'pyhoca.cli', ], package_dir = {'': '.'}, exclude = [ 'pyhoca.cli.x2go', ], install_requires = [ 'setuptools', ] ) pyhoca-cli-0.6.1.3/TODO0000644000000000000000000000115514471055441011274 0ustar pyhoca-cli - Copyright (C) 2010-2023 by Mike Gabriel Contributors: 2010, Jörg Sawatzki 2010-2016, Dick Kniep Published under the terms of the GNU Affero General Public License. See https://www.gnu.org/licenses/gpl.html for a recent copy. === pyhoca-cli TODOs === * provide more cmdline options to configure session brokerage === pyhoca-cli Wishlist === * SOCKS client support If you find any issues with this programme please let me know. Fleckeby (Germany), 20141020 Mike Gabriel