Commit graph libervia-backend/sat/core
Author SHA1 Message Date
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
Goffi
c0a3f8d141 core (log): logging with Twisted now uses the new twisted.logger 2020-05-25 15:46:21 +02:00
Goffi
b5a872aed3 core (constants): added theme key 2020-05-18 23:30:55 +02:00
Goffi
47ec15cc46 core: image convertion + SVG support:
/!\ new optional dependency: CairoSVG (with installed `[SVG]` extra)

- new `convert` method in `tools.image` to save an image in an other format, with support
  for SVG (when CairoSVG is available)
- new `imageConvert` method is available for frontends
2020-04-19 16:53:44 +02:00
Goffi
88072e0453 core, frontends: avatar refactoring:
/!\ huge commit

Avatar logic has been reworked around the IDENTITY plugin: plugins able to handle avatar
or other identity related metadata (like nicknames) register to IDENTITY plugin in the
same way as for other features like download/upload. Once registered, IDENTITY plugin will
call them when suitable in order of priority, and handle caching.

Methods to manage those metadata from frontend now use serialised data.

For now `avatar` and `nicknames` are handled:

- `avatar` is now a dict with `path` + metadata like `media_type`, instead of just a string
  path
- `nicknames` is now a list of nicknames in order of priority. This list is never empty,
  and `nicknames[0]` should be the preferred nickname to use by frontends in most cases.
  In addition to contact specified nicknames, user set nickname (the one set in roster) is
  used in priority when available.

Among the side changes done with this commit, there are:

- a new `contactGet` bridge method to get roster metadata for a single contact
- SatPresenceProtocol.send returns a Deferred to check when it has actually been sent
- memory's methods to handle entities data now use `client` as first argument
- metadata filter can be specified with `getIdentity`
- `getAvatar` and `setAvatar` are now part of the IDENTITY plugin instead of XEP-0054 (and
  there signature has changed)
- `isRoom` and `getBareOrFull` are now part of XEP-0045 plugin
- jp avatar/get command uses `xdg-open` first when available for `--show` flag
- `--no-cache` has been added to jp avatar/get and identity/get
- jp identity/set has been simplified, explicit options (`--nickname` only for now) are
  used instead of `--field`. `--field` may come back in the future if necessary for extra
  data.
- QuickContactList `SetContact` now handle None as a value, and doesn't use it to delete the
  metadata anymore
- improved cache handling for `metadata` and `nicknames` in quick frontend
- new `default` argument in QuickContactList `getCache`
2020-04-14 21:00:33 +02:00
Goffi
7201730938 core (xmpp): helper method to launch a plugin method:
the `p` client method can be used to launch a method for a plugin, with a default value if
the plugin is not available (or an Exception to raise).
2020-04-03 18:02:31 +02:00
Goffi
1a5996ac4b core (exceptions): new MissingPlugin exception:
it is used when a feature needs an inactive or unavailable plugin.
2020-04-03 18:02:27 +02:00
Goffi
cf82140690 core (xmpp): properly clean profile data in case of startConnection failure:
- profile is now always removed from profiles_connecting
- an exception is raised if client already exists only if client is connected. Otherwise,
  it's deleted (this allow to keep session open to e.g. modify settings in case of failure
  during connection)
2020-04-01 16:17:09 +02:00