Commit graph libervia-backend/libervia/backend/plugins
Author SHA1 Message Date
Goffi
1c1f617cdf plugin XEP-0048: don't fail if a type is missing in bookmark data. 2024-06-12 22:36:15 +02:00
Goffi
a6059161bb plugin XEP-470: Don't file configuration on feature-not-implemented. 2024-06-12 22:35:13 +02:00
Goffi
f97ed65a7a component AP Gateway: log invalid account in case of error. 2024-06-12 22:34:19 +02:00
Goffi
b402be2a7a component AP Gateway: implement HTTP GET signature. 2024-06-05 22:34:09 +02:00
Goffi
99b218fca4 plugin text syntaxes: fix empty string handling in _remove_markups. 2024-06-05 22:33:37 +02:00
Goffi
3d30449a93 app (weblate): use application weblate section 2024-05-31 15:15:42 +02:00
Goffi
47a29aa5ce app (peertube): environment variable must be strings (bis) 2024-05-31 11:24:12 +02:00
Goffi
187c09204c app (peertube): environment variable must be strings 2024-05-31 11:18:12 +02:00
Goffi
6fc76d1a0b plugin app manager: Add an app configuration file for PeerTube. 2024-05-31 11:08:22 +02:00
Goffi
4c7d4de032 doc: style/typos/URL fixes 2024-05-31 11:08:20 +02:00
Goffi
da80cae625 plugin app manager: various improvements:
- Generated password must now be named and are stored, so they are re-used on following
  restarts. Password size can now be specified.
- New `not` filter for `!libervia_param` to inverse a boolean value.
- Former `front_url` field has been renamed to `web_url_path` as it is the URL path used
  for web frontend. All Web frontend related field are prefixed with `web_`.
- `front_url` is now used to specify a whole front URL (notably useful if an app uses its
  own domain). A list can be used to retrieve a key, like for `url_prefix`, and `https`
  scheme is added if no scheme is specified.
- An abstract class is now used for App Managers.
- Last application start time is stored in persistent data.
2024-05-31 11:08:14 +02:00
Goffi
0e23b8c1b0 plugin XEP-0272: implement XEP-0272: Multiparty Jingle (Muji)
rel 429
2024-05-15 17:34:46 +02:00
Goffi
ed7a2fa132 core: Jingle Remote Control implementation:
This is an implementation of the protoXEP that will be submitted to XSF. It handle
establishment of a remote control session, and the management of A/V calls with XEP-0167.

rel 436
2024-05-11 13:52:43 +02:00
Goffi
de7260bfb9 backend, frontend: prepare remote control:
This is a series of changes necessary to prepare the implementation of remote control
feature:

- XEP-0166: add a `priority` attribute to `ApplicationData`: this is needed when several
  applications are working in a same session, to know which one must be handled first.
  Will be used to make Remote Control have precedence over Call content.
- XEP-0166: `_call_plugins` is now async and is not used with `DeferredList` anymore: the
  benefit to have methods called in parallels is very low, and it cause a lot of trouble
  as we can't predict order. Methods are now called sequentially so workflow can be
  predicted.
- XEP-0167: fix `senders` XMPP attribute <=> SDP mapping
- XEP-0234: preflight acceptance key is now `pre-accepted` instead of `file-accepted`, so
  the same key can be used with other jingle applications.
- XEP-0167, XEP-0343: move some method to XEP-0167
- XEP-0353: use new `priority` feature to call preflight methods of applications according
  to it.
- frontend (webrtc): refactor the sources/sink handling with a more flexible mechanism
  based on Pydantic models. It is now possible to have has many Data Channel as necessary,
  to have them in addition to A/V streams, to specify manually GStreamer sources and
  sinks, etc.
- frontend (webrtc): rework of the pipeline to reduce latency.
- frontend: new `portal_desktop` method. Screenshare portal handling has been moved there,
  and RemoteDesktop portal has been added.
- frontend (webrtc): fix `extract_ufrag_pwd` method.

rel 436
2024-05-11 13:52:41 +02:00
Goffi
e8fb0a8a28 plugin XEP-0353, XEP-0234, jingle: WebRTC data channel signaling implementation:
Implement XEP-0343: Signaling WebRTC Data Channels in Jingle. The current version of the
XEP (0.3.1) has no implementation and contains some flaws. After discussing this on xsf@,
Daniel (from Conversations) mentioned that they had a sprint with Larma (from Dino) to
work on another version and provided me with this link:
https://gist.github.com/iNPUTmice/6c56f3e948cca517c5fb129016d99e74 . I have used it for my
implementation.

This implementation reuses work done on Jingle A/V call (notably XEP-0176 and XEP-0167
plugins), with adaptations. When used, XEP-0234 will not handle the file itself as it
normally does. This is because WebRTC has several implementations (browser for web
interface, GStreamer for others), and file/data must be handled directly by the frontend.
This is particularly important for web frontends, as the file is not sent from the backend
but from the end-user's browser device.

Among the changes, there are:

- XEP-0343 implementation.
- `file_send` bridge method now use serialised dict as output.
- New `BaseTransportHandler.is_usable` method which get content data and returns a boolean
  (default to `True`) to tell if this transport can actually be used in this context (when
  we are initiator). Used in webRTC case to see if call data are available.
- Support of `application` media type, and everything necessary to handle data channels.
- Better confirmation message, with file name, size and description when available.
- When file is accepted in preflight, it is specified in following `action_new` signal for
  actual file transfer. This way, frontend can avoid the display or 2 confirmation
  messages.
- XEP-0166: when not specified, default `content` name is now its index number instead of
  a UUID. This follows the behaviour of browsers.
- XEP-0353: better handling of events such as call taken by another device.
- various other updates.

rel 441
2024-04-06 12:57:23 +02:00
Goffi
25aedf57d7 plugin XEP-0391: remove the need to have a OLDMEMO session started to decrypt:
It should not be mandatory to have an OLDMEMO session started to decrypt JET files, and
this was actually making a test failing.
2024-03-05 17:31:56 +01:00
Goffi
bb57b12329 plugin XEP-0313: fix value used in msg_from when from is not explicitely specified. 2024-03-05 17:31:56 +01:00
Goffi
b6383c557e plugin XEP-0060: fix incorrect type hint. 2024-03-05 17:31:56 +01:00
Goffi
a804e6a9dc plugin XEP-0234: fix action type when pre-flight file confirmation is confirmed:
the `C.META_TYPE_FILE` can't be used in this case as it is a preflight and we don't have
yet data such as progress ID. `C.META_TYPE_FILE` is used as a sub-type to help with dialog
management in frontend.
2024-03-05 17:31:49 +01:00
Goffi
f20e5d6103 plugin XEP-0384, XEP-0391: download missing devices list:
when a peer jid was not in our roster, devices list was not retrieved, resulting in failed
en/decryption. This patch does check it and download missing devices list in necessary.

There is no subscription managed yet, so the list won't be updated in case of new devices,
this should be addressed at some point.
2024-03-05 17:31:36 +01:00
Goffi
23e7b2720d plugin XEP-0384: be sure to have open access model for created nodes. 2024-03-05 17:31:36 +01:00
Goffi
0548f443ca plugin XEP-0373: fix serialisation of public_key_list 2024-03-05 17:31:36 +01:00
Goffi
3694bb3991 core (memory/migration):
Update XEP-0384 and `fe3a02cb4bec_convert_legacypickle_columns_to_json.py` migration to
properly handle (de)serialisation of `TrustMessageCacheEntry`.
2024-03-05 17:31:12 +01:00
Goffi
a8348576ae core: get rid of pickle:
Use of `pickle` to serialise data was a technical legacy that was causing trouble to store
in database, to update (if a class was serialised, a change could break update), and to
security (pickle can lead to code execution).

This patch remove all use of Pickle in favour in JSON, notably:
- for caching data, a Pydantic model is now used instead
- for SQLAlchemy model, the LegacyPickle is replaced by JSON serialisation
- in XEP-0373 a class `PublicKeyMetadata` was serialised. New method `from_dict` and
  `to_dict` method have been implemented to do serialisation.
- new methods to (de)serialise data can now be specified with Identity data types. It is
  notably used to (de)serialise `path` of avatars.

A migration script has been created to convert data (for upgrade or downgrade), with
special care for XEP-0373 case. Depending of size of database, this migration script can
be long to run.

rel 443
2024-02-23 13:31:04 +01:00
Goffi
133fe9c6fe plugin XEP-0444: fix emoji check and ID used 2023-12-13 22:00:25 +01:00
Goffi
b571b0d6e2 plugin XEP-0424: fix ID used and recipients 2023-12-13 22:00:25 +01:00
Goffi
817d7b6daf plugin XEP-0308: fix ID used, recipients and author check. 2023-12-13 22:00:25 +01:00
Goffi
5470bbf7b9 plugin XEP-0359: if no origin ID is found, use <message> ID instead:
This way, we always have the right ID to check for non groupchat message in
`History.origin_id`.
2023-12-13 22:00:25 +01:00
Goffi
79fd3d7c13 plugin XEP-0045: avoir crash if subject is not set when _get_room_joined_args is called. 2023-12-13 22:00:25 +01:00
Goffi
258c99b3c5 plugin forums: parsing fix + formatting:
- reformatted with black
- fix parsing of forums
- minor improvements
2023-12-12 12:17:15 +01:00
Goffi
b634e41ac0 core, doc, cli (forums): new forums set commands + doc:
- document the fact that if an empty `uri` is used, the forum node is created
  automatically
- new `forums/set` CLI commands and its documentation
2023-12-11 18:10:27 +01:00
Goffi
05bdfe122a component AP gateway: be sure to have a string for error message. 2023-12-11 18:07:58 +01:00
Goffi
1dd8a46572 plugin XEP-0277: fix comments node handling when parent node doesn't exist. 2023-12-11 00:46:34 +01:00
Goffi
ff5c2e0ea5 plugin ad-hoc registration: Implement plugin to handle registration links:
registration links are used in web frontend to allow registration with secret links when
it's normally closed.
2023-12-10 18:32:04 +01:00
Goffi
f1cc34cc53 plugin XEP-0050: small code quality improvements + add C.ENTITY_ADMINS magic key to allow administrators profiles 2023-12-10 15:08:08 +01:00
Goffi
b8d00757d3 plugin XEP-053, component AP gateway: use the new trigger.add_with_check method 2023-12-09 19:20:13 +01:00
Goffi
2db4ba9b3e plugin XEP-0471: modify variable name to be linter friendly. 2023-12-09 19:17:34 +01:00
Goffi
bbac8b6822 plugin IP: fix use of legacy URL + coroutine use:
An https:/salut-a-toi.org URL was used to retrieve external IP, but it's not valid
anymore, resulting in an exception. This feature is currently disabled.

Also moved several methods from legacy inline callbacks to coroutines.
2023-12-09 14:30:54 +01:00
Goffi
d80c4e89dc plugin XEP-0277, doc: conflict is now checked and avoided if user_friendly_id_suffix is False, doc updated 2023-12-05 13:39:03 +01:00
Goffi
4db2a87feb plugin XEP-0277: generate and parse altertate links with the new alt_links data in extra 2023-12-05 13:14:03 +01:00
Goffi
f35d799e28 Plugin XEP-0277: Add metadata to prevent adding random suffixes to generated user-friendly IDs. 2023-12-05 13:10:21 +01:00
Goffi
510b6fb62c component AP gateway: log a warning instead of raising an exception in onMessage:
if something goes wrong, a warning is logged instead of raising a failing in `onMessage`'s
`get_ap_actor_id_from_account` and `sign_and_post` calls.
2023-12-01 18:22:26 +01:00
Goffi
ec2a637847 plugin ad-hoc D-Bus: fix deprecated use of python-dbus:
the plugin was using python-dbus which is deprecated in the backend in the favor of
TxDBus. Methods calls have been updated, and the plugin works again, but there seems to be
still some issues (warnings in the logs). Those will be fixed later.
2023-12-01 15:22:55 +01:00
Goffi
3c35dea8b1 plugin XEP-0424: message retraction update:
- follow specification update (with namespace bump)
- retract from history on message reception for group chat
- send bridge message
2023-11-30 13:23:53 +01:00
Goffi
67e8367ff3 plugin XEP-0384: fix trigger used for OLDMEMO:
OLDMEMO was applied at the `send_message_data` trigger level, however this was missing
stanza constructed without message data (which is notably the case for XEP-0308). This has
been fixed by using the `send` trigger instead. As a side effect, the same code is now
used for TWOMEMO and OLDMEMO, making it simpler.
2023-11-28 17:41:02 +01:00
Goffi
85cecd3d30 plugin XEP-0308: implement Last Message Correction 2023-11-28 17:38:31 +01:00
Goffi
2b501c70d7 plugin XEP-0444: complete implementation:
"Message Reactions" implementation is now working and updating history. The
`message_reactions_set` bridge method can be used by frontend to `replace`, `add`,
`remove` or `toggle` reactions. History is properly updated, and signal are sent when
necessary.
2023-11-22 15:10:04 +01:00
Goffi
9d6158da2b plugin XEP-0359: use same ID as <message> for origin_id:
even if the XEP doesn't specify if Message ID must be the same as `origin_id`, using a
different one makes little sense, and is leading to bugs in other implementation (e.g.
Movim using the wrong ID for reactions).
2023-11-22 15:05:41 +01:00
Goffi
436848048a plugin XEP-0045: user normal workflow for history + get_room_user_jid method:
- workflow is now using the normal messages workflow even for history message: previous
  workflow was dedicated to MUC and only adding message to history, resulting in other
  plugins being skipped.
- new `get_room_user_jid` helps to retrieve easily the JID currently used in a joined
  room.
2023-11-22 15:00:57 +01:00
Goffi
f91c2be526 plugin XEP-0313: better error logging + store last stanza ID when retrieving archives + small improvments 2023-11-22 14:56:14 +01:00