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
|
|
@ -28,11 +28,13 @@ from twisted.words.protocols.jabber import jid
|
|||
from twisted.words.protocols.jabber import error as jabber_error
|
||||
from twisted.internet import defer
|
||||
from wokkel import disco, iwokkel, data_form
|
||||
from libervia.backend import G
|
||||
from libervia.backend.core.i18n import _
|
||||
from libervia.backend.core.xmpp import SatXMPPEntity
|
||||
from libervia.backend.core import exceptions
|
||||
from libervia.backend.core.constants import Const as C
|
||||
from libervia.backend.core.log import getLogger
|
||||
from libervia.backend.plugins.plugin_comp_file_sharing import FileSharingSettings
|
||||
from libervia.backend.tools import stream
|
||||
from libervia.backend.tools import utils
|
||||
from libervia.backend.tools.common import regex
|
||||
|
|
@ -360,9 +362,10 @@ class XEP_0329(object):
|
|||
|
||||
def profile_connected(self, client):
|
||||
if client.is_component:
|
||||
client._file_sharing_allowed_hosts = self.host.memory.config_get(
|
||||
"component file_sharing", "http_upload_allowed_hosts_list"
|
||||
) or [client.host]
|
||||
file_sharing_settings = G.config.get_settings(FileSharingSettings)
|
||||
client._file_sharing_allowed_hosts = (
|
||||
file_sharing_settings.http_upload_allowed_hosts or [client.host]
|
||||
)
|
||||
else:
|
||||
client._XEP_0329_root_node = ShareNode(
|
||||
None,
|
||||
|
|
|
|||
Loading…
Reference in a new issue