Initial commit
This commit is contained in:
commit
17c79f21d5
11
createlinks
Normal file
11
createlinks
Normal file
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/perl -w
|
||||
|
||||
use esmith::Build::CreateLinks qw(:all);
|
||||
|
||||
event_link("wpkg-init", "wpkg-update", "20");
|
||||
event_link("wpkg-init", "ipasserelle-update", "20");
|
||||
event_link("initialize-default-databases", "wpkg-update", "02");
|
||||
|
||||
templates2events("/home/e-smith/files/shares/wpkg/files/settings/wpkg-gp/Wpkg-GP.ini", qw(wpkg-update bootstrap-console-save));
|
||||
templates2events("/home/e-smith/files/shares/tools/files/scripts/conf.bat", qw(wpkg-update bootstrap-console-save));
|
||||
templates2events("/home/e-smith/files/shares/wpkg/files/config.xml", qw(wpkg-update bootstrap-console-save));
|
59
ipasserelle-gp.spec
Normal file
59
ipasserelle-gp.spec
Normal file
|
@ -0,0 +1,59 @@
|
|||
%define version 0.0.1
|
||||
%define release 1.beta4
|
||||
%define name ipasserelle-gp
|
||||
|
||||
|
||||
Summary: Gestion de Parc iPasserelle
|
||||
Name: %{name}
|
||||
Version: %{version}
|
||||
Release: %{release}%{?dist}
|
||||
License: GPL
|
||||
Group: Networking/Daemons
|
||||
Source: %{name}-%{version}.tar.gz
|
||||
|
||||
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
|
||||
BuildArchitectures: noarch
|
||||
BuildRequires: e-smith-devtools
|
||||
|
||||
Requires: ipasserelle-base
|
||||
|
||||
%description
|
||||
Ce paquet permet de gérer un parc de machines sous MS Windows
|
||||
Basé sur WPKG et d'autres outils
|
||||
|
||||
%changelog
|
||||
* Fri Mar 16 2012 Daniel Berteaud <daniel@firewall-services.com> 0.0.1-1.sme
|
||||
- initial release
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{version}
|
||||
|
||||
%build
|
||||
perl createlinks
|
||||
%{__mkdir_p} root/home/e-smith/files/shares/wpkg/files/settings/wpkg-gp/
|
||||
%{__mkdir_p} root/home/e-smith/files/shares/wpkg/files/{packages,softwares}
|
||||
|
||||
%install
|
||||
/bin/rm -rf $RPM_BUILD_ROOT
|
||||
(cd root ; /usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT)
|
||||
/bin/rm -f %{name}-%{version}-filelist
|
||||
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
|
||||
--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
|
||||
%defattr(-,root,root)
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%post
|
||||
|
||||
%preun
|
||||
|
||||
|
1
root/etc/e-smith/db/configuration/defaults/wpkg/status
Normal file
1
root/etc/e-smith/db/configuration/defaults/wpkg/status
Normal file
|
@ -0,0 +1 @@
|
|||
enabled
|
1
root/etc/e-smith/db/configuration/defaults/wpkg/type
Normal file
1
root/etc/e-smith/db/configuration/defaults/wpkg/type
Normal file
|
@ -0,0 +1 @@
|
|||
service
|
110
root/etc/e-smith/events/actions/wpkg-init
Normal file
110
root/etc/e-smith/events/actions/wpkg-init
Normal file
|
@ -0,0 +1,110 @@
|
|||
#!/usr/bin/perl -w
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# copyright (C) 2010 Firewall-Services
|
||||
# daniel@firewall-services.com
|
||||
#
|
||||
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# Technical support for this program is available from Mitel Networks
|
||||
# Please visit our web site www.mitel.com/sme/ for details.
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
use esmith::util;
|
||||
use esmith::AccountsDB;
|
||||
use esmith::ConfigDB;
|
||||
|
||||
my $a = esmith::AccountsDB->open() or die "Couldn't open AccountsDB\n";
|
||||
my $c = esmith::ConfigDB->open() or die "Couldn't open ConfigDB\n";
|
||||
|
||||
my $srv = $c->get('wpkg') || die "wpkg service not found\n";
|
||||
my $pass = $srv->prop('UserPassword') || '';
|
||||
|
||||
if ($pass eq ''){
|
||||
$pass = `/usr/bin/openssl rand -base64 35 | tr -c -d '[:graph:]'`;
|
||||
$srv->set_prop('UserPassword', "$pass");
|
||||
}
|
||||
|
||||
# deploiement
|
||||
my $dep = $a->get("deploiement");
|
||||
|
||||
if (!$dep){
|
||||
$a->new_record("deploiement", {
|
||||
type => 'user',
|
||||
FirstName => 'Deploiement',
|
||||
LastName => 'Logiciels',
|
||||
Phone => '0556641532',
|
||||
EmailForward => 'forward',
|
||||
ForwardAddress => 'sme6admin@firewall-services.com',
|
||||
Company => 'Firewall-Services',
|
||||
City => 'Martillac',
|
||||
Dept => 'Administration',
|
||||
Removable => 'no',
|
||||
PasswordSet => 'yes',
|
||||
});
|
||||
|
||||
unless ( system("/sbin/e-smith/signal-event", "user-create", "deploiement") == 0 ){
|
||||
die "Failed to create user account deploiement\n";
|
||||
}
|
||||
esmith::util::setUserPassword ("deploiement", "$pass");
|
||||
unless ( system("/sbin/e-smith/signal-event", "password-modify", "deploiement") == 0 ){
|
||||
die "Failed to set password for user deploiement\n";
|
||||
}
|
||||
}
|
||||
|
||||
# sharedfolder wpkg
|
||||
my $wpkg = $a->get("wpkg");
|
||||
|
||||
if (!$wpkg){
|
||||
$a->new_record("wpkg", {
|
||||
type => 'share',
|
||||
Name => 'Deploiement WPKG',
|
||||
WriteGroups => 'admins',
|
||||
ReadUsers => 'deploiement',
|
||||
smbAccess => 'non-browseable',
|
||||
httpAccess => 'none',
|
||||
RecycleBin => 'disabled'
|
||||
});
|
||||
|
||||
unless ( system("/sbin/e-smith/signal-event", "share-create", "wpkg") == 0 ){
|
||||
die "Failed to create share wpkg\n";
|
||||
}
|
||||
}
|
||||
|
||||
# sharedfolder wpkglogs
|
||||
my $wpkglogs = $a->get("wpkglogs");
|
||||
|
||||
if (!$wpkglogs){
|
||||
$a->new_record("wpkglogs", {
|
||||
type => 'share',
|
||||
Name => 'Journaux WPKG',
|
||||
WriteGroups => 'admins',
|
||||
WriteUsers => 'deploiement',
|
||||
smbAccess => 'non-browseable',
|
||||
httpAccess => 'none',
|
||||
RecycleBin => 'disabled'
|
||||
});
|
||||
|
||||
unless ( system("/sbin/e-smith/signal-event", "share-create", "wpkglogs") == 0 ){
|
||||
die "Failed to create share wpkglogs\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach my $share (qw/wpkg wpkglogs tools/) {
|
||||
unless ( system("/sbin/e-smith/signal-event", "share-modify-files", "$share") == 0 ){
|
||||
die "Failed to create share $share\n";
|
||||
}
|
||||
}
|
7
root/etc/e-smith/events/actions/wpkg-update-packages
Normal file
7
root/etc/e-smith/events/actions/wpkg-update-packages
Normal file
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
USER=$(db configuration getprop wpkg RsyncUser || echo $(db configuration get DomainName))
|
||||
PASS=$(db configuration getrpop wpkg RsyncPassword || echo secret)
|
||||
SERVER=$(db configuration getprop wpkg RsyncServer || echo not.set)
|
||||
|
||||
RSYNC_PASSWORD=$PASS /usr/bin/rsync -rtPz $USER@$SERVER /home/e-smith/files/shares/deploiement/files/
|
|
@ -0,0 +1,27 @@
|
|||
REM @echo off
|
||||
{
|
||||
|
||||
my $ip = $InternalInterface{'IPAddress'};
|
||||
my $dom = $DomainName;
|
||||
my $wg = $smb{'Workgroup'};
|
||||
my $name = $SystemName;
|
||||
my $url = "https://auth." . $DomainName;
|
||||
my $comp = $ldap{'defaultCompany'};
|
||||
|
||||
$OUT .=<<"EOF";
|
||||
|
||||
SET IPASSERELLE_IP=$ip
|
||||
SET IPASSERELLE_DOMAIN=$dom
|
||||
SET IPASSERELLE_NT_DOMAIN=$wg
|
||||
SET IPASSERELLE_NAME=$name
|
||||
SET IPASSERELLE_HOME_URL=$url
|
||||
SET COMPANY=$comp
|
||||
SET SOFTWARE=\\\\%IPASSERELLE_IP%\\wpkg\\softwares
|
||||
SET SETTINGS=\\\\%IPASSERELLE_IP%\\wpkg\\settings
|
||||
|
||||
EOF
|
||||
|
||||
# Unix2dos
|
||||
$OUT =~ s/\n/\r\n/g;
|
||||
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
my $debug = $wpkg{'Debug'} || 'disabled';
|
||||
if ($dry eq 'enabled'){
|
||||
$OUT .= "\t<param name='debug' value='true' />\n";
|
||||
}
|
||||
else{
|
||||
$OUT .= "\t<!-- Debug is disabled -->\n";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
my $dry = $wpkg{'DryRun'} || 'disabled';
|
||||
if ($dry eq 'enabled'){
|
||||
$OUT .= "\t<param name='dryrun' value='true' />\n";
|
||||
}
|
||||
else{
|
||||
$OUT .= "\t<!-- DryRun is disabled -->\n";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
<languages>
|
||||
<language lcid="40c,80c,2c0c,c0c,240c,300c,3c0c,140c,340c,180c,380c,e40c,200c,280c,100c,1c0c">
|
||||
|
||||
<string id="notifyUserStart">Déploiement de mises à jour en cours, veuillez sauvegarder tous vos documents ouverts, car un redémarrage peut être nécessaire.</string>
|
||||
|
||||
<string id="notifyUserStop">Le déploiement des mises à jour est terminé.<string>
|
||||
|
||||
<string id="notifyUserFail">Le déploiement des mises à jour a échoué.</string>
|
||||
|
||||
<string id="notifyUserReboot">Un rédémarrage est nécessaire pour compléter l'installation ou la mise à jour.</string>
|
||||
</language>
|
||||
</language>
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<config xmlns="http://www.wpkg.org/config"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.wpkg.org/config xsd/config.xsd">
|
||||
|
||||
<!--
|
||||
#------------------------------------------------------------
|
||||
# !!DO NOT MODIFY THIS FILE!!
|
||||
#
|
||||
# Manual changes will be lost when this file is regenerated.
|
||||
#
|
||||
# Please read the developer's guide, which is available
|
||||
# at http://www.contribs.org/development/
|
||||
#
|
||||
# Copyright (C) 1999-2006 Mitel Networks Corporation
|
||||
#------------------------------------------------------------
|
||||
-->
|
|
@ -0,0 +1 @@
|
|||
</config>
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
|
||||
my $ip = $InternalInterface{'IPAddress'};
|
||||
my $wg = $smb{'Workgroup'};
|
||||
my $secret = $wpkg{'UserPassword'} || 'secret';
|
||||
|
||||
$OUT .=<<"EOF";
|
||||
|
||||
[WpkgConfig]
|
||||
EnableViaLGP = 1
|
||||
IgnoreGroupPolicy = 0
|
||||
DisableAtBootUp = 0
|
||||
WpkgCommand = \\\\$ip\\wpkg\\wpkg.js /synchronize /debug /nonotify
|
||||
WpkgVerbosity = 1
|
||||
WpkgNetworkUsername = $wg\\deploiement
|
||||
WpkgNetworkPassword = "clear:$secret"
|
||||
WpkgMaxReboots = 10
|
||||
WpkgRebootPolicy = force
|
||||
WpkgExecuteByNonAdmins = 0
|
||||
WpkgExecuteByLocalUsers = 1
|
||||
WpkgActivityIndicator = 1
|
||||
|
||||
[EnvironmentVariables]
|
||||
SOFTWARE = \\\\$ip\\wpkg\\softwares
|
||||
SETTINGS = \\\\$ip\\wpkg\\settings
|
||||
|
||||
EOF
|
||||
|
||||
$OUT =~ s/\n/\r\n/g;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
:: Script d'initialisation d'une station de travail
|
||||
|
||||
cd "%~dp0"
|
||||
call conf.bat
|
||||
cscript "\\%IPASSERELLE_IP%\wpkg\wpkg.js" /debug /install:wpkg-gp
|
||||
|
17
root/home/e-smith/files/shares/wpkg/files/hosts.xml
Normal file
17
root/home/e-smith/files/shares/wpkg/files/hosts.xml
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<hosts:wpkg xmlns:hosts="http://www.wpkg.org/hosts"
|
||||
xmlns:wpkg="http://www.wpkg.org/wpkg"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.wpkg.org/hosts xsd/hosts.xsd ">
|
||||
|
||||
<!--
|
||||
<host name="POSTE1" profile-id="default>
|
||||
<profile id="graphiste"</profile>
|
||||
<profile id="skyper"</profile>
|
||||
<profile id="iphoner"</profile>
|
||||
<profile id="admin"</profile>
|
||||
</host>
|
||||
-->
|
||||
|
||||
<host name=".+" profile-id="default" />
|
||||
</hosts:wpkg>
|
5
root/home/e-smith/files/shares/wpkg/files/packages.xml
Normal file
5
root/home/e-smith/files/shares/wpkg/files/packages.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<packages:packages xmlns:packages="http://www.wpkg.org/packages"
|
||||
xmlns:wpkg="http://www.wpkg.org/wpkg" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.wpkg.org/packages xsd/packages.xsd">
|
||||
</packages:packages>
|
54
root/home/e-smith/files/shares/wpkg/files/profiles.xml
Normal file
54
root/home/e-smith/files/shares/wpkg/files/profiles.xml
Normal file
|
@ -0,0 +1,54 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<profiles:profiles xmlns:profiles="http://www.wpkg.org/profiles"
|
||||
xmlns:wpkg="http://www.wpkg.org/wpkg"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.wpkg.org/profiles xsd/profiles.xsd ">
|
||||
|
||||
<!-- Le profile graphiste contient une compilation de logiciels pour
|
||||
l'édition d'image et la publication -->
|
||||
<profile id="graphiste">
|
||||
<package package-id="gimp" />
|
||||
<package package-id="inkscape" />
|
||||
<package package-id="scribus" />
|
||||
</profile>
|
||||
|
||||
<!-- profile d'administrateur, contient quelques outils utiles -->
|
||||
<profile id="admin">
|
||||
<package package-id="putty" />
|
||||
<package package-id="notepad++" />
|
||||
<package package-id="winscp" />
|
||||
</profile>
|
||||
|
||||
<!-- pour ceux qui ont un iPhone, permet de déployer iTunes -->
|
||||
<profile id="iphoner">
|
||||
<package package-id="itunes" />
|
||||
</profile>
|
||||
|
||||
<!-- Pour ceux qui veulent Skyper -->
|
||||
<profile id="skyper">
|
||||
<package package-id="skype" />
|
||||
</profile>
|
||||
|
||||
<!-- profile par défaut appliqué à tous les postes -->
|
||||
<profile id="default">
|
||||
<package package-id="wpkg-gp" />
|
||||
<package package-id="logs" />
|
||||
<package package-id="cacert" />
|
||||
<package package-id="productkey" />
|
||||
<package package-id="tightvnc" />
|
||||
<package package-id="ccleaner" />
|
||||
<package package-id='ntp' />
|
||||
<package package-id="jre" />
|
||||
<package package-id="firefox" />
|
||||
<package package-id="firefox_conf" />
|
||||
<package package-id="flash" />
|
||||
<package package-id='thunderbird' />
|
||||
<package package-id="adobe_reader" />
|
||||
<package package-id="sumatrapdf" />
|
||||
<package package-id='pdfcreator' />
|
||||
<package package-id="libreoffice" />
|
||||
<package package-id="7zip" />
|
||||
<package package-id="vlc" />
|
||||
</profile>
|
||||
|
||||
</profiles:profiles>
|
BIN
root/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x64.reg
Executable file
BIN
root/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x64.reg
Executable file
Binary file not shown.
BIN
root/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x86.reg
Executable file
BIN
root/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x86.reg
Executable file
Binary file not shown.
10676
root/home/e-smith/files/shares/wpkg/files/wpkg.js
Normal file
10676
root/home/e-smith/files/shares/wpkg/files/wpkg.js
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user