Commit graph libervia-backend/libervia/backend/plugins
Author SHA1 Message Date
Goffi
314b741cf6 plugin XEP-0060: fix extra passing when publishing an item. 2026-02-23 12:56:42 +01:00
Goffi
c297da7ec9 plugin (forge, forge_git): forge plugin first draft:
This plugin implements the base for the forge feature in Libervia.

The "forge" plugin introduces configuration to set repositories to expose with the forge
(per profile), and the default repository to show.
In the future, this may be done dynamically from frontends, so users can create/import
repositories themselves.

The "forge_git" plugin implements methods to handle Git repositories. In the future, other
types of repositories may be managed (e.g.; Mercurial), but for now the focus is on Git.
2026-02-18 17:49:36 +01:00
Goffi
77e2c9ce11 plugin (android): add missing import. 2026-02-18 17:44:23 +01:00
Goffi
919cafc68c Update use of media_dir following change in Libervia Media:
Libervia Media is now a Python package instead of files to put in a directory to specify
in settings. The discovery is now automatic, removing the need for settings and enabling
easier installation. Furthermore, it should now work even if the package is zipped.
`libervia_media` can now be specified as a dependency for frontends requiring it.
2026-01-13 10:57:19 +01:00
Goffi
668b158bd5 core: restore blog params:
- Restore plugin_misc_static_blog and rename it to plugin_misc_render_blog_params as it is
  still in use in web frontend.
- Only the `Background` param is actually used, all other params have been removed.
2025-12-19 22:43:20 +01:00
Goffi
e6ddd42c72 plugin app manager: use "common" section when not specified. 2025-12-19 13:27:36 +01:00
Goffi
c5396f0acf backend: Tor integration:
- Add the `txtorcon` optional dependency, used with `tor` extra.
- Add settings for Tor.
- Use Tor endpoint when an `.onion` XMPP domain is used, of when Tor is explicitely
  enabled in conf.
- Disable WebRTC, for now it's the safer option as WebRTC can leak IP. It should be
  possible to use it over Tor by forcing the use of a .onion relay, but this is to be
  explored later (A/V should be to slow to be usable, but that stay relevant for file
  transfer or other WebRTC powered things).
- A new `treq` instance using Tor WebAgent is used when Tor is enabled. Properties has
  been added to SatXMPPEntity to conveniently get the right instance.
- Another `tor_mode` property has been added with corresponding bridge methods, to see if
  Tor is activated and in which mode for a given profile. For now there are only two modes
  (disabled, and enabled with WebRTC disabled), but in the future it may be possible to
  activate WebRTC over Tor, or to use Tor only to connect to XMPP server, while using
  clearnet for other connections.
- Tor dedicated models have been added, and bridge methods have been added to build and
  get them.
- Fix tests.

rel 473
2025-12-15 11:35:19 +01:00
Goffi
4e75139f22 plugin cache: removed forgotten breakpoint. 2025-12-04 12:18:08 +01:00
Goffi
7b3c8d2ba8 black reformatting. 2025-12-03 17:49:34 +01:00
Goffi
b0a94124d2 plugin NAT port: disable the plugin for tests:
The UPnP-IGD devices discovery takes time and is not necessary during tests, so this
plugin is now diable during tests.
2025-12-03 17:48:43 +01:00
Goffi
e68278a1ac tests (unit): Fix tests. 2025-12-03 17:43:06 +01:00
Goffi
3a2a5f787d componenent AP Gateway, plugin XEP-0277: fix MbData use:
Updated legacy use of dict microblog data for the new Pydantic based model MbData:
2025-12-03 17:41:10 +01:00
Goffi
6a7b7bc36a core: Replace legacy INI config system with Pydantic-based TOML configuration.
This is a huge configuration refactoring.

The configuration system now uses Pydantic settings, with better validation, better
support for environment variables and other goodies.

The main config files now use TOML instead of INI, this allow for better handling of
complex types, notably dict.

Plugins, components and frontends can declare their config settings in a class which will
be imported dynamically.
2025-11-30 12:27:35 +01:00
Goffi
f3f40848b3 black reformatting 2025-11-20 14:50:03 +01:00
Goffi
cd8516f0bb plugin XEP-0167: fix ICE credentials handling. 2025-10-29 13:20:56 +01:00
Goffi
47564ec828 plugin XEP-0176: Add non standard <tickle> element:
Add the non standard <trickle> element found with Jingle negociation with Conversations.
2025-10-29 12:12:51 +01:00
Goffi
9fd3e33425 core: fix wrong calls to addElement. 2025-10-29 12:12:25 +01:00
Goffi
06661e3bbc plugin XEP-0471: minor namespaces update. 2025-10-27 12:33:57 +01:00
Goffi
1b3593d95b plugin XEP-0050: Some more refactoring:
- Arguments are now grouped in a new `PageData` NamedTuple, making it simpler to use, and
  easier to extend.
- Page index is automatically calculated, and can be checked in callback to know which
  page to show.
- Form send by calling entity is automatically parsed, using original form to instantiate
  the right field types.
- A new `DataForm.get_field` method use Generic type as second argument to retrieve the
  right field when getting a `submit` form.
- Updated all classes registering Ad-Hoc commands to use the new system and simplify the
  code.
2025-10-10 17:44:04 +02:00
Goffi
eaf6f1f00b plugin XEP-0050: Improve page data handling:
- Ad-Hoc callbacks now receive only a `client` and a `page_data`.
- `page_data` keep all important data useful to process current page in a namedtuple.
- Submitted form is automatically parsed, so callback just has to check the data from there.
- Page index is automatically handled, so the handling by callback is no longed needed.
- Session data is now splitted in 2 dict: private for `AdHocCommandHandler`, and public
  for the callback.
2025-10-10 17:44:04 +02:00
Goffi
697c7dbdbe component Emai Gateway: Add Ad-Hoc Commands:
- add Ad-Hoc commands to
    * delete an email
    * move an email to another mailbox
    * change flags on an email

- The email Message-ID is used to identify to email to manipulate, it is used as <message>
  ID on XMPP side.
- Add a `vebose` attribute on IMAPClient to see data exchanged with server.
- Refactor IDLE workflow, to fix synchronisation issues when command were emitted quickly.
- When in IDLE mode, and a command is emitted, there is now a 5s delay to restart IDLE
  mode, allowing for a series of command to be run without going to IDLE mode between each
  command.
- Fix pubsub nodes which were returned on each disco#items query.

fix 465
2025-10-10 17:44:00 +02:00
Goffi
19f4ce55de add type hints + minor reformatting. 2025-10-01 17:57:48 +02:00
Goffi
b07179a871 plugin XEP-0050: refactor to use Pydantic models:
Pydantic models are now used for Ad-Hoc commands callback data. The `AdHocCommand` model
can (de)serialise the callback by using its import string.
This change has several benefits:
- better data validation.
- the serialisation mechanism will make communication with frontends easier.
- open the door for automatic documentation.

rel 465
2025-10-01 17:57:47 +02:00
Goffi
b882fb53ea plugin XEP-0004: New data form implementation using Pydantic:
This new model is easier to manipulate and serialize, and use the benefits from Pydantic's
data validation mechanisms. It has method to easily convert to/from Wokkel data form or
to/from a domish.Element.

rel 465
2025-10-01 17:57:47 +02:00
Goffi
a32b8bf9e8 plugin XEP-0050: use Enums and add type hints:
- Replaces namedtuple with enums which are more appropriate here.
- Add docstrings and type hints to `AdHocCommand`

rel 465
2025-10-01 17:57:47 +02:00
Goffi
96bf3af324 Global reformatting with black. 2025-09-13 10:46:10 +02:00
Goffi
63edb309f8 component email message: Mailing list messages cleaning:
For mailing-list messages:
    - convert all text-only messages to XHTML for consistency.
    - detect and flag "noisy" content, i.e. content which are not useful and annoying in
      forum-like view (full-lenght quoted previous messages, mailing-list signature)

rel 464
2025-09-11 21:17:47 +02:00
Goffi
412db6a216 component email (imap): fetch all recent emails instead of only the last one. 2025-09-11 21:10:35 +02:00
Goffi
81f63ef93e plugin XEP-0277: add mentions to extra data:
rel 463
2025-09-06 16:31:24 +02:00
Goffi
5c9c57588c plugin XEP-0376: Fix type hint for node which is optional in subscriptions. 2025-09-05 19:32:47 +02:00
Goffi
0a42dd3da3 core (main): renamed hasFeature to has_feature to fix inconsistency. 2025-09-05 19:31:50 +02:00
Goffi
57e71c326d component email gateway: implement pubsub relationships and pubsub extended discovery:
- Pubsub relationships are used to set node hierarchy (comments nodes are set as children of
corresponding pubsub nodes).
- XEP-0499 Extended Pubsub Discovery is used to return hierarchy of pubsub nodes and
  items.

rel 463
2025-08-31 12:34:37 +02:00
Goffi
70e76dd190 plugin XEP-0499 Pubsub Extended Discovery implementation:
- Implement Pubsub Extended Discovery, and Pydantic models to handle the data easily.
- `client.discoHandler` initialisation has been moved in `core.xmpp` at an earlier stage
  of the workflow as it has to be initialised so XEP-0499 could remove the default disco
  handler to handle disco itself.
- Removed `Disco handled` trigger point as it was not used.

rel 463
2025-08-31 12:34:30 +02:00
Goffi
5b18ba7313 plugin XEP-0060: Add a model to handle node metadata:
rel 463
2025-08-29 18:53:03 +02:00
Goffi
e1828b3672 component Email gateway: Convert mailing list to pubsub nodes:
- `Credentials` is now a Pydantic based model.
- Mailing list related emails are now detected hand saved as pubsub items, using XEP-0277
  blog items, and creating suitable nodes. The ID of the mailing list is used for root
  node.
- Mailing list items are currently restricted to recipient associated JID.
- Words in square bracket in title `[Like][That]` are removed and converted to blog
  categories.
- Method to convert between MbData and email (in both directions) have been created.

rel 462
2025-08-03 23:45:48 +02:00
Goffi
3dbd990902 backend: various fixes, and type hints improvments. 2025-08-03 23:36:22 +02:00
Goffi
cab460152c plugin XEP-0277: Make MbData a Pydantic model:
- MbData is now a Pydantic based model.
- Bridge method has been updated to use `service` and `node` from MbData instead of using
  separate fields.
- Added `In-Reply-To` to MbData.
- Adapted code using XEP-0277 to work with the changes.

rel 462
2025-08-03 23:35:21 +02:00
Goffi
b1e0e336c2 plugin XEP-0297: Reworked forward method and add bridge method:
`Forward` method has been reworked and now includes a fallback. XEP-0297 ask to not use
fallback, but following a discussion on xsf@, we agreed that this is a legacy thing and a
fallback should nowadays be used, I'll propose a patch to the specification.

A `message_forward` has been added to bridge.

rel 461
2025-07-04 12:33:42 +02:00
Goffi
030be64c45 plugin XEP-0428: Add missing "for" attribute:
The "for" attribute was missing from <fallback> element.

rel 461
2025-07-04 12:30:20 +02:00
Goffi
16f9e07ce1 minor type update and unused import removal. 2025-07-04 12:28:40 +02:00
Goffi
0df0b0a5d0 core (types): Renamed libervia.backend.core.core_types.MessageData to MessageDataLegacy:
There are 2 concurrent models, this one is an historical legacy. The type to use the one
from `libervia.backend.models.core`, and it will progressively be used everywhere and
fully based on Pydantic.
2025-07-04 12:28:00 +02:00
Goffi
8302d09cf6 plugin data policy: Data Policy implementation:
This plugin implement data policy parsing and an algorithm to calculate a score based on
them.

rel 460
2025-06-26 17:02:33 +02:00
Goffi
6c95b3bec8 component email gateway: Add basic disco policy:
rel 460
2025-06-26 17:01:41 +02:00
Goffi
331e7dc5c4 plugin identity: add a timeout when getting identities. 2025-05-15 17:45:19 +02:00
Goffi
51c40dd5f0 plugin XEP-0461: Message Replies implementation:
Implement message replies. Thread ID are always added when a reply is initiated from
Libervia, so a thread can continue the reply.

rel 457
2025-05-06 00:34:01 +02:00
Goffi
cfc4041b1d plugin XEP-0045: Fix _message_parse_trigger which was incorrectly breaking the trigger workflow:
`None` was returned in some case instead of `True`, breaking the trigger workflow.
2025-05-06 00:34:01 +02:00
Goffi
931052f40c plugin XEP-0444, storage: move get_history_from_xmpp_id to storage as it is generally useful. 2025-05-06 00:33:57 +02:00
Goffi
618fbcd750 plugin XEP-0433: Extended Channel Search implementation:
Implements client part of XEP-0433, and add its results to plugin JID Search.
2025-04-11 18:19:28 +02:00
Goffi
65c6aefd68 plugin XEP-0045: add MUC search to plugin JID search results. 2025-04-11 18:19:28 +02:00
Goffi
7f6081b54f plugin JID Search: Use Pydantic models + better handling of partial search. 2025-04-11 18:19:28 +02:00