Commit graph

4,462 commits

Author SHA1 Message Date
Goffi
c4c3b5bd7c update templates handling folling changes in Libervia Templates 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
69368e0201 config: use singular form for plugin and component
Singular form is chosen as it makes more sense when configuring settings in TOML:

```TOML
[plugin.some_plugin_name]
    option=value

[component.some_component]
    option=value
```
2025-12-19 12:30:33 +01:00
Goffi
a8ef17c5f8 doc(tor, cli/info): Add documentation on Tor feature:
- Add `autodoc_pydantic` dependency for `docs`, it renders nicely Pydantic models,
  including the settings.
- Add documentation for `li info tor`
- Add a dedicated section on Tor

fix 473
2025-12-15 11:44:26 +01:00
Goffi
4fda71eeec config: remove web settings as they are now in web frontend. 2025-12-15 11:43:11 +01:00
Goffi
b88aed3731 cli (info): Add tor sub-command:
`tor` sub-command shows info on currently running Tor daemon (if any), and on the circuit
used to connect to XMPP server with current profile (if relevant).

rel 473
2025-12-15 11:35:26 +01:00
Goffi
b295c7dc7c cli: Update default theme:
Values which were used with constants and the legacy ANSI module are now in the theme. The
ANSI module should be removed in the future.

rel 473
2025-12-15 11:35:26 +01:00
Goffi
dcee0e098f cli (output): Add a OUTPUT_MODEL for Pydantic models:
As Pydantic becomes more and more used in Libervia, it is now important to have a
dedicated output in the CLI.

This patch also fixes `json` and `json_raw` outputs which were incorrectly calling
`console.print_json`.

rel 473
2025-12-15 11:35:26 +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
4db02adf1d core (log_config): no need to log when default options are used. 2025-12-04 15:02:39 +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
4346278bd8 doc (cli/call): Update doc with new features:
Add doc for:

- `no_ui` output
- stdin/stdout redirection
- custom GStreamer pipelines
2025-11-19 18:03:07 +01:00
Goffi
07fe13698c cli (call): Add no_ui output:
`no_ui` output is used when a local UI must not be created, e.g.; because the stream is
piped out. The `--no-ui` option has been removed because using a dedicated output seems
like a better approach.
2025-11-19 17:21:26 +01:00
Goffi
fa2144a167 frontends (tools/webrtc): Add SinksPipeline:
This sinks allow to use custom pipelines, or to disable playback (e.g.; if we want to
record only by setting `record_fd`).
2025-11-19 17:18:44 +01:00
Goffi
72ff011ddd cli (call): set recording file descriptor when stdout is redirected. 2025-11-17 12:55:01 +01:00
Goffi
e77bf03f99 frontends (tools/webrtc): Add recording to file descriptor:
A new `record_fd` argument can now be used to specify a file descriptor. If set, the
incoming stream will be written there.

For now `record_fd` must be specified on `WebRTC` creation. In the future, it should
be possible to add or remove it it during a call.
2025-11-17 12:54:13 +01:00
Goffi
ed1a652029 frontends (tools/webrtc): Handle SourcesStdin:
Update the pipeline workflow to handle `SourcesStdin`. A `decodebin` is used to autodetect
the stream type, then audio and/or video elements are created and plugged accordingly.
2025-11-08 22:21:46 +01:00
Goffi
59cf0b846d cli (call), frontends(tools/webrtc_models): Add source for stdin:
If data is piped in with `auto` source, a new `SourcesStdin` is used.
2025-11-08 22:21:23 +01:00
Goffi
91b9fc7cd3 cli (call): Add arguments to set custom pipelines in sources. 2025-11-08 22:18:20 +01:00
Goffi
e91ebd8cf2 frontends (tools/webrtc): Use actual video sizes for dimension checks and PIP positioning. 2025-11-08 16:06:06 +01:00
Goffi
ac56375b70 frontends(tools/webrtc): raise webrtcbin latency to default's 200 2025-11-08 16:06:06 +01:00
Goffi
ba7ea7664a frontends (tools/webrtc): Add a video recovery mecanism:
When packets are lost, artefacts appear and the remove stream video quickly becomes mush
(can be reproduced by blocking UDP for few seconds). To recover from this situation, the
video pad is monitored for GAP events, and when they occur, a new keyframe is requested 1s
after the last GAP.
2025-11-08 16:06:06 +01:00
Goffi
3ad1f14c25 frontends (tools/Webrtc): use specific configs for video sources:
- Each video source (webcam, desktop, muted) has now a specific config, to adapt
  framerate, bitrate and keyframe max distance.
- Improve logging.
- Tuned pipeline to make it error resilient and improve bitrate.
2025-11-08 16:05:54 +01:00
Goffi
450ea7b381 frontends (tools/webrtc): More tuning for remote video sink:
This tuning is done to avoid mush after a few minutes.
2025-11-06 22:25:26 +01:00
Goffi
482de127e8 cli (call_gui): Make FastTransformation explicit. 2025-11-06 22:24:38 +01:00
Goffi
bcfd8d3285 cli (call_gui): Fix Qt events processing:
`app.sendPostedEvents` was not handling all events (notably not the window system ones),
resulting in side effects such as the image freezing during A/V calls when the mouse was
not moving for a few seconds.

Instead, `app.processEvents` is now used, even though the documentation discourages its
use: in this context, it should be fine, and it's a simple solution.
2025-11-06 22:24:10 +01:00
Goffi
cebd60ae56 frontends (tools/webrtc): Fix audio muting. 2025-11-06 22:23:57 +01:00
Goffi
a5e1280af8 frontends (tools/webrtc): Fix pipeline for desktop sharing:
Fix desktop sharing, and improve error handling.
2025-11-06 22:23:51 +01:00
Goffi
9a2830c7e2 frontends (tools/webrtc): improve ICE candidate buffering:
Buffer and wait for remote description to be set before sending ICE candidate. This avoids
the sending of ICE candidates before the negotiation is done.
2025-11-06 22:18:58 +01:00
Goffi
40b1c93f4c frontends (tools/webrtc): Fix PIP merging. 2025-11-06 22:15:47 +01:00
Goffi
d55315e75f tools (webrtc): improved pipeline:
- Adjust parameters and elements to better handle the buffering and jitter.
- Add logging, better error handling.
2025-11-06 22:10:13 +01:00
Goffi
cd8516f0bb plugin XEP-0167: fix ICE credentials handling. 2025-10-29 13:20:56 +01:00
Goffi
2fce8ba7d6 frontends (tools/webrtc): Better error handling and logging 2025-10-29 13:20:45 +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
d2f4623b53 doc: Add How-To for Email Gateway:
This How-To complete installation instruction with an easy-to follow document to
completely install the Email <=> XMPP gateway.

fix 466
2025-10-10 17:44:04 +02:00
Goffi
c1cb70ac1a doc (installation): Update instructions:
- Instructions have been checked and updated. OS packages dependencies have been added for
  Arch Linux.
- Added missing package.
- Reordered/refreshed instructions.
- Old/not relevant content has been removed.
- Tested on latest docker images of Debian/Arch/Unbutu.

rel 466
2025-10-10 17:44:04 +02:00
Goffi
8c35f015f1 tools (common/uri): fix missing f for f-string. 2025-10-10 17:44:04 +02:00
Goffi
fcb76a7dde cli (uri/build): fix call to uri.build_xmpp_uri. 2025-10-10 17:44:04 +02: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
e4e879d871 core (memory/sqla): Improve file_update by using raw value:
ORM was used, resulting in deserialisation/reserialisation of value checked for race
condition during update. In addition to the overhead, this could lead to modification even
if the value didn't change (e.g., because of JSON key order changed).

The raw value is not used to check if the row has not change between `select` and
`update`, making the method more robust.
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