Changeset View
Changeset View
Standalone View
Standalone View
swh/provenance/cli.py
Show All 20 Lines | |||||
# All generic config code should reside in swh.core.config | # All generic config code should reside in swh.core.config | ||||
CONFIG_ENVVAR = "SWH_CONFIG_FILENAME" | CONFIG_ENVVAR = "SWH_CONFIG_FILENAME" | ||||
DEFAULT_PATH = os.environ.get(CONFIG_ENVVAR, None) | DEFAULT_PATH = os.environ.get(CONFIG_ENVVAR, None) | ||||
DEFAULT_CONFIG: Dict[str, Any] = { | DEFAULT_CONFIG: Dict[str, Any] = { | ||||
"provenance": { | "provenance": { | ||||
"archive": { | "archive": { | ||||
# Storage API based Archive object | |||||
# "cls": "api", | # "cls": "api", | ||||
# "storage": { | # "storage": { | ||||
# "cls": "remote", | # "cls": "remote", | ||||
# "url": "http://uffizi.internal.softwareheritage.org:5002", | # "url": "http://uffizi.internal.softwareheritage.org:5002", | ||||
# } | # } | ||||
# Direct access Archive object | |||||
"cls": "direct", | "cls": "direct", | ||||
"db": { | "db": { | ||||
"host": "db.internal.softwareheritage.org", | "host": "db.internal.softwareheritage.org", | ||||
"dbname": "softwareheritage", | "dbname": "softwareheritage", | ||||
"user": "guest", | "user": "guest", | ||||
}, | }, | ||||
}, | }, | ||||
"storage": { | "storage": { | ||||
# Local PostgreSQL Storage | |||||
"cls": "postgresql", | "cls": "postgresql", | ||||
"db": {"host": "localhost", "dbname": "provenance"}, | "db": { | ||||
"host": "localhost", | |||||
"user": "postgres", | |||||
"password": "postgres", | |||||
"dbname": "provenance", | |||||
}, | |||||
# Local MongoDB Storage | |||||
# "cls": "mongodb", | |||||
# "db": { | |||||
# "dbname": "provenance", | |||||
# }, | |||||
# Remote REST-API/PostgreSQL | |||||
# "cls": "remote", | |||||
# "url": "http://localhost:8080/%2f", | |||||
}, | }, | ||||
} | } | ||||
} | } | ||||
CONFIG_FILE_HELP = f""" | CONFIG_FILE_HELP = f""" | ||||
\b Configuration can be loaded from a yaml file given either as --config-file | \b Configuration can be loaded from a yaml file given either as --config-file | ||||
option or the {CONFIG_ENVVAR} environment variable. If no configuration file | option or the {CONFIG_ENVVAR} environment variable. If no configuration file | ||||
▲ Show 20 Lines • Show All 174 Lines • Show Last 20 Lines |