Commit graph

4,551 commits

Author SHA1 Message Date
Goffi
c89b91c2e9 component pubsub: Integrate XEP-0499 extended discovery:
- Added `on_extended_disco()` handler.
- Added `with_parent=True` to all `get_pubsub_node()` calls to prevent lazy load errors in
  access checks.

rel 476

Registered XEP-0499 handler in `profile_connecting()` and added it to
plugin dependencies.
2026-04-11 12:46:47 +02:00
Goffi
f1ceb7db8e memory (sqla): Add with_parent and with_link to get_pubsub_nodes():
Added `with_parent` and `with_link` parameters for eager loading of parent and linked_node
relationships.

Fixed CTE to include all children (not just base nodes) and use `selectinload` for parent
to avoid cartesian products.

rel 476
2026-04-11 02:08:15 +02:00
Goffi
20bf3dffa1 plugin XEP-0499: metadata + filtering:
- Added `full_metadata` handling to return only relationship fields when requested.
- Implemented `filter_node_hierarchy_by_access` for access control filtering

rel 476
2026-04-11 02:03:22 +02:00
Goffi
31b55fbbe7 tests (unit/component pubsub): Fix tests
rel 476
2026-04-11 01:55:15 +02:00
Goffi
3492baaa65 component pubsub: integrate pubsub relationships:
Pubsub relationships from XEP-0496 are now handled. They can be set in config as explained
in the specification, and access are checked with parents when they are set.

Deletion cascade as specified in the XEP.

rel 476
2026-04-11 01:55:15 +02:00
Goffi
0c6921aad0 plugin XEP-0496: Pubsub Relationships implementation:
Add methods to handles the relationships which were already present in storage.
This plugins add methods to handle validation and rules from the specs.

`get_pubsub_node_children` helper method has been added to storage.
2026-04-11 01:55:15 +02:00
Goffi
4b91ea873e memory (sqla): New node_id, with_parent and with_link argument for get_pubsub_node:
- A node can now be retrieve directly by its ID.
- `with_parent` and `with_link` let load `parent_node` and `linked_node`.

rel 476
2026-04-10 22:02:53 +02:00
Goffi
2c3d11e7ff tests (unit): Pubsub component tests:
rel 476
2026-04-09 21:47:53 +02:00
Goffi
09bef94ffe plugin XEP-0373, tests (unit/XEP-0373): Make rpad size >= 50:
XEP-0420 bounds starts at 0 but 0-length rpad defeats its purpose (the XEP actually says
"TODO: sane boundaries?"). Furthermore, some tests where failing randomly due to 0-lenght
rpad sometimes happening. This patch makes rpad minimum size at 50.
2026-04-09 21:47:53 +02:00
Goffi
73b410aa97 tests (unit/cli/calls): Skip tests in case of missing media or webrtc:
Test were raising exceptions when optional modules were missing (GStreamer related modules
for `webrtc`). Those are now catched so the tests are simply skipped in this case.

`MissingModule` is now inheriting from `ImportError`, as it's a natural subclass, and it
makes import error catching easier.
2026-04-09 21:47:46 +02:00
Goffi
72d7868eb5 tests (unit/conftests): Add a reset_storage autouse fixture:
Storage can be modified by tests, and it is kept for the whole session, this may have side
effect resulting in other tests failing. This fixture avoid this problem by reseting
`storage` between each test.
2026-04-09 21:47:43 +02:00
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