Commit graph

4,716 commits

Author SHA1 Message Date
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
b4f88480db bridge (dbus): export the D-Bus name only once the plugins are loaded:
client connecting too early were seeing an incomplete plugin interface.
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
ed66cfd458 git: ignore Sphinx build artifacts 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
bdca7d2354 tools (common/async_process): add a cleaning mecanism:
PID of commands run with `CommandProtocol` are now tracked in memory and stopped/killed on
exit. A `pid_file` argument can be use to track the file on disk, which is useful to
detect stalled processes after a crash/unclean ending of the backend.

Add helper methods to stop and kill those processes.
2026-09-23 18:19:03 +02:00
Goffi
0fbf74aad6 tools (common/template): add brands style in icon definitions:
`brands` is notably needed for the new XMPP icon available in font-awesome.
2026-09-20 12:10:11 +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
45024d913e doc (howto backup, cli/backup): document the new backup mechanism:
Add a "How-To" for backup, and document the new `backup` commands

fix 480
2026-09-15 11:48:11 +02:00
Goffi
4ce7c807be tests (backup): add tests for backup engine:
rel 480
2026-09-15 11:48:11 +02:00
Goffi
f22af42ece cli (backup): add backup commands:
Add the `li backup` commands with `export`, `import` and `verify`:

- data types selection (`-i`/`-e`) and profile selection (`-p`), `--no-db` on export, `--use-db` on
  import
- GPG symmetric encryption of the archive (`--encrypt`)
- progression is shown, with ETA
- the commands can run without a backend connection (import from DB MUST be run without
  backend)
- cli (base): `BRIDGELESS_COMMANDS` holds the name of the few commands which can be run
  without backend.

rel 480
2026-09-15 11:48:11 +02:00
Goffi
86a91b5850 tools (backup): add backup/restore:
Add an offline backup/restore engine in `tools.backup`:

- format based on XEP-0227 (pie), extended with Libervia sections
- handle several data types (params, private, roster, pep , gpg, files and db)
- per profile export/import and global handlers
- a manifest is used to have metadata and checksums
- full database snapshot/restore with the `db` type
- sqla: add `get_db_url`
- tools.common.utils: add `is_safe_relpath` and `is_process_running`

rel 480
2026-09-15 11:48:11 +02:00
Goffi
63b3f4dfe2 tests (xep_0272): assert the group setup call in the preparation test 2026-09-15 11:48:11 +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
18d55242b9 Fix generated path in .gitignore 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
2be5d62dfc memory (sqla): add after_uid filter in history_get 2026-08-26 17:55:01 +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
2cfe6c7a82 tools (common/template): add jid_resource filter 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
a3cc29ca3c cli (debug/monitor): Add timestamp to XML logs. 2026-08-12 18:12:02 +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
b88d335d92 memory (sqla): Get original message in thread in history_get:
When using `thread_id` filter, original message could be missing (notably with a reply).
We now include it with `History.uid == filters["thread_id"]`.
2026-07-21 19:13:37 +02:00
Goffi
4b235fc86b core (xmpp): Prevent non printable message to be displayed:
We now use `client.is_message_printable` to check if message is printable. If it's not, we
block storage in DB and sending to bridge. The previous code could let message pass if
metadata were stored in `extra`.
2026-07-21 19:11:17 +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
33132827f3 cli (application): new update command:
Update an application, or all of them.
2026-07-21 11:50:20 +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
53a83b6042 doc (cli/serverless): serverless commands documentation:
Document the commands `discover` and `info`.

fix 479
2026-07-17 23:27:47 +02:00
Goffi
e013f9ba66 cli (serverless): New serverless commands:
New `serverless` commands. For now only `discover` and `info` are implemented:

    - `discover` find other peers on LAN
    - `info` get various infos on serverless status (for now, our own device ID,
      advertised service name, and the number of found peers)

rel 479
2026-07-17 23:27:47 +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
e05c69267d core (main, xmpp): fix cleaning methods:
Cleaning methods per-profile (`profile_disconnected`) and per-plugin (`unload`) were not
called correctly. They are now called on shutdown with the `before/shutdown` Twisted
event.
With this event, it's still possible to call Deferred and do cleaning requiring async
calls.

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