diff --git a/createlinks b/createlinks index e5d3ffc..7b334cf 100644 --- a/createlinks +++ b/createlinks @@ -12,4 +12,5 @@ templates2events("/home/e-smith/files/shares/tools/files/scripts/conf.bat", qw(w templates2events("/home/e-smith/files/shares/wpkg/files/config.xml", qw(wpkg-update bootstrap-console-save)); templates2events("/home/e-smith/files/shares/wpkg/files/settings/fusioninventory/fusioninventory_x86.reg", qw(wpkg-update bootstrap-console-save)); templates2events("/home/e-smith/files/shares/wpkg/files/settings/fusioninventory/fusioninventory_x64.reg", qw(wpkg-update bootstrap-console-save)); - +templates2events("/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x86.reg", qw(wpkg-update bootstrap-console-save)); +templates2events("/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x64.reg", qw(wpkg-update bootstrap-console-save)); diff --git a/ipasserelle-gp.spec b/ipasserelle-gp.spec index c8b924c..06a10ee 100644 --- a/ipasserelle-gp.spec +++ b/ipasserelle-gp.spec @@ -1,5 +1,5 @@ %define version 0.0.1 -%define release 1.beta14 +%define release 1.beta16 %define name ipasserelle-gp @@ -32,7 +32,7 @@ Basé sur WPKG et d'autres outils %build perl createlinks -%{__mkdir_p} root/home/e-smith/files/shares/wpkg/files/settings/{fusioninventory,wpkg-gp} +%{__mkdir_p} root/home/e-smith/files/shares/wpkg/files/settings/{fusioninventory,wpkg-gp,tightvnc} %{__mkdir_p} root/home/e-smith/files/shares/wpkg/files/{packages,softwares} %install @@ -43,8 +43,6 @@ perl createlinks --file /home/e-smith/files/shares/wpkg/files/profiles.xml 'attr(0770,root,admin) %config(noreplace)' \ --file /home/e-smith/files/shares/wpkg/files/hosts.xml 'attr(0770,root,admin) %config(noreplace)' \ --file /home/e-smith/files/shares/wpkg/files/packages.xml 'attr(0770,root,admin) %config(noreplace)' \ - --file /home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x86.reg 'attr(0660,root,admin) %config(noreplace)' \ - --file /home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x64.reg 'attr(0660,root,admin) %config(noreplace)' \ > %{name}-%{version}-filelist %files -f %{name}-%{version}-filelist diff --git a/root/etc/e-smith/db/configuration/migrate/WpkgVNCPassword b/root/etc/e-smith/db/configuration/migrate/WpkgVNCPassword new file mode 100644 index 0000000..41eb7d0 --- /dev/null +++ b/root/etc/e-smith/db/configuration/migrate/WpkgVNCPassword @@ -0,0 +1,10 @@ +{ +my $rec = $DB->get('wpkg') || $DB->new_record('wpkg', { type => 'service' }); +my $pw = $rec->prop('VNCPassword'); + +if (not $pw){ + $pw = `/usr/bin/openssl rand -base64 6`; + chomp($pw); + $rec->set_prop('VNCPassword', $pw); +} +} diff --git a/root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x64.reg/10All b/root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x64.reg/10All new file mode 100644 index 0000000..b019a6d --- /dev/null +++ b/root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x64.reg/10All @@ -0,0 +1,53 @@ +Windows Registry Editor Version 5.00 + +{ + +use Crypt::DES; +my $clear = $wpkg{'VNCPassword'} || 'secret'; +my $key = pack ('H16', "E84AD660C4721AE0"); +my $des = Crypt::DES->new($key); +my $crypt = $des->encrypt($clear); +my $pass = join(',', map {unpack('H2', $_)} split //, $cryptpass); + +my $out =<<"EOF"; + +[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\TightVNC\\Server] +"ExtraPorts"="" +"QueryTimeout"=dword:0000001e +"QueryAcceptOnTimeout"=dword:00000000 +"LocalInputPriorityTimeout"=dword:00000003 +"LocalInputPriority"=dword:00000000 +"BlockRemoteInput"=dword:00000000 +"BlockLocalInput"=dword:00000000 +"IpAccessControl"="" +"RfbPort"=dword:0000170c +"HttpPort"=dword:000016a8 +"DisconnectAction"=dword:00000000 +"AcceptRfbConnections"=dword:00000001 +"UseVncAuthentication"=dword:00000001 +"UseControlAuthentication"=dword:00000001 +"LoopbackOnly"=dword:00000000 +"AcceptHttpConnections"=dword:00000000 +"LogLevel"=dword:00000000 +"EnableFileTransfers"=dword:00000001 +"BlankScreen"=dword:00000000 +"RemoveWallpaper"=dword:00000001 +"EnableUrlParams"=dword:00000001 +"Password"=hex:$pass +"AlwaysShared"=dword:00000000 +"NeverShared"=dword:00000000 +"DisconnectClients"=dword:00000001 +"PollingInterval"=dword:000003e8 +"AllowLoopback"=dword:00000000 +"VideoRecognitionInterval"=dword:00000bb8 +"GrabTransparentWindows"=dword:00000001 +"SaveLogToAllUsersPath"=dword:00000000 +"RunControlInterface"=dword:00000001 +"VideoClasses"="" +"ControlPassword"=hex:$pass + +EOF + +$out =~ s/\n/\r\n/g; +$OUT = $out; +} diff --git a/root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x64.reg/template-begin b/root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x64.reg/template-begin new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x86.reg/10All b/root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x86.reg/10All new file mode 100644 index 0000000..f600259 --- /dev/null +++ b/root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x86.reg/10All @@ -0,0 +1,53 @@ +Windows Registry Editor Version 5.00 + +{ + +use Crypt::DES; +my $clear = $wpkg{'VNCPassword'} || 'secret'; +my $key = pack ('H16', "E84AD660C4721AE0"); +my $des = Crypt::DES->new($key); +my $crypt = $des->encrypt($clear); +my $pass = join(',', map {unpack('H2', $_)} split //, $cryptpass); + +my $out =<<"EOF"; + +[HKEY_LOCAL_MACHINE\\SOFTWARE\\TightVNC\\Server] +"ExtraPorts"="" +"QueryTimeout"=dword:0000001e +"QueryAcceptOnTimeout"=dword:00000000 +"LocalInputPriorityTimeout"=dword:00000003 +"LocalInputPriority"=dword:00000000 +"BlockRemoteInput"=dword:00000000 +"BlockLocalInput"=dword:00000000 +"IpAccessControl"="" +"RfbPort"=dword:0000170c +"HttpPort"=dword:000016a8 +"DisconnectAction"=dword:00000000 +"AcceptRfbConnections"=dword:00000001 +"UseVncAuthentication"=dword:00000001 +"UseControlAuthentication"=dword:00000001 +"LoopbackOnly"=dword:00000000 +"AcceptHttpConnections"=dword:00000000 +"LogLevel"=dword:00000000 +"EnableFileTransfers"=dword:00000001 +"BlankScreen"=dword:00000000 +"RemoveWallpaper"=dword:00000001 +"EnableUrlParams"=dword:00000001 +"Password"=hex:$pass +"AlwaysShared"=dword:00000000 +"NeverShared"=dword:00000000 +"DisconnectClients"=dword:00000001 +"PollingInterval"=dword:000003e8 +"AllowLoopback"=dword:00000000 +"VideoRecognitionInterval"=dword:00000bb8 +"GrabTransparentWindows"=dword:00000001 +"SaveLogToAllUsersPath"=dword:00000000 +"RunControlInterface"=dword:00000001 +"VideoClasses"="" +"ControlPassword"=hex:$pass + +EOF + +$out =~ s/\n/\r\n/g; +$OUT = $out; +} diff --git a/root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x86.reg/template-begin b/root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x86.reg/template-begin new file mode 100644 index 0000000..e69de29 diff --git a/root/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x64.reg b/root/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x64.reg deleted file mode 100644 index cb65fea..0000000 Binary files a/root/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x64.reg and /dev/null differ diff --git a/root/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x86.reg b/root/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x86.reg deleted file mode 100644 index 412d0c1..0000000 Binary files a/root/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x86.reg and /dev/null differ