]> repo.cephalix.eu Git - UltraVNC.git/commitdiff
Initial version
authorbuildmaster <buildmaster@git.cephalix.eu>
Mon, 1 Oct 2018 09:04:15 +0000 (11:04 +0200)
committerbuildmaster <buildmaster@git.cephalix.eu>
Mon, 1 Oct 2018 09:04:15 +0000 (11:04 +0200)
Makefile
oss-pkg-UltraVNC.spec.in [new file with mode: 0644]
packages.spec [deleted file]
server/get_screen_shots.sh [new file with mode: 0755]
server/oss_get_screen_shots.service [new file with mode: 0755]
server/oss_get_screen_shots.sh [new file with mode: 0755]
server/ultravncpw.pl [new file with mode: 0755]
server/vncsnapshot [new file with mode: 0755]

index 50c588a500f799e5cd29f25a870b9e8b40244dbe..89c4a1ee142eda5f1f5e148c28c6a6bb38ed9640 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -20,6 +20,7 @@ package:
        tar hjcvpf oss-pkg-$(PACKAGE).tar.bz2 oss-pkg-$(PACKAGE)  
        rm -rf oss-pkg-$(PACKAGE)
        mv  oss-pkg-$(PACKAGE).tar.bz2  /usr/src/packages/SOURCES/
+       cp  server/* /usr/src/packages/SOURCES/
        rpmbuild -bb oss-pkg-$(PACKAGE).spec
        mv /usr/src/packages/RPMS/noarch/oss-pkg-$(PACKAGE)-$(VERSION)-$(NRELEASE).noarch.rpm $(REPO)/noarch
        echo $(NRELEASE) > RELEASE
diff --git a/oss-pkg-UltraVNC.spec.in b/oss-pkg-UltraVNC.spec.in
new file mode 100644 (file)
index 0000000..d71cbf8
--- /dev/null
@@ -0,0 +1,95 @@
+#
+# Spec file for PACKAGE
+# Copyright (c) YEAR Helmuth Varkoly and Peter Varkoly Nuremberg, Germany.  All rights reserved.
+#
+
+Name:         oss-pkg-PACKAGE
+Summary:      Package to install PACKAGE on OSS-Clients
+Version:      VERSION
+Release:      RELEASE
+License:      GPL-2.0
+Vendor:       Peter Varkoly and Helmuth Varkoly
+Packager:     peter@varkoly.de
+Group:        Productivity/
+Source:       %{name}.tar.bz2
+Source1:      vncsnapshot
+Source2:      ultravncpw.pl
+Source3:      get_screen_shots.sh
+Source4:      oss_get_screen_shots.sh
+Source5:      oss_get_screen_shots.service
+BuildArch:    noarch
+BuildRequires:unzip
+#Requires:     
+Requires:     filesystem
+PreReq:       salt-master
+PreReq:       %fillup_prereq
+BuildRoot:    %{_tmppath}/%{name}-%{version}-build
+
+%description
+Package to install PACKAGE on OSS-Clients
+
+Authors:
+--------
+        helmuth@varkoly.de
+        peter@varkoly.de
+
+
+%prep
+%setup -n %{name}
+
+%build
+
+%install
+
+mkdir -p %{buildroot}/srv/salt/win/repo-ng/PACKAGE
+mkdir -p %{buildroot}/srv/salt/packages/
+cp PACKAGE.sls  %{buildroot}/srv/salt/packages/
+cp -a repo-ng/* %{buildroot}/srv/salt/win/repo-ng/PACKAGE
+
+#Server stuff
+mkdir -p %{buildroot}/usr/share/oss/vnc/
+install -m 750 %{SOURCE1} %{buildroot}/usr/share/oss/vnc/
+install -m 750 %{SOURCE2} %{buildroot}/usr/share/oss/vnc/
+install -m 750 %{SOURCE3} %{buildroot}/usr/share/oss/vnc/
+
+mkdir -p %{buildroot}/usr/sbin
+install -m 750 %{SOURCE4} %{buildroot}/usr/sbin/
+
+mkdir -p %{buildroot}/usr/lib/systemd/system/
+install -m 750 %{SOURCE5} %{buildroot}/usr/lib/systemd/system/
+
+%clean
+rm -rf %{buildroot}
+
+%pre
+%service_add_pre oss_get_screen_shots.service
+
+%preun
+%service_del_preun oss_get_screen_shots.service
+
+%post
+%service_add_post oss_get_screen_shots.service
+if [ !-e /var/adm/oss/vncpwd/VNCPW1 ]
+then
+       VNCPW1=$( mktemp -q XXXXXXXX )
+       VNCPW2=$( mktemp -q XXXXXXXX )
+       mkdir -m 750 /var/adm/oss/vncpwd/
+       echo $VNCPW1 | vncpasswd -f > /var/adm/oss/vncpwd/VNCPW1
+       echo $VNCPW2 | vncpasswd -f > /var/adm/oss/vncpwd/VNCPW2
+       UVNCPW1=$( /usr/share/oss/vnc/ultravncpw.pl --password $VNCPW1 )
+       UVNCPW2=$( /usr/share/oss/vnc/ultravncpw.pl --password $VNCPW2 )
+       echo -ne "[ultravnc]\r\n"           >  /srv/salt/win/repo-ng/PACKAGE/ultravnc.ini
+       echo -ne "passwd=${UVNCPW1}00\r\n"  >> /srv/salt/win/repo-ng/PACKAGE/ultravnc.ini
+       echo -ne "passwd2=${UVNCPW2}00\r\n" >> /srv/salt/win/repo-ng/PACKAGE/ultravnc.ini
+fi
+/usr/sbin/oss_api.sh POST 'softwares/add' '{"name":"PACKAGE","manually":false,"description":"PACKAGE","softwareVersions":[{"version":"VERSION"}]}'
+
+%postun
+%service_del_postun oss_get_screen_shots.service
+
+%files
+%defattr(644,root,root)
+/srv/salt/win/repo-ng/PACKAGE
+/srv/salt/packages/PACKAGE.sls
+
+
diff --git a/packages.spec b/packages.spec
deleted file mode 100644 (file)
index 079b12d..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#
-# Spec file for PACKAGE
-# Copyright (c) YEAR Helmuth Varkoly and Peter Varkoly Nuremberg, Germany.  All rights reserved.
-#
-
-Name:         oss-pkg-PACKAGE
-Summary:      Package to install PACKAGE on OSS-Clients
-Version:      VERSION
-Release:      RELEASE
-License:      GPL-2.0
-Vendor:       Peter Varkoly and Helmuth Varkoly
-Packager:     peter@varkoly.de
-Group:        Productivity/
-Source:       %{name}.tar.bz2
-BuildArch:    noarch
-BuildRequires:unzip
-#Requires:     
-Requires:     filesystem
-PreReq:       salt-master
-PreReq:       %fillup_prereq
-BuildRoot:    %{_tmppath}/%{name}-%{version}-build
-
-%description
-Package to install PACKAGE on OSS-Clients
-
-Authors:
---------
-        helmuth@varkoly.de
-        peter@varkoly.de
-
-
-%prep
-%setup -n %{name}
-
-%build
-
-%install
-
-mkdir -p %{buildroot}/srv/salt/win/repo-ng/PACKAGE
-mkdir -p %{buildroot}/srv/salt/packages/
-cp PACKAGE.sls  %{buildroot}/srv/salt/packages/
-cp -a repo-ng/* %{buildroot}/srv/salt/win/repo-ng/PACKAGE
-
-%clean
-rm -rf %{buildroot}
-
-%pre
-
-%post
-
-/usr/sbin/oss_api.sh POST 'softwares/add' '{"name":"PACKAGE","manually":false,"description":"PACKAGE","softwareVersions":[{"version":"VERSION"}]}'
-
-%files
-%defattr(644,root,root)
-/srv/salt/win/repo-ng/PACKAGE
-/srv/salt/packages/PACKAGE.sls
-
-
diff --git a/server/get_screen_shots.sh b/server/get_screen_shots.sh
new file mode 100755 (executable)
index 0000000..9a82b44
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/bash
+CLIENT=$1
+PIDF="/run/getScreenShots/${CLIENT}"
+if [ -e "$PIDF" ]; then
+    kill -9 $( cat $PIDF )
+fi
+echo $$ > /run/getScreenShots/${CLIENT}
+IP=$( host ${CLIENT} | gawk '{ print $4 }')
+/usr/share/oss/vnc/vncsnapshot -passwd /var/adm/oss/vncpwd/VNCPW1 ${IP} /srv/www/admin/screenShots/${CLIENT}.png &> /dev/null
+rm -f $PIDF
+
diff --git a/server/oss_get_screen_shots.service b/server/oss_get_screen_shots.service
new file mode 100755 (executable)
index 0000000..6762f54
--- /dev/null
@@ -0,0 +1,13 @@
+[Unit]
+Description=Gets screen shots from salt client where user is logged in.
+Wants=basic.target
+After=basic.target network.target syslog.target salt-master.service
+
+[Service]
+Restart=on-failure
+ExecStartPre=/usr/bin/mkdir -p /srv/www/admin/screenShots
+ExecStart=/usr/sbin/oss_get_screen_shots.sh
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/server/oss_get_screen_shots.sh b/server/oss_get_screen_shots.sh
new file mode 100755 (executable)
index 0000000..4132634
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+. /etc/sysconfig/schoolserver
+mkdir -p /srv/www/admin/screenShots/
+mkdir -p /run/getScreenShots/
+while /bin/true
+do
+        if [ -d /var/adm/oss/running/ ]; then
+                for i in $( ls /var/adm/oss/running/ )
+                do
+                        /usr/share/oss/tools/vnc/get_screen_shot.sh ${i/.$SCHOOL_DOMAIN/} &
+                done
+        fi
+        sleep 4
+done
+
diff --git a/server/ultravncpw.pl b/server/ultravncpw.pl
new file mode 100755 (executable)
index 0000000..2db6201
--- /dev/null
@@ -0,0 +1,66 @@
+#!/usr/bin/perl -w
+
+use strict;
+use warnings;
+use Getopt::Long;
+
+Getopt::Long::Configure('gnu_getopt');
+use Pod::Usage;
+
+use Crypt::DES;
+
+my ($password, $help, $man);
+
+GetOptions('help|?' => \$help, 'man' => \$man, 'password=s' => \$password) or pod2usage(2);
+pod2usage(1) if $help;
+pod2usage(-exitstatus => 0, -verbose =>2) if $man;
+
+pod2usage (1) if !$password;
+
+my $realkey = pack ('H16', "E84AD660C4721AE0");
+
+my $cipher = Crypt::DES->new($realkey);
+
+# pad then truncate the password to 8 chars
+$password = $password . "\x00\x00\x00\x00\x00\x00\x00\x00\x00";
+$password = substr ($password, 0, 8) if length $password > 8;
+
+my $cryptpass = $cipher->encrypt($password);
+
+# Foreach byte, unpack it, join the result list and print it in
+# uppercase
+print uc join ('', map {unpack('H2', $_)} split (//, $cryptpass));
+
+__END__
+
+=head1 vncpass.pl
+
+Generate a VNC password suitable for ultravnc.ini.
+
+=head1 SYNOPSIS
+
+vncpass.pl [options]
+
+Options:
+   --help      this help
+   --password   password to encrypt
+
+=head1 OPTIONS
+
+=over 8
+
+=item B<--help>
+
+Print the online help
+
+=item B<--password>
+
+The password to encrypt.
+
+=back
+
+=head1 DESCRIPTION
+
+B<vncpass.pl> generate a password suitable for ultravnc.ini.
+
+=cut
diff --git a/server/vncsnapshot b/server/vncsnapshot
new file mode 100755 (executable)
index 0000000..a6c586d
Binary files /dev/null and b/server/vncsnapshot differ