Changeset View
Changeset View
Standalone View
Standalone View
swh/web/config.py
Show All 35 Lines | ORIGIN_VISIT_TYPES = [ | ||||||||||||||||
"tar", | "tar", | ||||||||||||||||
] | ] | ||||||||||||||||
SETTINGS_DIR = os.path.dirname(settings.__file__) | SETTINGS_DIR = os.path.dirname(settings.__file__) | ||||||||||||||||
DEFAULT_CONFIG = { | DEFAULT_CONFIG = { | ||||||||||||||||
"allowed_hosts": ("list", []), | "allowed_hosts": ("list", []), | ||||||||||||||||
"search": ( | |||||||||||||||||
"dict", | |||||||||||||||||
{"cls": "remote", "url": "http://127.0.0.1:5010/", "timeout": 10,}, | |||||||||||||||||
), | |||||||||||||||||
"storage": ( | "storage": ( | ||||||||||||||||
"dict", | "dict", | ||||||||||||||||
{"cls": "remote", "url": "http://127.0.0.1:5002/", "timeout": 10,}, | {"cls": "remote", "url": "http://127.0.0.1:5002/", "timeout": 10,}, | ||||||||||||||||
), | ), | ||||||||||||||||
"indexer_storage": ( | "indexer_storage": ( | ||||||||||||||||
"dict", | "dict", | ||||||||||||||||
{"cls": "remote", "url": "http://127.0.0.1:5007/", "timeout": 1,}, | {"cls": "remote", "url": "http://127.0.0.1:5007/", "timeout": 1,}, | ||||||||||||||||
), | ), | ||||||||||||||||
"counters": ( | "counters": ( | ||||||||||||||||
"dict", | "dict", | ||||||||||||||||
{"cls": "remote", "url": "http://127.0.0.1:5011/", "timeout": 1,}, | {"cls": "remote", "url": "http://127.0.0.1:5011/", "timeout": 1,}, | ||||||||||||||||
), | ), | ||||||||||||||||
"search": ( | |||||||||||||||||
"dict", | |||||||||||||||||
{"cls": "remote", "url": "http://127.0.0.1:5010/", "timeout": 10,}, | |||||||||||||||||
), | |||||||||||||||||
"search_config": ( | |||||||||||||||||
"dict", | |||||||||||||||||
{"backend": "swh-indexer-storage", "enable_ql": False}, # or "swh-search" | |||||||||||||||||
vlorentzUnsubmitted Not Done Inline Actions
vlorentz: | |||||||||||||||||
), | |||||||||||||||||
"log_dir": ("string", "/tmp/swh/log"), | "log_dir": ("string", "/tmp/swh/log"), | ||||||||||||||||
"debug": ("bool", False), | "debug": ("bool", False), | ||||||||||||||||
"serve_assets": ("bool", False), | "serve_assets": ("bool", False), | ||||||||||||||||
"host": ("string", "127.0.0.1"), | "host": ("string", "127.0.0.1"), | ||||||||||||||||
"port": ("int", 5004), | "port": ("int", 5004), | ||||||||||||||||
"secret_key": ("string", "development key"), | "secret_key": ("string", "development key"), | ||||||||||||||||
# do not display code highlighting for content > 1MB | # do not display code highlighting for content > 1MB | ||||||||||||||||
"content_display_max_size": ("int", 5 * 1024 * 1024), | "content_display_max_size": ("int", 5 * 1024 * 1024), | ||||||||||||||||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | "graph": ( | ||||||||||||||||
{"server_url": "http://graph.internal.softwareheritage.org:5009/graph/"}, | {"server_url": "http://graph.internal.softwareheritage.org:5009/graph/"}, | ||||||||||||||||
), | ), | ||||||||||||||||
"status": ( | "status": ( | ||||||||||||||||
"dict", | "dict", | ||||||||||||||||
{ | { | ||||||||||||||||
"server_url": "https://status.softwareheritage.org/", | "server_url": "https://status.softwareheritage.org/", | ||||||||||||||||
"json_path": "1.0/status/578e5eddcdc0cc7951000520", | "json_path": "1.0/status/578e5eddcdc0cc7951000520", | ||||||||||||||||
}, | }, | ||||||||||||||||
), | ), | ||||||||||||||||
"metadata_search_backend": ("string", "swh-indexer-storage"), # or "swh-search" | |||||||||||||||||
"counters_backend": ("string", "swh-storage"), # or "swh-counters" | "counters_backend": ("string", "swh-storage"), # or "swh-counters" | ||||||||||||||||
Not Done Inline Actionsand since we're already changing this, rename metadata_search_backend to search, for consistency with the other keys (plus, we're not just using it for origin metadata anymore) vlorentz: and since we're already changing this, rename `metadata_search_backend` to `search`, for… | |||||||||||||||||
"staging_server_names": ("list", STAGING_SERVER_NAMES), | "staging_server_names": ("list", STAGING_SERVER_NAMES), | ||||||||||||||||
Not Done Inline Actionsthe comment should be on backend vlorentz: the comment should be on `backend` | |||||||||||||||||
"instance_name": ("str", "archive-test.softwareheritage.org"), | "instance_name": ("str", "archive-test.softwareheritage.org"), | ||||||||||||||||
Not Done Inline Actionsgroup it with metadata_search_backend. And make it default to False, this is what we'll want while testing the feature. (and it will make CI go green, at least until you add tests) vlorentz: group it with `metadata_search_backend`.
And make it default to False, this is what we'll want… | |||||||||||||||||
} | } | ||||||||||||||||
swhweb_config: Dict[str, Any] = {} | swhweb_config: Dict[str, Any] = {} | ||||||||||||||||
def get_config(config_file="web/web"): | def get_config(config_file="web/web"): | ||||||||||||||||
"""Read the configuration file `config_file`. | """Read the configuration file `config_file`. | ||||||||||||||||
▲ Show 20 Lines • Show All 72 Lines • Show Last 20 Lines |