The D-Bus bridge was the oldest one and using the legacy `dbus-python` implementation. In
addition to be dependent on GLib, this implementation has numerous issues and it's even
recommanded on its own documentation to use alternative.
On the other hand, txdbus is Twisted native D-Bus implementation and can be used natively
with asyncio reactor.
Regenerated bridges.
The reactor is now set in the launcher, as it is the first script to be
loaded. This should avoid race conditions when some Twisted or libervia
packages are imported and end up importing `twisted.internet.reactor`,
which installs the default reactor before the AsyncIO one. The AsyncIO
reactor is still set in `twisted.plugin.libervia_backend_plugin` (but it
no longer fails if already set), in case the backend is started as a
plugin (although this is not recommended anyway)
The loop was chosen according to the bridge used, but this is not possible anymore before
running it, because there is now an "auto" bridge which falls back from D-Bus to PB. To
work around that, the loop has been refactored to be started before knowing which bridge
is used, then the bridge-dependent hooks are installed later.
- D-Bus bridge check if it can import GLib, to raise early a BridgeInitError if it's not
possible
- PB bridge now do lazy import of `reactor` to avoid race condition in Twisted loop
initialisation.
- regenerated bridges.
`uv` is now used as the main project management tool. `hatchling` is
currently kept as the build system due to the use of its dynamic
versioning feature and to make the transition easier.
Most fields used are standardised and should work with all modern
packaging tools.
Add `uv.lock` to the repository, as versioning this file is recommended.
Repository has been converted to Git using fast-export
(https://github.com/frej/fast-export).
The following command has been used:
```sh
$ ../fast-export/hg-fast-export.sh -r ../hg-libervia-backend --hg-hash -M main
```
That means that previous HG hashes are annotated in the `hg` namespace.
`.hgignore` has been converted to `.gitignore`, and `_trial_temp/` has been removed as we
nowadays use `pytest` instead of `trial`.
While Mercurial is a great tool, more and more tools are only compatible with Git (e.g.,
ripgrep), and in particular `uv`, which becomes the new packaging de-facto standard in
Python. Also, many developers are more at ease with Git (even if Mercurial is actually
simpler to use).
Add commands to retrieve (`contacts get`) and set (`contacts set`) pubsub contacts. As
they are managed with pubsub node, deletion can be done using `pubsub delete`.
rel 475
This patch implements Pubsub Contacts (currently named "End-to-End Encrypted Contacts
Metadata" but it will be most probably renamed soon as following council discussion, e2e
encryption won't be mandatory anymore).
It adds 2 bridge method `ps_contacts_get` and `ps_contact_set`, and handles retrieving
large contacts or groups lists using RSM.
rel 475
The items events need to be decrypted too for plugin to handle correctly items updated or
retracted. When an event is decrypted, and `encrypted` attribute is added to the decrypted
<item> elements.
rel 475
`add_managed_node` now match node when they are exactly the same by default, but if the
new `strict_match` argument is set to `False`, the old behaviour of matching all node
which start with the given `node` argument is used.
rel 475
2 new methods `get_plugin_data` and `set_plugin_data` let plugin register data for a given
profile session (i.e. client instance). This is the clean way to handle plugin data
(instead of the former way of adding custom attribute to `client` instance), and it uses
generics so type hints are working correctly with linters.
Plugin for pubsub encryption and signing were named using prototype name as the
specifications where not yet published at the time. Since, those specifications have been
accepted, so we can rename those plugins using the corresponding XEP numbers.
Doc has been updated to remove old mention saying that the XEP was still being evaluated.
rel 475
- split the plugin in several classes, with models, exceptions, and backends separated.
- add a backend for `python-gnupg`, as it can be pip installed without having to use
`--system-site-packages` in the virtual environment.
- use modern syntax for type hints.
rel 475
This plugin implements the base for the forge feature in Libervia.
The "forge" plugin introduces configuration to set repositories to expose with the forge
(per profile), and the default repository to show.
In the future, this may be done dynamically from frontends, so users can create/import
repositories themselves.
The "forge_git" plugin implements methods to handle Git repositories. In the future, other
types of repositories may be managed (e.g.; Mercurial), but for now the focus is on Git.
The backend was not properly exiting in case of early exception (e.g. configuration
error). It seems to be related to the use of the `@aio` decorator, but couldn't find the
exact issue with loop. The use of `os._exit` is a workaround for now, until the fix is
inspected more deeply and properly fixed.
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.
- Restore plugin_misc_static_blog and rename it to plugin_misc_render_blog_params as it is
still in use in web frontend.
- Only the `Background` param is actually used, all other params have been removed.
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 `autodoc_pydantic` dependency for `docs`, it renders nicely Pydantic models,
including the settings.
- Add documentation for `li info tor`
- Add a dedicated section on Tor
fix 473
`tor` sub-command shows info on currently running Tor daemon (if any), and on the circuit
used to connect to XMPP server with current profile (if relevant).
rel 473
As Pydantic becomes more and more used in Libervia, it is now important to have a
dedicated output in the CLI.
This patch also fixes `json` and `json_raw` outputs which were incorrectly calling
`console.print_json`.
rel 473
- 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.