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 swh.core import config | from swh.core import config | ||||
from swh.storage import get_storage | |||||
from swh.indexer.storage import get_indexer_storage | from swh.indexer.storage import get_indexer_storage | ||||
from swh.vault import get_vault | |||||
from swh.scheduler import get_scheduler | from swh.scheduler import get_scheduler | ||||
from swh.storage import get_storage | |||||
from swh.vault import get_vault | |||||
from swh.web import settings | |||||
SETTINGS_DIR = os.path.dirname(settings.__file__) | |||||
DEFAULT_CONFIG = { | DEFAULT_CONFIG = { | ||||
'allowed_hosts': ('list', []), | 'allowed_hosts': ('list', []), | ||||
'storage': ('dict', { | 'storage': ('dict', { | ||||
'cls': 'remote', | 'cls': 'remote', | ||||
'args': { | 'args': { | ||||
'url': 'http://127.0.0.1:5002/', | 'url': 'http://127.0.0.1:5002/', | ||||
'timeout': 10, | 'timeout': 10, | ||||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | 'scheduler': ('dict', { | ||||
'url': 'http://127.0.0.1:5008/' | 'url': 'http://127.0.0.1:5008/' | ||||
} | } | ||||
}), | }), | ||||
'grecaptcha': ('dict', { | 'grecaptcha': ('dict', { | ||||
'activated': True, | 'activated': True, | ||||
'validation_url': 'https://www.google.com/recaptcha/api/siteverify', | 'validation_url': 'https://www.google.com/recaptcha/api/siteverify', | ||||
'site_key': '', | 'site_key': '', | ||||
'private_key': '' | 'private_key': '' | ||||
}), | }), | ||||
douardda: if you want to use the swh/web/settings directory by default, why not retrieve its path from… | |||||
'development_db': ('string', os.path.join(SETTINGS_DIR, 'db.sqlite3')), | |||||
'production_db': ('string', '/var/lib/swh/web.sqlite3'), | 'production_db': ('string', '/var/lib/swh/web.sqlite3'), | ||||
'deposit': ('dict', { | 'deposit': ('dict', { | ||||
'private_api_url': 'https://deposit.softwareheritage.org/1/private/', | 'private_api_url': 'https://deposit.softwareheritage.org/1/private/', | ||||
'private_api_user': 'swhworker', | 'private_api_user': 'swhworker', | ||||
'private_api_password': '' | 'private_api_password': '' | ||||
}), | }), | ||||
'coverage_count_origins': ('bool', False) | 'coverage_count_origins': ('bool', False) | ||||
} | } | ||||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |
if you want to use the swh/web/settings directory by default, why not retrieve its path from swh.web.settings.__file__?