Bugfix: security key location
This commit is contained in:
parent
deab85289b
commit
fc099dbbf7
@ -2,17 +2,17 @@ from os import environ, path
|
||||
from cryptography.fernet import Fernet
|
||||
|
||||
def generate_keyfile():
|
||||
with open('.security/.encryption.key', 'wb') as keyfile:
|
||||
with open('./.security/.encryption.key', 'wb') as keyfile:
|
||||
key = Fernet.generate_key()
|
||||
keyfile.write(key)
|
||||
|
||||
def load_key():
|
||||
with open('.security/.encryption.key', 'rb') as keyfile:
|
||||
with open('./.security/.encryption.key', 'rb') as keyfile:
|
||||
key = keyfile.read()
|
||||
return key
|
||||
|
||||
def check_keyfile_exists():
|
||||
return path.isfile('.security/.encryption.key')
|
||||
return path.isfile('./.security/.encryption.key')
|
||||
|
||||
def encrypt(input):
|
||||
if not check_keyfile_exists():
|
||||
|
Loading…
Reference in New Issue
Block a user