Settings¶
CveXplore by default looks for an .env file in ${HOME}/.cvexplore
folder. If certain values need to be
overwritten you can do it either there or pass them directly as environment variables.
The following config variables are the configuration settings for the database.
Common¶
-
DATASOURCE_TYPE : str =
'mysql'
¶ This actually defaults to
mongodb
but that breaks the documentation automation.Available options:
mongodb
,api
,mysql
.
-
DATASOURCE_PROTOCOL : str =
'mysql'
¶ This actually defaults to
mongodb
but that breaks the documentation automation.Used to build the URL; e.g.,
mongodb
,https
orhttp`
.
-
DATASOURCE_DBAPI : str =
'pymysql'
¶ This actually defaults to
None
but that breaks the documentation automation.DBAPI extension for the protocol. E.g.
srv
inmongodb+srv://
orpymysql
inmysql+pymysql://
.
-
DATASOURCE_CONNECTION_DETAILS : None =
None
¶ Not configurable via environment variables.
By default automatically built from the settings that are appropriate for the selected
DATASOURCE_TYPE
, but documented here as this can be overwritten in the code using CveXplore as a library, which would cause many of these settings not to be honored.
-
API_CONNECTION_DETAILS : None =
None
¶ Not configurable via environment variables.
Deprecated (replaced by
DATASOURCE_CONNECTION_DETAILS
). Will be removed in the 0.4 release.
MongoDB¶
-
MONGODB_HOST : str =
'127.0.0.1'
¶ MongoDB hostname (without the protocal that should be defined with
DATASOURCE_PROTOCOL
&DATASOURCE_DBAPI
).
-
MONGODB_CONNECTION_DETAILS : None =
None
¶ Not configurable via environment variables.
Deprecated (replaced by
DATASOURCE_CONNECTION_DETAILS
). Will be removed in the 0.4 release.
SQL¶
-
SQLALCHEMY_DATABASE_URI : str =
'mysql+pymysql://None:None@127.0.0.1:27017/cvedb'
¶ Built from other environment variables, but can be manually overwritten.
Defaults to
{DATASOURCE_PROTOCOL}[+{DATASOURCE_DBAPI}]://{DATASOURCE_USER}:{DATASOURCE_PASSWORD}@{DATASOURCE_HOST}:{DATASOURCE_PORT}/{DATASOURCE_DBNAME}
.
-
SQLALCHEMY_TRACK_MODIFICATIONS : bool =
False
¶ See https://docs.sqlalchemy.org/en/20/orm/session_events.html