parent
96fc39b7b0
commit
e38b0a38bb
6 changed files with 384 additions and 0 deletions
@ -0,0 +1,32 @@ |
|||||||
|
package : fws-openvpn |
||||||
|
version : 2.4.6-6 |
||||||
|
architecture : all |
||||||
|
section : base |
||||||
|
priority : optional |
||||||
|
maintainer : Daniel Berteaud <daniel@firewall-services.com> |
||||||
|
description : OpenVPN client |
||||||
|
depends : |
||||||
|
conflicts : |
||||||
|
maturity : DEV |
||||||
|
locale : all |
||||||
|
target_os : windows |
||||||
|
min_os_version : 6.0 |
||||||
|
max_os_version : |
||||||
|
min_wapt_version : 1.5 |
||||||
|
sources : |
||||||
|
installed_size : |
||||||
|
impacted_process : |
||||||
|
description_fr : Client OpenVPN |
||||||
|
description_pl : |
||||||
|
description_de : |
||||||
|
description_es : |
||||||
|
audit_schedule : 2d |
||||||
|
editor : OpenVPN |
||||||
|
keywords : vpn |
||||||
|
licence : GNU GPL |
||||||
|
homepage : https://openvpn.net |
||||||
|
package_uuid : |
||||||
|
signer : Daniel Berteaud |
||||||
|
signer_fingerprint: |
||||||
|
signature_date : |
||||||
|
signed_attributes : |
After Width: | Height: | Size: 7.3 KiB |
Binary file not shown.
Binary file not shown.
@ -0,0 +1,57 @@ |
|||||||
|
# -*- coding: utf-8 -*- |
||||||
|
from setuphelpers import * |
||||||
|
|
||||||
|
uninstallkey = [] |
||||||
|
variables = {} |
||||||
|
|
||||||
|
# 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(): |
||||||
|
version = control['version'].split('-',1)[0] |
||||||
|
|
||||||
|
print('Register OpenVPN as a trusted publisher') |
||||||
|
run(r'certutil.exe -addstore trustedpublisher openvpn.p7b') |
||||||
|
|
||||||
|
print('Installing OpenVPN client') |
||||||
|
install_exe_if_needed('openvpn-install-%s-I602.exe' % version,'/S',key='OpenVPN',min_version='%s-I602' % version,killbefore=['openvpn','openvpn-gui']) |
||||||
|
uninstallkey.append('TAP-Windows') |
||||||
|
|
||||||
|
if 'openvpn_config' in variables: |
||||||
|
print('Deploying client configuration') |
||||||
|
open(makepath(programfiles,'OpenVPN','config','vpn.ovpn'),'w').write(variables['openvpn_config']) |
||||||
|
|
||||||
|
def update_package(): |
||||||
|
import re, os |
||||||
|
from waptpackage import PackageEntry |
||||||
|
print('Updating OpenVPN package') |
||||||
|
page = wgets('https://openvpn.net/community-downloads/') |
||||||
|
latest_version = re.search('OpenVPN (\d+(\.\d+)*) .* released on', page).group(1) |
||||||
|
pe = PackageEntry() |
||||||
|
control = pe.load_control_from_wapt(os.getcwd()) |
||||||
|
current_version = control['version'].split('-',1)[0] |
||||||
|
if Version(latest_version) > Version(current_version): |
||||||
|
print('Updating Package from %s to %s' % (current_version, latest_version)) |
||||||
|
if not isfile('openvpn-install-%s-I602.exe' % latest_version): |
||||||
|
url = 'https://swupdate.openvpn.org/community/releases/openvpn-install-%s-I602.exe' % latest_version |
||||||
|
print('downloading %s' % url) |
||||||
|
wget(url, os.getcwd()) |
||||||
|
for file in glob.glob('*.exe'): |
||||||
|
if file != 'openvpn-install-%s-I602.exe' % latest_version: |
||||||
|
print('Removing %s' % file) |
||||||
|
remove_file(file) |
||||||
|
pe.version = latest_version + '-0' |
||||||
|
pe.save_control_to_wapt(os.getcwd()) |
||||||
|
print('Package updated to %s' % latest_version) |
||||||
|
else: |
||||||
|
print('No update available') |
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__': |
||||||
|
update_package() |
||||||
|
|
Loading…
Reference in new issue