Skip to content

Commit

Permalink
Merge branch 'main' into support/3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dsuch committed Dec 8, 2023
2 parents 0bffb70 + 93bf7da commit 328fbab
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions code/zato-web-admin/src/zato/admin/zato_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def update_globals(config, base_dir='.', needs_crypto=True):
for name in 'zato_secret_key', 'well_known_data', 'DATABASE_PASSWORD', 'SECRET_KEY', 'ADMIN_INVOKE_PASSWORD':
config[name] = config[name].encode('utf8')

is_sqlite = config['db_type'] == 'sqlite'

# If secret key is not given directly in the config file, we will expect to find it
# on command line.
zato_secret_key = config['zato_secret_key']
Expand All @@ -49,10 +51,17 @@ def update_globals(config, base_dir='.', needs_crypto=True):
if k.startswith('DATABASE_'):
default = globals()['DATABASES']['default']
k = k.replace('DATABASE_', '', 1)
if k == 'PASSWORD' and config['db_type'] != 'sqlite':
v = cm.decrypt(v)

if not is_sqlite:
if k == 'PASSWORD':
v = cm.decrypt(v)

if k == 'OPTIONS':
continue

v = str(v) if k != 'OPTIONS' else v
default[k] = v

else:
if k == 'ADMIN_INVOKE_PASSWORD' and needs_crypto:
v = cm.decrypt(v)
Expand Down

0 comments on commit 328fbab

Please sign in to comment.