Newer
Older
navi-1 / navi / config.py
@Eugene Sukhodolskiy Eugene Sukhodolskiy 19 hours ago 838 bytes navi: overlay the hive config onto the instance's own
"""Process-wide settings.

The model lives in :mod:`navi.settings_model` (no side effects — the hive
imports it to know which field names exist). This module builds the singleton:
local environment and ``.env`` first, then the hive's central overlay on top.

The overlay is fetched here, at import time, because every other module
imports ``settings`` and a configuration that arrives after them would only
ever be half-applied. The fetch is bounded (``HIVE_CONFIG_TIMEOUT_SEC``),
never fatal, and falls back to the last validated overlay cached on disk.
Without ``HIVE_URL`` — or with ``NAVI_OVERLAY=off`` — this is exactly the
old behaviour: a pure local config.
"""

from navi.overlay import bootstrap_settings
from navi.settings_model import Settings

__all__ = ["Settings", "settings"]

settings = bootstrap_settings(Settings)