Normally the backend is made to have a singleton instance, and handle all profiles.
However, it may be useful to run instances independently (e.g., for development, to run
components in independent processes, for testing, etc).
This was previously possible by using a specific configuration files at backend's root.
This patch introduce a cleaner way by using an isolation mode.
Isolation mode is activated by settings the `LIBERVIA_ISOLATION` environment variable to
the name of the isolated instance. `LIBERVIA_ISOLATION_MODE` can be used to specify one of
the following mode:
- normal (default): config and shared files are in XDG in a `isolated/<name>` subdirectory
(usually `~/.local/share/libervia/isolated/<name>` and
`~/.config/libervia/isolated/<name>`). Runtime files and other instance specific data
(such as D-Bus name) are also isolated. Config uses cascade as usual.
- full: same as above, but config isn't cascading, it's using only its own isolated config
file.
- tmp: same as normal but the local directory is put in a temporary directory, and deleted
on backend startup. It stays on termination, so data can be checked if necessary (this mode is
usually used for development).
This feature will notably be useful to test severless mode on a single machine.
rel 479
Fix embedded bridge and adapt to changes in core code:
- Add `EmbeddedBridgeSettings` so it can be used in settings.
- Add `AIOBridge` and `TwistedBridge` wrappers.
- Fix callbacks, instead of logging them (and breaking the errback chain), they are now
raised using `BridgeException` like in other bridges.
- Ensure that a singleton `Bridge` is used between backend and frontend.
- Init backend on first call to `bridge_connect`.
- Add Python 3.14 fix (as it is normally done in Launcher which is not run with with
`embedded`, we have to do it there).
- Track generated files.
- correct the case of `dynamicSettingsRegister` and `dynamicSettings` which are `dict`, not
classes.
- Use new `DynamicSettingsCollection` as base class for classes dynamically built during
parsing, to avoid name conflict.
- Use `DynamicSettingsCollection` instead of `dict` in dynamic field (`plugin` and
`component`). This correct inconsistency, and make linters happy.
- Catch `TOMLDecodeError` when parsing config, to show a more readable error message
instead of full backtrace.
New `jid`, `secret` and `autoconnect` field are used for component settings. When used,
backend will automatically create the profile and set its relevant parameters, or check
that existing profile is in sync (and update it if necessary).
This make component installation easier to Libervia, as it is not
necessary anymore to use the CLI frontend to install a component.
rel 476
Libervia Media is now a Python package instead of files to put in a directory to specify
in settings. The discovery is now automatic, removing the need for settings and enabling
easier installation. Furthermore, it should now work even if the package is zipped.
`libervia_media` can now be specified as a dependency for frontends requiring it.
Singular form is chosen as it makes more sense when configuring settings in TOML:
```TOML
[plugin.some_plugin_name]
option=value
[component.some_component]
option=value
```
- Add the `txtorcon` optional dependency, used with `tor` extra.
- Add settings for Tor.
- Use Tor endpoint when an `.onion` XMPP domain is used, of when Tor is explicitely
enabled in conf.
- Disable WebRTC, for now it's the safer option as WebRTC can leak IP. It should be
possible to use it over Tor by forcing the use of a .onion relay, but this is to be
explored later (A/V should be to slow to be usable, but that stay relevant for file
transfer or other WebRTC powered things).
- A new `treq` instance using Tor WebAgent is used when Tor is enabled. Properties has
been added to SatXMPPEntity to conveniently get the right instance.
- Another `tor_mode` property has been added with corresponding bridge methods, to see if
Tor is activated and in which mode for a given profile. For now there are only two modes
(disabled, and enabled with WebRTC disabled), but in the future it may be possible to
activate WebRTC over Tor, or to use Tor only to connect to XMPP server, while using
clearnet for other connections.
- Tor dedicated models have been added, and bridge methods have been added to build and
get them.
- Fix tests.
rel 473
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.