Changeset View
Changeset View
Standalone View
Standalone View
swh/web/config.py
# Copyright (C) 2017-2019 The Software Heritage developers | # Copyright (C) 2017-2019 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU Affero General Public License version 3, or any later version | # License: GNU Affero General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
import os | import os | ||||
from typing import Any, Dict | |||||
from swh.core import config | from swh.core import config | ||||
from swh.indexer.storage import get_indexer_storage | from swh.indexer.storage import get_indexer_storage | ||||
from swh.scheduler import get_scheduler | from swh.scheduler import get_scheduler | ||||
from swh.storage import get_storage | from swh.storage import get_storage | ||||
from swh.vault import get_vault | from swh.vault import get_vault | ||||
from swh.web import settings | from swh.web import settings | ||||
SETTINGS_DIR = os.path.dirname(settings.__file__) | SETTINGS_DIR = os.path.dirname(settings.__file__) | ||||
▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | 'deposit': ('dict', { | ||||
'private_api_password': '' | 'private_api_password': '' | ||||
}), | }), | ||||
'coverage_count_origins': ('bool', False), | 'coverage_count_origins': ('bool', False), | ||||
'e2e_tests_mode': ('bool', False), | 'e2e_tests_mode': ('bool', False), | ||||
'es_workers_index_url': ('string', ''), | 'es_workers_index_url': ('string', ''), | ||||
'history_counters_url': ('string', 'https://stats.export.softwareheritage.org/history_counters.json'), # noqa | 'history_counters_url': ('string', 'https://stats.export.softwareheritage.org/history_counters.json'), # noqa | ||||
} | } | ||||
swhweb_config = {} | swhweb_config = {} # type: 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`. | ||||
If an environment variable SWH_CONFIG_FILENAME is defined, this | If an environment variable SWH_CONFIG_FILENAME is defined, this | ||||
takes precedence over the config_file parameter. | takes precedence over the config_file parameter. | ||||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |