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
mongodbbut that breaks the documentation automation.Available options:
mongodb,api,mysql.
-
DATASOURCE_PROTOCOL : str =
'mysql'¶ This actually defaults to
mongodbbut that breaks the documentation automation.Used to build the URL; e.g.,
mongodb,httpsorhttp`.
-
DATASOURCE_DBAPI : str =
'pymysql'¶ This actually defaults to
Nonebut that breaks the documentation automation.DBAPI extension for the protocol. E.g.
srvinmongodb+srv://orpymysqlinmysql+pymysql://.
-
DATASOURCE_PARAMETERS : None =
None¶ Optional URI query string parameters appended to the constructed data source connection URI.
This value must be provided in
key=value&key=valueformat (without a leading?).It is used to pass additional connection options to the underlying database driver. See the database-specific documentation for supported parameters.
-
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).
-
DATASOURCE_PARAMETERS : None =
None¶ Connection String Options (optional URI query string parameters) for the MongoDB data source.
Common options include
authSource(authentication database),replicaSet, andretryWrites.Example:
authSource=cvedb&retryWrites=trueSee https://www.mongodb.com/docs/manual/reference/connection-string-options/
-
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://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