Compare commits

..

464 Commits
v3.5 ... master

Author SHA1 Message Date
Adolfo Gómez García
c07c21b6a9
updating user interface manager 2022-10-31 20:53:30 +01:00
Adolfo Gómez García
937240a9fc
Refactoring Authenticators related and minor type checking fixes 2022-10-31 19:24:14 +01:00
Adolfo Gómez García
0cf33501b6
some minor test fixes 2022-10-31 14:10:10 +01:00
Adolfo Gómez García
15576fdc22
Updating user interface and making tests 2022-10-31 01:47:55 +01:00
Adolfo Gómez García
adb4b5326a
Adding user interface tests and refactoring user interface 2022-10-30 23:14:13 +01:00
Adolfo Gómez García
284508632c
Merge remote-tracking branch 'origin/v3.6' 2022-10-28 14:44:34 +02:00
Adolfo Gómez García
dd08257fb9
Merge remote-tracking branch 'origin/v3.5' into v3.6 2022-10-28 14:42:35 +02:00
Adolfo Gómez García
71a0a228fb
merged backport of uds password encription 2022-10-27 14:55:43 +02:00
Adolfo Gómez García
910094065e
Merge remote-tracking branch 'origin/v3.6' 2022-10-27 14:47:03 +02:00
Adolfo Gómez García
7bd0d571e6
increased security by encrypting with own key, different on each instalation 2022-10-27 14:46:34 +02:00
Adolfo Gómez García
ab6c55ec58
Merge remote-tracking branch 'origin/v3.6' 2022-10-26 18:33:26 +02:00
Adolfo Gómez García
ad269b3c28
added initial export command for relevant UDS entities 2022-10-26 18:32:52 +02:00
Adolfo Gómez García
00ae824baf
Merge remote-tracking branch 'origin/v3.6' 2022-10-26 16:40:46 +02:00
Adolfo Gómez García
f3dd5753a3
fixed mfa_data name on db 2022-10-26 16:40:04 +02:00
Adolfo Gómez García
c4fcf7c57e
Merge remote-tracking branch 'origin/v3.6' 2022-10-21 00:56:54 +02:00
Adolfo Gómez García
13336b966e
updating delayed task 2022-10-21 00:56:12 +02:00
Adolfo Gómez García
7a64235440
Merge remote-tracking branch 'origin/v3.6' 2022-10-19 15:15:46 +02:00
Adolfo Gómez García
a76989d885
fixed not opening html5 2022-10-19 15:14:52 +02:00
Adolfo Gómez García
6b712d59a3
Merge remote-tracking branch 'origin/v3.6' 2022-10-19 14:20:18 +02:00
Adolfo Gómez García
5f0e5a5dfe
Merge remote-tracking branch 'origin/v3.5' into v3.6 2022-10-19 14:19:46 +02:00
Adolfo Gómez García
92960d47ed
fixing merge issues 2022-10-18 20:47:26 +02:00
Adolfo Gómez García
8648fc605d
small rdp fix for bandit 2022-10-17 18:21:32 +02:00
Adolfo Gómez García
6a71a505b3
Merge remote-tracking branch 'origin/v3.6' 2022-10-17 16:05:05 +02:00
Adolfo Gómez García
d2cb4356f0
Added user interface default value 2022-10-17 13:51:35 +02:00
Adolfo Gómez García
4153fa0fd9
fixes after merge 3.6 2022-10-16 18:54:24 +02:00
Adolfo Gómez García
daf4bbcc37
Merge remote-tracking branch 'origin/v3.6' 2022-10-16 18:47:51 +02:00
Adolfo Gómez García
4f4f1f24fd
fixes for transports 2022-10-16 18:46:56 +02:00
Adolfo Gómez García
ffde47af94
Merge remote-tracking branch 'origin/v3.6' 2022-10-14 19:52:11 +02:00
Adolfo Gómez García
65d38d8722
updated translations 2022-10-14 19:51:58 +02:00
Adolfo Gómez García
db5a08b0c7
Merge remote-tracking branch 'origin/v3.6' 2022-10-14 19:51:53 +02:00
Adolfo Gómez García
2b767e6bf9
small transport fix¡ 2022-10-14 19:51:43 +02:00
Adolfo Gómez García
b16cea984c
Updated mfa string 2022-10-14 19:07:41 +02:00
Adolfo Gómez García
7769351d42
adding spice support for proxmox 2022-10-14 02:07:12 +02:00
Adolfo Gómez García
c2c5bc8aa1
Merged and fixed 2022-10-14 00:47:37 +02:00
Adolfo Gómez García
bf635a5e9a
small html fixes 2022-10-14 00:28:18 +02:00
Adolfo Gómez García
ae2ffccbc3
Added ask credentials dialog 2022-10-13 20:02:02 +02:00
Adolfo Gómez García
a005bf1ca0
fixed incorrect import 2022-10-13 15:05:32 +02:00
Adolfo Gómez García
013558eb77
Merge remote-tracking branch 'origin/v3.6' 2022-10-13 14:50:04 +02:00
Adolfo Gómez García
4de443395d
Updated translations 2022-10-13 14:49:38 +02:00
Adolfo Gómez García
9f2bc5417f
Fixed choiceField bug & MFA table 2022-10-13 14:47:37 +02:00
Adolfo Gómez García
9deb2dcd74
fixing up actor things 2022-10-13 00:04:26 +02:00
Adolfo Gómez García
2908b99435
Merge remote-tracking branch 'origin/v3.6' 2022-10-05 23:56:54 +02:00
Adolfo Gómez García
c6d1bf450c
Fixed choicefield generator for strings (was generating "name" instead of "text") 2022-10-05 23:52:28 +02:00
Adolfo Gómez García
26d26315ac
Merge remote-tracking branch 'origin/v3.6' 2022-10-05 23:06:23 +02:00
Adolfo Gómez García
cf21936f41
Added report for audit log for administration 2022-10-05 23:05:36 +02:00
Adolfo Gómez García
bcf185d54a
Merge remote-tracking branch 'origin/v3.6' 2022-10-05 19:36:09 +02:00
Adolfo Gómez García
5d9c8ee53f
better audit log 2022-10-05 19:35:45 +02:00
Adolfo Gómez García
e1acdf1c85
Merge remote-tracking branch 'origin/v3.6' 2022-10-05 19:16:53 +02:00
Adolfo Gómez García
7d3bfb5d3b
replaced "-" with ":" for checking if a save field is optional so we can provide the default value" 2022-10-05 19:16:30 +02:00
Adolfo Gómez García
186bbb11e3
Merge remote-tracking branch 'origin/v3.6' 2022-10-05 18:08:05 +02:00
Adolfo Gómez García
b474e63924
updated translations 2022-10-05 18:06:48 +02:00
Adolfo Gómez García
09bbc7f22b
Merge remote-tracking branch 'origin/v3.6' 2022-10-05 17:58:15 +02:00
Adolfo Gómez García
d48747abff
Added administration audit and fixed some translations 2022-10-05 17:54:07 +02:00
Adolfo Gómez García
57f2c35af0
Several Fixes:
* Upgraded typing information on models
* Removed unused DBFile
* renamed osmanager.png wrong name
2022-10-01 06:45:41 +02:00
Adolfo Gómez García
8c40320b64
Merge remote-tracking branch 'origin/v3.6' 2022-09-29 16:32:56 +02:00
Adolfo Gómez García
8b3ad295cc
Added MAC controled by uds for proxmox 2022-09-28 15:33:54 +02:00
Adolfo Gómez García
c03c479a14
Merge remote-tracking branch 'origin/v3.6' 2022-09-19 14:24:54 +02:00
Adolfo Gómez García
aa677353ad
fixed tree command 2022-09-19 14:23:44 +02:00
Adolfo Gómez García
9c6c4078b1
Fixed showConfig 2022-09-19 14:04:53 +02:00
Adolfo Gómez García
22cee394ee
Merge remote-tracking branch 'origin/v3.6' 2022-09-18 15:09:47 +02:00
Adolfo Gómez García
9fba2b45ad
Added "ERROR" user services on report with log 2022-09-18 15:09:17 +02:00
Adolfo Gómez García
8f4f6bc5cb
Merge remote-tracking branch 'origin/v3.6' 2022-09-17 00:14:59 +02:00
Adolfo Gómez García
71582fc415
fixed tree yaml generation 2022-09-16 23:27:12 +02:00
Adolfo Gómez García
0d1d38c18a
added showconfig in yaml 2022-09-16 22:34:40 +02:00
Adolfo Gómez García
4ec8841a57
added tree command to allow an full overview of uds data 2022-09-16 18:45:37 +02:00
Adolfo Gómez García
2ecab27b16
Merge remote-tracking branch 'origin/v3.6' 2022-09-16 02:05:23 +02:00
Adolfo Gómez García
8c6390733c
added showconfig command 2022-09-16 00:53:56 +02:00
Adolfo Gómez García
ade53fc893
Merge remote-tracking branch 'origin/v3.6' 2022-09-15 14:06:44 +02:00
Adolfo Gómez García
98f56ee58b
restored deleted line by mistake on auth 2022-09-15 13:06:13 +02:00
Adolfo Gómez García
1c01c35a87
Renamed config value 2022-09-14 12:09:06 +02:00
Adolfo Gómez García
673d1b6813
Added "Ultimate Security". When enabled, UDS will not cache encrypted credentials on server, so no credential can be redirected 2022-09-13 16:14:54 +02:00
Adolfo Gómez García
1ba12bb82d
Updated translations 2022-09-12 15:04:33 +02:00
Adolfo Gómez García
c6dfd3f362
Refactorizing gui variables - types 2022-09-12 14:41:15 +02:00
Adolfo Gómez García
f7888468c0
Refactorizing gui variables 2022-09-12 14:21:55 +02:00
Adolfo Gómez García
ce8bb30cf1
Merge remote-tracking branch 'origin/v3.6' 2022-09-12 12:40:16 +02:00
Adolfo Gómez García
f90f108869
Fixed UserInterface new guiField acceptance of values 2022-09-12 12:37:21 +02:00
Adolfo Gómez García
115d8562e1 Refactorized groups manager and fixed ipInNetwork
Signed-off-by: Adolfo Gómez García <dkmaster@dkmon.com>
2022-09-09 02:13:20 +02:00
Adolfo Gómez García
f6607d0416 Merged allow users remove from 3.6 2022-09-08 12:21:00 +02:00
Adolfo Gómez García
411bddd79d Merge remote-tracking branch 'origin/v3.6' 2022-09-08 12:20:35 +02:00
Adolfo Gómez García
88c3f9077b small cosmetic fix 2022-09-08 12:20:21 +02:00
Adolfo Gómez García
bd13a39845 erge remote-tracking branch 'origin/v3.6' 2022-09-08 12:16:03 +02:00
Adolfo Gómez García
2a01df542d Added "allow reset" and "allow release" to metapool. Automatically enabled is ALL member pools allows. 2022-09-08 12:15:18 +02:00
Adolfo Gómez García
c976536b5f added a new test and small fixes 2022-09-06 15:25:05 +02:00
Adolfo Gómez García
0721c833fb Fixed settings and security (changed order for security middleware to be after globalrequest to fill ips 2022-09-05 15:00:37 +02:00
Adolfo Gómez García
7b877e3aea Merge remote-tracking branch 'origin/v3.6' 2022-09-05 12:53:50 +02:00
Adolfo Gómez García
2733444355 Merge remote-tracking branch 'origin/v3.5' into v3.6 2022-09-05 12:53:31 +02:00
Adolfo Gómez García
62f9f8f676 Merge remote-tracking branch 'origin/v3.6' 2022-09-02 16:47:40 +02:00
Adolfo Gómez García
6692e5ce6d Merge remote-tracking branch 'origin/v3.5' into v3.6 2022-09-02 16:45:25 +02:00
Adolfo Gómez García
2d6f55ef0b more tests and added a few exludes to coverage 2022-09-01 16:14:20 +02:00
Adolfo Gómez García
42b3826115 Added context to coverage and added first model test 2022-09-01 14:39:30 +02:00
Adolfo Gómez García
cb722c5e89 adding "build" to actor 2022-09-01 10:28:02 +02:00
Adolfo Gómez García
32b35c9651 fixed tests 2022-08-31 15:24:08 +02:00
Adolfo Gómez García
e33ea33797 Merge remote-tracking branch 'origin/v3.6' 2022-08-31 15:22:36 +02:00
Adolfo Gómez García
38b3318704 updated translations 2022-08-31 15:22:15 +02:00
Adolfo Gómez García
ccec281e0d Fixed text of maxServices 2022-08-31 15:09:55 +02:00
Adolfo Gómez García
4611c35b0d Merge remote-tracking branch 'origin/v3.6' 2022-08-31 13:54:55 +02:00
Adolfo Gómez García
8473b80978 fixed maxDeployed beinf overwriten 2022-08-31 13:52:45 +02:00
Adolfo Gómez García
230187d9ee small fix on service unmarshall 2022-08-31 13:52:11 +02:00
Adolfo Gómez García
c06c3df327 Merge remote-tracking branch 'origin/v3.6' 2022-08-31 12:52:37 +02:00
Adolfo Gómez García
092bb83001 Added "maxServices" to OpenGnsys to limit number of possible services provided by a single UDS Service 2022-08-31 12:45:33 +02:00
Adolfo Gómez García
5c6303fec0 Added more tests
* Fixed pytest to not look for classes
* Added 'destroy_after' property to user service for convenience
* Small cosmetic fixes
2022-08-31 00:10:57 +02:00
Adolfo Gómez García
b05c5b1396 Merge remote-tracking branch 'origin/v3.6' 2022-08-30 21:53:42 +02:00
Adolfo Gómez García
ac62aed420 upgrading cache updater to take into account maxDeployed to stop creating cache services 2022-08-30 21:53:03 +02:00
Adolfo Gómez García
8b540c350a Added more tests and a couple of cosmetic fixes 2022-08-30 17:40:29 +02:00
Adolfo Gómez García
db12077304 Adding more tests and fixes 2022-08-29 15:21:12 +02:00
Adolfo Gómez García
70488199b9 Merge remote-tracking branch 'origin/v3.6' 2022-08-29 15:20:50 +02:00
Adolfo Gómez García
3bdf4c18ad Fixed detecting canceling hanged 2022-08-29 15:20:43 +02:00
Adolfo Gómez García
e16be78ad5 Fixed remove or cancel detecting "hanged" canceling operations 2022-08-29 15:20:09 +02:00
Adolfo Gómez García
09c5cc2f43 Merge remote-tracking branch 'origin/v3.6' 2022-08-28 19:59:20 +02:00
Adolfo Gómez García
28319b216f updated compat level to 10 2022-08-28 19:23:04 +02:00
Adolfo Gómez García
07e6c3d0a8 unique ids testing 2022-08-28 13:41:57 +02:00
Adolfo Gómez García
96abb71d9c more tests 2022-08-28 13:23:04 +02:00
Adolfo Gómez García
7de259af87 adding more tests 2022-08-28 01:31:09 +02:00
Adolfo Gómez
1567996ebc
Delete LICENSE.txt 2022-08-27 20:59:25 +02:00
Adolfo Gómez
4edb3b3f0c
Create LICENSE 2022-08-27 20:59:08 +02:00
Adolfo Gómez García
07987504c3 added LICENSE.txt 2022-08-27 20:57:12 +02:00
Adolfo Gómez García
5f93b68c25 Modified transport to adapt for accept future client scripts in more langs 2022-08-27 19:09:12 +02:00
Adolfo Gómez García
d0e9c96573 Added new test and make pytests use parallel execution of tests using pytest-xdist 2022-08-25 22:28:57 +02:00
Adolfo Gómez García
a52ad44ef1 added basic web test and download testing 2022-08-25 17:55:51 +02:00
Adolfo Gómez García
69b778c922 Adding more tests and fixes 2022-08-24 22:16:47 +02:00
Adolfo Gómez García
5f12c2e7b3 Merge remote-tracking branch 'origin/v3.6' 2022-08-24 11:09:54 +02:00
Adolfo Gómez García
1a4a41a6b9 fixed logout building absolute url 2022-08-24 11:09:20 +02:00
Adolfo Gómez García
739b0c7f81 fixed logout absolute url building on logout 2022-08-24 11:08:56 +02:00
Adolfo Gómez García
78c7039c54 Merge remote-tracking branch 'origin/v3.6' 2022-08-23 15:23:25 +02:00
Adolfo Gómez García
e5e8ad5fbd Adding radius challenge MFA provided by Daniel Torregrosa (Thanks!) 2022-08-23 15:22:48 +02:00
Adolfo Gómez García
21d2a6fb27 Done actor initialize tests and fixed actor v3 initialization 2022-08-22 15:46:15 +02:00
Adolfo Gómez García
fa3e30c518 fixing tests 2022-08-21 19:37:32 +02:00
Adolfo Gómez García
c6be2562ee added test for initialize for managed machines 2022-08-21 14:23:03 +02:00
Adolfo Gómez García
4c19247a2c Adding more actor tests 2022-08-20 18:40:05 +02:00
Adolfo Gómez García
a6b502e0ba more fixes 2022-08-19 21:09:45 +02:00
Adolfo Gómez García
b12730d160 more test prepartion and fixes 2022-08-19 20:20:29 +02:00
Adolfo Gómez García
07031850e5 Advancing on tests 2022-08-19 00:46:38 +02:00
Adolfo Gómez García
a42857038c Fixes on migrations & finishing supporting test methods 2022-08-19 00:13:45 +02:00
Adolfo Gómez García
d19969fce3 Fixed migration field names on squashed migration. ManyToManyFields where not renamed on empty tables, so i had to move "manually" the creation of the fields on squashed one. Not a big issue, but strange. 2022-08-19 00:13:01 +02:00
Adolfo Gómez García
195e13682c Adding xxhash as fast alternative for some hash calcs (as cache i.e.) 2022-08-18 20:05:43 +02:00
Adolfo Gómez García
95b9b79b02 Adding testing elements 2022-08-18 19:46:22 +02:00
Adolfo Gómez García
225fed3012 Merge remote-tracking branch 'origin/v3.6' 2022-08-18 13:56:46 +02:00
Adolfo Gómez García
86ebd7766e Merge remote-tracking branch 'origin/v3.5' into v3.6 2022-08-18 13:56:32 +02:00
Adolfo Gómez García
d5eafb1179 Refactorized transport to adapt parameter typing 2022-08-17 23:42:33 +02:00
Adolfo Gómez García
11b56571d2 Removing old v2 actor rests. Not supported anymore 2022-08-17 20:26:51 +02:00
Adolfo Gómez García
18de1193b4 Updating tests and fied sample settings
- Fixed taskManager runner (added new parameters)
- refactoring and generating base rest testing
2022-08-17 20:15:32 +02:00
Adolfo Gómez García
d8164a9b4d Merge remote-tracking branch 'origin/v3.6' 2022-08-17 19:03:45 +02:00
Adolfo Gómez García
4f0ea76666 Merge remote-tracking branch 'origin/v3.5' into v3.6 2022-08-17 15:06:49 +02:00
Adolfo Gómez García
18e9cab9ef fixed local log 2022-08-17 14:33:44 +02:00
Adolfo Gómez García
4d3aa1d17c Merge remote-tracking branch 'origin/v3.6' 2022-08-17 14:13:17 +02:00
Adolfo Gómez García
6053e34d1d Merge remote-tracking branch 'origin/v3.5' into v3.6 2022-08-17 14:12:52 +02:00
Adolfo Gómez García
f274ae2fe3 fixed a bit the tests and tests tools 2022-08-16 21:40:46 +02:00
Adolfo Gómez García
195d2a1336 More request definition cleanups 2022-08-16 14:30:20 +02:00
Adolfo Gómez García
12846f9b1f Small XenApi Fixes, requests cleanup 2022-08-16 14:29:38 +02:00
Adolfo Gómez García
748d8d7464 Replaced session PickleSerializer with Json-bases serializer (custom one). More secure 2022-08-16 13:08:47 +02:00
Adolfo Gómez García
0ed1f3ccee Added coverage support on testing 2022-08-16 00:18:32 +02:00
Adolfo Gómez García
fe712d27b7 adding services fixtures 2022-08-16 00:10:48 +02:00
Adolfo Gómez García
c56666ed4b small test fixes 2022-08-15 23:34:52 +02:00
Adolfo Gómez García
01184582b3 Fixing up testing and make them usable from vscode sidebar 2022-08-15 23:31:23 +02:00
Adolfo Gómez García
76745e8624 Fixing up bandit recomendations & minor typo errors 2022-08-15 14:10:17 +02:00
Adolfo Gómez García
17b040d9b3 adding tests 2022-08-15 00:29:39 +02:00
Adolfo Gómez García
07e1c6214e Added Test Service 2022-08-14 23:36:22 +02:00
Adolfo Gómez García
de9bbfc896 removeing deprecated pyqt methods 2022-08-14 21:57:28 +02:00
Adolfo Gómez García
d84977dee0 Merge remote-tracking branch 'origin/v3.6' 2022-08-14 21:53:33 +02:00
Adolfo Gómez García
11041ff44f Merge remote-tracking branch 'origin/v3.5' into v3.6 2022-08-14 21:52:40 +02:00
Adolfo Gómez García
98826504d6 fixing up sqlite 2022-08-14 21:52:06 +02:00
Adolfo Gómez García
54ea57f330 added cache to checkIdle on macos 2022-08-12 22:49:19 +02:00
Adolfo Gómez García
cb4b2184a4 finishin operations for macos 2022-08-12 20:50:58 +02:00
Adolfo Gómez García
99fbb35512 Merge branch 'master' of github.com:dkmstr/openuds 2022-08-08 15:27:40 +02:00
Adolfo Gómez García
1374375ab9 Creating a couple of "test services" so we can make some automated tests 2022-08-08 15:27:30 +02:00
Adolfo Gómez García
909ef91181 Creating a couple of "test services" so we can make some automated tests 2022-08-08 15:27:11 +02:00
Adolfo Gómez García
01f9a1f9cd fixed for usersession 2022-08-07 13:32:07 +02:00
Adolfo Gómez García
78a3216b51 adding initial tracking of individial sessions on user services 2022-08-07 13:24:33 +02:00
Adolfo Gómez García
3a990e19a6 Merge remote-tracking branch 'origin/v3.5' into v3.6 2022-08-06 20:19:36 +02:00
Adolfo Gómez García
e5c8b9c763 Merge remote-tracking branch 'origin/v3.6' 2022-08-06 19:30:31 +02:00
Adolfo Gómez García
e51e13b821 Merge remote-tracking branch 'origin/v3.6' 2022-08-06 19:30:01 +02:00
Adolfo Gómez García
8a150439ae Merge remote-tracking branch 'origin/v3.5' into v3.6 2022-08-06 19:29:43 +02:00
Adolfo Gómez García
ec89a2cfa8 adding session id to uds actor 2022-08-06 19:23:51 +02:00
Adolfo Gómez García
e79753748e Merge remote-tracking branch 'origin/v3.5' into v3.6 2022-08-04 21:56:39 +02:00
Adolfo Gómez García
0ed8bd6027 Merge branch 'master' of github.com:dkmstr/openuds 2022-08-04 15:55:52 +02:00
Adolfo Gómez García
ff25b4945a Started MacOS Unmanaged Support 2022-08-04 15:55:47 +02:00
Adolfo Gómez García
3a2a2a4669 Merge remote-tracking branch 'origin/v3.6' 2022-08-04 15:08:10 +02:00
Adolfo Gómez García
a8a9b24596 exit_url is now relative by default 2022-08-04 15:07:52 +02:00
Adolfo Gómez García
552ba3796b adding __slots__ to optimize a bit code 2022-08-02 15:26:30 +02:00
Adolfo Gómez García
a6c6bca2fd Merge remote-tracking branch 'origin/v3.6' 2022-08-01 14:39:34 +02:00
Adolfo Gómez García
f24c77f20a removed mic redirect on mac py default for xfreerdp (2.8 is "crashing"?) 2022-08-01 14:37:39 +02:00
Adolfo Gómez García
a3c27dbd72 minor fixes 2022-08-01 14:10:55 +02:00
Adolfo Gómez García
ec7cf91579 small fix to remove "remember_device" if not set 2022-07-29 17:06:49 +02:00
Adolfo Gómez García
d2fa5e38d0 small fix to remove "remember_device" if not set 2022-07-29 16:59:33 +02:00
Adolfo Gómez García
c98f8e31d5 Merge remote-tracking branch 'origin/v3.6' 2022-07-29 16:42:50 +02:00
Adolfo Gómez García
ada5374db5 fixed showing MFA on list 2022-07-29 16:42:24 +02:00
Adolfo Gómez García
301d68b1a2 fixed authenticators rest 2022-07-29 16:38:03 +02:00
Adolfo Gómez García
46b6bb2305 Fixes 2022-07-29 16:23:53 +02:00
Adolfo Gómez García
93ba05f6cb Fixes to MFAs 2022-07-29 16:20:14 +02:00
Adolfo Gómez García
e3976794d9 some minor refactors & used sys.intern as key for rest api 2022-07-28 13:22:02 +02:00
Adolfo Gómez García
94cf5582e2 Added RH-based unmanaged actor 2022-07-26 13:33:09 +02:00
Adolfo Gómez García
f10b370eff Added Calendar Actions to remove ALL cache items 2022-07-18 18:03:51 +02:00
Adolfo Gómez García
692c8601bf Merge remote-tracking branch 'origin/v3.6' 2022-07-15 10:27:02 +02:00
Adolfo Gómez García
afcfffbd29 Merge remote-tracking branch 'origin/v3.5' into v3.6 2022-07-15 10:26:47 +02:00
Adolfo Gómez García
063fa46899 Merge remote-tracking branch 'origin/v3.6' 2022-07-14 12:49:41 +02:00
Adolfo Gómez García
d1329849f3 Merge remote-tracking branch 'origin/v3.5' into v3.6 2022-07-14 12:49:29 +02:00
Adolfo Gómez García
02aec9ebea Moved required client versio ton core __init__,py 2022-07-13 13:14:20 +02:00
Adolfo Gómez García
e33d63158a updated antular 2022-07-10 13:03:47 +02:00
Adolfo Gómez García
33258b0dcc Merge remote-tracking branch 'origin/v3.6' 2022-07-10 12:58:44 +02:00
Adolfo Gómez García
f5d2776478 Adde "custom html" support for MFA input code page 2022-07-06 17:41:09 +02:00
Adolfo Gómez García
0496117fc1 Fixing up mfa to include request on more methods 2022-07-06 14:34:42 +02:00
Adolfo Gómez García
b8e0dbf0c5 Merge remote-tracking branch 'origin/v3.6' 2022-07-06 13:24:41 +02:00
Adolfo Gómez García
fcdf599e18 Fixed HTML5 window opening & MFA 2022-07-06 13:17:35 +02:00
Adolfo Gómez García
05b6bebf36 bumping version to 3.6 2022-07-05 15:25:58 +02:00
Adolfo Gómez García
cdbc8d7ba1 bumping to v3.6 2022-07-05 15:20:44 +02:00
Adolfo Gómez García
072a722b09 Added udsactor-unamanged for rpm and bumped version to 3.6 2022-07-05 15:03:41 +02:00
Adolfo Gómez García
2d2e2d7b1f Upgrading version to next intermediary release 2022-07-05 14:52:17 +02:00
Adolfo Gómez García
1008bf988a upgraded migrations to adapt to MFA 2022-07-05 14:33:34 +02:00
Adolfo Gómez García
8ec815a75b Merge remote-tracking branch 'origin/v3.5-mfa' 2022-07-04 22:11:06 +02:00
Adolfo Gómez García
f4da75cea9 Adding MFA support to existing auths 2022-07-04 22:10:06 +02:00
Adolfo Gómez García
1c65722d24 added mfaData to admin 2022-07-04 21:29:41 +02:00
Adolfo Gómez García
2736390f95 Merge remote-tracking branch 'origin/v3.5-mfa' 2022-07-02 00:18:09 +02:00
Adolfo Gómez García
8783db925f fixed rest of MFA 2022-07-02 00:17:23 +02:00
Adolfo Gómez García
8b8bf7a321 Merge remote-tracking branch 'origin/v3.5-mfa' 2022-07-01 20:23:27 +02:00
Adolfo Gómez García
5e61871091 Added network to MFA and added initGui suppor for "providers" 2022-07-01 20:23:13 +02:00
Adolfo Gómez García
9a65d13890 test 2022-06-30 17:14:20 +02:00
Adolfo Gómez García
af2c01af66 fixing up merges from 3.5-mfa 2022-06-30 16:50:10 +02:00
Adolfo Gómez García
80b26446f6 translations 2022-06-30 16:45:13 +02:00
Adolfo Gómez García
a0ac50d9c2 small label fixes 2022-06-30 16:24:46 +02:00
Adolfo Gómez García
091a834074 Merge remote-tracking branch 'origin/v3.5-mfa' 2022-06-29 23:22:27 +02:00
Adolfo Gómez García
6094f55182 small MFA fixes for generic SMS 2022-06-29 23:17:52 +02:00
Adolfo Gómez García
11d9c77a79 Tested correct working of generic SMS sending using HTTP 2022-06-29 23:14:26 +02:00
Adolfo Gómez García
76e67b1f63 Fixing up MFA 2022-06-29 22:05:45 +02:00
Adolfo Gómez García
64fc61a2d6 Added generic SMS using HTTP server 2022-06-28 20:47:47 +02:00
Adolfo Gómez García
7b921ac161 Merge remote-tracking branch 'origin/v3.5-mfa' 2022-06-28 16:40:51 +02:00
Adolfo Gómez García
57b19757b9 fixed MFA 2022-06-28 16:40:35 +02:00
Adolfo Gómez García
0d281af982 merged 3.5-mfa till now 2022-06-28 16:38:25 +02:00
Adolfo Gómez García
365e2c56d3 Fixed mitration from MFA 2022-06-28 16:30:14 +02:00
Adolfo Gómez García
29fd2c068a Merge remote-tracking branch 'origin/v3.5-mfa' 2022-06-28 16:22:28 +02:00
Adolfo Gómez García
aec2f5b57f Added "not tested" generic SMS sending using an HTTP server 2022-06-28 14:50:39 +02:00
Adolfo Gómez García
4ba8bc9c5a Integrating mfa branch on 4.0. Initial changes. Work to do 2022-06-27 21:58:21 +02:00
Adolfo Gómez García
77e021a371 Fixed auth mfaIdentifier to provide userName 2022-06-27 21:30:59 +02:00
Adolfo Gómez García
2a25a8f70a removed nonsense comment copied from "sample" code used to create notifier 2022-06-24 16:53:59 +02:00
Adolfo Gómez García
b99a8de8c6 Added metadata config fields for SAML 2022-06-24 16:53:33 +02:00
Adolfo Gómez García
f922bbcd2e Removed legacy actors 2022-06-24 16:52:58 +02:00
Adolfo Gómez García
4db98684d3 refactorized 2022-06-24 13:27:45 +02:00
Adolfo Gómez García
a948d5eeb1 Added email MFA 2022-06-24 13:26:39 +02:00
Adolfo Gómez García
c7e6857492 If user has already been authorized, no mfa is allowed 2022-06-24 11:28:46 +02:00
Adolfo Gómez García
aaa4216862 Fixed MFA & Added remember me 2022-06-23 20:24:56 +02:00
Adolfo Gómez García
098396be87 Updared admin interface 2022-06-23 16:46:19 +02:00
Adolfo Gómez García
d02c693202 Fixed mfas rest path 2022-06-23 16:42:46 +02:00
Adolfo Gómez García
cb11a26fbe updated mfa icon 2022-06-23 16:23:27 +02:00
Adolfo Gómez García
43934d425f added timeout value 2022-06-23 15:56:14 +02:00
Adolfo Gómez García
5b499de983 Initial MFA done 2022-06-23 15:14:39 +02:00
Adolfo Gómez García
00d9f5759d Merge remote-tracking branch 'origin/v3.5' into v3.5-mfa 2022-06-23 14:05:25 +02:00
Adolfo Gómez García
a3bcedc38f Merge remote-tracking branch 'origin/v3.5' 2022-06-23 13:25:21 +02:00
Adolfo Gómez García
ec02f63cac advancing on MFA implementation 2022-06-23 12:16:08 +02:00
Adolfo Gómez García
0de655d14f Adding MFA authorization page 2022-06-22 23:39:11 +02:00
Adolfo Gómez García
7ab6d439cb Fixed migration tree 2022-06-22 21:53:00 +02:00
Adolfo Gómez García
68e327847b Created migrations 2022-06-22 21:40:43 +02:00
Adolfo Gómez García
81ea07f0a0 Created migrations 2022-06-22 21:40:23 +02:00
Adolfo Gómez García
d7540c3305 Adding MFA 2022-06-22 17:04:18 +02:00
Adolfo Gómez García
2eff59908a Merge remote-tracking branch 'origin/v3.5' 2022-06-21 14:28:30 +02:00
Adolfo Gómez García
a135e3ae9b Removed cache of SP metadata 2022-06-20 15:10:27 +02:00
Adolfo Gómez García
28db2f4e93 Added security options to SAML 2022-06-20 15:09:33 +02:00
Adolfo Gómez García
fefd53c84f Merge remote-tracking branch 'origin/v3.5' 2022-06-13 11:25:25 +02:00
Adolfo Gómez García
1fb8956679 Merge remote-tracking branch 'origin/v3.5' 2022-06-07 22:05:20 +02:00
Adolfo Gómez García
d96a5e69b0 Merge remote-tracking branch 'origin/v3.5' 2022-06-06 21:42:55 +02:00
Adolfo Gómez García
b9330fd28a Merge remote-tracking branch 'origin/v3.5' 2022-06-06 21:26:42 +02:00
Adolfo Gómez García
b7d0fef8bb Stats reports fixes 2022-06-06 21:26:07 +02:00
Adolfo Gómez García
6cf8eb3e77 Fixed admin lang change 2022-06-06 19:06:11 +02:00
Adolfo Gómez García
214c04d636 Remaking counters stats 2022-06-06 19:04:11 +02:00
Adolfo Gómez García
8f260f5efb Merge remote-tracking branch 'origin/v3.5' 2022-06-03 13:49:23 +02:00
Adolfo Gómez García
2695a5ccdc small cosmetic fix 2022-06-03 13:44:37 +02:00
Adolfo Gómez García
3b0e100021 Merge remote-tracking branch 'origin/v3.5' 2022-05-26 15:37:37 +02:00
Adolfo Gómez García
123b2243db updated main 2022-05-26 15:22:30 +02:00
Adolfo Gómez García
c9ef435d78 Merge remote-tracking branch 'origin/v3.5' 2022-05-26 15:20:25 +02:00
Adolfo Gómez García
2f403d3336 Added configurable logout url 2022-05-23 21:36:52 +02:00
Adolfo Gómez García
9c0f2a1859 small README fix 2022-05-23 21:23:10 +02:00
Adolfo Gómez García
ab35451121 Creating tests 2022-05-22 21:51:43 +02:00
Adolfo Gómez García
b0327c4fa0 Creating tests 2022-05-22 21:51:11 +02:00
Adolfo Gómez García
928a7aa58f Creating tests 2022-05-22 21:50:51 +02:00
Adolfo Gómez García
f9e2ccb7d3 Merge remote-tracking branch 'origin/v3.5' 2022-05-20 09:08:13 +02:00
Adolfo Gómez García
8db0e515a5 merged 3.5 user frontend 2022-05-20 09:04:25 +02:00
Adolfo Gómez García
fd0fbf63f0 Added help to configuration 2022-05-19 20:32:28 +02:00
Adolfo Gómez García
8d3653825a Removed Proxy, cleaned some more config variables, and added help to config variables. Refactorized a few config 2022-05-19 18:05:11 +02:00
Adolfo Gómez García
8836815186 improved safeHTML method 2022-05-19 09:17:42 +02:00
Adolfo Gómez García
2eb840e1c7 Merge remote-tracking branch 'origin/v3.5' 2022-05-19 09:15:42 +02:00
Adolfo Gómez García
859f18883f Updated user frontend 2022-05-17 16:48:40 +02:00
Adolfo Gómez García
66f62bcda0 Merge remote-tracking branch 'origin/v3.5' 2022-05-17 16:45:06 +02:00
Adolfo Gómez García
6b8e828835 adding messaging config 2022-05-17 16:45:04 +02:00
Adolfo Gómez García
d56ce0c653 advancing on notifications 2022-05-15 22:48:17 +02:00
Adolfo Gómez García
801a4ef1a7 Adding level to notifiers and fixed up admin angular 2022-05-15 22:25:17 +02:00
Adolfo Gómez García
12c32bde14 fixed SAML auth 2022-05-10 15:35:52 +02:00
Adolfo Gómez García
002b51a656 Merge remote-tracking branch 'origin/v3.5' 2022-05-10 15:32:28 +02:00
Adolfo Gómez García
3405797bb8 Adding messaging 2022-05-09 21:04:36 +02:00
Adolfo Gómez García
5ce7d008e6 Merge remote-tracking branch 'origin/v3.5' 2022-04-29 16:06:12 +02:00
Adolfo Gómez García
3ff7d1ea88 Changed script name to be authCallback URL 2022-04-28 18:16:22 +02:00
Adolfo Gómez García
91921537ce Adding tests 2022-04-27 00:37:23 +02:00
Adolfo Gómez García
0f587a4ec1 Merge remote-tracking branch 'origin/v3.5' 2022-04-25 14:31:45 +02:00
Adolfo Gómez García
6a178478b4 Updated signatures for type checking on all models 2022-04-24 19:07:44 +02:00
Adolfo Gómez García
f3af6a13ff Merge remote-tracking branch 'origin/v3.5' 2022-04-24 17:14:33 +02:00
Adolfo Gómez García
4067a5c423 Updating typy hints, etc... 2022-04-24 17:04:47 +02:00
Adolfo Gómez García
fbd7edf709 updating rest 2022-04-24 16:54:07 +02:00
Adolfo Gómez García
e8400b8702 updating models 2022-04-24 16:53:10 +02:00
Adolfo Gómez García
3a16b75e82 fixed requests typo 2022-04-23 20:29:12 +02:00
Adolfo Gómez García
586e1c3789 moving REST dispatcher to its own file 2022-04-23 20:23:28 +02:00
Adolfo Gómez García
67f115e50f Merge remote-tracking branch 'origin/v3.5' 2022-04-12 22:54:01 +02:00
Adolfo Gómez García
b0255a980c Merge remote-tracking branch 'origin/v3.5' 2022-04-12 21:37:06 +02:00
Adolfo Gómez García
aaa0f004ee Merge remote-tracking branch 'origin/v3.5' 2022-04-12 14:34:19 +02:00
Adolfo Gómez García
5a47d09c1a Merge remote-tracking branch 'origin/v3.5' 2022-04-08 15:29:49 +02:00
Adolfo Gómez García
0525bd4317 Merge remote-tracking branch 'origin/v3.5' 2022-04-06 21:32:31 +02:00
Adolfo Gómez García
7d5ff93946 Merge remote-tracking branch 'origin/v3.5' 2022-04-06 14:22:53 +02:00
Adolfo Gómez García
4e78c2837c Fixed address passing 2022-04-04 21:20:22 +02:00
Adolfo Gómez García
502cebfc3a Merge remote-tracking branch 'origin/v3.5' 2022-04-04 21:16:37 +02:00
Adolfo Gómez García
0f3f50f63c Added ThreadPoolExecutor to check handshakes... 2022-03-30 15:54:09 +02:00
Adolfo Gómez García
69192a2a1b Merge remote-tracking branch 'origin/v3.5' 2022-03-30 15:43:38 +02:00
Adolfo Gómez García
0ca85c5749 Changed check handshake method 2022-03-30 15:43:30 +02:00
Adolfo Gómez García
4577552773 Fixed log 2022-03-29 22:36:27 +02:00
Adolfo Gómez García
bec985e360 Restored timeout 2022-03-29 22:14:18 +02:00
Adolfo Gómez García
ccb2dfbdbe Merge remote-tracking branch 'origin/v3.5' 2022-03-29 22:13:50 +02:00
Adolfo Gómez García
b50b27d96e Remove external timeout 2022-03-29 22:06:17 +02:00
Adolfo Gómez García
bf4bb3f704 Merge remote-tracking branch 'origin/v3.5' 2022-03-29 22:01:32 +02:00
Adolfo Gómez García
5b4d017c53 Merge branch 'master' of github.com:dkmstr/openuds 2022-03-29 13:10:46 +02:00
Adolfo Gómez García
70b3544f2a added timeout to oppened tunnel to avoid possible DOS 2022-03-29 13:10:37 +02:00
Adolfo Gómez García
564b9db013 Merge remote-tracking branch 'origin/v3.5' 2022-03-29 13:08:54 +02:00
Adolfo Gómez García
1ff0a623db added timeout to oppened tunnel to avoid possible DOS 2022-03-29 13:08:49 +02:00
Adolfo Gómez García
a9c32debd2 Merge remote-tracking branch 'origin/v3.5' 2022-03-28 14:00:20 +02:00
Adolfo Gómez García
c675acc2e7 increaded backlog 2022-03-28 13:58:56 +02:00
Adolfo Gómez García
0662100c30 Merge remote-tracking branch 'origin/v3.5' 2022-03-23 21:34:29 +01:00
Adolfo Gómez García
74ad88d1bc Merge remote-tracking branch 'origin/v3.5' 2022-03-21 15:09:29 +01:00
Adolfo Gómez García
de71785c76 Merge remote-tracking branch 'origin/v3.5' 2022-03-20 23:10:43 +01:00
Adolfo Gómez García
27cbf920d5 Fixed a couple of things 2022-03-20 23:10:35 +01:00
Adolfo Gómez García
9ca143c2db Merge remote-tracking branch 'origin/v3.5' 2022-03-15 20:26:02 +01:00
Adolfo Gómez García
72700075ef Small tunnel fix 2022-03-15 16:33:15 +01:00
Adolfo Gómez García
ccdd15ed50 Merge remote-tracking branch 'origin/v3.5' 2022-03-15 16:30:23 +01:00
Adolfo Gómez García
1d62dbbacd Added new admin interface supporting notifiers 2022-03-14 20:59:04 +01:00
Adolfo Gómez García
d04068e19f Creating notifiers 2022-03-14 17:03:00 +01:00
Adolfo Gómez García
66aa7ccef3 small type checking fix 2022-03-14 14:44:16 +01:00
Adolfo Gómez García
c0c54f9ccd Merge remote-tracking branch 'origin/v3.5' 2022-03-14 14:43:57 +01:00
Adolfo Gómez García
b41a8e38cf Fixed GetRootUser 2022-03-13 15:41:45 +01:00
Adolfo Gómez García
410b0952e9 fixed "autoimported" module 2022-03-13 15:02:07 +01:00
Adolfo Gómez García
b9f57c47b0 Adde generic factory and added module loader to jobs 2022-03-11 16:39:39 +01:00
Adolfo Gómez García
07b0b00b90 Done refactoring module loader 2022-03-10 21:05:59 +01:00
Adolfo Gómez García
6e69246ca8 Added moduleLoaders to almost everything now 2022-03-10 20:32:40 +01:00
Adolfo Gómez García
a5554ed85a Adding generic importers to simplify module loading 2022-03-10 18:58:16 +01:00
Adolfo Gómez García
6c17b77841 Addded generic Factory for UDS Modules 2022-03-09 23:17:19 +01:00
Adolfo Gómez García
05a04997d6 Improved passwords security on DB 2022-03-07 23:10:10 +01:00
Adolfo Gómez García
b477b78d61 Merge remote-tracking branch 'origin/v3.5' 2022-03-06 15:41:26 +01:00
Adolfo Gómez García
2b6193a1ec Fixed SAMLResponse conversion under some circunstances 2022-03-02 15:51:59 +01:00
Adolfo Gómez García
0e257c779b Converted HTTP-POSt to HTTP-Request on SAML logout 2022-03-01 12:58:09 +01:00
Adolfo Gómez García
43eb09e9e2 Fixed logout binding to redirect 2022-02-28 16:48:01 +01:00
Adolfo Gómez García
6eab070bd1 Merge remote-tracking branch 'origin/v3.5' 2022-02-27 23:42:42 +01:00
Adolfo Gómez García
3f148f3bf0 notifications table 2022-02-25 03:05:27 +01:00
Adolfo Gómez García
f3c2015210 Fixed migrations from 3.5 2022-02-25 03:02:54 +01:00
Adolfo Gómez García
afd653422e Merge remote-tracking branch 'origin/v3.5' 2022-02-23 21:57:08 +01:00
Adolfo Gómez García
aad3336717 Migrated SAML auth to OneLogin library 2022-02-23 21:10:45 +01:00
Adolfo Gómez García
29e1694fce Removed lasso and added OneLogin saml library 2022-02-23 16:56:54 +01:00
Adolfo Gómez García
0ce1a565ab merged 3.5 temporal fix for login redirection 2022-02-21 14:34:58 +01:00
Adolfo Gómez García
6cc1a8823d Merge remote-tracking branch 'origin/v3.5' 2022-02-21 14:29:08 +01:00
Adolfo Gómez García
3667c82529 added a new ldap constant to ldaputil 2022-02-20 00:24:38 +01:00
Adolfo Gómez García
8cd050f71d Fixed changes to allow redirects 2022-02-19 16:08:11 +01:00
Adolfo Gómez García
88905b4e63 Refactor of assigned an unused 2022-02-18 15:51:49 +01:00
Adolfo Gómez García
67db932b0f Updating authentication response methods to include a possible url on login failure 2022-02-17 21:44:10 +01:00
Adolfo Gómez García
1be8edec92 Added getRootDSE method to ldaputils 2022-02-17 15:50:27 +01:00
Adolfo Gómez García
65087f5d47 Added SAML auth as open 2022-02-16 21:12:48 +01:00
Adolfo Gómez García
5388d03213 gitignore al ldaputil small comment fix 2022-02-15 22:44:09 +01:00
Adolfo Gómez García
6da7a4134e Merge remote-tracking branch 'origin/v3.5' 2022-02-15 22:43:33 +01:00
Adolfo Gómez García
b77330ac8f Added base notification mechanics 2022-02-13 19:38:40 +01:00
Adolfo Gómez García
7fca229537 Merge remote-tracking branch 'origin/v3.5' 2022-02-10 14:47:06 +01:00
Adolfo Gómez García
a2e5e00aa6 Merge remote-tracking branch 'origin/v3.5' 2022-02-10 13:33:50 +01:00
Adolfo Gómez García
02fcff2c94 refactorized alerts to messaging 2022-02-08 21:30:00 +01:00
Adolfo Gómez García
9e5b06e835 Adding notifier to allow sending some kind of event to outside recipients (as emails, telegram, ...) 2022-02-08 20:24:34 +01:00
Adolfo Gómez García
c7f96251ac Added level to notifier 2022-02-08 19:08:46 +01:00
Adolfo Gómez García
1b9fd22ba1 Merge remote-tracking branch 'origin/v3.5' 2022-02-07 16:12:51 +01:00
Adolfo Gómez García
fdd1b7235a Adding notifier base model. This will allow us to send remote notifications 2022-02-07 13:23:58 +01:00
Adolfo Gómez García
0d50e5ef93 Merged 3.5 fix on migrations 2022-02-06 04:02:38 +01:00
Adolfo Gómez García
c4a886c28d Fixed squashed migrations 2022-02-06 03:58:54 +01:00
Adolfo Gómez García
0355ef9591 squashed all previous to 3.5 migrations 2022-02-06 03:44:59 +01:00
Adolfo Gómez García
e0fa75cb00 squashed all previous to 3.5 migrations 2022-02-06 03:44:49 +01:00
Adolfo Gómez García
3b991e0749 Fixed ip lengths to allow future ipv6 support 2022-02-06 03:24:38 +01:00
Adolfo Gómez García
dd4dc738b4 Merge remote-tracking branch 'origin/v3.5' 2022-02-05 17:51:06 +01:00
Adolfo Gómez García
d5c9ee341d Fixed tunnel version 2022-02-05 17:50:55 +01:00
Adolfo Gómez García
f58cc159a7 Removed comments of old code 2022-02-05 17:31:31 +01:00
Adolfo Gómez García
fee413aa23 Added basic HA check on metapools, after adding "isAvailable" to all existing services 2022-02-01 16:16:57 +01:00
Adolfo Gómez García
189db28dc5 Added migration to add HA to metapool 2022-02-01 16:05:44 +01:00
Adolfo Gómez García
86a237ccac Homogenized services response dict 2022-02-01 15:47:29 +01:00
Adolfo Gómez García
9041e48080 Added end notification to UDS 2022-02-01 13:49:34 +01:00
Adolfo Gómez García
4893fa4fbe Fixed counters 2022-02-01 13:10:13 +01:00
Adolfo Gómez García
082ef6830d Merge remote-tracking branch 'origin/v3.5' 2022-01-30 19:34:19 +01:00
Adolfo Gómez García
2a7b112437 Merge remote-tracking branch 'origin/v3.5' 2022-01-29 21:45:46 +01:00
Adolfo Gómez García
a4390f7918 upgrading service 2022-01-29 21:44:14 +01:00
Adolfo Gómez García
e043a79721 Ported to asyncio uds tunnel. 2022-01-27 13:10:07 +01:00
Adolfo Gómez García
2f37caaf22 Merge remote-tracking branch 'origin/v3.5' 2022-01-27 12:17:16 +01:00
Adolfo Gómez García
77b6eff8e4 Removing curio from tunneler, so we do not have an unneeded dependency 2022-01-26 14:32:41 +01:00
Adolfo Gómez García
7d8ae689b5 Moving from curio to asyncio. 2022-01-26 12:18:41 +01:00
Adolfo Gómez García
143b9b675b Merge remote-tracking branch 'origin/v3.5' 2022-01-21 12:07:24 +01:00
Adolfo Gómez García
ecb876157a small fix 2022-01-20 11:16:23 +01:00
Adolfo Gómez García
f40c2ed618 Added isAvailable for all services 2022-01-19 14:11:37 +01:00
Adolfo Gómez García
61a32e13a2 Merge remote-tracking branch 'origin/v3.5' 2022-01-18 14:12:47 +01:00
Adolfo Gómez García
c14ae284b6 Merge remote-tracking branch 'origin/v3.5' 2022-01-18 13:34:46 +01:00
Adolfo Gómez García
7fc51ce513 Added isAvailable for more services 2022-01-18 13:21:44 +01:00
Adolfo Gómez García
0208c9b3f9 Merge remote-tracking branch 'origin/v3.5' 2022-01-18 13:18:43 +01:00
Adolfo Gómez García
18a49cece3 Merge remote-tracking branch 'origin/v3.5' 2022-01-18 11:44:16 +01:00
Adolfo Gómez García
03cdec8c31 Merge remote-tracking branch 'origin/v3.5' 2022-01-14 14:26:08 +01:00
Adolfo Gómez García
1667c8b4a8 adding "isAvaliable" method for services 2022-01-13 13:32:36 +01:00
Adolfo Gómez García
8018c7bed7 Merge remote-tracking branch 'origin/v3.5' 2022-01-12 13:35:02 +01:00
Adolfo Gómez García
58f4cd8356 Merge remote-tracking branch 'origin/v1.5' 2022-01-12 12:08:50 +01:00
Adolfo Gómez García
e41c0f32bb Merge remote-tracking branch 'origin/v3.5' 2022-01-04 10:39:12 +01:00
Adolfo Gómez García
5de90bf421 Merge remote-tracking branch 'origin/v3.5' 2022-01-03 14:36:06 +01:00
Adolfo Gómez García
493abb6228 Merge remote-tracking branch 'origin/v3.5' 2022-01-03 14:24:07 +01:00
Adolfo Gómez García
a071e2e8f5 Merge remote-tracking branch 'origin/v3.5' 2022-01-03 14:10:26 +01:00
Adolfo Gómez García
12e74c16b5 * Explained why stop shuld be ignored if no user service is found
* Small type checking addons
* Added method to allow "check" the availability of a service, currently used before removal
* Fixed removal so concurrent removal refers to real removals, not to marked for removal
2022-01-03 14:02:41 +01:00
Adolfo Gómez García
6d873ceccd Merge remote-tracking branch 'origin/v3.5' 2021-12-22 14:05:47 +01:00
Adolfo Gómez García
26f45b429f Merge remote-tracking branch 'origin/v3.5' 2021-12-22 13:37:06 +01:00
Adolfo Gómez García
49b2bd8772 Merge remote-tracking branch 'origin/v3.5' 2021-12-21 11:19:47 +01:00
Adolfo Gómez García
354061f55c Merge remote-tracking branch 'origin/v3.5' 2021-12-20 12:12:28 +01:00
Adolfo Gómez García
49975ab5d2 Upgrading for new django 4.0 2021-12-10 15:12:32 +01:00
Adolfo Gómez García
44f219402e removed orjson, uds uses numbers as key on dict and orjson does not supports it 2021-12-10 13:45:49 +01:00
Adolfo Gómez García
b3a8ae8abe Migrating to Django 4.0 (fixes) 2021-12-10 13:41:10 +01:00
Adolfo Gómez García
9ac2aaef81 Improved AutoAttributes & small typo fix on proxmox publication 2021-12-10 13:06:33 +01:00
Adolfo Gómez García
de0a2e2a34 Merge remote-tracking branch 'origin/v3.5' 2021-12-10 13:05:45 +01:00
Adolfo Gómez García
1702cd910a Merge remote-tracking branch 'origin/v3.5' 2021-11-30 13:54:33 +01:00
Adolfo Gómez García
78639af1a5 Merge remote-tracking branch 'origin/v3.5' 2021-11-30 13:32:56 +01:00
Adolfo Gómez García
8bebce4c6e added Content-Security-Policy to security 2021-11-30 13:31:12 +01:00
Adolfo Gómez García
e18f3746b4 Merge remote-tracking branch 'origin/v3.5' 2021-11-30 12:30:31 +01:00
Adolfo Gómez García
10bde45004 Merge remote-tracking branch 'origin/v3.5' 2021-11-26 11:59:07 +01:00
Adolfo Gómez García
057a26ea7b Completed network filtering for authentication, and improbed network filtering on transports (better undestanding now) 2021-11-23 11:55:55 +01:00
Adolfo Gómez García
e8dae69f6f Several actiosn:
* Added Disabled as an option state for an authenticator
* Added networks to check source to authenticators
* Generalized network access, now is usable from transports and from authenticators
* Fixed configjs to adapt to new model
2021-11-22 13:39:08 +01:00
Adolfo Gómez García
91923654f0 Added orjson as json "first option" for REST API (python json else) 2021-11-21 18:10:49 +01:00
Adolfo Gómez García
a0365e1277 Merge remote-tracking branch 'origin/v3.5' 2021-11-19 14:14:12 +01:00
Adolfo Gómez García
4b6ad6a2ed Merge remote-tracking branch 'origin/v3.5' 2021-11-16 14:20:07 +01:00
Adolfo Gómez García
e06f13fc84 Updating validators 2021-11-12 12:14:16 +01:00
Adolfo Gómez García
6a14917ec5 Updating validators 2021-11-12 11:35:09 +01:00
Adolfo Gómez García
85aab86b02 Fixed token length and remade migration 2021-11-12 10:48:11 +01:00
Adolfo Gómez García
eeae98ca79 Added token alias to secure unmanaged machine token 2021-11-11 13:50:58 +01:00
Adolfo Gómez García
11f6eec913 Merge remote-tracking branch 'origin/v3.5' 2021-11-11 12:07:49 +01:00
Adolfo Gómez García
e4d40b651e Merge remote-tracking branch 'origin/v3.5' 2021-11-10 10:57:09 +01:00
Adolfo Gómez García
a05390ed6c Merge remote-tracking branch 'origin/v3.5' 2021-11-08 13:48:17 +01:00
Adolfo Gómez García
c89c8d0523 Merge remote-tracking branch 'origin/v3.5' 2021-11-08 13:20:11 +01:00
Adolfo Gómez García
7f4453bd37 Added stats to udsfs 2021-11-08 11:55:59 +01:00
Adolfo Gómez García
e3568bc580 Updating UDSFS 2021-11-05 12:51:04 +01:00
Adolfo Gómez García
f273d262ac A few more advancements 2021-11-04 14:03:17 +01:00
Adolfo Gómez García
b55df32db0 Advancing on UDSFS 2021-11-04 12:46:40 +01:00
Adolfo Gómez García
6792283e44 Merge remote-tracking branch 'origin/v3.5' 2021-11-03 15:21:43 +01:00
Adolfo Gómez García
33764e5c1c Merge remote-tracking branch 'origin/v3.5' 2021-11-02 11:59:09 +01:00
Adolfo Gómez García
2d1897f720 Merge remote-tracking branch 'origin/v3.5' 2021-11-02 11:06:06 +01:00
Adolfo Gómez García
be013ac6dc Adding type checking on fuse before proceding to use it 2021-11-01 22:28:45 +01:00
Adolfo Gómez García
398837c20f Adding type checking on fuse before proceding to use it 2021-11-01 22:26:18 +01:00
Adolfo Gómez García
a6f1e95cc0 Adding type checking on fuse before proceding to use it 2021-11-01 18:44:11 +01:00
Adolfo Gómez García
a957e368e7 Experimenting with use for adding an "UDS FS" so we can explore several UDS contained data easily 2021-11-01 00:40:54 +01:00
Adolfo Gómez García
937465b2f2 Adding stats events for os manager relevant events (init, ready and release right now) 2021-10-28 16:17:26 +02:00
Adolfo Gómez García
e9df8c5cb1 Merge remote-tracking branch 'origin/v3.5' 2021-10-28 12:39:59 +02:00
Adolfo Gómez García
4f107ad464 Cleaning up things 2021-10-27 16:27:03 +02:00
Adolfo Gómez García
5b5a4e31e7 Merge remote-tracking branch 'origin/v3.5' 2021-10-27 13:06:45 +02:00
Adolfo Gómez García
98685c6e6a added back notifiedReady 2021-10-27 13:06:39 +02:00
Adolfo Gómez García
cb064f9af5 Removing all actor 2.2 support 2021-10-27 12:54:45 +02:00
Adolfo Gómez García
604f1c4a89 Removing old UDS Actor 2.2 support 2021-10-27 12:20:41 +02:00
Adolfo Gómez García
590f3191ac Removing "globalRequest" cache and passing through received request object to authenticators 2021-10-26 21:15:07 +02:00
Adolfo Gómez García
e999e5acf8 Removed outdated documentation 2021-10-26 16:31:54 +02:00
Adolfo Gómez García
101f846f0d Merge remote-tracking branch 'origin/v3.5' 2021-10-25 14:45:18 +02:00
Adolfo Gómez García
3ec0c15039 Merge remote-tracking branch 'origin/v3.5' 2021-10-25 14:07:39 +02:00
Adolfo Gómez García
ce433c0661 Merge remote-tracking branch 'origin/v3.5' 2021-10-23 22:37:07 +02:00
Adolfo Gómez García
b185024aeb Merge remote-tracking branch 'origin/v3.5' 2021-10-22 14:41:24 +02:00
Adolfo Gómez García
3a9312efe0 Fixed requests "getIdent" to retorn an unique id even in case of running as a asyncio task 2021-10-20 21:52:30 +02:00
Adolfo Gómez García
27535d4b43 Merge remote-tracking branch 'origin/v3.5' 2021-10-19 18:23:31 +02:00
Adolfo Gómez García
1eeab5f75f Merge remote-tracking branch 'origin/v3.5' 2021-10-18 18:01:27 +02:00
Adolfo Gómez García
b2adafdec7 Merge remote-tracking branch 'origin/v3.5' 2021-10-18 17:17:16 +02:00
Adolfo Gómez García
9c6a72d3ac Merge remote-tracking branch 'origin/v3.5' 2021-10-18 17:09:00 +02:00
Adolfo Gómez García
11342914cc Merge remote-tracking branch 'origin/v3.5' 2021-10-15 10:58:11 +02:00
Adolfo Gómez García
b2f2deebce Merge remote-tracking branch 'origin/v3.5' 2021-10-08 00:57:22 +02:00
Adolfo Gómez García
840a7a02bd Merge remote-tracking branch 'origin/v3.5' 2021-10-06 12:39:06 +02:00
Adolfo Gómez García
f80b00667e Upgrading versions 2021-10-05 13:26:55 +02:00
Adolfo Gómez García
ef9325aab9 Start of v4.0. 3.5 is closed now 2021-10-05 12:29:29 +02:00
779 changed files with 40412 additions and 59743 deletions

4
.gitignore vendored
View File

@ -64,8 +64,6 @@
# /server/
*_enterprise
/server/openuds.sublime-project
/server/openuds.sublime-workspace
# /server/src/
/server/src/taskmanager.pid
@ -88,7 +86,6 @@
# /server/src/uds/
/server/src/uds/*_enterprise.py
/server/src/uds/fixtures
/server/src/uds/tests
# /server/src/uds/auths/
/server/src/uds/auths/*-enterprise
@ -165,3 +162,4 @@
.vscode
.mypy_cache
.pytest_cache

29
LICENSE Normal file
View File

@ -0,0 +1,29 @@
BSD 3-Clause License
Copyright (c) 2022, Virtual Cable S.L.U.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. 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.
3. Neither the name of the copyright holder 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.

View File

@ -10,6 +10,6 @@ OpenUDS (Universal Desktop Services) is a multiplatform connection broker for:
This is an Open Source Source project, initiated by Spanish Company Virtualcable and released Open Source with the help of several Spanish Universities.
Any help provided will be welcome.
Please fell free to contribute to this project.
**Note: Master version is always under heavy development and it is not recommended for use, it will probably have unfixed bugs. Please use the latest stable branch.**

View File

@ -1 +1 @@
3.5.0
4.0.0

View File

@ -1,4 +0,0 @@
Linux:
python3-prctl (recommended, but not required in fact)
python3-pyqt5

View File

@ -11,6 +11,9 @@ dpkg-buildpackage -b
cat udsactor-template.spec |
sed -e s/"version 0.0.0"/"version ${VERSION}"/g |
sed -e s/"release 1"/"release ${RELEASE}"/g > udsactor-$VERSION.spec
cat udsactor-unmanaged-template.spec |
sed -e s/"version 0.0.0"/"version ${VERSION}"/g |
sed -e s/"release 1"/"release ${RELEASE}"/g > udsactor-unmanaged-$VERSION.spec
# Now fix dependencies for opensuse
# Note that, although on opensuse the library is "libXss1" on newer,
@ -22,7 +25,7 @@ cat udsactor-template.spec |
# sed -e s/"libXScrnSaver"/"libXss1"/g > udsactor-opensuse-$VERSION.spec
#for pkg in udsactor-$VERSION.spec udsactor-opensuse-$VERSION.spec; do
for pkg in udsactor-$VERSION.spec; do
for pkg in udsactor-*$VERSION.spec; do
rm -rf rpm
for folder in SOURCES BUILD RPMS SPECS SRPMS; do

View File

@ -1,3 +1,15 @@
udsactor (4.0.0) stable; urgency=medium
* Upgraded to 4.0.0 release
-- Adolfo Gómez García <agomez@virtualcable.es> Fri, 1 Jul 2022 15:00:00 +0200
udsactor (3.6.0) stable; urgency=medium
* Upgraded to 3.6.0 release
-- Adolfo Gómez García <agomez@virtualcable.es> Fri, 1 Jul 2022 14:00:00 +0200
udsactor (3.5.0) stable; urgency=medium
* Upgraded to 3.5.0 release

View File

@ -1,3 +1,3 @@
udsactor-unmanaged_3.5.0_all.deb admin optional
udsactor_3.5.0_all.deb admin optional
udsactor_3.5.0_amd64.buildinfo admin optional
udsactor-unmanaged_3.6.0_all.deb admin optional
udsactor_3.6.0_all.deb admin optional
udsactor_3.6.0_amd64.buildinfo admin optional

View File

@ -1,5 +1,5 @@
%define _topdir %(echo $PWD)/rpm
%define name udsactor
%define name udsactor-unmanaged
%define version 0.0.0
%define release 1
%define buildroot %{_topdir}/%{name}-%{version}-%{release}-root
@ -11,7 +11,7 @@ Release: %{release}
Summary: Actor for Universal Desktop Services (UDS) Broker
License: BSD3
Group: Admin
Requires: python-six python-requests PyQt4 libXScrnSaver
Requires: python3-six python3-requests python3-qt5 libXScrnSaver
Vendor: Virtual Cable S.L.U.
URL: http://www.udsenterprise.com
Provides: udsactor
@ -23,7 +23,7 @@ Provides: udsactor
%install
curdir=`pwd`
cd ../..
make DESTDIR=$RPM_BUILD_ROOT DISTRO=rh install-udsactor
make DESTDIR=$RPM_BUILD_ROOT DISTRO=rh install-udsactor-unmanaged
cd $curdir
%clean
@ -51,13 +51,13 @@ fi
rm -rf /usr/share/UDSActor > /dev/null 2>&1
%description
This package provides the required components to allow this machine to work on an environment managed by UDS Broker.
This package provides the required components to allow this unmanaged machine to work on an environment managed by UDS Broker.
%files
%defattr(-,root,root)
/etc/udsactor
/etc/xdg/autostart/UDSActorTool.desktop
/etc/init.d/udsactor
/etc/systemd/system/udsactor.service
/usr/bin/UDSActorTool-startup
/usr/bin/udsactor
/usr/bin/udsvapp

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>net.virtualcable.udsactor.server</string>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>ProgramArguments</key>
<array>
<string>/Applications/UDSActor.app/Contents/MacOS/udsactor</string>
<string>start</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>/var/log/udsactor.log</string>
<key>StandardOutPath</key>
<string>/var/log/nxserver.log</string>
<key>WorkingDirectory</key>
<string>/Applications/UDSActor.app/Contents/Resources/</string>
</dict>
</plist>

1
actor/macos/notes.txt Normal file
View File

@ -0,0 +1 @@
service file (net.virtualcable.udsactor.server.plist) goes in /Library/LaunchDaemons

View File

@ -29,33 +29,32 @@
'''
@author: Adolfo Gómez, dkmaster at dkmon dot com
'''
# pylint: disable=invalid-name
import sys
import os
import PyQt5 # pylint: disable=unused-import
import PyQt5 # noqa
from PyQt5.QtCore import QTimer
from PyQt5.QtWidgets import QMainWindow
from udsactor.log import logger, INFO
from udsactor.client import UDSClientQApp
from udsactor.platform import operations
from udsactor import platform
if __name__ == "__main__":
logger.setLevel(INFO)
# Ensure idle operations is initialized on start
operations.initIdleDuration(0)
platform.operations.initIdleDuration(0)
if 'linux' in sys.platform:
if platform.is_linux:
os.environ['QT_X11_NO_MITSHM'] = '1'
UDSClientQApp.setQuitOnLastWindowClosed(False)
qApp = UDSClientQApp(sys.argv)
if 'linux' not in sys.platform:
# The "hidden window" is only needed to process events on Windows
if platform.is_windows or platform.is_mac:
# The "hidden window" is not needed on linux
# Not needed on Linux
mw = QMainWindow()
mw.showMinimized() # Start minimized, will be hidden (not destroyed) as soon as qApp.init is invoked

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020 Virtual Cable S.L.
# Copyright (c) 2020-2022 Virtual Cable S.L.U.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
@ -35,7 +35,7 @@ import os
import logging
import typing
import PyQt5 # pylint: disable=unused-import
import PyQt5 # Ensures PyQt is included in the package
from PyQt5.QtWidgets import QApplication, QDialog, QFileDialog, QMessageBox
import udsactor

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020 Virtual Cable S.L.
# Copyright (c) 2020-2022 Virtual Cable S.L.U.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
@ -12,7 +12,7 @@
# * 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
# * Neither the name of Virtual Cable S.L.U. nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
@ -32,7 +32,7 @@
# pylint: disable=invalid-name
import sys
import os
import pickle
import pickle # nosec: B403
import logging
import typing
@ -102,7 +102,7 @@ class UDSConfigDialog(QDialog):
self,
'UDS Test',
'Service token seems to be invalid . Please, check token validity.',
QMessageBox.Ok,
QMessageBox.Ok, # type: ignore
)
else:
QMessageBox.information(
@ -111,14 +111,14 @@ class UDSConfigDialog(QDialog):
'Configuration for {} seems to be correct.'.format(
self._config.host
),
QMessageBox.Ok,
QMessageBox.Ok, # type: ignore
)
except Exception:
QMessageBox.information(
self,
'UDS Test',
'Configured host {} seems to be inaccesible.'.format(self._config.host),
QMessageBox.Ok,
QMessageBox.Ok, # type: ignore
)
def saveConfig(self) -> None:
@ -134,7 +134,7 @@ class UDSConfigDialog(QDialog):
self,
'Invalid subnet',
'Invalid subnet {}. Please, check it.'.format(restrictNet),
QMessageBox.Ok,
QMessageBox.Ok, # type: ignore
)
return
@ -153,12 +153,15 @@ class UDSConfigDialog(QDialog):
self.ui.testButton.setEnabled(True)
# Informs the user
QMessageBox.information(
self, 'UDS Configuration', 'Configuration saved.', QMessageBox.Ok
self,
'UDS Configuration',
'Configuration saved.',
QMessageBox.Ok, # type: ignore
)
if __name__ == "__main__":
# If to be run as "sudo" on linux, we will need this to avoid problems
# If run as "sudo" on linux, we will need this to avoid problems
if 'linux' in sys.platform:
os.environ['QT_X11_NO_MITSHM'] = '1'
@ -171,16 +174,18 @@ if __name__ == "__main__":
if len(sys.argv) > 2:
if sys.argv[1] == 'export':
try:
with open(sys.argv[2], 'wb') as f:
pickle.dump(udsactor.platform.store.readConfig(), f, protocol=3)
with open(sys.argv[2], 'wb') as export_:
pickle.dump(
udsactor.platform.store.readConfig(), export_, protocol=3
)
except Exception as e:
print('Error exporting configuration file: {}'.format(e))
sys.exit(1)
sys.exit(0)
if sys.argv[1] == 'import':
elif sys.argv[1] == 'import':
try:
with open(sys.argv[2], 'rb') as f:
config = pickle.load(f)
with open(sys.argv[2], 'rb') as import_:
config = pickle.load(import_) # nosec: B301: the file is provided by user, so it's not a security issue
udsactor.platform.store.writeConfig(config)
except Exception as e:
print('Error importing configuration file: {}'.format(e))

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020 Virtual Cable S.L.
# Copyright (c) 2020-2022 Virtual Cable S.L.U.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
@ -12,7 +12,7 @@
# * 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
# * Neither the name of Virtual Cable S.L.U. nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
@ -29,12 +29,8 @@
'''
@author: Adolfo Gómez, dkmaster at dkmon dot com
'''
import sys
from udsactor import platform
if sys.platform == 'win32':
from udsactor.windows import runner
else:
from udsactor.linux import runner
if __name__ == "__main__":
runner.run()
platform.runner.run()

View File

@ -214,10 +214,10 @@
<item row="2" column="1">
<widget class="QLineEdit" name="serviceToken">
<property name="toolTip">
<string>UDS user with administration rights (Will not be stored on template)</string>
<string>UDS Service Token</string>
</property>
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Administrator user on UDS Server.&lt;/p&gt;&lt;p&gt;Note: This credential will not be stored on client. Will be used to obtain an unique token for this image.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Token of the service on UDS platform&lt;/p&gt;&lt;p&gt;This token can be obtainend from the service configuration on UDS.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
@ -268,10 +268,10 @@
<item row="3" column="1">
<widget class="QLineEdit" name="restrictNet">
<property name="toolTip">
<string>UDS user with administration rights (Will not be stored on template)</string>
<string>Restrict valid detection of network interfaces to this network.</string>
</property>
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Administrator user on UDS Server.&lt;/p&gt;&lt;p&gt;Note: This credential will not be stored on client. Will be used to obtain an unique token for this image.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Restrics valid detection of network interfaces.&lt;/p&gt;&lt;p&gt;Note: Use this field only in case of several network interfaces, so UDS knows which one is the interface where the user will be connected..&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>

View File

@ -35,4 +35,4 @@ from . import platform
__title__ = 'udsactor'
__author__ = 'Adolfo Gómez <dkmaster@dkmon.com>'
__license__ = "BSD 3-clause"
__copyright__ = "Copyright 2014-2020 VirtualCable S.L.U."
__copyright__ = "Copyright 2014-2022 VirtualCable S.L.U."

View File

@ -196,7 +196,7 @@ class UDSActorClient(threading.Thread): # pylint: disable=too-many-instance-att
self.checkIdle()
self.checkDeadLine()
time.sleep(1.3) # Sleeps between loop iterations
time.sleep(1.22) # Sleeps between loop iterations
self.api.logout(user + self._extraLogoff, sessionType)
logger.info('Notified logout for %s (%s)', user, sessionType) # Log logout
@ -239,7 +239,7 @@ class UDSActorClient(threading.Thread): # pylint: disable=too-many-instance-att
pixmap: 'QPixmap' = self._qApp.primaryScreen().grabWindow(0) # type: ignore
ba = QByteArray()
buffer = QBuffer(ba)
buffer.open(QIODevice.WriteOnly)
buffer.open(QIODevice.WriteOnly) # type: ignore
pixmap.save(buffer, 'PNG')
buffer.close()
scrBase64 = bytes(ba.toBase64()).decode() # type: ignore # there are problems with Pylance and connects on PyQt5... :)

View File

@ -132,7 +132,7 @@ class HTTPServerThread(threading.Thread):
self._app = app
self.port = -1
self.id = secrets.token_urlsafe(16)
self.id = secrets.token_urlsafe(24)
@property
def url(self) -> str:

View File

@ -33,8 +33,8 @@ import json
import typing
import requests
from ..log import logger
from udsactor import tools, types
from udsactor.log import logger
# For avoid proxy on localhost connections
NO_PROXY = {
@ -42,55 +42,108 @@ NO_PROXY = {
'https': None,
}
class UDSActorClientPool:
_clientUrl: typing.List[str]
class UDSActorClientPool(metaclass=tools.Singleton):
_clients: typing.List[types.ClientInfo]
def __init__(self) -> None:
self._clientUrl = []
self._clients = []
def _post(self, method: str, data: typing.MutableMapping[str, str], timeout=2) -> typing.List[requests.Response]:
removables: typing.List[str] = []
result: typing.List[typing.Any] = []
for clientUrl in self._clientUrl:
def _post(
self,
session_id: typing.Optional[str],
method: str,
data: typing.MutableMapping[str, str],
timeout: int = 2,
) -> typing.List[
typing.Tuple[types.ClientInfo, typing.Optional[requests.Response]]
]:
result: typing.List[
typing.Tuple[types.ClientInfo, typing.Optional[requests.Response]]
] = []
for client in self._clients:
# Skip if session id is provided but does not match
if session_id and client.session_id != session_id:
continue
clientUrl = client.url
try:
result.append(requests.post(clientUrl + '/' + method, data=json.dumps(data), verify=False, timeout=timeout, proxies=NO_PROXY))
result.append(
(
client,
requests.post(
clientUrl + '/' + method,
data=json.dumps(data),
verify=False,
timeout=timeout,
proxies=NO_PROXY, # type: ignore
),
)
)
except Exception as e:
# If cannot request to a clientUrl, remove it from list
logger.info('Could not connect with client %s: %s. Removed from registry.', e, clientUrl)
removables.append(clientUrl)
# Remove failed connections
for clientUrl in removables:
self.unregister(clientUrl)
logger.info(
'Could not connect with client %s: %s. ',
e,
clientUrl,
)
result.append((client, None))
return result
def register(self, clientUrl: str) -> None:
@property
def clients(self) -> typing.List[types.ClientInfo]:
return self._clients
def register(self, client_url: str) -> None:
# Remove first if exists, to avoid duplicates
self.unregister(clientUrl)
self.unregister(client_url)
# And add it again
self._clientUrl.append(clientUrl)
self._clients.append(types.ClientInfo(client_url, ''))
def unregister(self, clientUrl: str) -> None:
self._clientUrl = list((i for i in self._clientUrl if i != clientUrl))
def set_session_id(self, client_url: str, session_id: typing.Optional[str]) -> None:
"""Set the session id for a client
def executeScript(self, script: str) -> None:
self._post('script', {'script': script}, timeout=30)
Args:
clientUrl (str): _description_
session_id (str): _description_
"""
for client in self._clients:
if client.url == client_url:
# remove existing client from list, create a new one and insert it
self._clients.remove(client)
self._clients.append(types.ClientInfo(client_url, session_id or ''))
break
def logout(self) -> None:
self._post('logout', {})
def unregister(self, client_url: str) -> None:
# remove client url from array if found
for i, client in enumerate(self._clients):
if client.url == client_url:
self._clients.pop(i)
return
def message(self, message: str) -> None:
self._post('message', {'message': message})
def executeScript(self, session_id: typing.Optional[str], script: str) -> None:
self._post(session_id, 'script', {'script': script}, timeout=30)
def ping(self) -> bool:
if not self._clientUrl:
return True # No clients, ping ok
self._post('ping', {}, timeout=1)
return bool(self._clientUrl) # There was clients, but they are now lost!!!
def logout(self, session_id: typing.Optional[str]) -> None:
self._post(session_id, 'logout', {})
def screenshot(self) -> typing.Optional[str]: # Screenshot are returned as base64
for r in self._post('screenshot', {}, timeout=3):
def message(self, session_id: typing.Optional[str], message: str) -> None:
self._post(session_id, 'message', {'message': message})
def lost_clients(
self,
session_id: typing.Optional[str] = None,
) -> typing.Iterable[types.ClientInfo]: # returns the list of "lost" clients
# Port ping to every client
for i in self._post(session_id, 'ping', {}, timeout=1):
if i[1] is None:
yield i[0]
def screenshot(
self, session_id: typing.Optional[str]
) -> typing.Optional[str]: # Screenshot are returned as base64
for client, r in self._post(session_id, 'screenshot', {}, timeout=3):
if not r:
continue # Missing client, so we ignore it
try:
return r.json()['result']
except Exception:

View File

@ -30,19 +30,23 @@
'''
import typing
from . import handler
from udsactor.http import handler, clients_pool
if typing.TYPE_CHECKING:
from ..service import CommonService
from udsactor.service import CommonService
class LocalProvider(handler.Handler):
def post_login(self) -> typing.Any:
result = self._service.login(self._params['username'], self._params['session_type'])
# if callback_url is provided, record it in the clients pool
if 'callback_url' in self._params and result.session_id:
# If no session id is returned, then no login is acounted for
clients_pool.UDSActorClientPool().set_session_id(self._params['callback_url'], result.session_id)
return result._asdict()
def post_logout(self) -> typing.Any:
self._service.logout(self._params['username'], self._params['session_type'])
self._service.logout(self._params['username'], self._params['session_type'], self._params['session_id'])
return 'ok'
def post_ping(self) -> typing.Any:

View File

@ -71,7 +71,7 @@ class HTTPServerHandler(http.server.BaseHTTPRequestHandler):
# Very simple path & params splitter
path = self.path.split('?')[0][1:].split('/')
logger.debug('Path: %s, params: %s', path, params)
logger.debug('Path: %s, ip: %s, params: %s', path, self.client_address, params)
handlerType: typing.Optional[typing.Type['Handler']] = None

View File

@ -101,7 +101,7 @@ class Daemon:
def removePidFile(self) -> None:
try:
os.remove(self.pidfile)
except Exception:
except Exception: # nosec: Not interested in exception
# Not found/not permissions or whatever, ignore it
pass

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2014-2019 Virtual Cable S.L.
# Copyright (c) 2014-2022 Virtual Cable S.L.U.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
@ -11,7 +11,7 @@
# * 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
# * Neither the name of Virtual Cable S.L.U. nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
@ -35,8 +35,8 @@ import logging
import typing
class LocalLogger: # pylint: disable=too-few-public-methods
linux = False
windows = True
linux = True
windows = False
serviceLogger = False
logger: typing.Optional[logging.Logger]
@ -59,7 +59,8 @@ class LocalLogger: # pylint: disable=too-few-public-methods
self.logger = logging.getLogger('udsactor')
os.chmod(fname, 0o0600)
return
except Exception:
except Exception: # nosec: B110: we don't care about exceptions here
# Ignore and try next
pass
# Logger can't be set

View File

@ -34,7 +34,7 @@ import platform
import socket
import fcntl # Only available on Linux. Expect complains if edited from windows
import os
import subprocess
import subprocess # nosec
import struct
import array
import typing
@ -53,7 +53,9 @@ def _getMacAddr(ifname: str) -> typing.Optional[str]:
ifnameBytes = ifname.encode('utf-8')
try:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
info = bytearray(fcntl.ioctl(s.fileno(), 0x8927, struct.pack(str('256s'), ifnameBytes[:15])))
info = bytearray(
fcntl.ioctl(s.fileno(), 0x8927, struct.pack(str('256s'), ifnameBytes[:15]))
)
return str(''.join(['%02x:' % char for char in info[18:24]])[:-1]).upper()
except Exception:
return None
@ -67,11 +69,15 @@ def _getIpAddr(ifname: str) -> typing.Optional[str]:
ifnameBytes = ifname.encode('utf-8')
try:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
return str(socket.inet_ntoa(fcntl.ioctl(
s.fileno(),
0x8915, # SIOCGIFADDR
struct.pack(str('256s'), ifnameBytes[:15])
)[20:24]))
return str(
socket.inet_ntoa(
fcntl.ioctl(
s.fileno(),
0x8915, # SIOCGIFADDR
struct.pack(str('256s'), ifnameBytes[:15]),
)[20:24]
)
)
except Exception:
return None
@ -91,22 +97,32 @@ def _getInterfaces() -> typing.List[str]:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
names = array.array(str('B'), b'\0' * space)
outbytes = struct.unpack('iL', fcntl.ioctl(
s.fileno(),
0x8912, # SIOCGIFCONF
struct.pack('iL', space, names.buffer_info()[0])
))[0]
outbytes = struct.unpack(
'iL',
fcntl.ioctl(
s.fileno(),
0x8912, # SIOCGIFCONF
struct.pack('iL', space, names.buffer_info()[0]),
),
)[0]
namestr = names.tobytes()
# return namestr, outbytes
return [namestr[i:i + offset].split(b'\0', 1)[0].decode('utf-8') for i in range(0, outbytes, length)]
return [
namestr[i : i + offset].split(b'\0', 1)[0].decode('utf-8')
for i in range(0, outbytes, length)
]
def _getIpAndMac(ifname: str) -> typing.Tuple[typing.Optional[str], typing.Optional[str]]:
def _getIpAndMac(
ifname: str,
) -> typing.Tuple[typing.Optional[str], typing.Optional[str]]:
ip, mac = _getIpAddr(ifname), _getMacAddr(ifname)
return (ip, mac)
def checkPermissions() -> bool:
return os.getuid() == 0 # getuid only available on linux. Expect "complaioins" if edited from Windows
return os.getuid() == 0
def getComputerName() -> str:
'''
@ -114,15 +130,23 @@ def getComputerName() -> str:
'''
return socket.gethostname().split('.')[0]
def getNetworkInfo() -> typing.Iterator[types.InterfaceInfoType]:
for ifname in _getInterfaces():
ip, mac = _getIpAndMac(ifname)
if mac != '00:00:00:00:00:00' and mac and ip and ip.startswith('169.254') is False: # Skips local interfaces & interfaces with no dhcp IPs
if (
mac != '00:00:00:00:00:00'
and mac
and ip
and ip.startswith('169.254') is False
): # Skips local interfaces & interfaces with no dhcp IPs
yield types.InterfaceInfoType(name=ifname, mac=mac, ip=ip)
def getDomainName() -> str:
return ''
def getLinuxOs() -> str:
try:
with open('/etc/os-release', 'r') as f:
@ -133,18 +157,22 @@ def getLinuxOs() -> str:
except Exception:
return 'unknown'
def getVersion() -> str:
return 'Linux ' + getLinuxOs()
def reboot(flags: int = 0):
'''
Simple reboot using os command
'''
subprocess.call(['/sbin/shutdown', 'now', '-r'])
subprocess.call(['/sbin/shutdown', 'now', '-r']) # nosec: Fine, all under control
def loggoff() -> None:
'''
Right now restarts the machine...
'''
subprocess.call(['/usr/bin/pkill', '-u', os.environ['USER']])
subprocess.call(['/usr/bin/pkill', '-u', os.environ['USER']]) # nosec: Fine, all under control
# subprocess.call(['/sbin/shutdown', 'now', '-r'])
# subprocess.call(['/usr/bin/systemctl', 'reboot', '-i'])
@ -158,7 +186,9 @@ def renameComputer(newName: str) -> bool:
return True # Always reboot right now. Not much slower but much more convenient
def joinDomain(domain: str, ou: str, account: str, password: str, executeInOneStep: bool = False):
def joinDomain(
domain: str, ou: str, account: str, password: str, executeInOneStep: bool = False
):
pass
@ -166,7 +196,11 @@ def changeUserPassword(user: str, oldPassword: str, newPassword: str) -> None:
'''
Simple password change for user using command line
'''
os.system('echo "{1}\n{1}" | /usr/bin/passwd {0} 2> /dev/null'.format(user, newPassword))
subprocess.run( # nosec: Fine, all under control
'echo "{1}\n{1}" | /usr/bin/passwd {0} 2> /dev/null'.format(user, newPassword),
shell=True,
)
def initIdleDuration(atLeastSeconds: int) -> None:
@ -181,16 +215,22 @@ def getCurrentUser() -> str:
'''
Returns current logged in user
'''
return os.environ['USER']
return os.getlogin()
def getSessionType() -> str:
'''
Known values:
* Unknown -> No XDG_SESSION_TYPE environment variable
* xrdp --> xrdp session
* other types
Known values:
* Unknown -> No XDG_SESSION_TYPE environment variable
* xrdp --> xrdp session
* other types
'''
return 'xrdp' if 'XRDP_SESSION' in os.environ else os.environ.get('XDG_SESSION_TYPE', 'unknown')
return (
'xrdp'
if 'XRDP_SESSION' in os.environ
else os.environ.get('XDG_SESSION_TYPE', 'unknown')
)
def forceTimeSync() -> None:
return

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2014-2019 Virtual Cable S.L.
# Copyright (c) 2014-2022 Virtual Cable S.L.U.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
@ -11,7 +11,7 @@
# * 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
# * Neither the name of Virtual Cable S.L.U. nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
@ -28,7 +28,7 @@
'''
@author: Alexey Shabalin, shaba at altlinux dot org
'''
import os
import subprocess # nosec
from .common import renamers
from ...log import logger
@ -46,8 +46,8 @@ def rename(newName: str) -> bool:
hostname.write(newName)
# Force system new name
os.system('/bin/hostname {}'.format(newName))
os.system('/usr/bin/hostnamectl set-hostname {}'.format(newName))
subprocess.run(['hostnamectl', 'set-hostname', newName]) # nosec: subprocess
subprocess.run(['/bin/hostname', newName]) # nosec: subprocess
# add name to "hosts"
with open('/etc/hosts', 'r') as hosts:

View File

@ -29,9 +29,6 @@
'''
@author: Adolfo Gómez, dkmaster at dkmon dot com
'''
import os
import sys
import pkgutil
import typing
from .. import operations

View File

@ -29,7 +29,7 @@
'''
@author: Adolfo Gómez, dkmaster at dkmon dot com
'''
import os
import subprocess # nosec
from .common import renamers
from ...log import logger
@ -45,8 +45,8 @@ def rename(newName: str) -> bool:
hostname.write(newName)
# Force system new name
os.system('/bin/hostname {}'.format(newName))
os.system('/usr/bin/hostnamectl set-hostname {}'.format(newName))
subprocess.run(['hostnamectl', 'set-hostname', newName]) # nosec: ok, we are root
subprocess.run(['/bin/hostname', newName]) # nosec: ok, we are root
# add name to "hosts"
with open('/etc/hosts', 'r') as hosts:

View File

@ -28,7 +28,7 @@
'''
@author: Adolfo Gómez, dkmaster at dkmon dot com
'''
import os
import subprocess # nosec
from .common import renamers
from ...log import logger
@ -46,8 +46,8 @@ def rename(newName: str) -> bool:
hostname.write(newName)
# Force system new name
os.system('/bin/hostname {}'.format(newName))
os.system('/usr/bin/hostnamectl set-hostname {}'.format(newName))
subprocess.run(['hostnamectl', 'set-hostname', newName]) # nosec: ok, we are root
subprocess.run(['/bin/hostname', newName]) # nosec: ok, we are root
# add name to "hosts"
with open('/etc/hosts', 'r') as hosts:

View File

@ -28,7 +28,7 @@
'''
@author: Adolfo Gómez, dkmaster at dkmon dot com
'''
import os
import subprocess # nosec
from .common import renamers
from ...log import logger
@ -46,8 +46,8 @@ def rename(newName: str) -> bool:
hostname.write(newName)
# Force system new name
os.system('/bin/hostname {}'.format(newName))
os.system('/usr/bin/hostnamectl set-hostname {}'.format(newName))
subprocess.run(['hostnamectl', 'set-hostname', newName]) # nosec: ok, we are root
subprocess.run(['/bin/hostname', newName]) # nosec: ok, we are root
# add name to "hosts"
with open('/etc/hosts', 'r') as hosts:

View File

@ -50,7 +50,7 @@ def run() -> None:
r = client.login(sys.argv[2], platform.operations.getSessionType())
print('{},{},{},{}\n'.format(r.ip, r.hostname, r.max_idle, r.dead_line or ''))
elif sys.argv[1] == 'logout':
client.logout(sys.argv[2])
client.logout(sys.argv[2], platform.operations.getSessionType())
except Exception as e:
logger.exception()
logger.error('Got exception while processing command: %s', e)

View File

@ -37,7 +37,7 @@ from ..log import logger
from ..service import CommonService
try:
from prctl import set_proctitle # @UnresolvedImport
from prctl import set_proctitle # type: ignore
except ImportError: # Platform may not include prctl, so in case it's not available, we let the "name" as is
def set_proctitle(_):
pass

View File

@ -32,12 +32,13 @@
import os
import configparser
import base64
import pickle
import pickle # nosec
from .. import types
CONFIGFILE = '/etc/udsactor/udsactor.cfg'
def readConfig() -> types.ActorConfigurationType:
try:
cfg = configparser.ConfigParser()
@ -45,10 +46,22 @@ def readConfig() -> types.ActorConfigurationType:
uds: configparser.SectionProxy = cfg['uds']
# Extract data:
base64Config = uds.get('config', None)
config = pickle.loads(base64.b64decode(base64Config.encode())) if base64Config else None
config = (
pickle.loads( # nosec: file is restricted
base64.b64decode(base64Config.encode())
)
if base64Config
else None
)
base64Data = uds.get('data', None)
data = pickle.loads(base64.b64decode(base64Data.encode())) if base64Data else None
data = (
pickle.loads( # nosec: file is restricted
base64.b64decode(base64Data.encode())
)
if base64Data
else None
)
return types.ActorConfigurationType(
actorType=uds.get('type', types.MANAGED),
@ -62,20 +75,23 @@ def readConfig() -> types.ActorConfigurationType:
post_command=uds.get('post_command', None),
log_level=int(uds.get('log_level', '2')),
config=config,
data=data
data=data,
)
except Exception:
return types.ActorConfigurationType('', False)
def writeConfig(config: types.ActorConfigurationType) -> None:
cfg = configparser.ConfigParser()
cfg.add_section('uds')
uds: configparser.SectionProxy = cfg['uds']
uds['host'] = config.host
uds['validate'] = 'yes' if config.validateCertificate else 'no'
def writeIfValue(val, name):
if val:
uds[name] = val
writeIfValue(config.actorType, 'type')
writeIfValue(config.master_token, 'master_token')
writeIfValue(config.own_token, 'own_token')
@ -93,15 +109,19 @@ def writeConfig(config: types.ActorConfigurationType) -> None:
# Ensures exists destination folder
dirname = os.path.dirname(CONFIGFILE)
if not os.path.exists(dirname):
os.mkdir(dirname, mode=0o700) # Will create only if route to path already exists, for example, /etc (that must... :-))
os.mkdir(
dirname, mode=0o700
) # Will create only if route to path already exists, for example, /etc (that must... :-))
with open(CONFIGFILE, 'w') as f:
cfg.write(f)
os.chmod(CONFIGFILE, 0o0600) # Ensure only readable by root
def useOldJoinSystem() -> bool:
return False
def invokeScriptOnLogin() -> str:
return ''

View File

@ -31,7 +31,7 @@
# pylint: disable=invalid-name
import ctypes
import ctypes.util
import subprocess
import subprocess # nosec
xlib = None
xss = None
@ -39,17 +39,22 @@ display = None
xssInfo = None
initialized = False
class XScreenSaverInfo(ctypes.Structure): # pylint: disable=too-few-public-methods
_fields_ = [('window', ctypes.c_long),
('state', ctypes.c_int),
('kind', ctypes.c_int),
('til_or_since', ctypes.c_ulong),
('idle', ctypes.c_ulong),
('eventMask', ctypes.c_ulong)]
_fields_ = [
('window', ctypes.c_long),
('state', ctypes.c_int),
('kind', ctypes.c_int),
('til_or_since', ctypes.c_ulong),
('idle', ctypes.c_ulong),
('eventMask', ctypes.c_ulong),
]
class c_ptr(ctypes.c_void_p):
pass
def _ensureInitialized():
global xlib, xss, xssInfo, display, initialized # pylint: disable=global-statement
@ -73,13 +78,15 @@ def _ensureInitialized():
xss.XScreenSaverQueryExtension.argtypes = [
ctypes.c_void_p,
ctypes.POINTER(ctypes.c_int),
ctypes.POINTER(ctypes.c_int)
ctypes.POINTER(ctypes.c_int),
]
xss.XScreenSaverAllocInfo.restype = ctypes.POINTER(XScreenSaverInfo) # Result in a XScreenSaverInfo structure
xss.XScreenSaverAllocInfo.restype = ctypes.POINTER(
XScreenSaverInfo
) # Result in a XScreenSaverInfo structure
xss.XScreenSaverQueryInfo.argtypes = [
ctypes.c_void_p,
ctypes.c_void_p,
ctypes.POINTER(XScreenSaverInfo)
ctypes.POINTER(XScreenSaverInfo),
]
xlib.XOpenDisplay.argtypes = [ctypes.c_char_p]
xlib.XOpenDisplay.restype = c_ptr
@ -95,7 +102,9 @@ def _ensureInitialized():
event_base = ctypes.c_int()
error_base = ctypes.c_int()
available = xss.XScreenSaverQueryExtension(display, ctypes.byref(event_base), ctypes.byref(error_base))
available = xss.XScreenSaverQueryExtension(
display, ctypes.byref(event_base), ctypes.byref(error_base)
)
if available != 1:
raise Exception('ScreenSaver not available')
@ -107,9 +116,11 @@ def _ensureInitialized():
def initIdleDuration(atLeastSeconds: int) -> None:
_ensureInitialized()
if atLeastSeconds:
subprocess.call(['/usr/bin/xset', 's', '{}'.format(atLeastSeconds + 30)])
subprocess.call( # nosec, controlled params
['/usr/bin/xset', 's', '{}'.format(atLeastSeconds + 30)]
)
# And now reset it
subprocess.call(['/usr/bin/xset', 's', 'reset'])
subprocess.call(['/usr/bin/xset', 's', 'reset']) # nosec: fixed command
def getIdleDuration() -> float:
@ -122,7 +133,11 @@ def getIdleDuration() -> float:
xss.XScreenSaverQueryInfo(display, xlib.XDefaultRootWindow(display), xssInfo)
# States: 0 = off, 1 = On, 2 = Cycle, 3 = Disabled, ...?
if xssInfo.contents.state == 1: # state = 1 means "active", so idle is not a valid state
return 3600 * 100 * 1000 # If screen saver is active, return a high enough value
if (
xssInfo.contents.state == 1
): # state = 1 means "active", so idle is not a valid state
return (
3600 * 100 * 1000
) # If screen saver is active, return a high enough value
return xssInfo.contents.idle / 1000.0

View File

@ -35,6 +35,8 @@ import typing
if sys.platform == 'win32':
from .windows.log import LocalLogger
elif sys.platform == 'darwin':
from .macos.log import LocalLogger
else:
from .linux.log import LocalLogger
@ -55,7 +57,7 @@ class Logger:
self.logLevel = INFO
self.localLogger = LocalLogger()
self.remoteLogger = None
self.own_token = ''
self.own_token = '' # nosec: This is no password at all
def setLevel(self, level: typing.Union[str, int]) -> None:
'''

View File

@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2022 Virtual Cable S.L.U.
# 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.U. 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
'''

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2014 Virtual Cable S.L.
# Copyright (c) 2022 Virtual Cable S.L.U.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
@ -11,7 +11,7 @@
# * 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
# * Neither the name of Virtual Cable S.L.U. nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
@ -25,29 +25,27 @@
# 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
Author: Adolfo Gómez, dkmaster at dkmon dot com
'''
from __future__ import unicode_literals
import logging
# pylint: disable=invalid-name
import os
import tempfile
import six
import logging
import typing
# Valid logging levels, from UDS Broker (uds.core.utils.log)
OTHER, DEBUG, INFO, WARN, ERROR, FATAL = (10000 * (x + 1) for x in six.moves.xrange(6)) # @UndefinedVariable
# Basically, same logger as in linux,
class LocalLogger:
linux = False
windows = False
serviceLogger = False
logger: typing.Optional[logging.Logger]
class LocalLogger(object):
def __init__(self):
# tempdir is different for "user application" and "service"
# service wil get c:\windows\temp, while user will get c:\users\XXX\temp
def __init__(self) -> None:
# Try to open logger at /var/log path
# If it fails (access denied normally), will try to open one at user's home folder, and if
# agaim it fails, open it at the tmpPath
for logDir in ('/var/log', os.path.expanduser('~'), tempfile.gettempdir()):
try:
fname = os.path.join(logDir, 'udsactor.log')
@ -60,21 +58,17 @@ class LocalLogger(object):
self.logger = logging.getLogger('udsactor')
os.chmod(fname, 0o0600)
return
except Exception:
except Exception: # nosec: B110: we don't care about exceptions here
# ignore and try next one
pass
# Logger can't be set
self.logger = None
def log(self, level, message):
def log(self, level: int, message: str) -> None:
# Debug messages are logged to a file
# our loglevels are 10000 (other), 20000 (debug), ....
# our loglevels are 0 (other), 10000 (debug), ....
# logging levels are 10 (debug), 20 (info)
# OTHER = logging.NOTSET
self.logger.log(int(level / 1000) - 10, message)
def isWindows(self):
return False
def isLinux(self):
return True
if self.logger:
self.logger.log(int(level / 1000), message)

View File

@ -0,0 +1,185 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2022 Virtual Cable S.L.U.
# 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.U. 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
'''
# Note. most methods are not implemented, as they are not needed for this platform (macos)
# that only supports unmanaged machines
import socket
import os
import re
import subprocess # nosec
import typing
import psutil
from udsactor import types, tools
MACVER_RE = re.compile(
r"<key>ProductVersion</key>\s*<string>(.*)</string>", re.MULTILINE
)
MACVER_FILE = '/System/Library/CoreServices/SystemVersion.plist'
def checkPermissions() -> bool:
return os.getuid() == 0
def getComputerName() -> str:
'''
Returns computer name, with no domain
'''
return socket.gethostname().split('.')[0]
def getNetworkInfo() -> typing.Iterator[types.InterfaceInfoType]:
ifdata: typing.List['psutil._common.snicaddr']
for ifname, ifdata in psutil.net_if_addrs().items():
name, ip, mac = '', '', ''
# Get IP address, interface name and MAC address whenever possible
for row in ifdata:
if row.family == socket.AF_INET:
ip = row.address
name = ifname
elif row.family == socket.AF_LINK:
mac = row.address
# if all data is available, stop iterating
if ip and name and mac:
if (
mac != '00:00:00:00:00:00'
and mac
and ip
and ip.startswith('169.254') is False
): # Skips local interfaces & interfaces with no dhcp IPs
yield types.InterfaceInfoType(name=name, ip=ip, mac=mac)
break
def getDomainName() -> str:
return ''
def getMacOs() -> str:
try:
with open(MACVER_FILE, 'r') as f:
data = f.read()
m = MACVER_RE.search(data)
if m:
return m.group(1)
except Exception: # nosec: B110: ignore exception because we are not interested in it
pass
return 'unknown'
def getVersion() -> str:
return 'MacOS ' + getMacOs()
def reboot(flags: int = 0) -> None:
'''
Simple reboot using os command
'''
subprocess.call(['/sbin/shutdown', '-r', 'now']) # nosec: Command line is fixed
def loggoff() -> None:
'''
Right now restarts the machine...
'''
subprocess.run(
"/bin/launchctl bootout gui/$(id -u $USER)", shell=True
) # nosec: Command line is fixed
# Ignores output, as it may fail if user is not logged in
def renameComputer(newName: str) -> bool:
'''
Changes the computer name
Returns True if reboot needed
Note: For macOS, no configuration is supported, only "unmanaged" actor
'''
return False
def joinDomain(
domain: str, ou: str, account: str, password: str, executeInOneStep: bool = False
):
pass
def changeUserPassword(user: str, oldPassword: str, newPassword: str) -> None:
pass
def initIdleDuration(atLeastSeconds: int) -> None:
pass
# se we cache for 20 seconds the result, that is enough for our needs
# and we avoid calling a system command every time we need it
@tools.cache(20)
def getIdleDuration() -> float:
# Execute:
try:
return (
int(
next(
filter(
lambda x: b"HIDIdleTime" in x,
subprocess.check_output(
["/usr/sbin/ioreg", "-c", "IOHIDSystem"]
).split(b"\n"),
)
).split(b"=")[1]
)
/ 1000000000
) # nosec: Command line is fixed
except Exception: # nosec: B110: ignore exception because we are not interested in it
return 0
def getCurrentUser() -> str:
'''
Returns current logged in user
'''
return os.getlogin()
def getSessionType() -> str:
'''
Returns the session type. Currently, only "macos" (console) is supported
'''
return 'macos'
def forceTimeSync() -> None:
return

View File

@ -0,0 +1,71 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2022 Virtual Cable S.L.U.
# 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
'''
import sys
import typing
from .. import rest
from .. import platform
from ..log import logger
from .service import UDSActorSvc
def usage() -> typing.NoReturn:
sys.stderr.write('usage: udsactor start|login "username"|logout "username"\n')
sys.exit(2)
def run() -> None:
logger.setLevel(20000)
if len(sys.argv) == 3 and sys.argv[1] in ('login', 'logout'):
logger.debug('Running client udsactor')
try:
client: rest.UDSClientApi = rest.UDSClientApi()
if sys.argv[1] == 'login':
r = client.login(sys.argv[2], platform.operations.getSessionType())
print('{},{},{},{}\n'.format(r.ip, r.hostname, r.max_idle, r.dead_line or ''))
elif sys.argv[1] == 'logout':
client.logout(sys.argv[2], platform.operations.getSessionType())
except Exception as e:
logger.exception()
logger.error('Got exception while processing command: %s', e)
sys.exit(0)
elif len(sys.argv) != 2:
usage()
daemonSvr = UDSActorSvc()
if len(sys.argv) == 2:
# Daemon mode...
if sys.argv[1] in ('start', 'start-foreground'):
daemonSvr.run() # execute in foreground
else:
usage()
sys.exit(0)
else:
usage()

View File

@ -0,0 +1,108 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2022 Virtual Cable S.L.U.
# 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.U. 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
'''
import typing
import signal
from ..log import logger
from ..service import CommonService
class UDSActorSvc(CommonService):
def __init__(self) -> None:
CommonService.__init__(self)
# Captures signals so we can stop gracefully
signal.signal(signal.SIGINT, self.markForExit)
signal.signal(signal.SIGTERM, self.markForExit)
def markForExit(self, signum, frame) -> None: # pylint: disable=unused-argument
self._isAlive = False
def joinDomain( # pylint: disable=unused-argument, too-many-arguments
self,
name: str,
domain: str,
ou: str,
account: str,
password: str
) -> None:
pass # Not implemented for unmanaged machines
def rename(
self,
name: str,
userName: typing.Optional[str] = None,
oldPassword: typing.Optional[str] = None,
newPassword: typing.Optional[str] = None,
) -> None:
pass # Not implemented for unmanaged machines
def run(self) -> None:
logger.debug('Running Daemon: {}'.format(self._isAlive))
# Linux daemon will continue running unless something is requested to
# Unmanaged services does not initializes "on start", but rather when user logs in (because userservice does not exists "as such" before that)
if self.isManaged(): # Currently, managed is not implemented for UDS on M
logger.error('Managed machines not supported on MacOS')
# Wait a bit, this is mac os and will be run by launchd
# If the daemon shuts down too quickly, launchd may think it is a crash.
self.doWait(10000)
self.finish()
return # Stop daemon if initializes told to do so
if not self.initializeUnmanaged():
# Wait a bit, this is mac os and will be run by launchd
# If the daemon shuts down too quickly, launchd may think it is a crash.
self.doWait(10000)
self.finish()
return
# Start listening for petitions
self.startHttpServer()
# *********************
# * Main Service loop *
# *********************
# Counter used to check ip changes only once every 10 seconds, for
# example
counter = 0
while self._isAlive:
counter += 1
try:
if counter % 5 == 0:
self.loop()
except Exception as e:
logger.error('Got exception on main loop: %s', e)
# In milliseconds, will break
self.doWait(1000)
self.finish()

View File

@ -0,0 +1,106 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2022 Virtual Cable S.L.U.
# 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.U. 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
'''
import os
import configparser
import base64
import pickle # nosec
from .. import types
CONFIGFILE = '/etc/udsactor/udsactor.cfg'
def readConfig() -> types.ActorConfigurationType:
try:
cfg = configparser.ConfigParser()
cfg.read(CONFIGFILE)
uds: configparser.SectionProxy = cfg['uds']
# Extract data:
base64Config = uds.get('config', None)
config = pickle.loads(base64.b64decode(base64Config.encode())) if base64Config else None # nosec: Read from root controled file, secure
base64Data = uds.get('data', None)
data = pickle.loads(base64.b64decode(base64Data.encode())) if base64Data else None # nosec: Read from root controled file, secure
return types.ActorConfigurationType(
actorType=uds.get('type', types.MANAGED),
host=uds.get('host', ''),
validateCertificate=uds.getboolean('validate', fallback=False),
master_token=uds.get('master_token', None),
own_token=uds.get('own_token', None),
restrict_net=uds.get('restrict_net', None),
pre_command=uds.get('pre_command', None),
runonce_command=uds.get('runonce_command', None),
post_command=uds.get('post_command', None),
log_level=int(uds.get('log_level', '2')),
config=config,
data=data
)
except Exception:
return types.ActorConfigurationType('', False)
def writeConfig(config: types.ActorConfigurationType) -> None:
cfg = configparser.ConfigParser()
cfg.add_section('uds')
uds: configparser.SectionProxy = cfg['uds']
uds['host'] = config.host
uds['validate'] = 'yes' if config.validateCertificate else 'no'
def writeIfValue(val, name):
if val:
uds[name] = val
writeIfValue(config.actorType, 'type')
writeIfValue(config.master_token, 'master_token')
writeIfValue(config.own_token, 'own_token')
writeIfValue(config.restrict_net, 'restrict_net')
writeIfValue(config.pre_command, 'pre_command')
writeIfValue(config.post_command, 'post_command')
writeIfValue(config.runonce_command, 'runonce_command')
uds['log_level'] = str(config.log_level)
if config.config: # Special case, encoded & dumped
uds['config'] = base64.b64encode(pickle.dumps(config.config)).decode()
if config.data: # Special case, encoded & dumped
uds['data'] = base64.b64encode(pickle.dumps(config.data)).decode()
# Ensures exists destination folder
dirname = os.path.dirname(CONFIGFILE)
if not os.path.exists(dirname):
os.mkdir(dirname, mode=0o700) # Will create only if route to path already exists, for example, /etc (that must... :-))
with open(CONFIGFILE, 'w') as f:
cfg.write(f)
os.chmod(CONFIGFILE, 0o0600) # Ensure only readable by root
def useOldJoinSystem() -> bool:
return False
def invokeScriptOnLogin() -> str:
return ''

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2014 Virtual Cable S.L.
# Copyright (c) 2014-2022 Virtual Cable S.L.U.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
@ -11,7 +11,7 @@
# * 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
# * Neither the name of Virtual Cable S.L.U. nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
@ -31,7 +31,15 @@
import sys
name = sys.platform
is_windows = is_linux = is_mac = False
if sys.platform == 'win32':
from .windows import operations, store # pylint: disable=unused-import
from .windows import operations, store, runner
is_windows = True
elif sys.platform == 'darwin':
from .macos import operations, store, runner
is_mac = True
elif sys.platform == 'linux':
from .linux import operations, store, runner
is_linux = True
else:
from .linux import operations, store # pylint: disable=unused-import
raise Exception('Unsupported platform: {0}'.format(sys.platform))

View File

@ -36,8 +36,8 @@ import typing
import requests
from . import types
from .version import VERSION
from udsactor import types, tools
from udsactor.version import VERSION, BUILD
# Default public listen port
LISTEN_PORT = 43910
@ -90,9 +90,9 @@ class UDSApi: # pylint: disable=too-few-public-methods
Base for remote api accesses
"""
_host: str
_validateCert: bool
_url: str
_host: str = ''
_validateCert: bool = True
_url: str = ''
def __init__(self, host: str, validateCert: bool) -> None:
self._host = host
@ -103,17 +103,17 @@ class UDSApi: # pylint: disable=too-few-public-methods
logging.getLogger('urllib3').setLevel(logging.ERROR)
try:
warnings.simplefilter('ignore') # Disables all warnings
except Exception:
except Exception: # nosec: not interested in exceptions
pass
@property
def _headers(self) -> typing.MutableMapping[str, str]:
return {
'Content-Type': 'application/json',
'User-Agent': 'UDS Actor v{}'.format(VERSION),
'User-Agent': 'UDS Actor v{}/{}'.format(VERSION, BUILD),
}
def _apiURL(self, method: str) -> str:
def _api_url(self, method: str) -> str:
raise NotImplementedError
def _doPost(
@ -126,7 +126,7 @@ class UDSApi: # pylint: disable=too-few-public-methods
headers = headers or self._headers
try:
result = requests.post(
self._apiURL(method),
self._api_url(method),
data=json.dumps(payLoad),
headers=headers,
verify=self._validateCert,
@ -157,7 +157,7 @@ class UDSApi: # pylint: disable=too-few-public-methods
# UDS Broker API access
#
class UDSServerApi(UDSApi):
def _apiURL(self, method: str) -> str:
def _api_url(self, method: str) -> str:
return self._url + 'actor/v3/' + method
def enumerateAuthenticators(self) -> typing.Iterable[types.AuthenticatorType]:
@ -178,10 +178,10 @@ class UDSServerApi(UDSApi):
priority=v['priority'],
isCustom=v['isCustom'],
)
except Exception:
except Exception: # nosec: not interested in exceptions
pass
def register( # pylint: disable=too-many-arguments, too-many-locals
def register(
self,
auth: str,
username: str,
@ -225,7 +225,7 @@ class UDSServerApi(UDSApi):
headers['X-Auth-Token'] = result.json()['token']
result = requests.post(
self._apiURL('register'),
self._api_url('register'),
data=json.dumps(data),
headers=headers,
verify=self._validateCert,
@ -252,6 +252,7 @@ class UDSServerApi(UDSApi):
'type': actor_type or types.MANAGED,
'token': token,
'version': VERSION,
'build': BUILD,
'id': [{'mac': i.mac, 'ip': i.ip} for i in interfaces],
}
r = self._doPost('initialize', payload)
@ -270,6 +271,7 @@ class UDSServerApi(UDSApi):
)
if r['os']
else None,
alias_token=r.get('alias_token'), # Possible alias for unmanaged
)
def ready(
@ -322,20 +324,20 @@ class UDSServerApi(UDSApi):
actor_type: typing.Optional[str],
token: str,
username: str,
sessionType: str,
session_type: str,
interfaces: typing.Iterable[types.InterfaceInfoType],
secret: typing.Optional[str],
) -> types.LoginResultInfoType:
if not token:
return types.LoginResultInfoType(
ip='0.0.0.0', hostname=UNKNOWN, dead_line=None, max_idle=None
ip='0.0.0.0', hostname=UNKNOWN, dead_line=None, max_idle=None, session_id=None
)
payload = {
'type': actor_type or types.MANAGED,
'id': [{'mac': i.mac, 'ip': i.ip} for i in interfaces],
'token': token,
'username': username,
'session_type': sessionType,
'session_type': session_type,
'secret': secret or '',
}
result = self._doPost('login', payload)
@ -344,6 +346,7 @@ class UDSServerApi(UDSApi):
hostname=result['hostname'],
dead_line=result['dead_line'],
max_idle=result['max_idle'],
session_id=result.get('session_id', ''),
)
def logout(
@ -351,7 +354,8 @@ class UDSServerApi(UDSApi):
actor_type: typing.Optional[str],
token: str,
username: str,
sessionType: str,
session_id: str,
session_type: str,
interfaces: typing.Iterable[types.InterfaceInfoType],
secret: typing.Optional[str],
) -> typing.Optional[str]:
@ -362,7 +366,8 @@ class UDSServerApi(UDSApi):
'id': [{'mac': i.mac, 'ip': i.ip} for i in interfaces],
'token': token,
'username': username,
'session_type': sessionType,
'session_type': session_type,
'session_id': session_id,
'secret': secret or '',
}
return self._doPost('logout', payload) # Can be 'ok' or 'notified'
@ -381,13 +386,17 @@ class UDSServerApi(UDSApi):
return self._doPost('test', payLoad) == 'ok'
class UDSClientApi(UDSApi):
class UDSClientApi(UDSApi, metaclass=tools.Singleton):
_session_id: str = ''
_callback_url: str = ''
def __init__(self) -> None:
super().__init__('127.0.0.1:{}'.format(LISTEN_PORT), False)
# Override base url
# Replace base url
self._url = "https://{}/ui/".format(self._host)
def _apiURL(self, method: str) -> str:
def _api_url(self, method: str) -> str:
return self._url + method
def post(
@ -397,13 +406,15 @@ class UDSClientApi(UDSApi):
) -> typing.Any:
return self._doPost(method=method, payLoad=payLoad, disableProxy=True)
def register(self, callbackUrl: str) -> None:
payLoad = {'callback_url': callbackUrl}
def register(self, callback_url: str) -> None:
self._callback_url = callback_url
payLoad = {'callback_url': callback_url}
self.post('register', payLoad)
def unregister(self, callbackUrl: str) -> None:
payLoad = {'callback_url': callbackUrl}
def unregister(self, callback_url: str) -> None:
payLoad = {'callback_url': callback_url}
self.post('unregister', payLoad)
self._callback_url = ''
def login(
self, username: str, sessionType: typing.Optional[str] = None
@ -411,19 +422,26 @@ class UDSClientApi(UDSApi):
payLoad = {
'username': username,
'session_type': sessionType or UNKNOWN,
'callback_url': self._callback_url, # So we identify ourselves
}
result = self.post('login', payLoad)
return types.LoginResultInfoType(
res = types.LoginResultInfoType(
ip=result['ip'],
hostname=result['hostname'],
dead_line=result['dead_line'],
max_idle=result['max_idle'],
session_id=result['session_id'],
)
# Store session id for future use
self._session_id = res.session_id or ''
return res
def logout(self, username: str, sessionType: typing.Optional[str]) -> None:
payLoad = {
'username': username,
'session_type': sessionType or UNKNOWN
'session_type': sessionType or UNKNOWN,
'callback_url': self._callback_url, # So we identify ourselves
'session_id': self._session_id, # We now know the session id, provided on login
}
self.post('logout', payLoad)

View File

@ -36,13 +36,13 @@ import secrets
import subprocess
import typing
from . import platform
from . import rest
from . import types
from . import tools
from udsactor import platform
from udsactor import rest
from udsactor import types
from udsactor import tools
from .log import logger, DEBUG, INFO, ERROR, FATAL
from .http import clients_pool, server, cert
from udsactor.log import logger, DEBUG, INFO, ERROR, FATAL
from udsactor.http import clients_pool, server, cert
# def setup() -> None:
# cfg = platform.store.readConfig()
@ -60,15 +60,12 @@ from .http import clients_pool, server, cert
class CommonService: # pylint: disable=too-many-instance-attributes
_isAlive: bool = True
_rebootRequested: bool = False
_loggedIn: bool = False
_initialized: bool = False
_cfg: types.ActorConfigurationType
_api: rest.UDSServerApi
_interfaces: typing.List[types.InterfaceInfoType]
_secret: str
_certificate: types.CertificateInfoType
_clientsPool: clients_pool.UDSActorClientPool
_http: typing.Optional[server.HTTPServerThread]
@staticmethod
@ -101,7 +98,7 @@ class CommonService: # pylint: disable=too-many-instance-attributes
# 0 = OTHER, 10000 = DEBUG, 20000 = WARN, 30000 = INFO, 40000 = ERROR, 50000 = FATAL
# So this comes:
logger.setLevel([DEBUG, INFO, ERROR, FATAL][self._cfg.log_level])
# If windows, enable service logger
# If windows, enable service logger FOR SERVICE only
logger.enableServiceLogger()
socket.setdefaulttimeout(20)
@ -323,7 +320,13 @@ class CommonService: # pylint: disable=too-many-instance-attributes
return False
# Only removes master token for managed machines (will need it on next client execution)
master_token = None if self.isManaged() else self._cfg.master_token
# For unmanaged, if alias is present, replace master token with it
master_token = (
None
if self.isManaged()
else (initResult.alias_token or self._cfg.master_token)
)
# Replace master token with alias token if present
self._cfg = self._cfg._replace(
master_token=master_token,
own_token=initResult.own_token,
@ -332,9 +335,10 @@ class CommonService: # pylint: disable=too-many-instance-attributes
),
)
# On first successfull initialization request, master token will dissapear for managed hosts so it will be no more available (not needed anyway)
if self.isManaged():
platform.store.writeConfig(self._cfg)
# On first successfull initialization request, master token will dissapear for managed hosts
# so it will be no more available (not needed anyway). For unmanaged, the master token will
# be replaced with an alias token.
platform.store.writeConfig(self._cfg)
# Setup logger now
if self._cfg.own_token:
@ -370,19 +374,23 @@ class CommonService: # pylint: disable=too-many-instance-attributes
self._http.stop()
# If logged in, notify UDS of logout (daemon stoped = no control = logout)
if self._loggedIn and self._cfg.own_token:
self._loggedIn = False
try:
self._api.logout(
self._cfg.actorType,
self._cfg.own_token,
'',
'',
self._interfaces,
self._secret,
)
except Exception as e:
logger.error('Error notifying final logout to UDS: %s', e)
# For every connected client...
if self._cfg.own_token:
for client in clients_pool.UDSActorClientPool().clients:
if client.session_id:
try:
self._api.logout(
self._cfg.actorType,
self._cfg.own_token,
'',
client.session_id
or 'stop', # If no session id, pass "stop"
'',
self._interfaces,
self._secret,
)
except Exception as e:
logger.error('Error notifying final logout to UDS: %s', e)
self.notifyStop()
@ -464,8 +472,9 @@ class CommonService: # pylint: disable=too-many-instance-attributes
self.checkIpsChanged()
# Now check if every registered client is already there (if logged in OFC)
if self._loggedIn and not self._clientsPool.ping():
self.logout('client_unavailable', '')
for lost_client in clients_pool.UDSActorClientPool().lost_clients():
logger.info('Lost client: {}'.format(lost_client))
self.logout('client_unavailable', '', lost_client.session_id or '') # '' means "all clients"
except Exception as e:
logger.error('Exception on main service loop: %s', e)
@ -486,7 +495,7 @@ class CommonService: # pylint: disable=too-many-instance-attributes
self, username: str, sessionType: typing.Optional[str] = None
) -> types.LoginResultInfoType:
result = types.LoginResultInfoType(
ip='', hostname='', dead_line=None, max_idle=None
ip='', hostname='', dead_line=None, max_idle=None, session_id=None
)
master_token = None
secret = None
@ -513,9 +522,9 @@ class CommonService: # pylint: disable=too-many-instance-attributes
secret,
)
if result.logged_in:
logger.debug('Login successful')
self._loggedIn = True
if (
result.session_id
): # If logged in, process it. client_pool will take account of login response to client and session
script = platform.store.invokeScriptOnLogin()
if script:
logger.info('Executing script on login: {}'.format(script))
@ -524,7 +533,12 @@ class CommonService: # pylint: disable=too-many-instance-attributes
return result
def logout(self, username: str, sessionType: typing.Optional[str]) -> None:
def logout(
self,
username: str,
session_type: typing.Optional[str],
session_id: typing.Optional[str],
) -> None:
master_token = self._cfg.master_token
# Own token will not be set if UDS did not assigned the initialized VM to an user
@ -537,24 +551,26 @@ class CommonService: # pylint: disable=too-many-instance-attributes
self._cfg.actorType,
token,
username,
sessionType or '',
session_id or '',
session_type or '',
self._interfaces,
self._secret,
)
!= 'ok'
!= 'ok' # Can return also "notified", that means the logout has not been processed by UDS
):
logger.info('Logout from %s ignored as required by uds broker', username)
logger.info(
'Logout from %s ignored as required by uds broker', username
)
return
self._loggedIn = False
self.onLogout(username)
self.onLogout(username, session_id or '')
if not self.isManaged():
self.uninitialize()
# ****************************************
# Methods that CAN BE overriden by actors
# ****************************************
# ******************************************************
# Methods that CAN BE overriden by specific OS Actor
# ******************************************************
def doWait(self, miliseconds: int) -> None:
'''
Invoked to wait a bit
@ -595,5 +611,5 @@ class CommonService: # pylint: disable=too-many-instance-attributes
return 'ok'
def onLogout(self, userName: str) -> None:
def onLogout(self, userName: str, session_id: str) -> None:
logger.debug('On logout invoked for {}'.format(userName))

View File

@ -30,14 +30,43 @@
'''
import threading
import ipaddress
import time
import typing
import functools
if typing.TYPE_CHECKING:
from udsactor.types import InterfaceInfoType
# Simple cache for n seconds (default = 30) decorator
def cache(seconds: int = 30) -> typing.Callable:
'''
Simple cache for n seconds (default = 30) decorator
'''
def decorator(func) -> typing.Callable:
@functools.wraps(func)
def wrapper(*args, **kwargs) -> typing.Any:
if not hasattr(wrapper, 'cache'):
wrapper.cache = {} # type: ignore
cache = wrapper.cache # type: ignore
# Compose a key for the cache
key = '{}:{}'.format(args, kwargs)
if key in cache:
if time.time() - cache[key][0] < seconds:
return cache[key][1]
# Call the function
result = func(*args, **kwargs)
cache[key] = (time.time(), result)
return result
return wrapper
return decorator
# Simple sub-script exectution thread
class ScriptExecutorThread(threading.Thread):
def __init__(self, script: str) -> None:
super(ScriptExecutorThread, self).__init__()
self.script = script
@ -47,14 +76,40 @@ class ScriptExecutorThread(threading.Thread):
try:
logger.debug('Executing script: {}'.format(self.script))
exec(self.script, globals(), None) # pylint: disable=exec-used
exec(
self.script, globals(), None
) # nosec: exec is fine, it's a "trusted" script
except Exception as e:
logger.error('Error executing script: {}'.format(e))
logger.exception()
class Singleton(type):
'''
Metaclass for singleton pattern
Usage:
class MyClass(metaclass=Singleton):
...
'''
_instance: typing.Optional[typing.Any]
# We use __init__ so we customise the created class from this metaclass
def __init__(self, *args, **kwargs) -> None:
self._instance = None
super().__init__(*args, **kwargs)
def __call__(self, *args, **kwargs) -> typing.Any:
if self._instance is None:
self._instance = super().__call__(*args, **kwargs)
return self._instance
# Convert "X.X.X.X/X" to ipaddress.IPv4Network
def strToNoIPV4Network(net: typing.Optional[str]) -> typing.Optional[ipaddress.IPv4Network]:
def strToNoIPV4Network(
net: typing.Optional[str],
) -> typing.Optional[ipaddress.IPv4Network]:
if not net: # Empty or None
return None
try:

View File

@ -51,16 +51,22 @@ class InitializationResultType(typing.NamedTuple):
own_token: typing.Optional[str] = None
unique_id: typing.Optional[str] = None
os: typing.Optional[ActorOsConfigurationType] = None
alias_token: typing.Optional[str] = None
class LoginResultInfoType(typing.NamedTuple):
ip: str
hostname: str
dead_line: typing.Optional[int]
max_idle: typing.Optional[int] # Not provided by broker
max_idle: typing.Optional[int]
session_id: typing.Optional[str]
@property
def logged_in(self) -> bool:
return self.hostname != '' or self.ip != ''
return bool(self.session_id)
class ClientInfo(typing.NamedTuple):
url: str
session_id: str
class CertificateInfoType(typing.NamedTuple):
private_key: str

View File

@ -1 +1,2 @@
VERSION = '3.5.0'
VERSION = '4.0.0'
BUILD = '20220901'

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2014-2019 Virtual Cable S.L.
# Copyright (c) 2014-2022 Virtual Cable S.L.U.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
@ -11,7 +11,7 @@
# * 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
# * Neither the name of Virtual Cable S.L.U. nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2014 Virtual Cable S.L.
# Copyright (c) 2014-2022 Virtual Cable S.L.U.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
@ -11,7 +11,7 @@
# * 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
# * Neither the name of Virtual Cable S.L.U. nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2014-2019 Virtual Cable S.L.
# Copyright (c) 2014-2022 Virtual Cable S.L.U.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
@ -11,7 +11,7 @@
# * 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
# * Neither the name of Virtual Cable S.L.U. nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
@ -45,32 +45,46 @@ import win32con
from .. import types
from ..log import logger
def checkPermissions() -> bool:
return shell.IsUserAnAdmin()
def getErrorMessage(resultCode: int = 0) -> str:
# sys_fs_enc = sys.getfilesystemencoding() or 'mbcs'
msg = win32api.FormatMessage(resultCode)
return msg
def getComputerName() -> str:
return win32api.GetComputerNameEx(win32con.ComputerNamePhysicalDnsHostname)
def getNetworkInfo() -> typing.Iterator[types.InterfaceInfoType]:
obj = win32com.client.Dispatch("WbemScripting.SWbemLocator")
wmobj = obj.ConnectServer("localhost", "root\\cimv2")
adapters = wmobj.ExecQuery("Select * from Win32_NetworkAdapterConfiguration where IpEnabled=True")
adapters = wmobj.ExecQuery(
"Select * from Win32_NetworkAdapterConfiguration where IpEnabled=True"
)
try:
for obj in adapters:
for ip in obj.IPAddress:
if ':' in ip: # Is IPV6, skip this
continue
if ip is None or ip == '' or ip.startswith('169.254') or ip.startswith('0.'): # If single link ip, or no ip
if (
ip is None
or ip == ''
or ip.startswith('169.254')
or ip.startswith('0.')
): # If single link ip, or no ip
continue
yield types.InterfaceInfoType(name=obj.Caption, mac=obj.MACAddress, ip=ip)
yield types.InterfaceInfoType(
name=obj.Caption, mac=obj.MACAddress, ip=ip
)
except Exception:
return
def getDomainName() -> str:
'''
Will return the domain name if we belong a domain, else None
@ -87,9 +101,19 @@ def getDomainName() -> str:
return domain
def getWindowsVersion() -> typing.Tuple[int, int, int, int, str]:
return win32api.GetVersionEx()
def getVersion() -> str:
verinfo = getWindowsVersion()
# Remove platform id i
return 'Windows-{}.{} Build {} ({})'.format(
verinfo[0], verinfo[1], verinfo[2], verinfo[4]
)
EWX_LOGOFF = 0x00000000
EWX_SHUTDOWN = 0x00000001
EWX_REBOOT = 0x00000002
@ -97,31 +121,53 @@ EWX_FORCE = 0x00000004
EWX_POWEROFF = 0x00000008
EWX_FORCEIFHUNG = 0x00000010
def reboot(flags: int = EWX_FORCEIFHUNG | EWX_REBOOT) -> None:
hproc = win32api.GetCurrentProcess()
htok = win32security.OpenProcessToken(hproc, win32security.TOKEN_ADJUST_PRIVILEGES | win32security.TOKEN_QUERY)
privs = ((win32security.LookupPrivilegeValue(None, win32security.SE_SHUTDOWN_NAME), win32security.SE_PRIVILEGE_ENABLED),)
htok = win32security.OpenProcessToken(
hproc, win32security.TOKEN_ADJUST_PRIVILEGES | win32security.TOKEN_QUERY
)
privs = (
(
win32security.LookupPrivilegeValue(None, win32security.SE_SHUTDOWN_NAME),
win32security.SE_PRIVILEGE_ENABLED,
),
)
win32security.AdjustTokenPrivileges(htok, 0, privs)
win32api.ExitWindowsEx(flags, 0)
def loggoff() -> None:
win32api.ExitWindowsEx(EWX_LOGOFF)
def renameComputer(newName: str) -> bool:
'''
Changes the computer name
Returns True if reboot needed
'''
# Needs admin privileges to work
if ctypes.windll.kernel32.SetComputerNameExW(DWORD(win32con.ComputerNamePhysicalDnsHostname), LPCWSTR(newName)) == 0: # @UndefinedVariable
if (
ctypes.windll.kernel32.SetComputerNameExW(
DWORD(win32con.ComputerNamePhysicalDnsHostname), LPCWSTR(newName)
)
== 0
): # @UndefinedVariable
# win32api.FormatMessage -> returns error string
# win32api.GetLastError -> returns error code
# (just put this comment here to remember to log this when logger is available)
error = getErrorMessage()
computerName = win32api.GetComputerNameEx(win32con.ComputerNamePhysicalDnsHostname)
raise Exception('Error renaming computer from {} to {}: {}'.format(computerName, newName, error))
computerName = win32api.GetComputerNameEx(
win32con.ComputerNamePhysicalDnsHostname
)
raise Exception(
'Error renaming computer from {} to {}: {}'.format(
computerName, newName, error
)
)
return True
NETSETUP_JOIN_DOMAIN = 0x00000001
NETSETUP_ACCT_CREATE = 0x00000002
NETSETUP_ACCT_DELETE = 0x00000004
@ -132,7 +178,10 @@ NETSETUP_MACHINE_PWD_PASSED = 0x00000080
NETSETUP_JOIN_WITH_NEW_NAME = 0x00000400
NETSETUP_DEFER_SPN_SET = 0x1000000
def joinDomain(domain: str, ou: str, account: str, password: str, executeInOneStep: bool = False) -> None:
def joinDomain(
domain: str, ou: str, account: str, password: str, executeInOneStep: bool = False
) -> None:
'''
Joins machine to a windows domain
:param domain: Domain to join to
@ -149,7 +198,9 @@ def joinDomain(domain: str, ou: str, account: str, password: str, executeInOneSt
account = domain + '\\' + account
# Do log
flags: typing.Any = NETSETUP_ACCT_CREATE | NETSETUP_DOMAIN_JOIN_IF_JOINED | NETSETUP_JOIN_DOMAIN
flags: typing.Any = (
NETSETUP_ACCT_CREATE | NETSETUP_DOMAIN_JOIN_IF_JOINED | NETSETUP_JOIN_DOMAIN
)
if executeInOneStep:
flags |= NETSETUP_JOIN_WITH_NEW_NAME
@ -163,18 +214,31 @@ def joinDomain(domain: str, ou: str, account: str, password: str, executeInOneSt
lpAccount = LPCWSTR(account)
lpPassword = LPCWSTR(password)
res = ctypes.windll.netapi32.NetJoinDomain(None, lpDomain, lpOu, lpAccount, lpPassword, flags)
res = ctypes.windll.netapi32.NetJoinDomain(
None, lpDomain, lpOu, lpAccount, lpPassword, flags
)
# Machine found in another ou, use it and warn this on log
if res == 2224:
flags = DWORD(NETSETUP_DOMAIN_JOIN_IF_JOINED | NETSETUP_JOIN_DOMAIN)
res = ctypes.windll.netapi32.NetJoinDomain(None, lpDomain, None, lpAccount, lpPassword, flags)
res = ctypes.windll.netapi32.NetJoinDomain(
None, lpDomain, None, lpAccount, lpPassword, flags
)
if res:
# Log the error
error = getErrorMessage(res)
if res == 1355:
error = "DC Is not reachable"
logger.error('Error joining domain: {}, {}'.format(error, res))
raise Exception('Error joining domain {}, with credentials {}/*****{}: {}, {}'.format(domain, account, ', under OU {}'.format(ou) if ou is not None else '', res, error))
raise Exception(
'Error joining domain {}, with credentials {}/*****{}: {}, {}'.format(
domain,
account,
', under OU {}'.format(ou) if ou is not None else '',
res,
error,
)
)
def changeUserPassword(user: str, oldPassword: str, newPassword: str) -> None:
# lpUser = LPCWSTR(user)
@ -188,7 +252,10 @@ def changeUserPassword(user: str, oldPassword: str, newPassword: str) -> None:
if res:
# Log the error, and raise exception to parent
error = getErrorMessage(res)
raise Exception('Error changing password for user {}: {} {}'.format(user, res, error))
raise Exception(
'Error changing password for user {}: {} {}'.format(user, res, error)
)
class LASTINPUTINFO(ctypes.Structure): # pylint: disable=too-few-public-methods
_fields_ = [
@ -196,16 +263,20 @@ class LASTINPUTINFO(ctypes.Structure): # pylint: disable=too-few-public-methods
('dwTime', ctypes.c_uint),
]
def initIdleDuration(atLeastSeconds: int): # pylint: disable=unused-argument
'''
In windows, there is no need to set screensaver
'''
return
def getIdleDuration() -> float:
try:
lastInputInfo = LASTINPUTINFO()
lastInputInfo.cbSize = ctypes.sizeof(lastInputInfo) # pylint: disable=attribute-defined-outside-init
lastInputInfo.cbSize = ctypes.sizeof(
lastInputInfo
) # pylint: disable=attribute-defined-outside-init
if ctypes.windll.user32.GetLastInputInfo(ctypes.byref(lastInputInfo)) == 0:
return 0
current = ctypes.c_uint(ctypes.windll.kernel32.GetTickCount()).value
@ -217,22 +288,27 @@ def getIdleDuration() -> float:
logger.error('Getting idle duration: {}'.format(e))
return 0
def getCurrentUser() -> str:
'''
Returns current logged in username
'''
return os.environ['USERNAME']
def getSessionType() -> str:
'''
Known values:
* Unknown -> No SESSIONNAME environment variable
* Console -> Local session
* RDP-Tcp#[0-9]+ -> RDP Session
Known values:
* Unknown -> No SESSIONNAME environment variable
* Console -> Local session
* RDP-Tcp#[0-9]+ -> RDP Session
'''
return os.environ.get('SESSIONNAME', 'unknown')
def writeToPipe(pipeName: str, bytesPayload: bytes, waitForResponse: bool) -> typing.Optional[bytes]:
def writeToPipe(
pipeName: str, bytesPayload: bytes, waitForResponse: bool
) -> typing.Optional[bytes]:
# (str, bytes, bool) -> Optional[bytes]
try:
with open(pipeName, 'r+b', 0) as f:
@ -244,8 +320,11 @@ def writeToPipe(pipeName: str, bytesPayload: bytes, waitForResponse: bool) -> ty
except Exception:
return None
def forceTimeSync() -> None:
try:
subprocess.call([r'c:\WINDOWS\System32\w32tm.exe', ' /resync']) # , '/rediscover'])
subprocess.call(
[r'c:\WINDOWS\System32\w32tm.exe', ' /resync']
) # , '/rediscover'])
except Exception as e:
logger.error('Error invoking time sync command: %s', e)

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2019 Virtual Cable S.L.
# Copyright (c) 2019-2022 Virtual Cable S.L.U.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
@ -11,7 +11,7 @@
# * 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
# * Neither the name of Virtual Cable S.L.U. nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#

View File

@ -183,7 +183,7 @@ class UDSActorSvc(win32serviceutil.ServiceFramework, CommonService):
operations.writeToPipe("\\\\.\\pipe\\VDSMDPipe", packet, True)
return 'done'
def onLogout(self, userName) -> None:
def onLogout(self, userName: str, session_id: str) -> None:
logger.debug('Windows onLogout invoked: {}, {}'.format(userName, self._user))
try:
p = win32security.GetBinarySid(REMOTE_USERS_SID)

View File

@ -146,7 +146,7 @@ class Ui_UdsActorSetupDialog(object):
self.host.setToolTip(_translate("UdsActorSetupDialog", "Uds Broker Server Addres. Use IP or FQDN"))
self.host.setWhatsThis(_translate("UdsActorSetupDialog", "Enter here the UDS Broker Addres using either its IP address or its FQDN address"))
self.label_serviceToken.setText(_translate("UdsActorSetupDialog", "Service Token"))
self.serviceToken.setToolTip(_translate("UdsActorSetupDialog", "UDS user with administration rights (Will not be stored on template)"))
self.serviceToken.setToolTip(_translate("UdsActorSetupDialog", "UDS Service Token"))
self.serviceToken.setWhatsThis(_translate("UdsActorSetupDialog", "<html><head/><body><p>Administrator user on UDS Server.</p><p>Note: This credential will not be stored on client. Will be used to obtain an unique token for this image.</p></body></html>"))
self.label_loglevel.setText(_translate("UdsActorSetupDialog", "Log Level"))
self.label_restrictNet.setText(_translate("UdsActorSetupDialog", "Restrict Net"))

View File

@ -1,3 +1,15 @@
udsclient3 (4.0.0) stable; urgency=medium
* Upgraded to 4.0.0 release
-- Adolfo Gómez García <agomez@virtualcable.es> Fri, 1 Jul 2022 15:12:10 +0200
udsclient3 (4.0.0) stable; urgency=medium
* Upgraded to 3.6.0 release
-- Adolfo Gómez García <agomez@virtualcable.es> Fri, 1 Jul 2022 14:12:10 +0200
udsclient3 (3.5.0) stable; urgency=medium
* Upgraded to 3.5.0 release

View File

@ -1 +1 @@
9
10

View File

@ -1,2 +1,2 @@
udsclient3_3.5.0_all.deb admin optional
udsclient3_3.5.0_amd64.buildinfo admin optional
udsclient3_4.0.0_all.deb admin optional
udsclient3_4.0.0_amd64.buildinfo admin optional

View File

@ -38,7 +38,7 @@ import webbrowser
import threading
import typing
from PyQt5 import QtCore, QtWidgets
from PyQt5 import QtCore, QtWidgets, QtGui
from PyQt5.QtCore import QSettings
from uds.rest import RestApi, RetryException, InvalidVersion, UDSException
@ -79,10 +79,10 @@ class UDSClient(QtWidgets.QMainWindow):
self.ui.info.setText('Initializing...')
screen = QtWidgets.QDesktopWidget().screenGeometry()
screen_geometry = QtGui.QGuiApplication.primaryScreen().geometry()
mysize = self.geometry()
hpos = (screen.width() - mysize.width()) // 2
vpos = (screen.height() - mysize.height() - mysize.height()) // 2
hpos = (screen_geometry.width() - mysize.width()) // 2
vpos = (screen_geometry.height() - mysize.height() - mysize.height()) // 2
self.move(hpos, vpos)
self.animTimer = QtCore.QTimer()

View File

@ -45,7 +45,7 @@ class UdsApplication(QtWidgets.QApplication):
tunnel.kill()
def event(self, evnt: QtCore.QEvent) -> bool:
if evnt.type() == QtCore.QEvent.FileOpen:
if evnt.type() == QtCore.QEvent.FileOpen: # type: ignore
fe = typing.cast(QtGui.QFileOpenEvent, evnt)
logger.debug('Got url: %s', fe.url().url())
fe.accept()

View File

@ -29,13 +29,11 @@
'''
@author: Adolfo Gómez, dkmaster at dkmon dot com
'''
from __future__ import unicode_literals
VERSION = '3.5.0'
VERSION = '3.6.0'
__title__ = 'udclient'
__version__ = VERSION
__build__ = 0x010760
__author__ = 'Adolfo Gómez'
__build__ = 0x010712
__author__ = 'Adolfo Gómez <dkmaster@dkmon.com>'
__license__ = "BSD 3-clause"
__copyright__ = "Copyright 2014-2017 VirtualCable S.L.U."
__copyright__ = "Copyright 2014-2022 VirtualCable S.L.U."

View File

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

View File

@ -1,10 +0,0 @@
bin
*_enterprise*
udsactor*.deb
udsactor*.build
udsactor*.changes
/udsactor_*.dsc
/udsactor_*.tar.xz
/udsactor_*_amd64.buildinfo
/udsactor*.rpm
linux/debian/files

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>actors</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

@ -1,8 +0,0 @@
<?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

@ -1 +0,0 @@
/udsactor-*[1-9].*.spec

View File

@ -1,98 +0,0 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Directories
SOURCEDIR := ../src
LIBDIR := $(DESTDIR)/usr/share/UDSActor
BINDIR := $(DESTDIR)/usr/bin
SBINDIR = $(DESTDIR)/usr/sbin
APPSDIR := $(DESTDIR)/usr/share/applications
CFGDIR := $(DESTDIR)/etc/udsactor
INITDIR := $(DESTDIR)/etc/init.d
POLKITDIR := $(DESTDIR)/usr/share/polkit-1/actions/
XDGAUTOSTARTDIR := $(DESTDIR)/etc/xdg/autostart
KDEAUTOSTARTDIR := $(DESTDIR)/usr/share/autostart
PYC := $(shell find $(SOURCEDIR) -name '*.py[co]')
CACHES := $(shell find $(SOURCEDIR) -name '__pycache__')
clean:
rm -rf $(PYC) $(CACHES) $(DESTDIR)
install-udsactor-xrdp:
mkdir -p $(BINDIR)
cp scripts/uds-sesman.sh $(BINDIR)/uds-sesman
cp scripts/uds-wait-session.sh $(BINDIR)/uds-wait-session
chmod 0755 $(BINDIR)/uds-sesman
chmod 0755 $(BINDIR)/uds-wait-session
install-udsactor-nx:
mkdir -p $(BINDIR)
cp scripts/udsnxstart.sh $(BINDIR)/udsnxstart
cp scripts/udsnxstop.sh $(BINDIR)/udsnxstop
chmod 0755 $(BINDIR)/udsnxstart
chmod 0755 $(BINDIR)/udsnxstop
install-udsactor:
rm -rf $(DESTDIR)
mkdir -p $(LIBDIR)
mkdir -p $(BINDIR)
mkdir -p $(SBINDIR)
mkdir -p $(APPSDIR)
mkdir -p $(CFGDIR)
mkdir -p $(POLKITDIR)
mkdir -p $(XDGAUTOSTARTDIR)
mkdir -p $(KDEAUTOSTARTDIR)
mkdir $(LIBDIR)/img
# Cleans up .pyc and cache folders
rm -f $(PYC) $(CACHES)
cp -r $(SOURCEDIR)/udsactor $(LIBDIR)/udsactor
cp $(SOURCEDIR)/img/uds.png $(LIBDIR)/img
cp $(SOURCEDIR)/UDSActorConfig.py $(LIBDIR)
cp $(SOURCEDIR)/UDSActorUser.py $(LIBDIR)
# QT Dialogs & resources
cp $(SOURCEDIR)/*_ui.py $(LIBDIR)
cp $(SOURCEDIR)/UDSActor_rc.py $(LIBDIR)
# Menu GUI app
cp desktop/UDS_Actor_Configuration.desktop $(APPSDIR)
# Autostart elements for gnome/kde
cp desktop/UDSActorTool.desktop $(XDGAUTOSTARTDIR)
cp desktop/UDSActorTool.desktop $(KDEAUTOSTARTDIR)
# scripts
cp scripts/udsactor $(BINDIR)
cp scripts/UDSActorConfig-pkexec $(SBINDIR)
cp scripts/UDSActorTool-startup $(BINDIR)
cp scripts/udsvapp ${BINDIR}
# Policy to run as administrator
cp policy/org.openuds.pkexec.UDSActorConfig.policy $(POLKITDIR)
# Fix permissions
chmod 755 $(BINDIR)/udsactor
chmod 755 $(BINDIR)/udsvapp
chmod 755 $(BINDIR)/UDSActorTool-startup
chmod 755 $(SBINDIR)/UDSActorConfig-pkexec
chmod 755 $(LIBDIR)/UDSActorConfig.py
chmod 755 $(LIBDIR)/UDSActorUser.py
chmod 644 $(POLKITDIR)/org.openuds.pkexec.UDSActorConfig.policy
# If for red hat based, copy init.d
ifeq ($(DISTRO),rh)
mkdir -p $(INITDIR)
cp debian/udsactor.init $(INITDIR)/udsactor
ln -s /usr/share/UDSActor/UDSActorConfig.py $(SBINDIR)/UDSActorConfig
ln -s /usr/share/UDSActor/UDSActorUser.py $(BINDIR)/UDSActorTool
endif
# chmod 0755 $(BINDIR)/udsactor
uninstall:
rm -rf $(LIBDIR)
# rm -f $(BINDIR)/udsactor
rm -rf $(CFGDIR)

View File

@ -1,34 +0,0 @@
#!/bin/bash
VERSION=`cat ../../VERSION`
RELEASE=1
top=`pwd`
# Debian based
dpkg-buildpackage -b
cat udsactor-template.spec |
sed -e s/"version 0.0.0"/"version ${VERSION}"/g |
sed -e s/"release 1"/"release ${RELEASE}"/g > udsactor-$VERSION.spec
# Now fix dependencies for opensuse
cat udsactor-template.spec |
sed -e s/"version 0.0.0"/"version ${VERSION}"/g |
sed -e s/"name udsactor"/"name udsactor-opensuse"/g |
sed -e s/"PyQt4"/"python-qt4"/g |
sed -e s/"libXScrnSaver"/"libXss1"/g > udsactor-opensuse-$VERSION.spec
# Right now, udsactor-xrdp-1.7.0.spec is not needed
for pkg in udsactor-$VERSION.spec udsactor-opensuse-$VERSION.spec; do
rm -rf rpm
for folder in SOURCES BUILD RPMS SPECS SRPMS; do
mkdir -p rpm/$folder
done
rpmbuild -v -bb --clean --buildroot=$top/rpm/BUILD/$pkg-root --target noarch $pkg 2>&1
done
#rm udsactor-$VERSION

View File

@ -1,3 +0,0 @@
/udsactor/
/udsactor-xrdp/
/udsactor-nx/

View File

@ -1,53 +0,0 @@
udsactor (3.0.0) stable; urgency=medium
* Upgraded to 3.0.0 release
-- Adolfo Gómez García <agomez@virtualcable.es> Wed, 10 Jul 2019 9:24:10 +0200
udsactor (2.2.1) stable; urgency=medium
* Upgraded to 2.2.1 release
-- Adolfo Gómez García <agomez@virtualcable.es> Thu, 2 Oct 2018 12:44:12 +0200
udsactor (2.2.0) stable; urgency=medium
* Upgraded to 2.2.0 release
-- Adolfo Gómez García <agomez@virtualcable.es> Thu, 19 Oct 2017 16:44:12 +0200
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
-- Adolfo Gómez García <agomez@virtualcable.es> Tue, 01 Mar 2016 03:39:21 +0100
udsactor (1.9.1) stable; urgency=medium
* Upgrade for 1.9.1
-- Adolfo Gómez García <agomez@virtualcable.es> Tue, 01 Mar 2016 03:19:21 +0100
udsactor (1.9.0) stable; urgency=medium
* Upgrade for 1.9.0 (fixed package version)
-- Adolfo Gómez García <agomez@virtualcable.es> Tue, 05 May 2015 07:10:27 +0200
udsactor (1.7.5) stable; urgency=medium
* Upgrade for 1.7.5
-- Adolfo Gómez García <agomez@virtualcable.es> Thu, 23 Apr 2015 06:08:53 +0200
udsactor (1.7.0) stable; urgency=medium
* Initial release.
-- Adolfo Gómez García <agomez@virtualcable.es> Mon, 17 Nov 2014 05:32:41 +0100

View File

@ -1 +0,0 @@
9

View File

@ -1,17 +0,0 @@
Source: udsactor
Section: admin
Priority: optional
Maintainer: Adolfo Gómez García <agomez@virtualcable.es>
Build-Depends: debhelper (>= 7), po-debconf
Standards-Version: 3.9.2
Homepage: http://www.virtualcable.es
Package: udsactor
Section: admin
Priority: optional
Architecture: all
Depends: policykit-1(>=0.100), python3-requests (>=0.8.2), python3-pyqt4 (>=4.9), python3-six(>=1.1), python3 (>=3.4), libxss1, xscreensaver, ${misc:Depends}
Recommends: python3-prctl(>=1.1.1)
Description: Actor for Universal Desktop Services (UDS) Broker
This package provides the required components to allow this machine to work on an environment managed by UDS Broker.

View File

@ -1,26 +0,0 @@
Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135
Name: udsactor
Maintainer: Adolfo Gómez García
Source: http://www.udsenterprise.com/
Copyright: 2014 Virtual Cable S.L.U.
License: BSD-3-clause
License: GPL-2+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
.
On Debian systems, the full text of the GNU General Public
License version 2 can be found in the file
`/usr/share/common-licenses/GPL-2'.

View File

@ -1 +0,0 @@
readme.txt

View File

@ -1,46 +0,0 @@
#!/usr/bin/make -f
# -*- makefile -*-
configure: configure-stamp
configure-stamp:
dh_testdir
touch configure-stamp
build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp: configure-stamp
dh_testdir
$(MAKE)
touch $@
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
dh_clean
install: build
dh_testdir
dh_testroot
dh_prep
dh_installdirs
$(MAKE) DESTDIR=$(CURDIR)/debian/udsactor install-udsactor
$(MAKE) DESTDIR=$(CURDIR)/debian/udsactor-xrdp install-udsactor-xrdp
$(MAKE) DESTDIR=$(CURDIR)/debian/udsactor-nx install-udsactor-nx
binary-arch: build install
# emptyness
binary-indep: build install
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
dh_installdebconf
dh_installinit --no-start
dh_python2=python
dh_compress
dh_link
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep
.PHONY: build clean binary-indep binary install configure

View File

@ -1 +0,0 @@
3.0 (native)

View File

@ -1,37 +0,0 @@
#!/bin/sh
NXNODECFG=/usr/NX/etc/node.cfg
. /usr/share/debconf/confmodule
set -e
case "$1" in
configure)
TMPFILE=$(mktemp /tmp/node.cfg.XXXXX)
trap "rm -f $TMPFILE" 0
cat $NXNODECFG | sed -e "s/.*udsnxst.*//; s/\(UserScriptAfterSessionStart *=.*\)/#\1/;s/\(UserScriptAfterSessionClose *=.*\)/#\1/" > $TMPFILE
echo >> $TMPFILE
echo "# Added by udsactor-nx (udsnxstart and udsnxstop)" >> $TMPFILE
echo UserScriptAfterSessionStart = \"/usr/bin/udsnxstart\" >> $TMPFILE
echo UserScriptAfterSessionClose = \"/usr/bin/udsnxstop\" >> $TMPFILE
cp $TMPFILE $NXNODECFG
invoke-rc.d nxserver restart
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
# Don't know why, but descriptors get "weird" when launched daemon, so we tell here to debconf to stop.
# Solved not starting the service right now, defered to next reboot
exit 0

View File

@ -1,30 +0,0 @@
#!/bin/sh
NXNODECFG=/usr/NX/etc/node.cfg
. /usr/share/debconf/confmodule
set -e
case "$1" in
purge)
;;
remove)
if [ -f $NXNODECFG ]; then
TMPFILE=$(mktemp /tmp/node.cfg.XXXXX)
trap "rm -f $TMPFILE" 0
cat $NXNODECFG | sed -e "s/.*udsnxst.*//" > $TMPFILE
cp $TMPFILE $NXNODECFG
invoke-rc.d nxserver restart
fi
;;
upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#

View File

@ -1,39 +0,0 @@
#!/bin/sh
SESMANFILE=/etc/pam.d/xrdp-sesman
. /usr/share/debconf/confmodule
set -e
case "$1" in
configure)
trap "cp $SESMANFILE $SESMANFILE.uds.old" 0
TMPFILE=$(mktemp /tmp/sesman.XXXXX)
trap "rm -f $TMPFILE" 0
grep -v uds $SESMANFILE > $TMPFILE # Removes all UDS lines from sesman if they exists
echo >> $TMPFILE
echo "# Added by udsactor-xrdp" >> $TMPFILE
echo "session optional pam_exec.so /usr/bin/uds-sesman" >> $TMPFILE
cp $TMPFILE $SESMANFILE
trap "rm -f $TMPFILE" 0
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
# Don't know why, but descriptors get "weird" when launched daemon, so we tell here to debconf to stop.
# Solved not starting the service right now, defered to next reboot
exit 0

View File

@ -1,30 +0,0 @@
#!/bin/sh -e
SESMANFILE=/etc/pam.d/xrdp-sesman
. /usr/share/debconf/confmodule
set -e
case "$1" in
purge)
;;
remove)
if [ -f $SESMANFILE ]; then
TMPFILE=$(mktemp /tmp/sesman.XXXXX)
trap "rm -f $TMPFILE" 0
grep -v uds $SESMANFILE > $TMPFILE # Removes all UDS lines from sesman if they exists
cp $TMPFILE $SESMANFILE
trap "rm -f $TMPFILE" 0
fi
;;
upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#

View File

@ -1,45 +0,0 @@
#!/bin/sh -e
. /usr/share/debconf/confmodule
db_version 2.0
# This conf script is capable of backing up
db_capb backup
if [ -f /etc/udsactor/udsactor.cfg ] && [ "$1" != "reconfigure" ]; then
echo "/etc/udsactor/udsactor.cfg already exists, leaving untouched."
exit 0
fi
STATE=1
while [ "$STATE" != 0 -a "$STATE" != 4 ]; do
case "$STATE" in
1)
db_input high udsactor/host || true
;;
2)
db_input high udsactor/secure || true
;;
3)
db_input high udsactor/masterKey || true
;;
esac
if db_go; then
STATE=$(($STATE + 1))
else
STATE=$(($STATE - 1))
fi
done
# If "cancelled", exit
if [ "$STATE" = 0 ]; then
exit 0
fi
# If using reconfigure, and already exists an configuration file, move it to a backup
if [ -f /etc/udsactor/udsactor.cfg ] && [ "$1" = "reconfigure" ]; then
echo "/etc/udsactor.cfg backup to /etc/udsactor.cfg.back"
mv /etc/udsactor/udsactor.cfg /etc/udsactor/udsactor.cfg.back
fi

View File

@ -1,23 +0,0 @@
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: udsactor
# Required-Start: $local_fs $remote_fs $network $syslog $named
# Required-Stop: $local_fs $remote_fs $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: UDS Actor
### END INIT INFO
#
# . /lib/lsb/init-functions
case "$1" in
start|stop|restart)
/usr/bin/udsactor $1
;;
force-reload)
/usr/bin/udsactor restart
;;
*) echo "Usage: $0 {start|stop|restart|force-reload}" >&2; exit 1 ;;
esac

View File

@ -1,2 +0,0 @@
/usr/share/UDSActor/UDSActorConfig.py /usr/sbin/UDSActorConfig
/usr/share/UDSActor/UDSActorUser.py /usr/bin/UDSActorTool

View File

@ -1,54 +0,0 @@
#!/bin/sh
. /usr/share/debconf/confmodule
set -e
case "$1" in
configure)
/usr/bin/python3 -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
host=$RET
db_get udsactor/secure
ssl=$RET
if [ "$ssl" = "true" ]; then
ssl=True;
else
ssl=False;
fi
db_get udsactor/masterKey
masterKey=$RET
# If already has a config file there
if [ -f /etc/udsactor/udsactor.cfg ]; then
cp /etc/udsactor/udsactor.cfg /etc/udsactor/udsactor.cfg.dpkg-old
fi
echo "[uds]" > /etc/udsactor/udsactor.cfg
echo "host = $host" >> /etc/udsactor/udsactor.cfg
echo "logLevel = 30000" >> /etc/udsactor/udsactor.cfg
echo "ssl = $ssl" >> /etc/udsactor/udsactor.cfg
echo "masterKey = $masterKey" >> /etc/udsactor/udsactor.cfg
fi
# Fix perms so only root can access "masterKey"
chmod 0700 /etc/udsactor
chmod 0600 /etc/udsactor/udsactor.cfg
chown root:root /etc/udsactor
chown root:root /etc/udsactor/udsactor.cfg
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0

View File

@ -1,14 +0,0 @@
#!/bin/sh -e
. /usr/share/debconf/confmodule
set -e
if [ "$1" = "purge" ] ; then
if [ -f /etc/udsactor/udsactor.cfg ]; then
mv /etc/udsactor/udsactor.cfg /etc/udsactor/udsactor.cfg.dpkg-backup
# Remove .pyc leaved behind
rm -rf /usr/share/UDSActor || true > /dev/null 2>&1
fi
fi

View File

@ -1 +0,0 @@
#! /bin/bash -e

View File

@ -1,20 +0,0 @@
Template: udsactor/host
Type: string
Default:
Description: UDS Server address:
The actor needs the address of the server in order to communicate with it.
Provide here full address (or i) of the UDS server
Template: udsactor/secure
Type: boolean
Default: true
Description: Use secure (https) connection to communicate with UDS server?
If selected, the communication will be done using https.
If not selected, the communication will be done using http
Template: udsactor/masterKey
Type: string
Default:
Description: Master Key:
This key is available on UDS Administration interface.
Look for it under configuration, on Security tab.

View File

@ -1,12 +0,0 @@
[Desktop Entry]
Name=UDS Actor Tool
Comment=UDS Actor Userspace tools
Exec=/usr/bin/UDSActorTool-startup
Icon=/usr/share/UDSActor/img/uds.png
Terminal=false
Type=Application
NoDisplay=true
X-KDE-autostart-after=panel
X-KDE-StartupNotify=false
X-DBUS-StartupType=None
X-KDE-UniqueApplet=false

View File

@ -1,11 +0,0 @@
[Desktop Entry]
Name=UDS Actor Configuration
Version=1.0
Exec=/usr/sbin/UDSActorConfig-pkexec
Comment=UDS Actor Configuration Application. (Must be executed as root)
Icon=/usr/share/UDSActor/img/uds.png
Type=Application
Terminal=false
StartupNotify=true
Encoding=UTF-8
Categories=Settings;System;

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
<action id="org.freedesktop.policykit.pkexec.run-UDSActorConfig">
<description>Run UDS Actor Configuration Program</description>
<message>Authentication is required to run UDS Actor Configuration</message>
<defaults>
<allow_any>no</allow_any>
<allow_inactive>no</allow_inactive>
<allow_active>auth_admin_keep</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/sbin/UDSActorConfig</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">TRUE</annotate>
</action>
</policyconfig>

View File

@ -1,3 +0,0 @@
UDSActor is the client actor needed to get machines managed by UDS Broker.
Please, visit http://www.udsenterprise.com for more information

View File

@ -1,3 +0,0 @@
#!/bin/sh
# pkexec env DISPLAY=$DISPLAY QT_X11_NO_MITSHM=1 "/usr/sbin/UDSActorConfig" "$@"
pkexec "/usr/sbin/UDSActorConfig" "$@"

View File

@ -1,10 +0,0 @@
#!/bin/sh
# Simple hack to wait for systray to be present
# Exec tool if not already runned by session manager
ps -ef | grep "$USER" | grep -v grep | grep -v UDSActorTool-startup | grep 'UDSActorTool' -q
# If not already running
if [ $? -eq 1 ]; then
sleep 5
exec /usr/bin/UDSActorTool
fi

View File

@ -1,13 +0,0 @@
#!/bin/sh
env > /tmp/env.txt
if [ "$PAM_TYPE" = "open_session" ]; then
nohup /usr/bin/udsactor login $PAM_USER &
# Wait in backgroud to TTY to close (close_session is not being invoked right now)
nohup /usr/bin/uds-wait-session &
elif [ "$PAM_TYPE" = "close_session" ]; then
nohup /usr/bin/udsactor logout $PAM_USER &
fi
return 0

View File

@ -1,12 +0,0 @@
#!/bin/sh
while :
do
sleep 5 # Wait 5 seconds between checks
found=`ps -f -u$PAM_USER | grep -v grep | grep -v uds-wait-session | grep "$PAM_TTY" | wc -l`
if [ "$found" = "0" ]; then
/usr/bin/udsactor logout $PAM_USER
exit 0
fi
done

View File

@ -1,6 +0,0 @@
#!/bin/sh
FOLDER=/usr/share/UDSActor
cd $FOLDER
exec python3 -m udsactor.linux.UDSActorService $@

View File

@ -1,3 +0,0 @@
#!/bin/sh
exec /usr/bin/udsactor login $2 &

View File

@ -1,3 +0,0 @@
#!/bin/sh
exec /usr/bin/udsactor logout $2 &

View File

@ -1,5 +0,0 @@
#!/bin/sh
/usr/bin/udsactor login "$USER"
$@
/usr/bin/udsactor logout "$USER"

View File

@ -1,6 +0,0 @@
build
dist
*.spec
.idea
*_enterprise*
/samples/

View File

@ -1,5 +0,0 @@
<RCC>
<qresource prefix="images">
<file>img/uds.png</file>
</qresource>
</RCC>

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
type="win32"
name="UDSActorConfig"
version="1.6.0.0"
processorArchitecture="x86"
/>
<description>Description</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

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