Switch to yaml encrypted variables

master
Daniel Berteaud 6 years ago
parent 809709a3e2
commit 011bdc2eb0
  1. 2
      WAPT/control
  2. 6
      setup.py

@ -1,5 +1,5 @@
package : fws-thunderbird-sogo-addons package : fws-thunderbird-sogo-addons
version : 60.0.0-3 version : 60.0.0-6
architecture : all architecture : all
section : base section : base
priority : optional priority : optional

@ -1,7 +1,5 @@
# -*- coding: UTF-8 -*- # -*- coding: UTF-8 -*-
from setuphelpers import * from setuphelpers import *
import json
from cryptography.fernet import Fernet
import os import os
from jinja2 import Environment, FileSystemLoader from jinja2 import Environment, FileSystemLoader
@ -14,8 +12,10 @@ variables = {
# Read local variables file if available # Read local variables file if available
if isfile(makepath(programfiles32,'wapt','private','symetric.txt')) and isfile(makepath(programfiles32,'wapt','private','variables.txt')): if isfile(makepath(programfiles32,'wapt','private','symetric.txt')) and isfile(makepath(programfiles32,'wapt','private','variables.txt')):
print('Reading local encrypted variables file') print('Reading local encrypted variables file')
from cryptography.fernet import Fernet
import yaml
f = Fernet(open(makepath(programfiles32,'wapt','private','symetric.txt'),'r').read()) f = Fernet(open(makepath(programfiles32,'wapt','private','symetric.txt'),'r').read())
variables.update(json.loads(f.decrypt(open(makepath(programfiles32,'wapt','private','variables.txt'),'r').read()))) variables.update(yaml.safe_load(f.decrypt(open(makepath(programfiles32,'wapt','private','variables.txt'),'r').read())))
def install(): def install():
connector_version = control['version'].split('-',1)[0] connector_version = control['version'].split('-',1)[0]

Loading…
Cancel
Save