variable to personalise password length

This commit is contained in:
Emmanuel Garette 2021-05-11 18:28:57 +02:00
parent 1063d2e735
commit 3085bf67d6
1 changed files with 6 additions and 0 deletions

View File

@ -115,6 +115,11 @@ if 'PASSWORD_URL' in environ:
PASSWORD_URL = environ['PASSWORD_URL'] PASSWORD_URL = environ['PASSWORD_URL']
else: else:
PASSWORD_URL = config.get('PASSWORD_URL', 'https://localhost:8001/') PASSWORD_URL = config.get('PASSWORD_URL', 'https://localhost:8001/')
if 'PASSWORD_LENGTH' in environ:
PASSWORD_LENGTH = environ['PASSWORD_LENGTH']
else:
PASSWORD_LENGTH = config.get('PASSWORD_LENGTH', 20)
if 'PKI_ADMIN_PASSWORD' in environ: if 'PKI_ADMIN_PASSWORD' in environ:
PKI_ADMIN_PASSWORD = environ['PKI_ADMIN_PASSWORD'] PKI_ADMIN_PASSWORD = environ['PKI_ADMIN_PASSWORD']
else: else:
@ -155,6 +160,7 @@ _config = {'database': {'dsn': dsn_factory(RISOTTO_DB_NAME, RISOTTO_DB_USER, RIS
'admin_password': PASSWORD_ADMIN_PASSWORD, 'admin_password': PASSWORD_ADMIN_PASSWORD,
'device_identifier': PASSWORD_DEVICE_IDENTIFIER, 'device_identifier': PASSWORD_DEVICE_IDENTIFIER,
'service_url': PASSWORD_URL, 'service_url': PASSWORD_URL,
'length': PASSWORD_LENGTH,
}, },
'pki': {'admin_password': PKI_ADMIN_PASSWORD, 'pki': {'admin_password': PKI_ADMIN_PASSWORD,
'owner': PKI_ADMIN_EMAIL, 'owner': PKI_ADMIN_EMAIL,