diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..5135af0 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.exe filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore index f8b73e7..99049c4 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ __pycache__/ # Distribution / packaging .Python +env/ build/ develop-eggs/ dist/ @@ -21,11 +22,9 @@ parts/ sdist/ var/ wheels/ -share/python-wheels/ *.egg-info/ .installed.cfg *.egg -MANIFEST # PyInstaller # Usually these files are written by a python script from a template @@ -40,17 +39,13 @@ pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ -.nox/ .coverage .coverage.* .cache nosetests.xml coverage.xml -*.cover -*.py,cover +*,cover .hypothesis/ -.pytest_cache/ -cover/ # Translations *.mo @@ -59,8 +54,6 @@ cover/ # Django stuff: *.log local_settings.py -db.sqlite3 -db.sqlite3-journal # Flask stuff: instance/ @@ -73,68 +66,34 @@ instance/ docs/_build/ # PyBuilder -.pybuilder/ target/ # Jupyter Notebook .ipynb_checkpoints -# IPython -profile_default/ -ipython_config.py - # pyenv -# For a library or package, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# .python-version +.python-version -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow -__pypackages__/ - -# Celery stuff +# celery beat schedule file celerybeat-schedule -celerybeat.pid # SageMath parsed files *.sage.py -# Environments +# dotenv .env + +# virtualenv .venv -env/ venv/ ENV/ -env.bak/ -venv.bak/ # Spyder project settings .spyderproject -.spyproject # Rope project settings .ropeproject -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# pytype static type analyzer -.pytype/ - -# Cython debug symbols -cython_debug/ - +WAPT/certificate.crt +WAPT/manifest.sha256 +WAPT/signature.sha256 \ No newline at end of file diff --git a/NetworkAccessClient_5.2.0-142_x64.exe b/NetworkAccessClient_5.2.0-142_x64.exe new file mode 100644 index 0000000..d14477a --- /dev/null +++ b/NetworkAccessClient_5.2.0-142_x64.exe @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e0abfad95b546c5329573f73693e8eebb5a1920bda91f315d248839f323aa1fb +size 34702472 diff --git a/WAPT/control b/WAPT/control new file mode 100644 index 0000000..2579084 --- /dev/null +++ b/WAPT/control @@ -0,0 +1,43 @@ +package : fws-barracuda-nac +version : 5.2.0.142-2 +architecture : all +section : base +priority : optional +name : +categories : +maintainer : Daniel Berteaud +description : Barracuda Network Access Client +depends : +conflicts : +maturity : PROD +locale : all +target_os : windows +min_os_version : 5.1 +max_os_version : +min_wapt_version : 1.5 +sources : +installed_size : +impacted_process : nacvpn.exe, nacuserctx.exe +description_fr : Client d'acces distant Barracuda +description_pl : +description_de : +description_es : +description_pt : +description_it : +description_nl : +description_ru : +audit_schedule : +editor : Barracuda +keywords : +licence : +homepage : https://campus.barracuda.com/product/networkaccessclient/ +package_uuid : 975bb7eb-edd6-49b4-9515-d2c9c7f476a4 +valid_from : +valid_until : +forced_install_on : +changelog : +signer : Daniel Berteaud +signer_fingerprint: 3c9415559e2dedbc4390e3faa2c28d3b67265baa5b35902d2764d9e41c3b3f0a +signature : 2N/3t1oam6rCh0ihTlEYYOXSxemCD/ngnlvOeh62h1xiCrbF1LFnYev/ey+yV1qbML832DHmsz9IOsCvAciERWuLX9IvWtjVQP/f9vHY6a3mp6AvGsO/CitCVYOZl0aukGLaJROF0ATAHCcLAOdJ6omyX4Pj4ZuZhCXJu8KIxPcrQ2lFjkaUN0NP5p7qipi6rz+RihjmIlEeqZ4liBLEn6/cyIMuWFpOzpeA1M+INOfCiXZb8vOQa/pN8mA3+R7I7Fv6Sj2JtBf5XvNprtRUGtx7q/duzwRJgx3Ps42d5IKNKscr1YGjY3aHmE50BKlhV/jkk6LpWrLzytfwOcoBBQ== +signature_date : 2021-05-27T17:46:16.599000 +signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_os_version,max_os_version,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,changelog,signer,signer_fingerprint,signature_date,signed_attributes \ No newline at end of file diff --git a/WAPT/icon.png b/WAPT/icon.png new file mode 100644 index 0000000..3723923 Binary files /dev/null and b/WAPT/icon.png differ diff --git a/WAPT/wapt.psproj b/WAPT/wapt.psproj new file mode 100644 index 0000000..29acc4b --- /dev/null +++ b/WAPT/wapt.psproj @@ -0,0 +1,295 @@ +[PyScripter] +Version=3.3.2.0 + +[Project] +ClassName=TProjectRootNode +StoreRelativePaths=TRUE +ShowFileExtensions=FALSE + +[Project\ChildNodes\Node0] +ClassName=TProjectFilesNode + +[Project\ChildNodes\Node0\ChildNodes\Node0] +ClassName=TProjectFolderNode +Name=wapt + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node0] +ClassName=TProjectFileNode +FileName=C:\Program Files (x86)\wapt\common.py + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1] +ClassName=TProjectFileNode +FileName=C:\Program Files (x86)\wapt\setuphelpers.py + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node2] +ClassName=TProjectFileNode +FileName=C:\Program Files (x86)\wapt\wapt-get.ini + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3] +ClassName=TProjectFileNode +FileName=C:\Program Files (x86)\wapt\wapt-get.py + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node4] +ClassName=TProjectFileNode +FileName=C:\Program Files (x86)\wapt\waptpackage.py + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes] +Count=5 + +[Project\ChildNodes\Node0\ChildNodes\Node1] +ClassName=TProjectFileNode +FileName=$[Project-Path]changelog.txt + +[Project\ChildNodes\Node0\ChildNodes\Node2] +ClassName=TProjectFileNode +FileName=$[Project-Path]control + +[Project\ChildNodes\Node0\ChildNodes\Node3] +ClassName=TProjectFileNode +FileName=$[Project-Path]..\setup.py + +[Project\ChildNodes\Node0\ChildNodes] +Count=4 + +[Project\ChildNodes\Node1] +ClassName=TProjectRunConfiguationsNode + +[Project\ChildNodes\Node1\ChildNodes\Node0] +ClassName=TProjectRunConfiguationNode +Name=install + +[Project\ChildNodes\Node1\ChildNodes\Node0\RunConfig] +ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=install "$[Project-Path].." +WorkingDir=$[Project-Path].. +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node0\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node1] +ClassName=TProjectRunConfiguationNode +Name=remove + +[Project\ChildNodes\Node1\ChildNodes\Node1\RunConfig] +ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=remove "$[Project-Path].." +WorkingDir=$[Project-Path].. +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node1\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node2] +ClassName=TProjectRunConfiguationNode +Name=session-setup + +[Project\ChildNodes\Node1\ChildNodes\Node2\RunConfig] +ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=session-setup "$[Project-Path].." +WorkingDir=$[Project-Path].. +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node2\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node3] +ClassName=TProjectRunConfiguationNode +Name=update + +[Project\ChildNodes\Node1\ChildNodes\Node3\RunConfig] +ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=update +WorkingDir=$[Project-Path].. +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node3\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node4] +ClassName=TProjectRunConfiguationNode +Name=upgrade + +[Project\ChildNodes\Node1\ChildNodes\Node4\RunConfig] +ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=-f upgrade +WorkingDir=$[ActiveScript-Dir] +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node4\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node5] +ClassName=TProjectRunConfiguationNode +Name=-i build-upload + +[Project\ChildNodes\Node1\ChildNodes\Node5\RunConfig] +ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=-i build-upload "$[Project-Path].." +WorkingDir=$[Project-Path].. +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node5\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node6] +ClassName=TProjectRunConfiguationNode +Name=svn update + +[Project\ChildNodes\Node1\ChildNodes\Node6\RunConfig] +ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=sources "$[Project-Path].." +WorkingDir=$[Project-Path].. +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node6\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node7] +ClassName=TProjectRunConfiguationNode +Name=uninstall + +[Project\ChildNodes\Node1\ChildNodes\Node7\RunConfig] +ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=uninstall "$[Project-Path].." +WorkingDir=$[Project-Path].. +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node7\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[Project-Path].. +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node8] +ClassName=TProjectRunConfiguationNode +Name=update-package-sources + +[Project\ChildNodes\Node1\ChildNodes\Node8\RunConfig] +ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=update-package-sources "$[Project-Path].." +WorkingDir=$[Project-Path].. +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node8\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes\Node9] +ClassName=TProjectRunConfiguationNode +Name=audit + +[Project\ChildNodes\Node1\ChildNodes\Node9\RunConfig] +ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +EngineType=peRemote +ReinitializeBeforeRun=TRUE +Parameters=audit "$[Project-Path].." +WorkingDir=$[Project-Path].. +WriteOutputToFile=FALSE +OutputFileName=$[ActiveScript-NoExt].log +AppendToFile=FALSE + +[Project\ChildNodes\Node1\ChildNodes\Node9\RunConfig\ExternalRun] +Caption=External Run +Description=Run script using an external Python Interpreter +ApplicationName=$[PythonExe-Short] +Parameters=$[ActiveScript-Short] +WorkingDirectory=$[ActiveScript-Dir] +ShortCut=0 +MessagesFormat=$[FileName] $[LineNumber] + +[Project\ChildNodes\Node1\ChildNodes] +Count=10 + +[Project\ChildNodes] +Count=2 + +[Project\ExtraPythonPath] +Count=0 + diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..55145af --- /dev/null +++ b/setup.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- +# ----------------------------------------------------------------------- +# This file is part of WAPT +# Copyright (C) 2013 Tranquil IT Systems http://www.tranquil.it +# WAPT aims to help Windows systems administrators to deploy +# setup and update applications on users PC. +# +# WAPT 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 3 of the License, or +# (at your option) any later version. +# +# WAPT 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 WAPT. If not, see . +# +# ----------------------------------------------------------------------- +from setuphelpers import * + +uninstallkey = [] + +variables = { + #'barracuda_nac_conf': XXXX +} + +# Read local variables file if available +if isfile(makepath(programfiles32,'wapt','private','symetric.txt')) and isfile(makepath(programfiles32,'wapt','private','variables.txt')): + print('Reading local encrypted variables file') + from cryptography.fernet import Fernet + import yaml + f = Fernet(open(makepath(programfiles32,'wapt','private','symetric.txt'),'r').read()) + variables.update(yaml.safe_load(f.decrypt(open(makepath(programfiles32,'wapt','private','variables.txt'),'r').read()))) + +def install(): + import re + print('Installing Barracuda Network Access Client') + + match = re.search('(\d+\.\d+\.\d+)\.(\d+)$',control['version'].split('-',1)[0]) + major_version = match.group(1) + minor_version = match.group(2) + + install_exe_if_needed( + 'NetworkAccessClient_%s-%s_x64.exe' % (major_version, minor_version), + silentflags=r'/clone_wait /s /v"/qr PROGTYPE=VPN REBOOT=Suppress"', + key='{51A8F280-06EC-490C-8AE6-D702F5689507}', + min_version=major_version, + killbefore=['nacvpn.exe','nacuserctx.exe'] + ) + + if 'barracuda_nac_conf' in variables: + print('Configuring Barracuda Network Access Client') + open('barracuda.reg','w').write( + variables['barracuda_nac_conf'] + ) + run('reg import barracuda.reg') + +if __name__ == '__main__': + update_package() +