Commit 4f1c8c44 authored by sim's avatar sim

[SECURITY FIX] Potential database password leak while in DEBUG mode

parent 4380a775
...@@ -14,7 +14,8 @@ from gargantext import models ...@@ -14,7 +14,8 @@ from gargantext import models
# this is the Alembic Config object, which provides # this is the Alembic Config object, which provides
# access to the values within the .ini file in use. # access to the values within the .ini file in use.
config = context.config config = context.config
config.set_main_option("sqlalchemy.url", settings.DATABASES['default']['URL']) config.set_main_option("sqlalchemy.url",
settings.DATABASES['default']['SECRET_URL'])
# Interpret the config file for Python logging. # Interpret the config file for Python logging.
# This line sets up loggers basically. # This line sets up loggers basically.
......
...@@ -131,7 +131,7 @@ DATABASES = { ...@@ -131,7 +131,7 @@ DATABASES = {
}, },
} }
} }
DATABASES['default']['URL'] = \ DATABASES['default']['SECRET_URL'] = \
'postgresql+psycopg2://{USER}:{PASSWORD}@{HOST}:{PORT}/{NAME}'.format( 'postgresql+psycopg2://{USER}:{PASSWORD}@{HOST}:{PORT}/{NAME}'.format(
**DATABASES['default'] **DATABASES['default']
) )
......
...@@ -10,7 +10,7 @@ from sqlalchemy import delete ...@@ -10,7 +10,7 @@ from sqlalchemy import delete
def get_engine(): def get_engine():
from sqlalchemy import create_engine from sqlalchemy import create_engine
return create_engine( settings.DATABASES['default']['URL'] return create_engine( settings.DATABASES['default']['SECRET_URL']
, use_native_hstore = True , use_native_hstore = True
, json_serializer = json_dumps , json_serializer = json_dumps
, pool_size=20, max_overflow=0 , pool_size=20, max_overflow=0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment