Update package to read encrypted variables

master
Daniel Berteaud 6 years ago
parent 2938075df3
commit 6887868621
  1. 32
      WAPT/control
  2. BIN
      fusioninventory-agent_windows-x64_2.4.2.exe
  3. BIN
      fusioninventory-agent_windows-x86_2.4.2.exe
  4. 16
      setup.py

@ -1,30 +1,30 @@
package : fws-fusioninventory package : fws-fusioninventory
version : 2.4.2 version : 2.4.2-3
architecture : all architecture : all
section : base section : base
priority : optional priority : optional
maintainer : Kevin Guerineau maintainer : Kevin Guerineau
description : FusionInventory is a software for inventory computers. description : FusionInventory is a software for inventory computers.
depends : depends :
conflicts : conflicts :
maturity : maturity :
locale : all locale : all
target_os : windows target_os : windows
min_os_version : 5.0 min_os_version : 5.0
max_os_version : max_os_version :
min_wapt_version : 1.3.12 min_wapt_version : 1.3.12
sources : sources :
installed_size : installed_size :
impacted_process : impacted_process :
description_fr : FusionInventory est un logiciel d'inventaire d'ordinateurs description_fr : FusionInventory est un logiciel d'inventaire d'ordinateurs
description_pl : description_pl :
description_de : description_de :
description_es : description_es :
audit_schedule : audit_schedule :
editor : editor :
keywords : keywords :
licence : licence :
homepage : homepage :
package_uuid : 8151a535-59a4-4951-bb82-c3f7c98644f5 package_uuid : 8151a535-59a4-4951-bb82-c3f7c98644f5
signer : Daniel Berteaud signer : Daniel Berteaud
signer_fingerprint: 3c9415559e2dedbc4390e3faa2c28d3b67265baa5b35902d2764d9e41c3b3f0a signer_fingerprint: 3c9415559e2dedbc4390e3faa2c28d3b67265baa5b35902d2764d9e41c3b3f0a

@ -1,28 +1,27 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from setuphelpers import * from setuphelpers import *
from cryptography.fernet import Fernet
import json import json
uninstallkey = [] uninstallkey = []
key='FusionInventory-Agent'
def install(): def install():
print('Opening variable file') print('Reading variables')
variables = json.loads(open(makepath(programfiles32,'wapt','variables.json'),'r').read()) key = open(makepath(programfiles32,'wapt','private','symetric.txt'),'r').read()
f = Fernet(key)
variables = json.loads(f.decrypt(open(makepath(programfiles32,'wapt','private','variables.txt'),'r').read()))
if not 'fusinv_server' in variables: if not 'fusinv_server' in variables:
error('Missing fusinv_server variable') error('Missing fusinv_server variable')
parameters = '/S /acceptlicense /server="%s" /execmode=service /runnow' % (variables['fusinv_server']) parameters = '/S /acceptlicense /server="%s" /execmode=service /runnow' % (variables['fusinv_server'])
if 'fusinv_user' in variables and 'fusinv_pass' in variables: if 'fusinv_user' in variables and 'fusinv_pass' in variables:
parameters = parameters + ' /user="%s" /password="%s"' % (variables['fusinv_user'],variables['fusinv_pass']) parameters = parameters + ' /user="%s" /password="%s"' % (variables['fusinv_user'],variables['fusinv_pass'])
print('installing Fusion inventory agent') print('installing Fusion inventory agent')
versionpaquet = control['version'].split('-',1)[0] versionpaquet = control['version'].split('-',1)[0]
if iswin64(): if iswin64():
install_exe_if_needed("fusioninventory-agent_windows-x64_%s.exe" % versionpaquet,parameters,key=key,min_version=versionpaquet) install_exe_if_needed("fusioninventory-agent_windows-x64_%s.exe" % versionpaquet,parameters,key='FusionInventory-Agent',min_version=versionpaquet)
else: else:
install_exe_if_needed("fusioninventory-agent_windows-x86_%s.exe" % versionpaquet,parameters,key=key,min_version=versionpaquet) install_exe_if_needed("fusioninventory-agent_windows-x86_%s.exe" % versionpaquet,parameters,key='FusionInventory-Agent',min_version=versionpaquet)
def update_package(): def update_package():
@ -75,7 +74,6 @@ def update_package():
print('Download ' + url86) print('Download ' + url86)
wget(url86,filenamex86) wget(url86,filenamex86)
if __name__ == '__main__': if __name__ == '__main__':
update_package() update_package()

Loading…
Cancel
Save