Commit graph libervia-backend/sat/core
Author SHA1 Message Date
Goffi
07109f0354 core (types): add is_component to SatXMPPEntity 2022-06-29 10:14:14 +02:00
Goffi
3ccd4280ac core (xmpp): adapt message workflow to components:
message workflow were not used for components so far. This patch activate it, normalise
namespace to the client one to simplify parsing, and use SatXMPPComponent.sendHistory and
SatXMPPComponent.receiveHistory to indicate if a component should store sent and received
message in database (they both default to False).

OTR plugin is deactivated for components.

rel 367
2022-06-17 14:15:23 +02:00
Goffi
441ae82fcb core (constants): type hints 2022-06-17 14:15:23 +02:00
Goffi
fa81d96d79 comp AP gateway: message conversion:
Convert direct AP items to XMPP `<message>` stanzas, and vice versa.
Documentation will follow soon to explain the behaviour.

rel 366
2022-05-24 17:57:36 +02:00
Goffi
d0973d121d core: remove useless method (it's available directly in client) 2022-05-16 13:02:59 +02:00
Goffi
c8025a52eb core: method to know if a profile/entity is an admin:
the new `is_admin` SatXMPPEntity property tell if it's an administrator.

Admin JIDs are retrieve on init, so they can be looked after when profle is not available
(notably when a component handle a request and has only a JID available). The new
`memory.isAdminJID` method is then used.
2022-05-15 14:14:52 +02:00
Goffi
0a23ca36cb core (xmpp): add a server_jid property 2022-05-13 17:52:43 +02:00
Goffi
8a2154ccca comp AP gateway: signature checking, caching and threads management:
- HTTP signature is checked for incoming messages
- AP actor can now be followed using pubsub subscription. When following is accepted, the
  node is cached
- replies to posts are put in cached pubsub comment nodes, with a `comments_max_depth`
  option to limit the number of comment nodes for a root message (documentation will come
  to explain this).

ticket 364
2022-03-22 17:00:42 +01:00
Goffi
b5ea5bfdc8 core (xmpp): new getVirtualClient for components:
this method is used to make a client with a given JID instead of component's JID. This is
needed when a JID managed by the component (e.g. associated to a legacy service account)
must be used.

rel 364
2022-03-22 17:00:42 +01:00
Goffi
7ed5c0ff9d memory (disco), core (main): new hasIdentity method 2022-01-25 17:07:15 +01:00
Goffi
7b05d97229 merge bookmark 0.9 2021-12-01 16:13:31 +01:00
Goffi
68092dd2bb core (xmpp): specify profile when logging a connection problem 2021-11-30 17:27:26 +01:00
Goffi
14d00a9dda merge bookmark @ 2021-11-12 17:21:24 +01:00
Goffi
7c37f32dc4 core: don't callback self.conn_deferred if already called:
if the connection has been lost (e.g. forced disconnection by server),
`self.conn_deferred` may have already been called, thus this is now checked to avoid an
exception.
2021-11-04 18:27:36 +01:00
Goffi
8eddf8c271 core (core_types): add jid to SatXMPPEntity 2021-09-26 16:38:34 +02:00
Goffi
50d7cb2a51 merge bookmark @ 2021-09-08 11:20:37 +02:00
Goffi
12209c1bdc core (main): check plugin modes and skip pluggin/log an error if value is invalid 2021-09-08 11:16:35 +02:00
Goffi
f2988ea7be core (sat_main): fix the "Could not initialize backend" error logging 2021-09-08 11:16:29 +02:00
Goffi
fe502fc0fc merge branche "@" 2021-08-28 15:32:58 +02:00
Goffi
547eb9feba bridge: bridge can now be set using environment variable:
The `LIBERVIA_BRIDGE_NAME` environment variable can now be used to specify the bridge to
use. If set and different from empty string, the environment has precedence over config
file value.

For `pb` bridge, the following environment variable can also be used:

- LIBERVIA_BRIDGE_PB_CONNECTION_TYPE
- LIBERVIA_BRIDGE_PB_HOST
- LIBERVIA_BRIDGE_PB_PORT
2021-08-28 15:26:02 +02:00
Goffi
92c0c09eb2 plugin pubsub cache: Pubsub Caching implementation 2021-07-29 22:51:01 +02:00
Goffi
42979a7140 plugin XEP-0060: handle purge notifications 2021-07-29 15:54:54 +02:00
Goffi
fcbbc2aeed core (xmpp): renamed SatRosterProtocol.presenceSubscribed to isSubscribedFrom (and added isSubscribedTo) 2021-07-28 22:15:31 +02:00
Goffi
4421eefbf3 merge changes from main branch 2021-06-17 13:05:58 +02:00
Goffi
d5f0d7ec8e core (xmpp): show "Libervia" without the "(backend)" component in version 2021-06-09 11:27:22 +02:00
Goffi
8d9d911497 core (xmpp): catch cancelError in pre_xml_treatments in message workflow 2021-06-03 15:40:57 +02:00
Goffi
97df5f8be3 core: various changes and fixes to work with new storage and D-Bus bridge:
- fixes coroutines handling in various places
- fixes types which are not serialised by Tx DBus
- XEP-0384: call storage methods in main thread in XEP: Python OMEMO's Promise use thread
  which prevent the use of AsyncIO loop. To work around that, callLater is used to launch
  storage method in main thread. This is a temporary workaround, as Python OMEMO should
  get rid of Promise implementation and threads soon.
2021-06-03 15:21:43 +02:00
Goffi
6c853262e1 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Due to recent SQLAlchemy integration, Libervia is now using AsyncIO loop exclusively as
main loop, thus GLib's one can't be used anymore (event if it could be in a separate
thread).
Furthermore Python-DBus is known to have design flaws mentioned even in the official
documentation.

Tx DBus is now used to replace Python-DBus, but only for the backend for now, as it will
need some work on the frontend before we can get completely rid of it.
2021-06-03 15:21:43 +02:00
Goffi
a5f225e1ea core (memory/storage): backend storage is now based on SQLAlchemy 2021-06-03 15:20:47 +02:00
Goffi
7e6026e090 core (xmpp): fix typo in sendError 2021-05-06 18:10:09 +02:00
Goffi
672d35d44f core (xmpp): added appCondition argument to sendError 2021-05-05 12:58:11 +02:00
Goffi
24a4b12ac4 frontends: use new EXIT_BACKEND_NOT_FOUND exit code:
- new EXIT_BACKEND_NOT_FOUND (5) is used when frontend can't find backend with the bridge.
  It differs from EXIT_BRIDGE_ERROR (3) which is used when something went wrong when
  connecting to backend.
- use this exit code in quick app and in jp
2021-03-23 21:21:00 +01:00
Goffi
018d09caaa Renamed the project from "Salut à Toi" to "Libervia":
This renaming follows the decision taken at the General Assemblee of January 27th 2021 (cf.
https://repos.goffi.org/sat_docs/raw-file/tip/association/2021-01-27%20-%20compte%20rendu%20de%20l%27AG%20extraordinaire.pdf)
2021-03-20 20:42:04 +01:00
Goffi
dc86957043 date update 2021-03-19 15:45:14 +01:00
Goffi
3f9e61662c core (constants): added EXIT_CONFLICT 2020-12-04 12:30:46 +01:00
Goffi
6f07157904 core (launcher): exit code can now specified
Exit code can now be specified by setting the `_exitCode` variable in
`twisted.application.app` module.
2020-11-14 21:19:40 +01:00
Goffi
883a07c591 core (constants): moved shell exit code constants to core constants:
Well defined shell exit code are generally useful, not only for jp, thus constants have been
moved to core.
2020-11-12 14:53:15 +01:00
Goffi
63e61fc036 plugin XEP-0353: Jingle Message Initiation implementation:
This plugin uses the new `XEP-0166_initiate` trigger to initiate a Jingle session with
messages if the peer jid has no resource specified.
On reception, if the sender is not in our roster, a confirmation is requested to user to
avoid leaking presence and IP. If user refuses the session for somebody not in roster,
nothing is sent at all (the request is just ignored).
2020-11-12 14:53:15 +01:00
Goffi
da22ab2ce2 core (xmpp): client.roster now implements __contains__
Now a jid can be tested directly with "entity_jid in client.roster".
2020-11-12 14:53:15 +01:00
Goffi
d7bd6e56eb core: use utils.asDeferred for launchCallback so coroutines can be used 2020-11-12 14:53:15 +01:00
Goffi
459c169e63 doc, core: typos 2020-11-12 14:53:11 +01:00
Goffi
59b7820b3f core: sat.conf is now first checked in /etc/_sat.conf for system-related settings 2020-10-15 16:13:30 +02:00
Goffi
c47ebb39a0 core: plugins can now be loaded from a directory:
A plugin can now be a directory with a name starting by `plugin_`. It will then be loaded
as a module. The `__init__.py` file must contain the `PLUGIN_INFO` dict with metadata.
2020-09-20 14:05:40 +02:00
Goffi
50df9e6537 plugin XEP-0329, core(xmpp): moved _compParseJids to SatXMPPComponent:
This method to retrieve owner and peer JID from an element is generally useful for
components, thus it has been moved. The part to retrieve owner JID from local JID has been
splitted in its own `getOwnerFromJid` method.
2020-09-20 14:04:11 +02:00
Goffi
edd33a126d core (xmpp): text can now be specified in sendError 2020-08-01 15:59:49 +02:00
Goffi
bdf8f38aa2 core: findByFeatures type hints 2020-06-09 06:16:52 +02:00
Goffi
b9fa21ab47 core: getLocalPath now returns a Path 2020-05-29 21:02:20 +02:00
Goffi
f48ad8179c core (launcher): fixed launching of twistd when no subparsed is specified 2020-05-29 20:57:23 +02:00
Goffi
d3b7510c0e core (launcher): extra arguments can now be passed the service with bg, fg and dbg:
- `dbg` is an alias for `debug`
- extra arguments can be passed to the service, use `-- --help` to see them`
2020-05-25 16:15:05 +02:00
Goffi
a1eb68c1e7 core: replaced sat shell script by a python script:
the backend is now launched by `sat.core.launcher`, and the script is generated during
installation with a new entry point in `setup.py`.
2020-05-25 15:50:01 +02:00