Adapt for Python3

This commit is contained in:
Daniel Berteaud 2023-03-28 14:57:25 +02:00
parent 09d22c49aa
commit 960a09c828
3 changed files with 30 additions and 15 deletions

3
.gitignore vendored
View File

@ -94,3 +94,6 @@ ENV/
# Rope project settings
.ropeproject
WAPT/certificate.crt
WAPT/manifest.sha256
WAPT/signature.sha256

View File

@ -1,17 +1,17 @@
package : fws-backuppc-agent
version : 1.3.4-26
package : eht-backuppc-agent
version : 1.3.4-29
architecture : all
section : base
priority : optional
maintainer : Daniel Berteaud
name :
categories :
maintainer : Daniel Berteaud <dbd@ehtrace.com>
description : BackupPC Agent
depends : fws-openssh
depends : eht-openssh
conflicts :
maturity : PROD
locale : all
target_os : windows
min_os_version : 5.0
max_os_version :
min_wapt_version : 1.3.12
sources :
installed_size :
@ -20,13 +20,25 @@ description_fr : Agent de sauvegarde BackupPC
description_pl :
description_de :
description_es :
description_pt :
description_it :
description_nl :
description_ru :
audit_schedule : 2d
editor :
keywords :
licence : GPLv2+
homepage : http://www.michaelstowe.com/backuppc/
package_uuid :
signer : Daniel Berteaud
signer_fingerprint:
signature_date :
signed_attributes :
package_uuid : 722dc1af-f673-4965-bfa7-9e899ddc838e
valid_from :
valid_until :
forced_install_on :
changelog :
min_os_version : 5.0
max_os_version :
icon_sha256sum : 29de7586307e356ff29abdb83e7476580a480f67caebad67863ca48e9fac36d3
signer : dbd
signer_fingerprint: e9156ec73f1ea6b50f33e0d9f580e8ae56db147100894bb5d2d4648a46f07ed1
signature : JuoXNKR5ajmeqe0zIOF8BgAChwjkhuDV+nbIBgCs1clCXoShjL7FSQD82SgjLpvEwBVZU6XDYohqsz3HSri8iLM0ySdwhEaCeWdmDGwCfYf7PtEM8iJP8+pDP6PwHCFd62TQ/qTKf340Z6tOVD8wCjBtGyllKAVKCTQ7iDboD89ZUgdZMgi//fI87mUW8TRHzImqOZJU+/xk+JfQnAxUAYsdrSArHbInAawhCFXOuJGMQlS4OxdNhZWKNsmbAx8m//S4086q8MOT7HT/VSteJMnUo6ascOTU0hfZK5cs56KGQTCcnizp/X+AoM70mECsemBPYADGBNp+TMwx71aRTw==
signature_date : 2023-03-27T17:47:38.229815
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,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,min_os_version,max_os_version,icon_sha256sum,signer,signer_fingerprint,signature_date,signed_attributes

View File

@ -16,12 +16,12 @@ if isfile(makepath(programfiles32,'wapt','private','symetric.txt')) and isfile(m
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())))
f = Fernet(bytes(open(makepath(programfiles32,'wapt','private','symetric.txt'),'r').read(), 'utf-8'))
variables.update(yaml.safe_load(f.decrypt(bytes(open(makepath(programfiles32,'wapt','private','variables.txt'),'r').read(), 'utf-8'))))
# Create a random pass for the local backup account if not defined
if not 'backup_pass' in variables:
variables['backup_pass'] = ''.join(random.sample(string.lowercase+string.uppercase+string.digits,60))
variables['backup_pass'] = ''.join(random.sample(string.ascii_lowercase+string.ascii_uppercase+string.digits,60))
overrides = ['rsyncd.conf', 'rsync.cmd', 'pre-exec.cmd', 'vsrsync.cmd', 'cygiconv-2.dll', 'cygwin1.dll', 'cygz.dll', 'rsync.exe']
install_dir = makepath(os.getenv('SYSTEMDRIVE','C:\\'),'BackupPC')
@ -70,7 +70,7 @@ def install():
ssh_keys = variables['backup_ssh_keys']
)
)
# We need to create lbkp profile dir and put it's .ssh.authorized_keys file.
# We need to create lbkp profile dir and put it's .ssh/authorized_keys file.
# We can't use runas, we can't use psexec either as waptservice runs as SYSTEM. So we create a one-time task running as user lbkp
# This task just creates .ssh and populate .ssh/authorized_keys
print('Deploying ssh keys through a scheduled task')