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

Compare commits

...

62 Commits

Author SHA1 Message Date
Alexander Burmatov
6240c4cbff Add checkbox to enable SSL connection for SPICE
If in OpenNebula not enabled TLS for SPICE protocol, when
cannot connect to OpenNebula with generated virt-viewer connection
config file, because "secure-channel" options successfully work
over TLS only.
This changes allow enable or disable TLS on UDS site.
2023-01-27 18:21:09 +03:00
Alexander Burmatov
879ae4b74a Adding a script to register the tunnel token 2022-11-17 16:48:59 +03:00
8b48120134 3.5.0-alt2
- Build release-v3.5
2022-10-04 14:38:50 +03:00
3e27815256 Merge tag 'release-v3.5' into server 2022-10-04 14:34:59 +03:00
bff1fe7750 3.5.0-alt1
- v3.5 snapshot 83394f0d34
2022-08-28 13:55:21 +03:00
53ba2b541e fix version 2022-08-22 17:47:08 +03:00
51f95bf782 Merge remote-tracking branch 'upstream/v3.5' into server 2022-08-22 14:22:46 +03:00
6078c40bd9 3.0.0-alt13
- Add link for download python 3.9 client.
2021-11-29 23:31:30 +03:00
896ce53fb0 Add link for download python 3.9 client 2021-11-29 23:30:19 +03:00
8a989bfc90 3.0.0-alt12
- Switch to use macros from rpm-build-systemd for post scripts.
2021-10-28 14:44:03 +03:00
6ed3113d61 3.0.0-alt11
- Add requires openuds-installers (client and actor windows installers).
- Revert "Remove download pages".
- Fix client and actor file name on download page.
2021-10-27 13:39:47 +03:00
81a7ecd96f Merge remote-tracking branch 'upstream/v3.0' into server 2021-10-27 13:35:16 +03:00
058784a10e Disable linux actor installers from download page 2021-10-27 13:24:12 +03:00
51d7b19687 Define win actor installer name from openuds-installer package for download page 2021-10-27 13:23:31 +03:00
b56ca2d50e Define only win client installer from openuds-installer package for download page 2021-10-27 13:18:00 +03:00
7798d62db2 Delete DEVEL from version 2021-10-27 13:14:01 +03:00
f482f09621 Update JS from openuds-gui 2021-10-27 13:10:43 +03:00
b154073efd 3.0.0-alt10
- Updated RSA key to 4096 bit in config.
2021-09-06 19:52:14 +03:00
196400ed34 Update RSA key to 4096 bit 2021-09-06 19:51:02 +03:00
Adolfo Gómez García
263071750c Fixed logs removal 2021-09-02 13:23:04 +02:00
Adolfo Gómez García
4fed22d39d Merge branch 'v3.0' of github.com:dkmstr/openuds into v3.0 2021-08-25 12:49:08 +02:00
Adolfo Gómez García
24687fda2e Fixed configjs so disabled custom auths works in all cases 2021-08-25 12:48:54 +02:00
7ebf875e8d 3.0.0-alt9
- v3.0 snapshot 51b0cec536
2021-08-21 01:45:02 +03:00
4462629234 Merge remote-tracking branch 'upstream/v3.0' into server 2021-08-21 01:43:32 +03:00
Adolfo Gómez García
51b0cec536 Upgraded git signatures outdated for RDP (thanks Dani por the report ;-) ) 2021-08-19 12:55:30 +02:00
3f7c199c4b Update JS from openuds-gui 2021-08-18 17:53:12 +03:00
43b60a22b8 Merge remote-tracking branch 'upstream/v3.0' into server
# Conflicts:
#	server/src/uds/locale/ru/LC_MESSAGES/djangojs.po
#	server/src/uds/static/modern/main-es2015.js
#	server/src/uds/static/modern/main-es5.js
2021-08-18 17:44:22 +03:00
bb3ab772e1 3.0.0-alt8
- Fix Russian translation
- Update SECRET_KEY config for install only in %post
2021-07-09 01:56:37 +03:00
e11a6f6892 Drop applied patch 2021-07-09 01:08:51 +03:00
231fc0d4db Fix Russian translation 2021-07-09 01:07:08 +03:00
8ff65a3aa4 Add Russian language to server config file (cas@) 2021-07-09 00:57:19 +03:00
Andrey Cherepanov
97721e8e84 3.0.0-alt7.2
- Compile l10n messages using django-admin
- Add Russian language to server config file
2021-06-23 12:11:14 +03:00
Andrey Cherepanov
192750a66f Add Russian language to server config file 2021-06-23 12:10:07 +03:00
Andrey Cherepanov
4cd8c5c72c Compile l10n messages using django-admin 2021-06-23 11:55:01 +03:00
Andrey Cherepanov
96ce2839e7 3.0.0-alt7.1
- NMU: package compiled localization files (ALT #40161)
2021-06-05 10:34:36 +03:00
Andrey Cherepanov
b1eb5a557a Compile localization files 2021-06-05 10:32:50 +03:00
a8dc429746 3.0.0-alt7
- Fix create home dir for user openuds
2021-04-23 15:49:28 +03:00
5cbb71a33e 3.0.0-alt6
- Switch to local memory from memcached by default in settings.py.
- Fix openuds-web.service for execute gunicorn.py3 for use python3.
- Add conflicts with openuds-tunnel,openuds-guacamole-tunnel.
2021-04-22 15:15:30 +03:00
a7bcc2430c Add conflicts with openuds-tunnel,openuds-guacamole-tunnel.
openuds-tunnel and openuds-guacamole-tunnel should install to other
server.
2021-04-22 15:08:28 +03:00
48451036fa Update systemd unit 2021-04-22 15:00:37 +03:00
c49bfc8e93 Execute gunicorn.py3 for use python3 2021-04-22 14:58:17 +03:00
b1e77acc3c Switch to local memory from memcached as cache 2021-04-22 14:38:32 +03:00
95e29cbffc 3.0.0-alt5
- Fix typo in nginx config (ALT #39968)
2021-04-21 16:59:31 +03:00
793d70e6f5 Fix typo in nginx config 2021-04-21 16:57:58 +03:00
Mikhail Gordeev
1c69cf320d 3.0.0-alt4
- Remove pages and buttons with downloading clients and actors
2021-04-14 22:40:05 +03:00
Mikhail Gordeev
6c2ef9752f Remove pages and buttons with downloading clients and actors 2021-04-14 22:39:22 +03:00
bc7dda51e8 3.0.0-alt3
- merge with upstream v3.0 branch (b1c4385090)
- update nginx config
2020-12-07 19:59:13 +03:00
413907b896 Merge remote-tracking branch 'upstream/v3.0' into server 2020-12-07 19:44:20 +03:00
eaddab1332 merge nginx config to one file 2020-12-07 19:33:20 +03:00
116991c260 fix License 2020-12-03 23:28:42 +03:00
dea737666f filter django site from provides 2020-12-03 23:17:04 +03:00
241f38ac73 3.0.0-alt2
- move apache config to apache2 package
- add package with nginx config and service for start django app over gunicorn
2020-12-03 23:03:33 +03:00
e4180b3b87 update gear rules 2020-12-03 22:16:42 +03:00
0c56531698 add nginx configs 2020-12-03 22:16:07 +03:00
4b7e636ea8 add OpenUDS Broker gunicorn executor as systemd unit 2020-12-03 22:15:45 +03:00
0a1aaa7cfe add OpenUDS Broker task manager 2020-12-03 22:14:36 +03:00
5e2117e2a5 update apache configs 2020-12-03 22:13:26 +03:00
312c01e2bb 3.0.0-alt1
- 3.0.0 Release
2020-11-05 18:18:10 +03:00
abf32a7a47 fix httpd config 2020-11-05 18:17:26 +03:00
Adolfo Gómez García
06cb44e865 fixed incorrectly removing service with token on edition of service and duplication of token 2020-11-05 18:06:01 +03:00
8496b7d711 Merge tag 'v3.0' into server 2020-11-05 18:02:58 +03:00
e02e9be564 3.0.0-alt0.1.git.d7e30d14
- Initial build for ALT
2020-04-14 02:46:11 +03:00
18 changed files with 635 additions and 67 deletions

View File

@@ -0,0 +1,43 @@
<IfModule ssl_module>
#Listen 443
<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /etc/httpd2/ssl.crt/openuds-server.crt
SSLCertificateKeyFile /etc/httpd2/ssl.key/openuds-server.key
ServerName openuds.example.com
ServerAdmin webmaster@openuds.example.com
DocumentRoot /usr/share/openuds
Alias /favicon.ico /usr/share/openuds/uds/static/modern/img/favicon.ico
Alias /static/ /usr/share/openuds/uds/static/
Alias /uds/res/ /usr/share/openuds/uds/static/
LogLevel warn
ErrorLog /var/log/openuds/error.log
# CustomLog /var/log/openuds/access.log combined
WSGIScriptReloading On
WSGIDaemonProcess openuds processes=2 threads=10 python-path=/usr/share/openuds user=openuds group=openuds display-name=%{GROUP}
WSGIProcessGroup openuds
WSGIApplicationGroup openuds
WSGIPassAuthorization On
WSGIScriptAlias / /usr/share/openuds/server/wsgi.py
<Directory /usr/share/openuds/uds>
Require all granted
</Directory>
<Directory /usr/share/openuds/server>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
</VirtualHost>
</IfModule>

34
.gear/openuds-httpd.conf Normal file
View File

@@ -0,0 +1,34 @@
#Listen 443
<VirtualHost *:80>
DocumentRoot /usr/share/openuds
Alias /favicon.ico /usr/share/openuds/uds/static/modern/img/favicon.ico
Alias /static/ /usr/share/openuds/uds/static/
Alias /uds/res/ /usr/share/openuds/uds/static/
LogLevel warn
ErrorLog /var/log/openuds/error.log
# CustomLog /var/log/openuds/access.log combined
WSGIScriptReloading On
WSGIDaemonProcess openuds processes=2 threads=10 python-path=/usr/share/openuds user=openuds group=openuds display-name=%{GROUP}
WSGIProcessGroup openuds
WSGIApplicationGroup openuds
WSGIPassAuthorization On
WSGIScriptAlias / /usr/share/openuds/server/wsgi.py
<Directory /usr/share/openuds/uds>
Require all granted
</Directory>
<Directory /usr/share/openuds/server>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
</VirtualHost>

View File

@@ -0,0 +1,79 @@
upstream uds_server {
server unix:/run/openuds/socket fail_timeout=10s;
}
map $http_x_forwarded_proto $thescheme {
default $scheme;
https https;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
# SSL configuration
#
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
ssl_protocols TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_session_timeout 10m;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
#resolver $DNS-IP-1 $DNS-IP-2 valid=300s;
resolver_timeout 5s;
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
ssl_certificate /var/lib/ssl/certs/nginx-openuds.cert;
ssl_certificate_key /var/lib/ssl/private/nginx-openuds.key;
root /usr/share/openuds/;
# Add index.php to the list if you are using PHP
index index.html;
server_name _;
# Activate GZIP
# In our app, saves around 80% or the traffic.
#
gzip on;
gzip_proxied any;
# text/html is always included
gzip_types
text/css
text/javascript
text/xml
text/plain
application/javascript
application/x-javascript
application/json;
location /favicon.ico {
alias /usr/share/openuds/uds/static/modern/img/favicon.ico;
}
location /uds/res/ {
autoindex off;
alias /usr/share/openuds/uds/static/;
}
location / {
# First attempt to server /maintenance (to allow easy backend maintenance) if exists
# if not, fallback to UDS
try_files /maintenance.html @proxy_to_uds;
}
location @proxy_to_uds {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $thescheme;
proxy_set_header Host $http_host;
# we don't want nginx trying to do something clever with
# redirects, we set the Host: header above already.
proxy_redirect off;
proxy_pass http://uds_server;
}
}

218
.gear/openuds-server.spec Normal file
View File

@@ -0,0 +1,218 @@
%add_python3_lib_path %_datadir/openuds
%allow_python3_import_path %_datadir/openuds
%add_findreq_skiplist %_datadir/openuds/uds/transports/*/scripts/windows/* %_datadir/openuds/uds/transports/*/scripts/macosx/*
%add_python3_req_skip uds.forward
%add_python3_req_skip uds.tunnel
%filter_from_provides /^python3(manage)/d
%filter_from_provides /^python3(server)/d
%filter_from_provides /^python3(server\.settings)/d
%filter_from_provides /^python3(server\.urls)/d
%filter_from_provides /^python3(server\.wsgi)/d
Name: openuds-server
Version: 3.5.0
Release: alt2
Summary: Universal Desktop Services (UDS) Broker
License: BSD-3-Clause and MIT and Apache-2.0
Group: Networking/Remote access
URL: https://github.com/dkmstr/openuds
AutoReqProv: yes, nopython
Source0: %name-%version.tar
Source10: openuds-httpd.conf
Source11: openuds-httpd-ssl.conf
Source12: openuds.logrotate
Source13: openuds-nginx-sites.conf
Source15: openuds-taskmanager.service
Source16: openuds-web.service
Source17: openuds-web.socket
#Patch: %name-%version.patch
BuildRequires(pre): rpm-macros-systemd
Requires: python3-module-django >= 2.2
Requires: python3-module-django-dbbackend-mysql >= 2.2
Requires: python3-module-django-dbbackend-sqlite3 >= 2.2
Requires: openssl
Requires: logrotate
Requires: openuds-installers
Conflicts: openuds-tunnel openuds-guacamole-tunnel
BuildArch: noarch
BuildRequires(pre): rpm-build-python3
BuildRequires(pre): webserver-common rpm-build-webserver-common rpm-macros-apache2
BuildRequires: python3-module-django
%description
OpenUDS (Universal Desktop Services) is a multiplatform connection broker for:
- VDI: Windows and Linux virtual desktops administration and deployment
- App virtualization
- Desktop services consolidation
This package provides the required components
to allow this machine to work as UDS Broker.
%package apache2
Group: Networking/WWW
BuildArch: noarch
Summary: apache2 configs for %name
Requires: %name = %version-%release
Requires: apache2-httpd-prefork-like
Requires: apache2-base
Requires: apache2-mod_wsgi-py3
%description apache2
%summary
%package nginx
Group: Networking/WWW
BuildArch: noarch
Summary: nginx configs for %name
Requires: %name = %version-%release
Requires: nginx
Requires: python3-module-gunicorn
Requires: cert-sh-functions
%description nginx
%summary
%prep
%setup
#%patch -p1
sed -i 's|#!/usr/bin/env python3|#!/usr/bin/python3|' \
$(find . -name '*.py')
%build
# Compile localization files
django-admin compilemessages
#find src/uds/locale -name \*.po -delete
%install
mkdir -p %buildroot{%_datadir,%_logdir,%_sysconfdir,%_sharedstatedir}/openuds
cp -r src/* %buildroot%_datadir/openuds/
mkdir -p %buildroot%_datadir/openuds/uds/static/clients
mkdir -p %buildroot%_datadir/openuds/uds/osmanagers/WindowsOsManager/files
mv %buildroot%_datadir/openuds/server/settings.py.sample %buildroot%_sysconfdir/openuds/settings.py
ln -r -s %buildroot%_logdir/openuds %buildroot%_datadir/openuds/log
ln -r -s %buildroot%_sysconfdir/openuds/settings.py %buildroot%_datadir/openuds/server/settings.py
# drop httpd-conf snippet
install -p -D -m 644 %SOURCE10 %buildroot%apache2_sites_available/openuds.conf
install -p -D -m 644 %SOURCE11 %buildroot%apache2_sites_available/openuds-ssl.conf
mkdir -p %buildroot%apache2_sites_enabled
touch %buildroot%apache2_sites_enabled/openuds.conf
install -p -D -m 644 %SOURCE12 %buildroot%_logrotatedir/openuds-server
install -p -D -m 644 %SOURCE13 %buildroot%_sysconfdir/nginx/sites-available.d/openuds.conf
mkdir -p %buildroot%_sysconfdir/nginx/sites-enabled.d
touch %buildroot%_sysconfdir/nginx/sites-enabled.d/openuds.conf
install -p -D -m 644 %SOURCE15 %buildroot%_unitdir/openuds-taskmanager.service
install -p -D -m 644 %SOURCE16 %buildroot%_unitdir/openuds-web.service
install -p -D -m 644 %SOURCE17 %buildroot%_unitdir/openuds-web.socket
%pre
%_sbindir/groupadd -r -f openuds >/dev/null 2>&1 ||:
%_sbindir/useradd -M -r -g openuds -G _webserver -c 'OpenUDS Brocker Daemon' \
-s /bin/false -d %_sharedstatedir/openuds openuds >/dev/null 2>&1 ||:
%post
if [ $1 -eq 1 ]; then
# ugly hack to set a unique SECRET_KEY
sed -i "/^SECRET_KEY.*$/{N;s/^.*$/SECRET_KEY='`openssl rand -hex 10`'/}" %_sysconfdir/openuds/settings.py
fi
%post_systemd_postponed openuds-taskmanager.service
%preun
%preun_systemd openuds-taskmanager.service
%post nginx
%post_systemd_postponed openuds-web.socket openuds-web.service
# Create SSL certificate for HTTPS server
cert-sh generate nginx-openuds ||:
%preun nginx
%preun_systemd openuds-web.service openuds-web.socket
%files
%_datadir/openuds
%dir %attr(0750, root, openuds) %_sysconfdir/openuds
%config(noreplace) %attr(0640, root, openuds) %_sysconfdir/openuds/settings.py
%dir %attr(0770, root, openuds) %_sharedstatedir/openuds
%dir %attr(0770, root, openuds) %_logdir/openuds
%config(noreplace) %_logrotatedir/openuds-server
%_unitdir/openuds-taskmanager.service
%files apache2
%config(noreplace) %apache2_sites_available/*.conf
%ghost %apache2_sites_enabled/*.conf
%files nginx
%config(noreplace) %_sysconfdir/nginx/sites-available.d/openuds.conf
%ghost %_sysconfdir/nginx/sites-enabled.d/openuds.conf
%_unitdir/openuds-web.service
%_unitdir/openuds-web.socket
%changelog
* Tue Oct 04 2022 Alexey Shabalin <shaba@altlinux.org> 3.5.0-alt2
- Build release-v3.5
* Mon Aug 22 2022 Alexey Shabalin <shaba@altlinux.org> 3.5.0-alt1
- v3.5 snapshot 83394f0d34daf18722923be8d57b35627b330121
* Mon Nov 29 2021 Alexey Shabalin <shaba@altlinux.org> 3.0.0-alt13
- Add link for download python 3.9 client.
* Thu Oct 28 2021 Alexey Shabalin <shaba@altlinux.org> 3.0.0-alt12
- Switch to use macros from rpm-build-systemd for post scripts.
* Wed Oct 27 2021 Alexey Shabalin <shaba@altlinux.org> 3.0.0-alt11
- Add requires openuds-installers (client and actor windows installers).
- Revert "Remove download pages".
- Fix client and actor file name on download page.
* Mon Sep 06 2021 Alexey Shabalin <shaba@altlinux.org> 3.0.0-alt10
- Updated RSA key to 4096 bit in config.
* Wed Aug 18 2021 Alexey Shabalin <shaba@altlinux.org> 3.0.0-alt9
- v3.0 snapshot 51b0cec5365698dffdb9a3a468d52bbba4656ba4
* Fri Jul 09 2021 Alexey Shabalin <shaba@altlinux.org> 3.0.0-alt8
- Fix Russian translation
- Update SECRET_KEY config for install only in %%post
* Wed Jun 23 2021 Andrey Cherepanov <cas@altlinux.org> 3.0.0-alt7.2
- Compile l10n messages using django-admin
- Add Russian language to server config file
* Sat Jun 05 2021 Andrey Cherepanov <cas@altlinux.org> 3.0.0-alt7.1
- NMU: package compiled localization files (ALT #40161)
* Fri Apr 23 2021 Alexey Shabalin <shaba@altlinux.org> 3.0.0-alt7
- Fix create home dir for user openuds
* Thu Apr 22 2021 Alexey Shabalin <shaba@altlinux.org> 3.0.0-alt6
- Switch to local memory from memcached by default in settings.py.
- Fix openuds-web.service for execute gunicorn.py3 for use python3.
- Add conflicts with openuds-tunnel,openuds-guacamole-tunnel.
* Wed Apr 21 2021 Alexey Shabalin <shaba@altlinux.org> 3.0.0-alt5
- Fix typo in nginx config (ALT #39968)
* Wed Apr 14 2021 Mikhail Gordeev <obirvalger@altlinux.org> 3.0.0-alt4
- Remove pages and buttons with downloading clients and actors
* Mon Dec 07 2020 Alexey Shabalin <shaba@altlinux.org> 3.0.0-alt3
- merge with upstream v3.0 branch (b1c43850908c5c207afa5812edc6c1ce46d8ca78)
- update nginx config
* Thu Dec 03 2020 Alexey Shabalin <shaba@altlinux.org> 3.0.0-alt2
- move apache config to apache2 package
- add package with nginx config and service for start django app over gunicorn
* Thu Nov 05 2020 Alexey Shabalin <shaba@altlinux.org> 3.0.0-alt1
- 3.0.0 Release
* Tue Apr 14 2020 Alexey Shabalin <shaba@altlinux.org> 3.0.0-alt0.1.git.d7e30d14
- Initial build for ALT

View File

@@ -0,0 +1,16 @@
[Unit]
Description=OpenUDS Broker task manager
After=network.target
[Service]
User=openuds
Group=openuds
RuntimeDirectory=openuds
WorkingDirectory=/usr/share/openuds
ExecStart=/usr/bin/python3 /usr/share/openuds/manage.py taskManager --start --foreground
PrivateTmp=true
Restart=always
RestartSec=16
[Install]
WantedBy=multi-user.target

21
.gear/openuds-web.service Normal file
View File

@@ -0,0 +1,21 @@
[Unit]
Description=OpenUDS Broker Web server daemon
Requires=openuds-web.socket
After=network.target
[Service]
PIDFile=/run/openuds/pid
User=openuds
Group=openuds
RuntimeDirectory=openuds
WorkingDirectory=/usr/share/openuds
ExecStart=/usr/bin/gunicorn.py3 --pid /run/openuds/pid \
--bind unix:/run/openuds/socket server.wsgi \
--workers 5 --threads 8
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target
Also=openuds-web.socket

10
.gear/openuds-web.socket Normal file
View File

@@ -0,0 +1,10 @@
[Unit]
Description=OpenUDS Broker Web server socket
[Socket]
ListenStream=/run/openuds/socket
SocketUser=openuds
SocketGroup=_webserver
[Install]
WantedBy=sockets.target

8
.gear/openuds.logrotate Normal file
View File

@@ -0,0 +1,8 @@
/var/log/openuds/*.log {
weekly
rotate 4
missingok
compress
minsize 100k
}

View File

@@ -0,0 +1,106 @@
#!/usr/bin/python3
# Copyright (C) 2022
# Alexander Burmatov
# 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 the Alexander Burmatov 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
# OWNER 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: Alexander Burmatov, thatman at altlinux dot org
'''
import argparse
import socket
import os
import sys
import secrets
import MySQLdb
import datetime
sys.path.append('/etc/openuds/')
from settings import DATABASES
ip_addr = socket.gethostbyname(socket.gethostname())
creation_datetime = datetime.datetime.today()
parser = argparse.ArgumentParser(description='Register tunnel token in MySQL DB')
parser.add_argument(
'-H',
'--host',
type=str,
default='',
help='Input tunnel server IP Address'
)
parser.add_argument(
'-n',
'--name',
type=str,
default='',
help='Input tunnel server name'
)
parser.add_argument(
'-t',
'--token',
type=str,
default='',
help='Input tunnel server token (default: "")'
)
parser.add_argument(
'-N',
'--generate_new_token',
type=bool,
default=False,
help='Input True if you want to generate a new token (default: False)'
)
args = parser.parse_args()
empty_name = args.name == ''
empty_ip = args.host == ''
only_token = args.token != '' and not args.generate_new_token
only_gen_new_token = args.token == '' and args.generate_new_token
if empty_ip:
print('Empty tunnel server IP Address')
elif empty_name:
print('Empty tunnel server name')
elif args.token == '' and not args.generate_new_token:
print('Choose to generate a new token or enter a token')
elif only_token != only_gen_new_token:
if only_gen_new_token:
token = secrets.token_urlsafe(36)
else:
token = args.token
db=MySQLdb.connect(host=DATABASES['default']['HOST'], user=DATABASES['default']['USER'],
passwd=DATABASES['default']['PASSWORD'], db=DATABASES['default']['NAME'])
c=db.cursor()
c.execute("""INSERT INTO uds_tunneltoken(username, ip_from, ip, hostname, token, stamp) VALUES (%s,%s,%s,%s,%s,%s);""",
(os.getlogin(), ip_addr, args.host, args.name, token, creation_datetime,))
db.commit()
c.close()
print(f'Tunnel token register success. (With token: {token})')
else:
print('Choose to generate a new token only or only enter the token')

7
.gear/rules Normal file
View File

@@ -0,0 +1,7 @@
tar: server name=@name@-@version@ base=@name@-@version@
spec: .gear/openuds-server.spec
copy?: .gear/*.logrotate
copy?: .gear/*.conf
copy?: .gear/*.service
copy?: .gear/*.socket
copy?: .gear/*.patch

View File

@@ -59,8 +59,9 @@ LANGUAGE_CODE = 'en'
ugettext = lambda s: s
LANGUAGES = (
('es', ugettext('Spanish')),
('ru', ugettext('Russian')),
('en', ugettext('English')),
('es', ugettext('Spanish')),
('fr', ugettext('French')),
('de', ugettext('German')),
('pt', ugettext('Portuguese')),
@@ -130,13 +131,13 @@ CACHES = {
'CULL_FREQUENCY': 3, # 0 = Entire cache will be erased once MAX_ENTRIES is reached, this is faster on DB. if other value, will remove 1/this number items fromm cache
},
},
# 'memory': {
# 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
# }
'memory': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
},
'memory': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
},
#'memory': {
# 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
# 'LOCATION': '127.0.0.1:11211',
#},
}
# Related to file uploading
@@ -147,7 +148,58 @@ FILE_UPLOAD_MAX_MEMORY_SIZE = 512 * 1024 # 512 Kb
# Make this unique, and don't share it with anybody.
SECRET_KEY = 's5ky!7b5f#s35!e38xv%e-+iey6yi-#630x)kk3kk5_j8rie2*'
# This is a very long string, an RSA KEY (this can be changed, but if u loose it, all encription will be lost)
RSA_KEY = '-----BEGIN RSA PRIVATE KEY-----\nMIICXgIBAAKBgQC0qe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J7bsPsVg0LQ4jDy3PFx3ok9pmC8TKSA4LEaK69tJaY657ntI+0vVE
kbZ6wD50ZnCox0M8bHLqxiwqqEQObVtCpxw+Z8Wk8Kn4iYIotHFhcYL3IB+42xj8
F7bjYQKCAQAtFXhrXltzh2AuNaSuXzKMmRz84i9Ei3m15eTopP1fnulublc6Nb8q
zliroFm6G8SdJzq0/+140oo6ECAAW5YUF26KVgxqL3wBf9ZlrkuF6EwM+yJkSIMv
sjevgG7g97GFijOIJZJ9SXPhgCiZej+0zwYODCe/2dNmjyX6IsB9bV7KVprzjQ6A
ZaGQBPK+I7T4oOgR6fMBJWAWZtxo6YI+oHzglMUMSwWHNHt4bwsvuJv8U2zSnj9T
kR673LUTwspnk/ipIDfPDVBxCLFCPSJXyLfIW8zsd4yDV68l6fQiOGcSQpJ65E3g
nRfC7Xm17LMkUJz/vmDjt3pJJ4zCbsGZAoIBABfQCRUEqniropccsF09FiXDvKF8
e5jN1HybXltnjlGlas4IJdVaGMPdJC3zZGpdnbGK8y8YsXwWlEgTQuUqBgjRdmt3
toRDTVSKc+4g2P7Vv2hG2Q2ofayXiyez1h9wwcdUyn+oeSvOTJuxL4P4Gh0psfsS
jyoGbNL4P5ONJaknVxsv/zcbHW3BrawbpBo4Pao7hWCnyJd5f33uOW/9eAfa5gXq
fsHnIw6EsZLMJmZgQcx6be4ZkMX00FR4+uxqouVbgdWIhjDxTdFXD4mPoa1XExTd
7NIOhKdva4tz0Re3b5qWwNnsHLitx+YJor1JjlZ8wwlZ7LC2d/wcxQtQIpI=
-----END RSA PRIVATE KEY-----'''
TEMPLATES = [
{

View File

@@ -40,5 +40,5 @@ from .serializable import Serializable
from .module import Module
VERSION = '3.x.x-DEVEL'
VERSION_STAMP = '{}-DEVEL'.format(time.strftime("%Y%m%d"))
VERSION = '3.5.0'
VERSION_STAMP = '{}'.format(time.strftime("%Y%m%d"))

View File

@@ -44,6 +44,7 @@ from .linux_randompass_osmanager import LinuxRandomPassManager
OSManagersFactory.factory().insert(LinuxOsManager)
OSManagersFactory.factory().insert(LinuxRandomPassManager)
"""
downloadsManager().registerDownloadable(
'udsactor_{version}_all.deb'.format(version=VERSION),
_(
@@ -103,3 +104,4 @@ downloadsManager().registerDownloadable(
+ '/files/udsactor-opensuse-legacy-2.2.1-1.noarch.rpm',
'application/x-redhat-package-manager',
)
"""

View File

@@ -48,17 +48,13 @@ osmanagers.factory().insert(WinDomainOsManager)
osmanagers.factory().insert(WinRandomPassManager)
managers.downloadsManager().registerDownloadable(
'UDSActorSetup-{version}.exe'.format(version=VERSION),
'openUDS-Managed_Installer-{version}.exe'.format(version=VERSION),
_('UDS Actor for windows machines'),
os.path.dirname(sys.modules[__package__].__file__)
+ '/files/UDSActorSetup-{version}.exe'.format(version=VERSION),
'application/x-msdos-program',
)
os.path.dirname(sys.modules[__package__].__file__) + '/files/openUDS-Managed_Installer-{version}.exe'.format(version=VERSION),
'application/x-msdos-program')
managers.downloadsManager().registerDownloadable(
'UDSActorUnmanagedSetup-{version}.exe'.format(version=VERSION),
'openUDS-Unmanaged_Installer-{version}.exe'.format(version=VERSION),
_('UDS Actor for Unmanaged windows machines. Used ONLY for static machines.'),
os.path.dirname(sys.modules[__package__].__file__)
+ '/files/UDSActorUnmanagedSetup-{version}.exe'.format(version=VERSION),
'application/x-msdos-program',
)
os.path.dirname(sys.modules[__package__].__file__) + '/files/openUDS-Unmanaged_Installer-{version}.exe'.format(version=VERSION),
'application/x-msdos-program')

View File

@@ -65,6 +65,7 @@ class RemoteViewerFile:
usb_auto_share: bool = True
new_usb_auto_share: bool = False
delete_file: bool = True
ssl_connection: bool = False
def __init__(
self,
@@ -101,6 +102,7 @@ class RemoteViewerFile:
delete_file = '01'[self.delete_file]
usb_auto_share = '01'[self.usb_auto_share]
new_usb_auto_share = '01'[self.new_usb_auto_share]
ssl_connection = '01'[self.ssl_connection]
ca = self.ca.strip().replace(
'\n', '\\n'
@@ -121,6 +123,6 @@ class RemoteViewerFile:
host_subject=self.host_subject if tls_port != '-1' else '',
ca=ca if tls_port != '-1' else '',
secure_channel='secure-channels=main;inputs;cursor;playback;record;display;usbredir;smartcard'
if tls_port != '-1'
if ssl_connection and tls_port != '-1'
else '',
)

View File

@@ -64,6 +64,7 @@ class SPICETransport(BaseSpiceTransport):
usbShare = BaseSpiceTransport.usbShare
autoNewUsbShare = BaseSpiceTransport.autoNewUsbShare
smartCardRedirect = BaseSpiceTransport.smartCardRedirect
sslConnection = BaseSpiceTransport.SSLConnection
def getUDSTransportScript(
self,
@@ -98,6 +99,7 @@ class SPICETransport(BaseSpiceTransport):
r.usb_auto_share = self.usbShare.isTrue()
r.new_usb_auto_share = self.autoNewUsbShare.isTrue()
r.smartcard = self.smartCardRedirect.isTrue()
r.ssl = self.sslConnection.isTrue()
osName = {
OsDetector.KnownOS.Windows: 'windows',

View File

@@ -113,6 +113,12 @@ class BaseSpiceTransport(transports.Transport):
defvalue=gui.FALSE,
tab=gui.ADVANCED_TAB,
)
SSLConnection = gui.CheckBoxField(
order=9,
label=_('SSL Connection'),
tooltip=_('If checked, SPICE protocol will required SSL connection.'),
defvalue=gui.FALSE,
)
def isAvailableFor(self, userService: 'models.UserService', ip: str) -> bool:
"""

View File

@@ -213,51 +213,17 @@ def udsJs(request: 'ExtendedHttpRequest') -> str:
'description': description,
'name': name,
'legacy': legacy,
}
for url, description, name, legacy in (
(
'UDSClientSetup-{version}.exe',
gettext('Windows client'),
'Windows',
False,
),
('UDSClient-{version}.pkg', gettext('Mac OS X client'), 'MacOS', False),
(
'udsclient3_{version}_all.deb',
gettext('Debian based Linux client')
+ ' '
+ gettext('(requires Python-3.6 or newer)'),
'Linux',
False,
),
(
'udsclient3-{version}-1.noarch.rpm',
gettext('RPM based Linux client (Fedora, Suse, ...)')
+ ' '
+ gettext('(requires Python-3.6 or newer)'),
'Linux',
False,
),
(
'udsclient3-x86_64-{version}.tar.gz',
gettext('Binary appimage X86_64 Linux client'),
'Linux',
False,
),
(
'udsclient3-armhf-{version}.tar.gz',
gettext('Binary appimage Raspberry Linux client'),
'Linux',
False,
),
(
'udsclient3-{version}.tar.gz',
gettext('Generic .tar.gz Linux client')
+ ' '
+ gettext('(requires Python-3.6 or newer)'),
'Linux',
False,
),
} for url, description, name, legacy in (
# ('UDSClientSetup-{version}.exe', gettext('Windows client'), 'Windows', False),
# ('UDSClient-{version}.pkg', gettext('Mac OS X client'), 'MacOS', False),
# ('udsclient3_{version}_all.deb', gettext('Debian based Linux client') + ' ' + gettext('(requires Python-3.6 or newer)'), 'Linux', False),
# ('udsclient3-{version}-1.noarch.rpm', gettext('RPM based Linux client (Fedora, Suse, ...)') + ' ' + gettext('(requires Python-3.6 or newer)'), 'Linux', False),
# ('udsclient3-{version}.tar.gz', gettext('Generic .tar.gz Linux client') + ' ' + gettext('(requires Python-3.6 or newer)'), 'Linux', False),
# ('udsclient_{version}_all.deb', gettext('Legacy Debian based Python 2.7 Linux client') + ' ' + gettext('(requires outdated Python-2.7)'), 'Linux', True),
# ('udsclient-{version}-1.noarch.rpm', gettext('Legacy RH based Linux client (Fedora, Centos, Suse, ...)') + ' ' + gettext('(requires outdated Python-2.7)'), 'Linux', True),
# ('udsclient-opensuse-{version}-1.noarch.rpm', gettext('Legacy OpenSuse based Linux client)') + ' ' + gettext('(requires outdated Python-2.7)'), 'Linux', True),
('openUDS-Client_Installer-{version}.exe', gettext('Windows python 3.9 client'), 'Windows', False),
('openUDS-Client_Installer-{version}-py27.exe', gettext('Windows python 2.7 client'), 'Windows', False),
)
]