Commit graph

4,540 commits

Author SHA1 Message Date
Goffi
0cfeea8203 tests (unit/conftest): bridge is now a read-only property, update _bridge instead. 2026-04-09 21:47:07 +02:00
Goffi
378c6e3fef memory (sqla): docstrings/type hints improvements 2026-04-09 21:47:06 +02:00
Goffi
1013266cc5 component pubsub: remove node creation restriction to local user only:
External users should be able to create nodes, it is necessary for many feature such as
blog comments.

rel 476
2026-04-09 21:47:06 +02:00
Goffi
e7917b1b63 component pubsub: Implement remaining methods:
- `retract`, `purge` and `delete` are now implemented
- `features` list has been added
- `publish` now returns the Item ID when it is generated
- `subscribers` publish model is handled.

rel 476
2026-04-09 21:46:31 +02:00
Goffi
572662653f component pubsub: implement default configuration:
rel 476
2026-04-09 10:26:08 +02:00
Goffi
6b2c34190e component pubsub: implement notifications
rel 476
2026-04-09 10:11:29 +02:00
Goffi
5038fdb8f0 component pubsub: Implement subscription handling methods:
rel 476
2026-04-09 10:11:29 +02:00
Goffi
0a0735ec4c memory (sqla): Add methods to handle pubsub node subscriptions:
Add `get_pubsub_subscriptions` and `set_pubsub_subscriptions`.

rel 476
2026-04-09 10:11:29 +02:00
Goffi
753623e934 cli (pubsub/node/subscription/set): Fix bridge call 2026-04-08 16:16:20 +02:00
Goffi
34d6032cf5 component pubsub: Handle affiliations setting/retrieval:
Let retrieve affiliations for the whole service or a specific node, and set affiliations
for a node.

rel 476
2026-04-08 16:16:20 +02:00
Goffi
8ebf5360a2 component pubsub: publish and items retrieval implementation:
rel 476
2026-04-07 15:00:37 +02:00
Goffi
57d3d8e07e memory (sqla): Improve handling of RSM in get_items:
- update queries to handle correctly the `before=""` case and RSM order (older to newer)
  while having correct order when `max_items` without RSM is used (then order it newer to
  older).
- put RSM code path in a separated method for better readability.
- check values of `max_items` and `from_index` and raise exception is they are not
  positive
- when using `before` or `after`, check that the item ID used as reference exists, and
  raise an exception otherwise.
- updated docstring to reflect the new behaviour.
- update pubsub cache use of `get_items` with RSM, to adapt to new behaviour.

rel 476
2026-04-07 14:58:42 +02:00
Goffi
9cf71f2119 component Pubsub: initial implementation:
Base component implementation, handle node creation, listing, configuration and metadata.

rel 476
2026-04-07 11:48:53 +02:00
Goffi
cba0e388b6 core (types): fix name conflict with xmlstream + docstring for is_local. 2026-04-04 00:48:19 +02:00
Goffi
7af89d3abd core (memory/param): Replace warning sign in ASCII by emoji:
The warning sign in ASCII should be escaped, but that doesn't play well with docstrings.
Emoji is a better option.
2026-03-31 13:00:31 +02:00
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