core: Replace legacy INI config system with Pydantic-based TOML configuration.
This is a huge configuration refactoring. The configuration system now uses Pydantic settings, with better validation, better support for environment variables and other goodies. The main config files now use TOML instead of INI, this allow for better handling of complex types, notably dict. Plugins, components and frontends can declare their config settings in a class which will be imported dynamically.
This commit is contained in:
parent
f3f40848b3
commit
6a7b7bc36a
1 changed files with 1392 additions and 1011 deletions
|
|
@ -30,6 +30,7 @@ from twisted.internet import defer
|
|||
from twisted.python.procutils import which
|
||||
from yaml.constructor import ConstructorError
|
||||
|
||||
from libervia.backend import G
|
||||
from libervia.backend.core import exceptions
|
||||
from libervia.backend.core.constants import Const as C
|
||||
from libervia.backend.core.i18n import _
|
||||
|
|
@ -177,7 +178,7 @@ class AppManager:
|
|||
"is expected"
|
||||
)
|
||||
|
||||
value = self.host.memory.config_get(section, name, default)
|
||||
value = getattr(getattr(G.config, section), name) or default
|
||||
# FIXME: "public_url" is used only here and doesn't take multi-sites into account
|
||||
if name == "public_url" and (not value or value.startswith("http")):
|
||||
if not value:
|
||||
|
|
|
|||
Loading…
Reference in a new issue