Commit graph

4,525 commits

Author SHA1 Message Date
Goffi
68da01a043 Dates update. 2026-03-31 12:57:17 +02:00
Goffi
346c640f75 cli (config): add default verbosity config (verbosity) 2026-03-31 12:49:39 +02:00
Goffi
c4954ab508 cli: Set default verbosity for missing import messages:
Missing import messages now only display when verbosity is >= 2, this is to avoid
polluting the output. Dependency may be missing because user has not installed all
optional packages, the display should not show that every time.
2026-03-31 12:46:53 +02:00
Goffi
60753f4d71 tools (config): QoL improvements:
- 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.
2026-03-30 12:05:47 +02:00
Goffi
685193602e cli (profile): fix profile check for create and delete:
When checking existing profiles with `bridge.profiles_list_get`, all profiles have to be
retrieved, including components.
2026-03-30 12:05:13 +02:00
Goffi
d3113ed2d8 core: fix failure raising with exception classes:
When raising a `Failure` with an exception, the `Exception` class can't be used, it must
be an instance.
2026-03-30 12:03:16 +02:00
Goffi
90c6f11415 plugin XEP-0198: Fix disconnecting of component profile:
- There is not need to use stream management with component, so we set mode to `client`
only.
- `_disconnecting_trigger` was causing an exception when disconnecting a component, it is
now disabled in this case.
2026-03-30 12:01:17 +02:00
Goffi
5c1326c8e4 iplugin app manager: remove forgotten breakpoint 2026-03-30 11:58:39 +02:00
Goffi
c634204ac7 core (main): log errors during post_init. 2026-03-30 11:37:17 +02:00
Goffi
b9762ce474 core (launcher): log configuration filenames. 2026-03-30 11:37:17 +02:00
Goffi
80944e7a62 core (constants): Fix path for hidden config files in $HOME:
Config file can be hidden in $HOME (`~/.libervia.toml`), and the path was wrongly handled
probably following a change to use `Path`.
2026-03-30 11:37:17 +02:00
Goffi
a9fa2eeed4 core (main, config): Component auto-configuration:
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
2026-03-30 11:37:17 +02:00
Goffi
51776603e0 depdencies, core: update Tx-XMPP to be version >= 10.0:
This version changes the package name, so all `wokkel` imports habe been replaced by
`tx_xmpp`
2026-03-24 16:42:27 +01:00
Goffi
9fb5912567 install (dependencies): use tx-xmpp from PyPI 2026-03-22 13:18:00 +01:00
Goffi
eaa49911a6 core (xmpp): Don't use Tx-XMPP deprecated attributes:
Some deprecated attribute from `Tx-XMPP` (`Wokkel`) were still used.
This patch also remove some legacy `inlineCallbacks`.
2026-03-21 12:24:39 +01:00
Goffi
78d72304d5 core: bye bye sat_tmp :)
After 11 years of "temporary" monkey patches, I've finally made a friendly fork of Wokkel
at https://www.goffi.org/forge/goffi/tx-xmpp with all needed PRs merged and changes from
`sat_tmp`, using the same license as Wokkel (with agreement from contributors). No more
monkey patching, and it will also stop the deprecation warning due to outdated packages
used in Wokkel. Last but not least, it should unblock the move to the latest Twisted and
Python versions.
2026-03-20 18:32:36 +01:00
Goffi
243aab9cec bridge (pb): Remove existing socket if any:
If the backend was not closed properly, the former socket may still be present. This was
preventing the backend to start again, while now the old socket is removed in this case.
2026-03-19 12:01:21 +01:00
Goffi
04d53ebe10 plugin forge: Check that repository exist before returning counters. 2026-03-18 10:54:59 +01:00
Goffi
bc95840d46 plugin (forge): add bridge methods to handle clone counters:
A counter of clones (i.e.; Git clones as Git is currently the only backend) can be incremented or retrieved.
Counters are stored per day.
2026-03-18 10:42:15 +01:00
Goffi
a405d6c8f7 memory (storage): add get_profile_by_name method 2026-03-17 17:55:03 +01:00
Goffi
ea52ebe434 plugin (XEP-0059): fix max handling:
since the move to the new model, the `_` suffix must not be used any more with `max`.
2026-03-17 16:08:37 +01:00
Goffi
42df19195d config: renamed common.hosts_dict to common.hosts and improved its description 2026-03-14 00:58:08 +01:00
Goffi
f4ca8c52cc core (main): ensure that reactor is running during post initialisation:
In background mode, the reactor is run later, this may cause troubles during some
initialisation. This has notably be seen for PB bridge which was not correctly listening
to the socket.
2026-03-13 22:45:04 +01:00
Goffi
a338bef90d core (constants): Use runtime dir:
PID and PB bridge socket were using temporary directory, but the good practice is to use
XDG_RUNTIME_DIR instead.
2026-03-13 17:16:35 +01:00
Goffi
1cf75f1126 install (dependencies): update miniupnpc and make netifaces optional:
- update `miniupnpc` as latest version have proper wheels, making installation easier.
- `netifaces` is not maintained anymore, and only used optionally in one plugin
  (plugin_misc_ip). It cause troubles during installation because it needs do be build.
  This patch make it optional, and it will probably be removed in the future.
2026-03-13 13:01:03 +01:00
Goffi
c9211fb270 install (pyproject): Remove dbus-python and make pygobject optional:
`dbus-python` is no longer used since the D-Bus bridge is now fully based on txdbus.

As a consequence, `pygobject` is no longer necessary for base features, but still
necessary for webRTC-based features (as we are using GStreamer). Making it optional makes
the installation far easier, as the GLib parts often cause trouble during installation
(mainly because they need local libraries).
2026-03-13 12:08:29 +01:00
Goffi
b69c7e4565 cli (loop): Remove GLib and Twisted related code:
Now that D-Bus has been fully reimplemented with txdbus, GLib is not needed anymore for
D-Bus bridge.
As `dbus` and `pb` (and future other bridges) both support "AIOBridge", we don't have to
use a Twisted specific version for anything.
2026-03-13 11:54:27 +01:00
Goffi
b607b962a8 core (main): fix bridge return value of message_send:
`message_send` was returning message data while the method is declared
with no return value, this was causing issues with some bridges (pb
notably).
2026-03-13 11:38:14 +01:00
Goffi
e82a946123 tools (dynamic_import): add an argument to select bridge type:
If a frontend is using Twisted it must use the `TwistedBridge` instead of `AIOBridge`. A
new argument has been added to let do that.
2026-03-13 11:38:14 +01:00
Goffi
2278002f38 bridge (pb): add TwistedBridge:
`TwistedBridge` is needed for Twisted based frontends (it's the case for
the web frontend).

Regenerated bridges.
2026-03-13 11:38:07 +01:00
Goffi
baab23abe4 bridge (dbus): replace D-Bus implementation:
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.
2026-03-13 11:37:37 +01:00
Goffi
364f365bc7 core (launcher): set AsyncIO reactor in launcher
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)
2026-03-13 10:30:06 +01:00
Goffi
99377fadfc install (pyproject): add a main extra to install essential packages:
`all` install everything, `main` only the essential ones.
Also add some comments to explain what the groups are for.
2026-03-13 10:27:51 +01:00
Goffi
1256e92cec cli (base): Refactor loop handling:
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.
2026-03-13 10:27:51 +01:00
Goffi
30619f5689 bridge (dbus, pb): fix intialisation issues:
- 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.
2026-03-13 10:27:51 +01:00
Goffi
84321be4cc bridge: automatic bridge:
Add a new "auto" bridge which tries D-Bus and fall back to PB in case of problem. This is
the defaut reactor, but can also be explicitely used.
2026-03-13 10:27:51 +01:00
Goffi
0d57c1bbed install: move to uv:
`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.
2026-03-10 09:43:04 +01:00
Goffi
70c7451467 Transition from Mercurial to Git:
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).
2026-03-09 10:07:15 +01:00
Goffi
82e2c6efac apply black to the whole codebase. 2026-03-09 09:22:04 +01:00
Goffi
420df3340d CHANGELOG update 2026-03-09 09:22:02 +01:00
Goffi
c31b6e207c applicactions: fix applications:
This patch fix application configuration parsing. Peertube and Weblate can be started
again.
2026-03-04 15:49:47 +01:00
Goffi
f17fee4802 plugin forge/git: Implement diff retrieval:
Add models and parser to get diff from commits or branch references.
2026-03-04 12:32:48 +01:00
Goffi
48d197459a plugin forge: add tickets to settings:
Those settings are used to set the tickets node.
2026-03-04 12:32:48 +01:00
Goffi
9e10176914 plugin XEP-0060: cast types of plugins used internally. 2026-03-04 12:32:48 +01:00
Goffi
df2a9ba8e8 plugin android: only media on Android only:
Importing `media` on desktop was causing trouble as it may not be installed.
2026-02-24 09:43:32 +01:00
Goffi
3cf38d138e doc (cli/contacts): Add documentation for contacts:
describe the new `contacts` commands to handle pubsub contacts.

fix 475
2026-02-23 13:15:16 +01:00
Goffi
b4a13ce51e tests (unit): Add tests for pubsub contacts:
Tests the models and plugin data behaviour.

rel 475
2026-02-23 13:15:16 +01:00
Goffi
1a0cc787f8 cli (contacts): add commands to handle pubsub contacts:
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
2026-02-23 13:15:16 +01:00
Goffi
55e16c3db5 plugin pubsub contacts: Implementation of the new contacts handling XEP.
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
2026-02-23 13:15:16 +01:00
Goffi
0bc56134ad plugin XEP-0473: Decrypt items events when received:
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
2026-02-23 13:15:14 +01:00