1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-10-07 15:33:51 +03:00

195 Commits
v2.0 ... v2.1

Author SHA1 Message Date
Adolfo Gómez García
16f05920b5 Fix 2018-04-04 14:13:05 +02:00
Adolfo Gómez García
98befc7cee Removed cache for credentials on OpenStack platform 2018-02-27 06:49:24 +01:00
Adolfo Gómez García
1e6f806563 Added base support for Catalan 2017-09-21 15:49:17 +02:00
Adolfo Gómez García
08ed93121b Added base support for Catalan 2017-09-21 15:48:45 +02:00
Adolfo Gómez García
840cc57fdc Updated with 2.2 version of WinDomainOsManager 2017-09-21 15:37:25 +02:00
Adolfo Gómez García
e46b0d22e7 Now thinstation package is functional with gtk 2017-08-04 15:19:06 +02:00
Adolfo Gómez García
085b0c1393 Fixed Transport to remove references on scripts to Qt 2017-08-02 16:20:52 +02:00
Adolfo Gómez García
e257ca0571 First working (but already non functional) "thin plugin" for thinstation
(and any other linux also ;-) )
2017-08-02 16:20:25 +02:00
Adolfo Gómez García
29e062ba5d Small Fix, so UDS client gets an exception in case of UDS being unable
to identify client platform.
2017-08-02 16:08:46 +02:00
Adolfo Gómez García
2b9cd5508d * Advancing on "thin plugin" for UDS 2017-08-02 15:53:18 +02:00
Adolfo Gómez García
79a591180d Removed "sec:rdp" from Linux xfreerdp client 2017-07-26 15:08:33 +02:00
Adolfo Gómez García
1e711eecbb Updated "update" date :) 2017-07-21 07:46:13 +02:00
Adolfo Gómez García
7da01597e6 Enabled HTML5 file sharing as experimental feature 2017-07-20 12:20:19 +02:00
Adolfo Gómez García
2e4bd4b1db * Fix on recovering v1 WindDomainOsManager
* Added support for "strange" groupnames (with parentheses, quotes, ...)
2017-07-17 12:14:35 +02:00
Adolfo Gómez García
f3f936e401 Improvements for Windows domain os manager (now we can add the machine to a group on creation) 2017-07-14 14:48:18 +02:00
Adolfo Gómez García
90ed08c779 Added a feature so in windows we can have a custom "RunOnce" mechanics
so we can include a custom call if needed.
2017-07-11 21:24:56 +02:00
Adolfo Gómez García
c2874e74c8 added some RDP 2017-07-06 12:35:06 +02:00
Adolfo Gómez García
3a11c9832f Fixed post-script for windows 2017-07-03 14:07:44 +02:00
Adolfo Gómez García
0f6ffb559b Fixed HTML5RDP files upload (commented anyway right now) 2017-07-03 10:37:58 +02:00
Adolfo Gómez García
4769d7dc51 Added more REST API samples 2017-06-29 11:56:45 +02:00
Adolfo Gómez García
4fc2e98313 small fix for REST1 sample 2017-06-29 10:36:36 +02:00
Adolfo Gómez García
09a48c9c5a added usage list to providers 2017-06-20 08:11:41 +02:00
Adolfo Gómez García
ac245e71e9 fix for AD machine removal 2017-06-16 09:56:58 +02:00
Adolfo Gómez García
e5d2c711ce Fixed for 2.1 finsl 2017-06-13 08:08:00 +02:00
Adolfo Gómez García
de5e7380c4 Added a few "pretty" enhacements... 2017-06-08 11:31:47 +02:00
Adolfo Gómez García
3e87c90c67 Added fast admin navigation links 2017-06-08 11:10:39 +02:00
Adolfo Gómez García
4a97872cdd Added usage info 2017-06-08 11:02:34 +02:00
Adolfo Gómez García
19e67f5a18 Updated translations 2017-06-06 13:16:03 +02:00
Adolfo Gómez García
3e7c01f7f9 Added security option for HTML5 2017-06-06 12:18:41 +02:00
Adolfo Gómez García
0bda00e43d Added "custom parameter" for xfreerdp 2017-06-05 10:58:45 +02:00
Adolfo Gómez García
fe18faa863 Thistation 2017-06-05 09:55:12 +02:00
Adolfo Gómez García
808c715710 Added POST-CMD support 2017-06-01 12:25:48 +02:00
Adolfo Gómez García
16d458bb69 Fixed locales 2017-06-01 11:38:03 +02:00
Adolfo Gómez García
22a7e2336e Added config var for convert usernames to lowercase... 2017-06-01 09:35:43 +02:00
Adolfo Gómez García
f773cb5ecc Advancing on thin client & thinstation 2017-05-31 15:34:50 +02:00
Adolfo Gómez García
d1b6891ca7 Creating new "thin" uds client connector 2017-05-31 12:07:13 +02:00
Adolfo Gómez García
a9e65975c5 * Fixed X-Forwarded-Proto (was X-Forwarded-Protocol before...)
* Added "fix" on HTML5 javascript so it can fix the uds actor client
2017-05-26 10:55:47 +02:00
Adolfo Gómez García
c1377255b5 Added comment to metagroup groups combo 2017-05-24 11:52:58 +02:00
Adolfo Gómez García
cce8fa4869 Added double Crypt Method authentication 2017-05-24 10:23:16 +02:00
Adolfo Gómez García
dda1018901 fixed " on group names 2017-05-23 20:11:45 +02:00
Adolfo Gómez García
b44d02dbd9 Fixed tunnel wait 2017-05-22 14:16:38 +02:00
Adolfo Gómez García
cfded58563 Fixed 0x01 for 0x05 on cryptdata for windows rdp 2017-05-19 19:36:07 +02:00
Adolfo Gómez García
8642f4291b added pygtk dependencie to thinstation 2017-05-19 18:45:41 +02:00
Adolfo Gómez García
e83ff8d69d Fixed log to be INFO 2017-05-18 13:13:37 +02:00
Adolfo Gómez García
16edf04f1d Updated build packages 2017-05-18 12:39:30 +02:00
Adolfo Gómez García
cbaa5cef46 Fixed error on udsclient for Linux that was creating the log file on
/tmp instead of home user folder
2017-05-18 12:36:05 +02:00
Adolfo Gómez García
da75dc79a7 Fixed OpenStack error information 2017-05-17 11:55:18 +02:00
Adolfo Gómez García
9965be5a76 Fixed MAC address to uppercase on Free & OpenStack 2017-05-16 14:49:34 +02:00
Adolfo Gómez García
9d6f3111da Adding thinstation stuff 2017-05-16 13:30:47 +02:00
Adolfo Gómez García
9265ab3ac3 Fixed symlinks 2017-05-16 09:37:14 +02:00
Adolfo Gómez García
34e70394e9 Updating directory structure 2017-05-16 09:30:52 +02:00
Adolfo Gómez García
3a750018e2 New "thin uds client" 2017-05-16 09:22:10 +02:00
Adolfo Gómez García
390eea5c3d Fixed translations 2017-05-13 18:27:31 +02:00
Adolfo Gómez García
dbf94b4c17 Fixed a couple of things 2017-05-13 18:24:59 +02:00
Adolfo Gómez García
bc8b2de151 Enable usb redir added 2017-05-13 18:21:26 +02:00
Adolfo Gómez García
b73408043e Commented openstack volume availability for publishing only if not in
use.
2017-05-09 17:49:59 +02:00
Adolfo Gómez García
2ba6e4fa7c Updated locales & fixed usage summary report 2017-05-09 10:17:32 +02:00
Adolfo Gómez García
9bbd7fd57d Split usb sharing & auto new usb sharing into two options 2017-05-09 08:35:17 +02:00
Adolfo Gómez García
0ec3cb104a Fixed reversed options on spice transport 2017-05-09 08:25:22 +02:00
Adolfo Gómez García
b1f1d6701e removed log 2017-05-08 09:32:21 +02:00
Adolfo Gómez García
d54b447bf7 Added "allow" smartcard redirection also, and added an small fix for
"usb sharing"
2017-05-05 14:00:44 +02:00
Adolfo Gómez García
6ca7c5fb34 Enable USB Auto Sharing controled by UDS Transport now 2017-05-05 13:43:00 +02:00
Adolfo Gómez García
ca9ad5efbd Seems that opennebula allows "spaces" on imagenames???. Fixed this removing it, and enhaced error notification in case of an image not found 2017-05-05 09:25:54 +02:00
Adolfo Gómez García
b5154cbbe9 added report for UPC 2017-05-05 01:43:19 +02:00
Adolfo Gómez García
a3ad88b9e6 Removed "adminitrative" permissions (left just full access, the other
was in fact an synonim)
2017-05-03 14:30:51 +02:00
Adolfo Gómez García
a4b9bf1fb9 Added new report for UPC 2017-05-03 12:30:59 +02:00
Adolfo Gómez García
a95684d864 Fixed tunWait 2017-04-20 19:24:28 +02:00
Adolfo Gómez García
6057e8a3f8 Removed unusefull exception log :) 2017-04-19 13:32:18 +02:00
Adolfo Gómez García
4fbbfb8d10 Added possible support for personalized logout url on login form 2017-04-19 13:24:32 +02:00
Adolfo Gómez García
2daafa2c4a Added "allow cross domain logins" as comment to login view 2017-04-19 10:26:18 +02:00
Adolfo Gómez García
846489244e Fixed removal of users & authenticators 2017-04-18 14:24:22 +02:00
Adolfo Gómez García
ec33b46848 Removed trying to get opener StorageSession, as UDS will never do that, and under some cirtustances it may fail (for exmple, if using UDS API for getting a connection from a cross domain 2017-04-18 13:39:31 +02:00
Adolfo Gómez García
e067f09958 Fixed added by Gliphtodown backported to 2.1 2017-04-18 00:32:27 +02:00
Adolfo Gómez García
8cbfcbb104 Removed "annoying" messages on log when need to retry database accesss 2017-04-17 22:52:31 +02:00
Adolfo Gómez García
2b5cf494db backported pom.xml from 2.5 2017-04-10 02:43:24 +02:00
Adolfo Gómez García
39158bd7ae Removed download for Microsoft old RDP app 2017-04-10 01:43:42 +02:00
Adolfo Gómez García
95a695ee88 Fixed mac os x virt-viewer download url 2017-04-07 12:00:08 +02:00
Adolfo Gómez García
a860732ed2 small visual fix 2017-04-06 20:32:08 +02:00
Adolfo Gómez García
5d391a9fc4 Added exception log on case of invalid 2017-04-04 10:01:01 +02:00
Adolfo Gómez García
148cd249cd If removing takes too long, mark it as errored 2017-04-03 10:24:27 +02:00
Adolfo Gómez García
57e643333e Fixed TRanslations
Fixed SPICE name
2017-03-31 10:37:16 +02:00
Adolfo Gómez García
5794fab7da By default, on 2.1, linux machines will do a reboot after configure. 2017-03-31 10:23:39 +02:00
Adolfo Gómez García
9955e7bcff Fixed tunneled access for SPICE for opennebula (no secure port, no need
of channel config...)
2017-03-30 23:05:15 +02:00
Adolfo Gómez García
86b252916c Set ready to y so initial wait is not done 2017-03-29 13:33:39 +02:00
Adolfo Gómez García
e81a8fdc5f Fixed ovirt.. 2017-03-29 13:02:17 +02:00
Adolfo Gómez García
92cf8c36bd fixed ou with spaces 2017-03-29 10:53:34 +02:00
Adolfo Gómez García
de07a4f3cd Another small fix 2017-03-28 15:20:23 +02:00
Adolfo Gómez García
320a530bbc Several fixes so we can check availability of spice transport BEFORE
user tries to access it.
2017-03-28 15:12:14 +02:00
Adolfo Gómez García
e945ad9fe8 A couples of fixes for opennebula 2017-03-27 10:35:53 +02:00
Adolfo Gómez García
be3c242a7d Added delay on actor EINTR 2017-03-23 13:55:32 +01:00
Adolfo Gómez García
f86712a05a ignore EINTR on connection error 2017-03-23 09:58:36 +01:00
Adolfo Gómez García
777ca4c016 Keep running on case of commmunitacion error with uds server... 2017-03-23 09:40:56 +01:00
Adolfo Gómez García
f715f48a7b * Now if notifyReadyFromOsManager raises an error, puts the machine on
"error" state
* Fixed L2 cache on oVirt, that was not working correctly con 4.x
versions
2017-03-22 15:04:19 +01:00
Adolfo Gómez García
315dd77a5a Ovirt publication now take into account removed 2017-03-22 13:10:10 +01:00
Adolfo Gómez García
82f7f56590 Another small typo 2017-03-22 12:32:20 +01:00
Adolfo Gómez García
8e594c7c7f Fixed indent 2017-03-22 12:30:34 +01:00
Adolfo Gómez García
e99c77a97f fix for ovirt python sdk types 2017-03-22 12:03:11 +01:00
Adolfo Gómez García
a80fc629a2 Backported ovirt cleanups from 2.5 to 2.1 2017-03-22 11:55:39 +01:00
Adolfo Gómez García
8b644d4fec Removed "free old macs??" 2017-03-22 11:26:38 +01:00
Adolfo Gómez García
17196ac31d Fixed 404 error on oVirt access 2017-03-22 10:01:20 +01:00
Adolfo Gómez García
632bb3e6d4 Fixed openstack support for newer versions 2017-03-21 15:46:13 +01:00
Adolfo Gómez García
def1c59e4c Added CredSSP Support parameter to transport 2017-03-20 21:17:48 +01:00
Adolfo Gómez García
e90e56c426 Set enablecredsspsupport to 0 to allow windows10->windows10 connections
to work under some circustances...
2017-03-17 13:29:36 +01:00
Adolfo Gómez García
5f1676e56b Added usb support workaround for 4.0 & 4.1 of ovirt 2017-03-17 10:05:03 +01:00
Adolfo Gómez García
72230c5a60 Fixed linux actor with KDE
Removed temporally usb support for 4.x until a fix/workaround is found
2017-03-16 15:33:36 +01:00
Adolfo Gómez García
fad5eca5b9 Fixed cord tunneled access for rdp 2017-03-15 09:57:13 +01:00
Adolfo Gómez García
8054f088b9 Added custom message text for calendar limitation 2017-03-14 13:45:38 +01:00
Adolfo Gómez García
544b8b7b25 Locales 2017-03-10 13:24:07 +01:00
Adolfo Gómez García
4d6f54f54c fixed tunnel wait 2017-03-10 10:00:34 +01:00
Adolfo Gómez García
2004f4f882 Added "preconnect" script for Linux 2017-03-09 17:34:28 +01:00
Adolfo Gómez García
08e33ee20e Fixed RDP tunnel 2017-03-08 17:01:44 +01:00
Adolfo Gómez García
330973ac30 * Fixed calendars "required" fields not being honored
* Fixed open nebula "volatile" disks
2017-03-07 10:26:47 +01:00
Adolfo Gómez García
f78c755f12 Several fixes for XenServer and L2 Cache... 2017-03-06 14:17:07 +01:00
Adolfo Gómez García
bbc2cdfa30 Fixed Opennebula & Xen connectors 2017-03-06 12:26:47 +01:00
Adolfo Gómez García
d566285098 Minor fixes 2017-03-06 08:40:22 +01:00
Adolfo Gómez García
4c7b48588f Fixed ovirt 4 client "unicode" problems :)
*
2017-03-03 11:03:09 +01:00
Adolfo Gómez García
22313a517f Small opennebula fix for better control of certain situations... 2017-03-03 08:30:24 +01:00
Adolfo Gómez García
0c7a4911d2 Small message fix 2017-03-02 22:34:33 +01:00
Adolfo Gómez García
f11bccc868 Last fixes for OpenNebula (now correctly detect "done" VM State) 2017-02-28 11:38:17 +01:00
Adolfo Gómez García
c62e90f0a1 Small fix for better cancel on opennebula 2017-02-28 10:28:35 +01:00
Adolfo Gómez García
170319f871 Fix for very very weird situation (invalid argument in case no OS was
detected...)
2017-02-27 08:11:46 +01:00
Adolfo Gómez García
c6dd782150 * Fixed webLogout if we accesed UDS using ticketing system 2017-02-27 07:57:47 +01:00
Adolfo Gómez García
cc7740bafb Translation Fix 2017-02-27 07:45:38 +01:00
Adolfo Gómez García
1626fe96b1 Fixed getting password for access spice from OpenNebula 2017-02-22 13:32:28 +01:00
Adolfo Gómez García
efbca46af9 small typo 2017-02-22 12:51:32 +01:00
Adolfo Gómez García
548f44b1a7 last fixes 2017-02-22 12:30:02 +01:00
Adolfo Gómez García
2664be7ec4 fixes for linux actor 2017-02-22 11:49:42 +01:00
Adolfo Gómez García
bd3d0dd006 Minor fixes for actor for linux 2017-02-22 10:38:27 +01:00
Adolfo Gómez García
a83e218679 * Fixed use of Spice over OpenNebula
* Minor cosmetic fixes :)
2017-02-21 14:51:25 +01:00
Adolfo Gómez García
8ee34cd42b Coherence 2017-02-17 14:12:43 +01:00
Adolfo Gómez García
1ad57ee70c Simple fix 2017-02-17 14:11:58 +01:00
Adolfo Gómez García
c9ab76c19c Added infor message for multple join :) 2017-02-14 13:35:30 +01:00
Adolfo Gómez García
217655c276 Fixes for joining domains in multi steps using key from registro (HKEY_LOCAL_MACHINE\Sotware\UDSEntepriseActor, value "join" of type string must contain "old" (remenber that in 64 bits, this key can be under WOW3264Node) 2017-02-14 12:05:36 +01:00
Adolfo Gómez García
57d1041f87 Fixed DBFile not found on "url" method 2017-02-14 09:53:41 +01:00
Adolfo Gómez García
b56bf7b13f updated translations 2017-02-13 17:28:27 +01:00
Adolfo Gómez García
3a137213a7 * Fixed mistake on osmanager dashboard template
* Added "custom string" to Linux Clients using xfreerdp client for
printer & smartcard
2017-02-13 16:58:35 +01:00
Adolfo Gómez García
90cb224c9a Translations fixes 2017-02-09 20:03:39 +01:00
Adolfo Gómez García
69ad1baa7d Translations fixes 2017-02-09 20:01:15 +01:00
Adolfo Gómez García
6d2dee2664 Removed "print" 2017-02-09 07:52:30 +01:00
Adolfo Gómez García
ace11fd77a Added timeout to RDP Tranpsort & little fix for OpenNebula access using SPICE 2017-02-08 11:23:52 +01:00
Adolfo Gómez García
afa6f62daa Some additions yo HTML5 transport 2017-02-02 15:35:27 +01:00
Adolfo Gómez García
6c8f9affc2 Addedl length to name (128 max) 2017-02-02 14:10:52 +01:00
Adolfo Gómez García
fa0acb6a1a Locale updates (included arabian translation) 2017-02-02 00:26:21 +01:00
Adolfo Gómez García
4fa7d26191 Minor text upgrades 2017-02-02 00:15:23 +01:00
Adolfo Gómez García
e22f489038 added temporary storage in memory for stlite 2017-01-30 10:57:35 +01:00
Adolfo Gómez García
11100e3fda Enhanced performance on sqlite 2017-01-30 10:41:32 +01:00
Adolfo Gómez García
047eac18a7 added trace file for connections checking tracing 2017-01-26 06:26:45 +01:00
Adolfo Gómez García
32b5354a15 fixed meta group information 2017-01-25 12:28:28 +01:00
Adolfo Gómez García
0d085ba708 Fixed RDP to add "font smoothing" capability
Fixed users_groups metagroups information
2017-01-25 10:49:27 +01:00
Adolfo Gómez García
d184f0eec3 Updated css for administration, now it easy access elements 2017-01-25 05:42:53 +01:00
Adolfo Gómez García
675d502f73 Added information for groups 2017-01-24 09:56:01 +01:00
Adolfo Gómez García
4268004fcf Added information button (and information) to users, so certain information can be found more easily 2017-01-23 11:45:01 +01:00
Adolfo Gómez García
aabc5540d0 Fixes for several user text so the can be better understand 2017-01-20 11:01:39 +01:00
Adolfo Gómez García
68806c6366 Removed check of FQDN from domain 2017-01-20 09:40:28 +01:00
Adolfo Gómez García
343fed3245 Fixed & updated translations 2017-01-20 05:34:55 +01:00
Adolfo Gómez García
c740457860 Fixed doing "pkill" in correct session logout (only needs to do this on session timeout and persistent machines...) 2017-01-19 12:46:22 +01:00
Adolfo Gómez García
1d417c6075 Removed pkill right now 2017-01-19 11:02:33 +01:00
Adolfo Gómez García
ec7d3d39bd Fixed a lot of things from javi 2017-01-17 11:17:55 +01:00
Adolfo Gómez García
2e98197376 Fixed to x2go transport 2017-01-10 17:19:29 +01:00
Adolfo Gómez García
df17a86820 Added a Physical "single machine" service to physicals machines
provider.
Fixed textbox admin template to honor "required"
2016-12-02 12:13:46 +01:00
Adolfo Gómez García
54c751e4c5 Removed "files" from actors' debian files (redundant? :) ) 2016-12-02 08:21:01 +01:00
Adolfo Gómez García
151d35459e Added execution of script on /etc/udsactor/post on Linux Actor after
getting "ready" on machine...
2016-11-28 09:47:31 +01:00
Adolfo Gómez García
1ae22ff249 Fixing opennebula password spice access 2016-11-24 10:06:25 +01:00
Adolfo Gómez García
983114af88 Updated translations 2016-11-24 09:55:04 +01:00
Adolfo Gómez García
8a828bd087 For testing experimental SPICE support on opennebula 2016-11-23 10:13:10 +01:00
Adolfo Gómez García
76fc938604 Added limitation for users authenticated using tickets. (Tickets are
used from external apps to provide acces to one machine, but not to
provide access to all platform...)
2016-11-22 11:09:49 +01:00
Adolfo Gómez García
c08cb38dbc Fixing tunneled access for ovirt in case there is only "secure port" and
no "unsecure port"....
2016-11-21 16:49:37 +01:00
Adolfo Gómez García
f5dcb73e33 Fixed for mysql 5.7 2016-11-17 14:18:50 +01:00
Adolfo Gómez García
4108cf4df7 Added to enumeate by default images, templates & vms of user & his
group.
2016-11-10 11:38:05 +01:00
Adolfo Gómez García
f33c536adf Minor cosmetic changes 2016-11-07 03:03:12 +01:00
Adolfo Gómez García
a66b36e142 Finished with x2go? (more tests to go, but seems good right now...) 2016-11-07 02:59:38 +01:00
Adolfo Gómez García
c9bff899ba Added "experimental" to x2go transports 2016-11-07 02:36:46 +01:00
Adolfo Gómez García
82097b67f4 X2Go Working on linux & Windows 2016-11-07 02:35:23 +01:00
Adolfo Gómez García
3a58e0e446 * Fixed calendar rules with 0 interval
* Running X2Go direct connection from windows
* fixed Actor to notify correctly listening address on ip chang
2016-11-02 10:30:19 +01:00
Adolfo Gómez García
5ce61e1f98 Fixed "0" interval rules, that could hang UDS index page & consume all
memory
2016-10-31 12:55:56 +01:00
Adolfo Gómez García
5af198db75 More fixes (in fact, fixing fixes... :P) for actors 2016-10-27 08:25:30 +02:00
Adolfo Gómez García
1f6279cd46 Replaced REST listener address to listen on 0.0.0.0 so we do not need to
reassing listener on case of ip change of VM.
2016-10-27 08:05:01 +02:00
Adolfo Gómez García
a07f1d5b24 Advancing on x2go implementation 2016-10-24 16:59:29 +02:00
Adolfo Gómez García
26c0532fd5 first injection test seems to work 2016-10-23 22:09:32 +02:00
Adolfo Gómez García
9901bc2c8f *Updating linux client
* Updating x2go
2016-10-23 21:20:31 +02:00
Adolfo Gómez García
715957feb2 Some advances on x2go 2016-10-20 10:00:09 +02:00
Adolfo Gómez García
c7dc1e8b81 advancing on x2go support 2016-10-19 11:54:12 +02:00
Adolfo Gómez García
00798e5927 Merge remote-tracking branch 'origin/v2.0' into v2.1 2016-10-14 10:59:12 +02:00
Adolfo Gómez García
a68837bf4b fixed new sub-menus for tranports 2016-10-14 09:30:04 +02:00
Adolfo Gómez García
387b7f51d4 * Added support for multi-level new menu items (for transport for
example, they are going too long...)
* Fixed all transports to include group
2016-10-14 08:17:52 +02:00
Adolfo Gómez García
649a3515fc Added backport of x2go development branch for 2.1 version 2016-10-14 06:52:15 +02:00
Adolfo Gómez García
fe8f8be1d8 Merge remote-tracking branch 'origin/v2.0' into v2.1 2016-10-14 06:51:29 +02:00
Adolfo Gómez García
cd9f9ad523 updated changelod for uds debian based actors 2016-10-11 08:02:43 +02:00
Adolfo Gómez García
bba494cdc0 Merge remote-tracking branch 'origin/v2.0' into v2.1 2016-10-11 07:57:39 +02:00
Adolfo Gómez García
49e3f72d89 Finishing up fixes... 2016-10-10 22:16:41 +02:00
Adolfo Gómez García
a266cdaeff Fixing on Linux getting mor than one XScreenSaverAllocInfo (too many
clients error with time...)
2016-10-10 22:03:19 +02:00
Adolfo Gómez García
43bf2de385 Small fix for actor timeout detection on centos 7 2016-10-10 21:43:50 +02:00
Adolfo Gómez García
447dc23914 Fixed 2.1 version 2016-10-10 08:35:56 +02:00
Adolfo Gómez García
49aaaedbe9 Backporting transport limitation by connecting os 2016-10-10 08:31:32 +02:00
Adolfo Gómez García
7892a196ac Adapting v2.1 2016-10-10 07:52:03 +02:00
271 changed files with 28329 additions and 12908 deletions

View File

@@ -1 +1 @@
2.0.0
2.1.0

2
actors/.gitignore vendored
View File

@@ -6,3 +6,5 @@ udsactor*.changes
/udsactor_1.7.0.dsc
/udsactor_1.7.0.tar.xz
/udsactor*.rpm
/udsactor_2.1.0_amd64.buildinfo
linux/debian/files

View File

@@ -1,3 +1,9 @@
udsactor (2.1.0) stable; urgency=medium
* Fixes for 2.1.0 release
-- Adolfo Gómez García <agomez@virtualcable.es> Tue, 19 Jan 2017 08:00:22 +0200
udsactor (2.0.0) stable; urgency=medium
* Upgrade for 2.0.0

View File

@@ -1,3 +0,0 @@
udsactor-nx_2.0.0_all.deb x11 optional
udsactor-xrdp_2.0.0_all.deb x11 optional
udsactor_2.0.0_all.deb admin optional

View File

@@ -5,6 +5,7 @@
set -e
case "$1" in
configure)
/usr/bin/python2.7 -m compileall /usr/share/UDSActor > /dev/nul 2>&1
# If new "fresh" install or if configuration file has disappeared...
if [ "$2" = "" ] || [ ! -f /etc/udsactor/udsactor.cfg ]; then
db_get udsactor/host

View File

@@ -8,5 +8,5 @@ Type=Application
NoDisplay=true
X-KDE-autostart-after=panel
X-KDE-StartupNotify=false
X-DBUS-StartupType=Unique
X-KDE-UniqueApplet=true
X-DBUS-StartupType=None
X-KDE-UniqueApplet=false

View File

@@ -51,6 +51,8 @@ from udsactor import VERSION
trayIcon = None
doLogoff = False
def sigTerm(sigNo, stackFrame):
if trayIcon:
@@ -253,7 +255,7 @@ class UDSSystemTray(QtGui.QSystemTrayIcon):
if remainingTime <= 0:
logger.info('User has been idle for too long, notifying Broker that service can be reclaimed')
self.quit()
self.quit(logoff=True)
def displayMessage(self, message):
logger.debug('Displaying message')
@@ -290,7 +292,8 @@ class UDSSystemTray(QtGui.QSystemTrayIcon):
def about(self):
self.aboutDlg.exec_()
def quit(self):
def quit(self, logoff=False):
global doLogoff
logger.debug('Quit invoked')
if self.stopped is False:
self.stopped = True
@@ -303,10 +306,7 @@ class UDSSystemTray(QtGui.QSystemTrayIcon):
# May we have lost connection with server, simply exit in that case
pass
try:
operations.loggoff() # Invoke log off
except Exception:
pass
doLogoff = logoff
self.app.quit()
@@ -339,4 +339,12 @@ if __name__ == '__main__':
logger.debug('Exiting')
trayIcon.quit()
if doLogoff:
try:
time.sleep(1)
operations.loggoff() # Invoke log off
except Exception:
pass
sys.exit(res)

View File

@@ -34,7 +34,7 @@ from __future__ import unicode_literals
# On centos, old six release does not includes byte2int, nor six.PY2
import six
VERSION = '2.0.0'
VERSION = '2.1.0'
__title__ = 'udsactor'
__version__ = VERSION

View File

@@ -196,13 +196,22 @@ class HTTPServerThread(threading.Thread):
self.initiateServer(address)
def getPort(self):
return self.address[1]
def getIp(self):
return self.address[0]
def initiateServer(self, address):
self.server = socketserver.TCPServer(address, HTTPServerHandler)
self.address = (address[0], address[1]) # Copy address & keep it for future reference...
addr = ('0.0.0.0', address[1]) # Adapt to listen on 0.0.0.0
self.server = socketserver.TCPServer(addr, HTTPServerHandler)
self.server.socket = ssl.wrap_socket(self.server.socket, certfile=self.certFile, server_side=True)
def getServerUrl(self):
return 'https://{}:{}/{}'.format(self.server.server_address[0], self.server.server_address[1], HTTPServerHandler.uuid)
return 'https://{}:{}/{}'.format(self.getIp(), self.getPort(), HTTPServerHandler.uuid)
def stop(self):
logger.debug('Stopping REST Service')
@@ -211,11 +220,14 @@ class HTTPServerThread(threading.Thread):
def restart(self, address=None):
if address is None:
address = self.server.server_address
# address = self.server.server_address
address = self.address
self.stop()
self.address = (address[0], self.address[1]) # Copy address & keep it for future reference, port is never changed once assigned on init
self.initiateServer(address)
# Listening on 0.0.0.0, does not need to restart listener..
# self.stop()
# self.initiateServer(address)
def run(self):
self.server.serve_forever()

View File

@@ -36,6 +36,8 @@ import sys
import six
import traceback
import pickle
import errno
import time
from udsactor.utils import toUnicode
from udsactor.log import logger
@@ -407,8 +409,11 @@ class ClientIPC(threading.Thread):
self.messageReceived()
except socket.error as e:
if e.errno == errno.EINTR:
time.sleep(1) #
continue # Ignore interrupted system call
logger.error('Communication with server got an error: {}'.format(toUnicode(e.strerror)))
self.running = False
# self.running = False
return
except Exception as e:
tb = traceback.format_exc()

View File

@@ -36,6 +36,7 @@ from udsactor import operations
from udsactor.service import CommonService
from udsactor.service import initCfg
from udsactor.service import IPC_PORT
from udsactor import ipc
from udsactor.log import logger
@@ -44,15 +45,23 @@ from udsactor.linux.daemon import Daemon
from udsactor.linux import renamer
import sys
import time
import os
import stat
import subprocess
POST_CMD = '/etc/udsactor/post'
PRECONNECT_CMD = '/etc/udsactor/pre'
try:
from prctl import set_proctitle
from prctl import set_proctitle # @UnresolvedImport
except Exception: # Platform may not include prctl, so in case it's not available, we let the "name" as is
def set_proctitle(_):
pass
class UDSActorSvc(Daemon, CommonService):
rebootMachineAfterOp = False
def __init__(self, args=None):
Daemon.__init__(self, '/var/run/udsa.pid')
CommonService.__init__(self)
@@ -62,6 +71,12 @@ class UDSActorSvc(Daemon, CommonService):
Renames the computer, and optionally sets a password for an user
before this
'''
hostName = operations.getComputerName()
if hostName.lower() == name.lower():
logger.info('Computer name is already {}'.format(hostName))
self.setReady()
return
# Check for password change request for an user
if user is not None:
@@ -75,13 +90,48 @@ class UDSActorSvc(Daemon, CommonService):
'Could not change password for user {} (maybe invalid current password is configured at broker): {} '.format(user, unicode(e)))
renamer.rename(name)
self.setReady()
if self.rebootMachineAfterOp is False:
self.setReady()
else:
logger.info('Rebooting computer to activate new name {}'.format(name))
self.reboot()
def joinDomain(self, name, domain, ou, account, password):
logger.fatal('Join domain is not supported on linux platforms right now')
def preConnect(self, user, protocol):
'''
Invoked when received a PRE Connection request via REST
'''
# Execute script in /etc/udsactor/post after interacting with broker, if no reboot is requested ofc
# This will be executed only when machine gets "ready"
try:
if os.path.isfile(PRECONNECT_CMD):
if (os.stat(PRECONNECT_CMD).st_mode & stat.S_IXUSR) != 0:
subprocess.call([PRECONNECT_CMD, user, protocol])
else:
logger.info('PRECONNECT file exists but it it is not executable (needs execution permission by root)')
else:
logger.info('PRECONNECT file not found & not executed')
except Exception as e:
# Ignore output of execution command
logger.error('Executing preconnect command give')
def run(self):
initCfg()
cfg = initCfg() # Gets a local copy of config to get "reboot"
logger.debug('CFG: {}'.format(cfg))
if cfg is not None:
self.rebootMachineAfterOp = cfg.get('reboot', True)
else:
self.rebootMachineAfterOp = False
logger.info('Reboot after is {}'.format(self.rebootMachineAfterOp))
logger.debug('Running Daemon')
set_proctitle('UDSActorDaemon')
@@ -106,6 +156,21 @@ class UDSActorSvc(Daemon, CommonService):
logger.debug('Reboot has been requested, stopping service')
return
# Execute script in /etc/udsactor/post after interacting with broker, if no reboot is requested ofc
# This will be executed only when machine gets "ready"
try:
if os.path.isfile(POST_CMD):
if (os.stat(POST_CMD).st_mode & stat.S_IXUSR) != 0:
subprocess.call([POST_CMD, ])
else:
logger.info('POST file exists but it it is not executable (needs execution permission by root)')
else:
logger.info('POST file not found & not executed')
except Exception as e:
# Ignore output of execution command
logger.error('Executing post command give')
self.initIPC()
# *********************

View File

@@ -122,7 +122,7 @@ def getComputerName():
def getNetworkInfo():
for ifname in _getInterfaces():
ip, mac = _getIpAndMac(ifname)
if mac != '00:00:00:00:00:00': # Skips local interfaces
if mac != '00:00:00:00:00:00' and ip.startswith('169.254') is False: # Skips local interfaces & interfaces with no dhcp IPs
yield utils.Bunch(name=ifname, mac=mac, ip=ip)

View File

@@ -78,3 +78,11 @@ def writeConfig(data):
cfg.write(f)
os.chmod(CONFIGFILE, 0o0600)
def useOldJoinSystem():
return False
# Right now, we do not really need an application to be run on "startup" as could ocur with windows
def runApplication():
return None

View File

@@ -70,6 +70,8 @@ def initCfg():
cfg = None
break
return cfg
class CommonService(object):
def __init__(self):
@@ -84,6 +86,23 @@ class CommonService(object):
def reboot(self):
self.rebootRequested = True
def execute(self, cmd, section):
import os
import subprocess
import stat
if os.path.isfile(cmd):
if (os.stat(cmd).st_mode & stat.S_IXUSR) != 0:
subprocess.call([cmd, ])
return True
else:
logger.info('{} file exists but it it is not executable (needs execution permission by admin/root)'.format(section))
else:
logger.info('{} file not found & not executed'.format(section))
return False
def setReady(self):
self.api.setReady([(v.mac, v.ip) for v in operations.getNetworkInfo()])
@@ -136,6 +155,13 @@ class CommonService(object):
# Wait a bit before next check
self.doWait(5000)
# Now try to run the "runonce" element
runOnce = store.runApplication()
if runOnce is not None:
if self.execute(runOnce, 'RunOnce') is True:
# operations.reboot()
return False
# Broker connection is initialized, now get information about what to
# do
counter = 0
@@ -210,7 +236,7 @@ class CommonService(object):
self.knownIps = dict(((v.mac, v.ip) for v in netInfo))
# And notify new listening address to broker
address = (self.knownIps[self.api.mac], random.randrange(43900, 44000))
address = (self.knownIps[self.api.mac], self.httpServer.getPort())
# And new listening address
self.httpServer.restart(address)
# sends notification

View File

@@ -40,9 +40,11 @@ import win32event # @UnresolvedImport, pylint: disable=import-error
import win32com.client # @UnresolvedImport, @UnusedImport, pylint: disable=import-error
import pythoncom # @UnresolvedImport, pylint: disable=import-error
import servicemanager # @UnresolvedImport, pylint: disable=import-error
import subprocess
import os
from udsactor import operations
from udsactor import store
from udsactor.service import CommonService
from udsactor.service import initCfg
@@ -55,6 +57,8 @@ from .SENS import SENSGUID_PUBLISHER
from .SENS import PROGID_EventSubscription
from .SENS import PROGID_EventSystem
POST_CMD = 'c:\\windows\\post-uds.bat'
class UDSActorSvc(win32serviceutil.ServiceFramework, CommonService):
'''
@@ -113,7 +117,7 @@ class UDSActorSvc(win32serviceutil.ServiceFramework, CommonService):
operations.renameComputer(name)
# Reboot just after renaming
logger.info('Rebooting computer got activate new name {}'.format(name))
logger.info('Rebooting computer to activate new name {}'.format(name))
self.reboot()
def oneStepJoin(self, name, domain, ou, account, password):
@@ -158,12 +162,15 @@ class UDSActorSvc(win32serviceutil.ServiceFramework, CommonService):
ver = ver[0] * 10 + ver[1]
logger.debug('Starting joining domain {} with name {} (detected operating version: {})'.format(
domain, name, ver))
# If file c:\compat.bin exists, joind domain in two steps instead one
# Accepts one step joinDomain, also remember XP is no more supported by
# microsoft, but this also must works with it because will do a "multi
# step" join
if ver >= 60:
if ver >= 60 and store.useOldJoinSystem() is False:
self.oneStepJoin(name, domain, ou, account, password)
else:
logger.info('Using multiple step join because configuration requests to do so')
self.multiStepJoin(name, domain, ou, account, password)
def preConnect(self, user, protocol):
@@ -292,6 +299,17 @@ class UDSActorSvc(win32serviceutil.ServiceFramework, CommonService):
logger.debug('Registered SENS, running main loop')
# Execute script in c:\\windows\\post-uds.bat after interacting with broker, if no reboot is requested ofc
# This will be executed only when machine gets "ready"
try:
if os.path.isfile(POST_CMD):
subprocess.call([POST_CMD, ])
else:
logger.info('POST file not found & not executed')
except Exception as e:
# Ignore output of execution command
logger.error('Executing post command give')
# *********************
# * Main Service loop *
# *********************

View File

@@ -82,7 +82,6 @@ def readConfig():
except Exception:
return None
def writeConfig(data, fixPermissions=True):
try:
key = wreg.OpenKey(baseKey, path, 0, wreg.KEY_ALL_ACCESS) # @UndefinedVariable
@@ -93,3 +92,32 @@ def writeConfig(data, fixPermissions=True):
wreg.SetValueEx(key, "", 0, wreg.REG_BINARY, encoder(cPickle.dumps(data))) # @UndefinedVariable
wreg.CloseKey(key) # @UndefinedVariable
def useOldJoinSystem():
try:
key = wreg.OpenKey(baseKey, 'Software\\UDSEnterpriseActor', 0, wreg.KEY_QUERY_VALUE) # @UndefinedVariable
try:
data, _ = wreg.QueryValueEx(key, 'join') # @UndefinedVariable
except Exception:
data = ''
wreg.CloseKey(key) # @UndefinedVariable
except:
data = ''
return data == 'old'
# Gives the oportunity to run an application ONE TIME (because, the registry key "run" will be deleted after read)
def runApplication():
try:
key = wreg.OpenKey(baseKey, 'Software\\UDSEnterpriseActor', 0, wreg.KEY_ALL_ACCESS) # @UndefinedVariable
try:
data, _ = wreg.QueryValueEx(key, 'run') # @UndefinedVariable
wreg.DeleteValue(key, 'run') # @UndefinedVariable
except Exception:
data = None
wreg.CloseKey(key) # @UndefinedVariable
except:
data = None
return data

View File

@@ -1,6 +1,6 @@
#!/bin/bash
VERSION=`cat ../../VERSION`
VERSION=`cat ../../../VERSION`
RELEASE=1
# Debian based
dpkg-buildpackage -b

View File

@@ -1,3 +1,9 @@
udsclient (2.1.0) stable; urgency=medium
* Updated release
-- Adolfo Gómez García <agomez@virtualcable.es> Sun, 23 Oct 2016 21:12:23 +0200
udsclient (2.0.0) stable; urgency=medium
* Release upgrade

View File

@@ -0,0 +1,2 @@
udsclient_2.1.0_all.deb admin optional
udsclient_2.1.0_amd64.buildinfo admin optional

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2014 Virtual Cable S.L.
# Copyright (c) 2017 Virtual Cable S.L.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
@@ -281,7 +281,7 @@ if __name__ == "__main__":
# Setup REST api endpoint
RestRequest.restApiUrl = '{}://{}/rest/client'.format(['http', 'https'][ssl], host)
logger.debug('Setting requert URL to {}'.format(RestRequest.restApiUrl))
logger.debug('Setting request URL to {}'.format(RestRequest.restApiUrl))
# RestRequest.restApiUrl = 'https://172.27.0.1/rest/client'
try:

View File

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View File

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 137 KiB

View File

@@ -34,7 +34,7 @@ from __future__ import unicode_literals
# On centos, old six release does not includes byte2int, nor six.PY2
import six
VERSION = '2.0.0'
VERSION = '2.1.0'
__title__ = 'udclient'
__version__ = VERSION

View File

@@ -33,10 +33,17 @@ from __future__ import unicode_literals
import logging
import os
import sys
import tempfile
if sys.platform.startswith('linux'):
from os.path import expanduser
logFile = expanduser('~/udsclient.log')
else:
logFile = os.path.join(tempfile.gettempdir(), b'udsclient.log')
logging.basicConfig(
filename=os.path.join(tempfile.gettempdir(), b'udsclient.log'),
filename=logFile,
filemode='a',
format='%(levelname)s %(asctime)s %(message)s',
level=logging.DEBUG

View File

@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Virtual Cable S.L.
# Copyright (c) 2017 Virtual Cable S.L.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,

View File

@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Virtual Cable S.L.
# Copyright (c) 2017 Virtual Cable S.L.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,

View File

@@ -1 +0,0 @@
udsclient_2.0.0_all.deb admin optional

17
client/thin/.project Normal file
View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>UDSClient-Thin</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.python.pydev.PyDevBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.python.pydev.pythonNature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?eclipse-pydev version="1.0"?><pydev_project>
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
<path>/${PROJECT_DIR_NAME}/src</path>
</pydev_pathproperty>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
</pydev_project>

View File

@@ -0,0 +1,158 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 Virtual Cable S.L.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of Virtual Cable S.L. nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
'''
@author: Adolfo Gómez, dkmaster at dkmon dot com
'''
from __future__ import unicode_literals
from uds import ui
from uds.rest import RestRequest, RetryException
from uds.forward import forward
from uds import VERSION
from uds.log import logger # @UnresolvedImport
from uds import tools
import six
import sys
import pickle
def approveHost(host):
from os.path import expanduser
hostsFile = expanduser('~/.udsclient.hosts')
try:
with open(hostsFile, 'r') as f:
approvedHosts = f.read().splitlines()
except Exception:
approvedHosts = []
host = host.lower()
if host in approvedHosts:
return True
errorString = 'The server {} must be approved:\n'.format(host)
errorString += 'Only approve UDS servers that you trust to avoid security issues.'
approved = ui.question("ACCESS Warning", errorString)
if approved:
approvedHosts.append(host)
logger.debug('Host was approved, saving to approvedHosts file')
try:
with open(hostsFile, 'w') as f:
f.write('\n'.join(approvedHosts))
except Exception:
logger.warn('Got exception writing to {}'.format(hostsFile))
return approved
def getWithRetry(rest, url, params=None):
while True:
try:
res = rest.get(url, params)
return res
except RetryException as e:
if ui.question('Service not available', 'Error {}.\nPlease, wait a minute and press "OK" to retry, or "CANCEL" to abort'.format(e)) is True:
continue
raise Exception('Cancelled by user')
if __name__ == "__main__":
logger.debug('Initializing connector')
if six.PY3 is False:
logger.debug('Fixing threaded execution of commands')
import threading
threading._DummyThread._Thread__stop = lambda x: 42
# First parameter must be url
try:
uri = sys.argv[1]
if uri == '--test':
sys.exit(0)
logger.debug('URI: {}'.format(uri))
if uri[:6] != 'uds://' and uri[:7] != 'udss://':
raise Exception()
ssl = uri[3] == 's'
host, ticket, scrambler = uri.split('//')[1].split('/')
logger.debug('ssl: {}, host:{}, ticket:{}, scrambler:{}'.format(ssl, host, ticket, scrambler))
except Exception:
logger.debug('Detected execution without valid URI, exiting')
ui.message('UDS Client', 'UDS Client Version {}'.format(VERSION))
sys.exit(1)
rest = RestRequest(host, ssl)
logger.debug('Setting request URL to {}'.format(rest.restApiUrl))
# Main requests part
# First, get version
try:
res = getWithRetry(rest, '')
logger.debug('Got information {}'.format(res))
if res['requiredVersion'] > VERSION:
ui.message("New UDS Client available", "A new uds version is needed in order to access this version of UDS.\nPlease, download and install it")
sys.exit(1)
res = getWithRetry(rest, '/{}/{}'.format(ticket, scrambler), params={'hostname': tools.getHostName(), 'version': VERSION})
script = res.decode('base64').decode('bz2')
logger.debug('Script: {}'.format(script))
six.exec_(script, globals(), {'parent': None})
except Exception as e:
error = 'ERROR: {}'.format(e)
logger.error(error)
ui.message('Error', error)
sys.exit(2)
# Finalize
try:
tools.waitForTasks()
except Exception:
pass
try:
tools.unlinkFiles()
except Exception:
pass
try:
tools.execBeforeExit()
except Exception:
pass

View File

@@ -0,0 +1 @@
../../../full/src/uds/__init__.py

View File

@@ -0,0 +1 @@
../../../full/src/uds/forward.py

1
client/thin/src/uds/log.py Symbolic link
View File

@@ -0,0 +1 @@
../../../full/src/uds/log.py

View File

@@ -0,0 +1 @@
../../../full/src/uds/osDetector.py

View File

@@ -0,0 +1,86 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Virtual Cable S.L.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of Virtual Cable S.L. nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
'''
@author: Adolfo Gómez, dkmaster at dkmon dot com
'''
from __future__ import unicode_literals
import requests
from . import VERSION
import json
import six
import osDetector
from .log import logger
class RetryException(Exception):
pass
class RestRequest(object):
restApiUrl = ''
def __init__(self, host, ssl=True): # parent not used
super(RestRequest, self).__init__()
self.host = host
self.ssl = ssl
self.restApiUrl = '{}://{}/rest/client'.format(['http', 'https'][ssl], host)
def get(self, url, params=None):
url = self.restApiUrl + url
if params is not None:
url += '?' + '&'.join('{}={}'.format(k, six.moves.urllib.parse.quote(six.text_type(v).encode('utf8'))) for k, v in params.iteritems()) # @UndefinedVariable
logger.debug('Requesting {}'.format(url))
try:
r = requests.get(url, headers={'Content-type': 'application/json', 'User-Agent': osDetector.getOs() + " - UDS Connector " + VERSION })
except requests.exceptions.ConnectionError as e:
raise Exception('Error connecting to UDS Server at {}'.format(self.restApiUrl[0:-11]))
if r.ok:
logger.debug('Request was OK. {}'.format(r.text))
data = json.loads(r.text)
if not 'error' in data:
return data['result']
# Has error
if data.get('retryable', '0') == '1':
raise RetryException(data['error'])
raise Exception(data['error'])
else:
logger.error('Error requesting {}: {}, {}'.format(url, r.code. r.text))
raise Exception('Error {}: {}'.format(r.code, r.text))
return data

View File

@@ -0,0 +1 @@
../../../full/src/uds/tools.py

View File

@@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 Virtual Cable S.L.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of Virtual Cable S.L. nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
'''
@author: Adolfo Gómez, dkmaster at dkmon dot com
'''
from __future__ import unicode_literals
try:
import gtkui as theUI
except Exception:
import consoleui as theUI # @Reimport
def message(title, message):
theUI.message(title, message)
def question(title, message):
return theUI.question(title, message)

View File

@@ -0,0 +1,58 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 Virtual Cable S.L.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of Virtual Cable S.L. nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
'''
@author: Adolfo Gómez, dkmaster at dkmon dot com
'''
from __future__ import unicode_literals
import random
import os
import tempfile
import string
import webbrowser
TEMPLATE = '''<html>
<head>
<title>{title}</title>
</head>
<body>
<h1>{title}</h1>
<p>{message}<P>
</body>
</html>
'''
def _htmlFilename():
return os.path.join(tempfile.gettempdir(), ''.join([random.choice(string.ascii_lowercase) for i in range(22)]) + '.html')
def message(title, message):
filename = _htmlFilename()
with open(filename, 'w') as f:
f.write(TEMPLATE.format(title=title, message=message))
webbrowser.open('file://' + filename, new=0, autoraise=False)

View File

@@ -0,0 +1,49 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 Virtual Cable S.L.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of Virtual Cable S.L. nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
'''
@author: Adolfo Gómez, dkmaster at dkmon dot com
'''
from __future__ import unicode_literals
import sys
import time
from uds.log import logger
counter = 0
def message(title, message):
sys.stderr.write("** {} **\n {}\n".format(title, message))
def question(title, message):
global counter
if counter > 100: # 5 minutes
return False
counter += 1
sys.stderr.write("** {} **\n{}\nReturning YES in 3 seconds. (counter is {})\n".format(title, message, counter))
time.sleep(3) # Wait 3 seconds before returning
return True

View File

@@ -0,0 +1,143 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 Virtual Cable S.L.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of Virtual Cable S.L. nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
'''
@author: Adolfo Gómez, dkmaster at dkmon dot com
'''
from __future__ import unicode_literals
import re
import pygtk
pygtk.require('2.0')
import gtk
import gobject
LINE_LEN = 65
class Dialog():
def __init__(self, title, message, timeout=-1, withCancel=True):
self.title = title
self.message = message
self.timeout = timeout
self.withCancel = withCancel
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.set_position(gtk.WIN_POS_CENTER)
# self.window.set_size_request(320, 200)
self.window.set_title(self.title)
self.create_widgets()
self.connect_signals()
self.window.show_all()
self.window.connect("destroy", self.destroy)
# Setup "auto OK" timer
if timeout != -1:
self.timerId = gobject.timeout_add(self.timeout * 1000, self.callback_timer)
else:
self.timerId = -1
self.result = False
gtk.main()
@property
def adapted_message(self):
msg = ''
for l in re.sub(r'<p[^>]*>', '', self.message).replace('</p>', '\n').split('\n'):
words = []
length = 0
for word in l.split(' '):
if length + len(word) >= LINE_LEN:
msg += ' '.join(words) + '\n'
words = []
length = 0
length += len(word) + 1
words.append(word)
msg += ' '.join(words) + '\n'
return msg
def create_widgets(self):
self.vbox = gtk.VBox(spacing=10)
self.vbox.set_size_request(490, -1)
self.messageLabel = gtk.Label()
# Fix message markup
# self.message = re.sub(r'<p[^>]*>', '<span font_weight="bold">', self.message).replace('</p>', '</span>\n' )
# Set as simple markup
self.messageLabel.set_markup('\n' + self.adapted_message + '\n')
self.messageLabel.set_alignment(xalign=0.5, yalign=1)
self.hbox = gtk.HBox(spacing=10)
self.button_ok = gtk.Button("OK")
self.hbox.pack_start(self.button_ok)
if self.withCancel:
self.button_cancel = gtk.Button("Cancel")
self.hbox.pack_start(self.button_cancel)
self.vbox.pack_start(self.messageLabel)
self.vbox.pack_start(self.hbox)
self.window.add(self.vbox)
def connect_signals(self):
self.button_ok.connect("clicked", self.callback_ok)
if self.withCancel:
self.button_cancel.connect("clicked", self.callback_cancel)
def destroy(self, widget, data=None):
self.setResult(False)
def setResult(self, val):
if self.timerId != -1:
gobject.source_remove(self.timerId)
self.timerId = -1
self.result = val
self.window.hide()
gtk.main_quit()
def callback_ok(self, widget, callback_data=None):
self.setResult(True)
def callback_cancel(self, widget, callback_data=None):
self.setResult(False)
def callback_timer(self):
self.setResult(True)
def message(title, message):
Dialog(title, message, withCancel=False)
def question(title, message):
dlg = Dialog(title, message, timeout=30, withCancel=True)
return dlg.result

View File

@@ -0,0 +1,4 @@
#!/bin/sh
cd /lib/UDSClient
exec python UDSClient.pyc $@

View File

@@ -0,0 +1,11 @@
Steps:
1.- If building from repository, full copy (recursive) the "src" folder of "udsclient/thin" inside the "udsclient" folder. If building from the .tar.gz, simply ignor4e this step
2.- Copy the folder "udsclient" to /build/packages inside the thinstation build environment
3.- enter the chroot of thinstation
4.- go to the udsclient folder (/build/packages/udsclient)
5.- Execute "build.sh"
6.- Edit the file /build/build.conf, and add this line:
package udsclient
7.- Execute the build process
Ready!!!

View File

View File

@@ -0,0 +1,2 @@
lib
src

View File

@@ -0,0 +1,11 @@
[Desktop Entry]
Name=UDSClient
Comment=UDS Helper
Keywords=uds;client;vdi;
Exec=/bin/udsclient %u
Icon=help-browser
StartupNotify=true
Terminal=false
Type=Application
Categories=Utility;
MimeType=x-scheme-handler/uds;x-scheme-handler/udss;

View File

@@ -0,0 +1,4 @@
#!/bin/sh
cd /lib/UDSClient
exec python UDSClient.pyc $@

View File

@@ -0,0 +1,13 @@
#!/bin/sh
pip install paramiko requests six
rm -rf lib
mkdir -p lib/python2.7/site-packages
for a in requests paramiko pyasn1 cryptography packaging idna asn1crypto six enum ipaddress cffi ; do cp -r /usr/lib/python2.7/site-packages/$a* lib/python2.7/site-packages/; done
cp src/udsclient bin
chmod 755 bin/udsclient
mkdir lib/UDSClient
cp src/UDSClient.py lib/UDSClient
chmod 755 lib/UDSClient/UDSClient.py
cp -r src/uds lib/UDSClient
mkdir lib/applications
cp UDSClient.desktop lib/applications

View File

@@ -0,0 +1,5 @@
base
#add your own dependancies to this file, base should always be included.
python
pygtk
freerdp

View File

@@ -0,0 +1,15 @@
In here you place the commands to start your application if using the scripts
/etc/thinstation.packages
or /etc/thinstation.console
see examples for for information
possible types are
example.global (this is always needed)
example.menu
example.console
example.window
example.fullscreen

View File

@@ -0,0 +1 @@
CMD_FULLSCREEN="example -FULLSCREEN"

View File

@@ -0,0 +1 @@
CMD_GLOBAL="example -startapp"

View File

@@ -0,0 +1 @@
Place a 0 length file in here as the same name as the package if your application is a Console App

View File

@@ -0,0 +1,34 @@
#! /bin/sh
. /etc/thinstation.global
# note you can replace this package with a symlink to /etc/thinstation.packages
# for GUI apps, or /etc/thinstation.console for console apps
# if you do then you will need to create a seperate initilization script for
# any other parameters which need to be started at bootup
case "$1" in
init)
if ! pkg_initialized $PACKAGE; then
# Your startup instructions go here
pkg_set_init_flag $PACKAGE
fi
;;
console)
;;
window)
;;
fullscreen)
;;
help)
echo "Usage: $0 init"
;;
*)
exit 1
;;
esac
exit 0

View File

@@ -0,0 +1 @@
/etc/init.d/your_start_up_script

13
guacamole-tunnel/.gitignore vendored Normal file
View File

@@ -0,0 +1,13 @@
# Backup files
*~
# Generated files
src/main/webapp/META-INF/
src/main/webapp/generated/
target/
# IDE-specific configuration
nb-configuration.xml
.classpath
.project

View File

@@ -7,7 +7,7 @@
<groupId>org.openuds.server</groupId>
<artifactId>transport</artifactId>
<packaging>war</packaging>
<version>2.0.0</version>
<version>2.5.0</version>
<name>Guacamole Transport</name>
<url>https://github.com/dkmstr/openuds</url>
@@ -81,14 +81,14 @@
<dependency>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-common</artifactId>
<version>0.9.9-incubating</version>
<version>0.9.10-incubating</version>
</dependency>
<!-- Guacamole JavaScript library -->
<dependency>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-common-js</artifactId>
<version>0.9.9-incubating</version>
<version>0.9.12-incubating</version>
<type>zip</type>
<scope>runtime</scope>
</dependency>

View File

@@ -2,7 +2,7 @@
<!DOCTYPE html>
<!--
Copyright (C) 2013 Glyptodon LLC
Copyright (C) 2017 Glyptodon, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -147,30 +147,12 @@
<!-- guacamole-default-webapp scripts -->
<script type="text/javascript" src="scripts/session.js"></script>
<script type="text/javascript" src="scripts/history.js"></script>
<script type="text/javascript" src="scripts/service.js"></script>
<script type="text/javascript" src="scripts/guac-ui.js"></script>
<script type="text/javascript" src="scripts/client-ui.js"></script>
<!-- Init -->
<script type="text/javascript"> /* <![CDATA[ */
/*function getQueryParams(qs) {
qs = qs.split("+").join(" ");
var params = {}, tokens,
re = /[?&]?([^=]+)=([^&]*)/g;
while (tokens = re.exec(qs)) {
params[decodeURIComponent(tokens[1])]
= decodeURIComponent(tokens[2]);
}
return params;
}
window.query = getQueryParams(document.location.search);*/
// Adapted to 1.5
function getQueryParams(qs) {
qs = qs.split("+").join(" ");
@@ -187,16 +169,11 @@
window.query = getQueryParams(document.location.href);
// Sanity check Guacamole JavaScript API version
// if (Guacamole.API_VERSION !== "0.9.1")
// GuacUI.Client.showStatus("Clear Your Cache", "An older version of Guacamole has been cached by your browser. Please clear your browser's cache and try again.");
// Start connect after control returns from onload (allow browser
// to consider the page loaded).
//else
window.onload = function() {
window.setTimeout(GuacUI.Client.connect, 10);
};
window.onload = function() {
window.setTimeout(GuacUI.Client.connect, 10);
};
/* ]]> */ </script>

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2013 Glyptodon LLC
* Copyright (C) 2017 Glyptodon, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -746,48 +746,6 @@ GuacUI.Client.Pinch = function(element) {
};
/**
* Flattens the attached Guacamole.Client, storing the result within the
* connection history.
*/
GuacUI.Client.updateThumbnail = function() {
var guac = GuacUI.Client.attachedClient;
if (!guac)
return;
// Do not create empty thumbnails
if (guac.getDisplay().getWidth() <= 0 || guac.getDisplay().getHeight() <= 0)
return;
// Get screenshot
var canvas = guac.getDisplay().flatten();
// Calculate scale of thumbnail (max 320x240, max zoom 100%)
var scale = Math.min(
320 / canvas.width,
240 / canvas.height,
1
);
// Create thumbnail canvas
var thumbnail = document.createElement("canvas");
thumbnail.width = canvas.width*scale;
thumbnail.height = canvas.height*scale;
// Scale screenshot to thumbnail
var context = thumbnail.getContext("2d");
context.drawImage(canvas,
0, 0, canvas.width, canvas.height,
0, 0, thumbnail.width, thumbnail.height
);
// Save thumbnail to history
var id = decodeURIComponent(window.location.search.substring(4));
GuacamoleHistory.update(id, thumbnail.toDataURL());
};
/**
* Sets the current display scale to the given value, where 1 is 100% (1:1
* pixel ratio). Out-of-range values will be clamped in-range.
@@ -1588,15 +1546,11 @@ GuacUI.Client.attach = function(guac) {
}, false);
/*
* Disconnect and update thumbnail on close
* Disconnect on close
*/
window.onunload = function() {
GuacUI.Client.updateThumbnail();
if (GuacUI.Client.attachedClient)
GuacUI.Client.attachedClient.disconnect();
};
/*

Some files were not shown because too many files have changed in this diff Show More