Commit graph libervia-backend/libervia/backend/plugins
Author SHA1 Message Date
Goffi
e8b3948ad0 plugin misc account: fix send_email calls + admin email flag:
The `send_email` calls in `send_emails` passed the plugin `EmailSettings` as the `config`
argument, raising `AttributeError` on account creation and leading to the profile
deletion.

They now pass the main config via a new `email_settings`.

`credentials_xmpp_connect` takes a new `send_email` flag to let frontends skip the admin
notification email (notably useful in web local mode).
2026-11-04 09:47:04 +01:00
Goffi
8afde9962a plugin AP Gateway: various fixes and improvements:
- Sign item requests with the service/node actor and use the publisher for `attributedTo`.
- http_server: add missing `requestor_actor_id` to all `ap_*_request` handlers.
- http_server: fix following acceptation in `handle_follow_activity`.
- http_server: unescape `%40` in `get_ap_actor_data` at the beginning and use
  it everywhere.
- pubsub_service: delete subscription from storage on unsubscribe.
- Fix missing arguments in some calls.
- Fix various issues coming from conversion of data models to Pydantic.
- plugin XEP-0277: add `MbData.is_edit` property.
2026-10-28 14:29:38 +01:00
Goffi
50ffc8c3b4 core, memory (sqla), plugins XEP-0277, XEP-0346: various fixes:
- `is_local`: now use `server_jid`.
- `aio_func`: pass the missing `self` argument (`aio_fund` is unbound).
- Declare `pubsub_service` in `core_types.SatXMPPEntity`
- plugin XEP-0277: fix handling of `MbData.from_element` when node is not specified (so we
  use default node).
- plugin XEP-0346: `IdentityData`: fix field access, following move to Pydantic model.
2026-10-27 16:04:50 +01:00
Goffi
da20bba2ab plugin XEP-0050: fix handling of form submitted in the first request:
form submitted on first request (without retrieval first) was broken, this patch fixes it.
2026-10-26 18:36:41 +01:00
Goffi
8e4e96dcbb plugin File Sharing Management: generate video thumbnails:
Video thumbnails are now generated too (recursively, along with images) on the `thumb`
command. The poster frame is extracted at 25% of the duration (instead of a fixed 10s
seek).

Thumbnails are now kept in cache indefinitely.
2026-10-26 18:36:41 +01:00
Goffi
bd1c93f7d4 memory (cache): add persistent cache entries:
`max_age` can now be `C.MAX_AGE_PERSISTENT` to keep a cache entry indefinitely: its `eol`
is then `None` and no expiration check is done.
2026-10-26 18:36:41 +01:00
Goffi
19beb9d339 plugin NAT Port: fix errors handling:
`miniupnpc` raises `Exception("Success")` when no device is found
(instead of returning 0), which was resulting in an exception breaking workflows in
Libervia.

The code now catches unexpected exceptions, and handles `Exception("Success")` as "no
device found".
2026-10-26 18:36:41 +01:00
Goffi
e98e00be51 plugin XEP-0167: pass the call_end reason to the jingle termination 2026-10-18 23:51:06 +02:00
Goffi
c0860ca978 plugin XEP-0353: intialisation refactor:
slight refactor of initialisation workflow, it's now split in two part, with
`self._send_jingle_after_accept` called in a deferred, so the session ID can be returned
early by the jingle application, and the session can be cancelled even if not fully
established (e.g. while ringing during a call).
2026-10-18 23:51:06 +02:00
Goffi
53e6de5a3b plugin XEP-0298: remove the obsolete session-init trigger:
- Conferences are not using XEP-0298 anymore, following the Jingle A/V Conferences
  protoXEP update.
- fix XEP-0166 dependency
2026-10-18 23:51:06 +02:00
Goffi
cb570ab3cf component conferences: update to manage the new single Jingle session and the ICE restart:
The Jingle Audio/Video Conferences spec has been updated to work with a single Jingle
session. This patch updates the component to handle it, and implements ICE restart
management.

Closing is better handled, and session are replaced in case of duplication (happens
notably in web frontend on tab reload).
2026-10-18 23:51:06 +02:00
Goffi
7277e48f7f plugin av-conferences: implement Jingle A/V conferences:
This plugin implements the Jingle A/V Conferences specification. The plugin is small as
it's mostly (only so far) about specifying/retrieving <origin> element, and disco info;
the rest is handled by other Jingle plugins.
2026-10-17 14:23:52 +02:00
Goffi
53e9bcf91d plugin XEP-0272: remove the room bookmark when the group call ends:
When joining a room, it may be automatically added to bookmark (e.g. by other clients), so
we delete it when call end to be sure that we don't keep temporary rooms in bookmarks.
2026-10-17 13:43:33 +02:00
Goffi
60133fc47f plugin XEP-0384: log error when getting the OMEMO session manager fails 2026-10-17 13:43:33 +02:00
Goffi
571588f8a1 plugin XEP-0402: ignore missing item when removing a bookmark 2026-10-17 13:43:33 +02:00
Goffi
ab26a56c1d plugin XEP-0166: support all content actions + fixes:
- all content actions are now handled
- XEP-0167: the new contents of an offered SDP are added with a single content-add, the
  contents sharing a single transport are bundled (XEP-0338)
- XEP-0167: the generated SDP declares the BUNDLE group of its own contents
- XEP-0176: one transport-info IQ per content. ICE data are keyed by content names.
- fix session-level ICE attributes and fingerprint
2026-10-17 13:43:33 +02:00
Goffi
0c6f852ce9 plugin XEP-0272: update to v0.2.0 + fixes:
- use the proper `urn:xmpp:jingle:muji:0` namespace
- replace XEP-0249 invitations with XEP-0482
- the dedicated `META_TYPE_GROUP_CALL` subtype is now used for the confirm action (instead
  of `META_TYPE_MUC_INVITATION`)
- handle MUJI invitation: on accept, join the room, start preparing and answer with the
  connection method element
- add the `<muji>` element to outgoing Jingle IQs
- propagate the call type (audio/video) in the MUJI invites (the `type` attribute), so the
  invited clients set up the proper local stream
- the joining participant initiates the sessions with the other participants, using their
  real JIDs, extracted from the presence (the room is set non-anonymous for that)
- only trust the `<muji>` element of a `session-initiate` from a member of the room
- add a `call_group_end` bridge method to clean the MUJI session
- typo fix in `META_TYPE_MUC_INVIRATION` (`R` instead of `T`)
2026-10-17 13:43:33 +02:00
Goffi
c4e3a2b015 plugin XEP-0045: add set_room_configuration and is_jid_in_room methods:
The `set_room_configuration` allow to update configuration with well-known options.
The `is_jid_in_room` check if an entity with the given real JID is in the room.
2026-10-08 20:50:37 +02:00
Goffi
edc77d1517 plugin XEP-0060: fix get_items docstring. 2026-10-08 20:50:37 +02:00
Goffi
8d4120fb8a plugin XEP-0402: catch NotFound in _set_autojoin 2026-10-08 20:50:37 +02:00
Goffi
1de6c20d03 plugin XEP-0167: propagate muji_room in call metadata 2026-10-08 20:50:37 +02:00
Goffi
2f3960a15f plugin identity: minor loging improvement 2026-10-01 11:57:10 +02:00
Goffi
8d4d2e222a plugin XEP-0482: Call Invites implementation 2026-10-01 11:57:10 +02:00
Goffi
13db2e36fa component conferences: Clean stale Galène process if any before launching a new one. 2026-09-23 18:25:38 +02:00
Goffi
7fed56203b plugin XEP-0277: fix unawaited coroutine. 2026-09-19 18:02:34 +02:00
Goffi
b2bc25657d plugin XEP-0277: fix mb_preview D-Bus signature 2026-09-18 10:19:53 +02:00
Goffi
7325353d18 plugin XEP-0373, tools: Move GPG backend to tools.common:
GPG backend will be used for backup, and may be used in general to handle GPG.

rel 480
2026-09-15 11:48:11 +02:00
Goffi
1af645c0f0 plugin XEP-0045, XEP-0402: Update bookmark on room join/leave:
As PEP bookmarks are nowadays used to sync joined state across devices, trigger points
have been added to XEP-0045 so XEP-0402 can automatically update the `autojoin` status on
MUC joining or leaving.

A check has been added to ignore already joined or left room when XEP-0402 plugin updates
the MUC status on bookmark update.
2026-09-15 11:48:04 +02:00
Goffi
2f635798ac plugin XEP-0308: better author check:
Check full JID for MUC private messages.
2026-08-25 19:07:06 +02:00
Goffi
7a7a3d8fe4 plugin XEP-0308: check message edit for room messages:
- Reference the stanza-id assigned by the MUC service when correcting.
- Ignore the edit (with a warning) if the original message has no usable id.
2026-08-25 19:07:06 +02:00
Goffi
403b9e9d31 plugin XEP-0308: fix message edit for MUC private messages:
- Keep the destination resource when resending the correction (e.g. `room/nick`).
- Match the corrected message by id (fallback: last message from the sender).
- Ignore corrections that can't be matched, or whose content is already applied (e.g.
  own corrections redelivered by MAM).
2026-08-25 19:02:59 +02:00
Goffi
de6c050db2 plugin JID Search: Update cutoff ratio + dedup:
- `RATIO_CUTOFF` has been adapted to avoid returning approximate matches.
- In case of duplicate entries (e.g., rooms returned by the local search are also returned
  by the external one), we keep only the item with the most metadata.
- Exclude `None` values in `jid_search` bridge method.
2026-08-24 11:52:53 +02:00
Goffi
1a96c32c45 plugin XEP-0433: Check frontend's allow_external option:
To allow external search, there must now be both the general settings and the
`allow_external` option set by frontend.
2026-08-24 11:43:31 +02:00
Goffi
912ffd4e8b plugin XEP-0054: Fix missing await 2026-08-24 11:24:25 +02:00
Goffi
14dbca530b plugin XEP-0313: check message origin:
Check that "from" attribute of the forwarded message is coming from the service.
2026-08-18 18:48:04 +02:00
Goffi
93ce4112f8 plugin identity: Use Pydantic models:
Use Pydantic models for data used with bridge.
Also update `backend.models.core.DiscoIdentity` to have `None` as possible and default
value for `name`.
2026-08-14 14:53:46 +02:00
Goffi
dc9e3e98d5 plugin XEP-0045: Use disco as fallback for is_room:
If a room was not joined (e.g., due to failure), `is_room` was wrongly returning `False`.
Disco identity is now used as fallback to detect correctly is an entity is a room or not.
This changes makes `is_room` async, and by extension `get_bare_or_full` too.
2026-08-12 18:10:51 +02:00
Goffi
e5781641f3 plugin XEP-0045: Fix use of empty string for nicks:
If empty string is used for nick in `join` (e.g., due to a bridge call), take use part of
the JID. This fix the use of empty resource, which was resulting in rejection by the
server.
2026-08-12 18:02:14 +02:00
Goffi
25a491d7f0 plugin identity: Raise timeout:
5s timeout is too short, if the server is overloaded or connection is slow, it makes the
identity retrieval fail. 15s is more reasonable and matches timeout used for disco.
2026-08-12 17:57:13 +02:00
Goffi
1bfc7bd10b plugin XEP-0313: fallback to last N items in case of missing item:
If a reference item is missing (e.g., after server purge) we now fallback to last N items
(50 for now), instead of giving up.
2026-08-10 12:02:47 +02:00
Goffi
ad397e9705 plugin XEP-0199: fix typo 2026-07-22 02:27:10 +02:00
Goffi
b384c6bb8f app manager (weblate): Update images:
Update image to run on latest version, pin PostgreSQL to v18, and remove the now
deprecated `version` field.
2026-07-21 11:52:22 +02:00
Goffi
6b4f7252e3 plugin app manager, app manager docker: update implementation:
A new `application_update` bridge method is added to easily update images. Running
container are automatically updated if necessary.
2026-07-21 11:50:20 +02:00
Goffi
6119c37c0f plugin app manager docker: add support for Podman:
Podman can be used as a drop-in replacement for Docker, and it doesn't need root
permissions. The plugin now has a settings to use Podman, and use `auto` by default which
will choose the first found on the device (Podman is tested first).
2026-07-21 11:50:20 +02:00
Goffi
feae9ff38d plugin app manager docker (peertube): update image:
`chocobozzz/peertube:production-bookworm` is outdated, moving to
`chocobozzz/peertube:production` to avoid up-to-date versions.
2026-07-19 14:51:09 +02:00
Goffi
2ae02c8e4a plugin serverless: first draft, peer discovery on LAN:
Implement peer discovery on LAN using mDNS (via `zeroconf`).
A Peer ID is generated (via `libP2P`) per instance, and announced on backend startup.
Meanwhile, other peers are discovered on LAN. A signal is send on peer found and another
on peer lost.

There a bridge methods to find already discovered peers, and to get infos on serverless
(our own ID, adverised service name, and number of peers found).

`Zeroconf` runs in background in its own thread.

rel 479
2026-07-17 23:27:47 +02:00
Goffi
a539c21f9d plugin XEP-0060: fix exception on _node_cb modification:
Due to the yielding, `_node_cb` could be modified during node event management, resulting
in an exception. The items are now shallow copied to avoid issue.
2026-07-17 23:27:47 +02:00
Goffi
92cb52dd04 plugin XEP-0363, upload: compute hash on file upload:
- Hash (SHA-256) is now automacally computed when a file is uploaded via XEP-0363, and
  used if no hash has been specified by frontend already.
- Use named tuples (`UploadTracking` and `UploadResult`) to handle callback values.
- upload: fix a bug (missing variable) in `unregister` (which is not used yet anyway).
- usual docstring/type hints improvements
2026-07-09 17:13:37 +02:00
Goffi
dbc3973642 plugin XEP-0447: handle deferred sources:
XEP-0447 allow to send sources after the original message. Dino is doing that, and thus we
can't display attachment immediately with only the original message.

This patch handle that by updating the original message once the sources are received, and
emitting a `message_update` signal to notify frontends.
2026-07-09 17:13:37 +02:00
Goffi
14a50673a1 plugin XEP-0300: Fix hash encoding and use StrEnum for hashes:
- Fix the wrong encoding of the hash hex string value instead of the binary value.
- Use a `StrEnum` for model, use models specified in XEP-0414.
- Minor typing hint/docstring improvments.
2026-07-09 17:13:37 +02:00