Commit graph

4,471 commits

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
2b9b4e6bbf Convert data to JSON when using JSON output:
`output` with JSON was expecting a JSON str, this patch change it to use the `data`
argument, so a python object is given and converted to JSON
2026-02-23 12:56:36 +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
c46f0716dc tools (common/async_process): Accept bytes as stdin 2026-02-18 17:44:26 +01:00
Goffi
77e2c9ce11 plugin (android): add missing import. 2026-02-18 17:44:23 +01:00
Goffi
fa937e3e67 core(launcher): Force exit on early exception:
The backend was not properly exiting in case of early exception (e.g. configuration
error). It seems to be related to the use of the `@aio` decorator, but couldn't find the
exact issue with loop. The use of `os._exit` is a workaround for now, until the fix is
inspected more deeply and properly fixed.
2026-02-18 17:37:52 +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
2e7ada2b6d core (xmpp): Fix type hints for Tor:
The type hints were using `Tor` directly, causing a failure if `txtorcon` was not installed.
This patch fixes it by using a type hints string instead.
2026-01-13 10:56:53 +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
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