@@ -37,6 +37,16 @@ def get_sys_exec_root_or_drive():
3737if not all ([algolia_app_id , algolia_api_key ]):
3838 print ("Application requires 'ALGOLIA_APP_ID' and 'ALGOLIA_API_KEY' for search" )
3939
40+
41+ secret_key = os .environ .get ('SECRET_KEY' )
42+
43+ security_password_hash = 'pbkdf2_sha512'
44+ # Replace this with your own salt.
45+ security_password_salt = os .environ .get ('SECURITY_PASSWORD_SALT' )
46+ if not all ([secret_key , security_password_salt ]):
47+ raise KeyError ("Keys'SECRET_KEY' and 'SECURITY_PASSWORD_SALT' missing" )
48+
49+
4050index_name = os .environ .get ("INDEX_NAME" )
4151
4252
@@ -45,12 +55,9 @@ class Config:
4555
4656 SQLALCHEMY_DATABASE_URI = f"postgresql://{ pg_user } :{ pg_pw } @{ pg_host } :5432/{ pg_db } "
4757
48- SECRET_KEY = os .urandom (24 )
49- # Set config values for Flask-Security.
50- # We're using PBKDF2 with salt.
51- SECURITY_PASSWORD_HASH = 'pbkdf2_sha512'
52- # Replace this with your own salt.
53- SECURITY_PASSWORD_SALT = os .urandom (140 )
58+ SECRET_KEY = secret_key
59+ SECURITY_PASSWORD_HASH = security_password_hash
60+ SECURITY_PASSWORD_SALT = security_password_salt
5461
5562 ALGOLIA_APP_ID = algolia_app_id
5663 ALGOLIA_API_KEY = algolia_api_key
0 commit comments