Commit graph

3,746 commits

Author SHA1 Message Date
Goffi
44906f3bc3 doc (components): documentation of comments_max_depth option and threads conversion:
ActivityPub to XMPP threads conversion is detailed.

fix 364
2022-03-22 17:00:42 +01: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
317e8a6a94 core (memory/sqla): new table/mapping to handle Pubsub node subscriptions:
node subscriptions can now be cached, this can be useful for components which must keep
track of subscibers.

rel 364
2022-03-22 17:00:42 +01:00
Goffi
f90d76aa18 core (memory/migration): ignore FTS table when autogenerating script for migration:
SQLite Full-Text Search stable are not associated to Python object and can't be detected
by Alembic. To avoid the generation of unwanted drop commands, they are now ignored when
autogenerating migration scripts.

rel 364
2022-03-22 17:00:42 +01:00
Goffi
5ca925996d comp AP: helper methods to get AP objects:
rel 364
2022-03-22 17:00:42 +01:00
Goffi
16664ab939 comp AP gateway: regular expression to parse Signature header:
rel 364
2022-03-22 17:00:42 +01:00
Goffi
7588951bd9 plugin XEP-0277: methods to check is a node is a comments node and to get its parent
rel 364
2022-03-22 17:00:42 +01:00
Goffi
3ee5e1bbba tools (utils): fix getRepositoryData crash:
- use `hg_path` to be sure to use the right executable
- better exception handling
2022-03-22 17:00:42 +01:00
Goffi
0112d503ff plugin XEP-0059, cache: allow those plugins to work in component mode
rel 364
2022-03-22 17:00:42 +01:00
Goffi
81513eb7d8 plugin XEP-0060: specify sender using client.jid in subscribe:
this is necessary to do a subscription with a component managing a virtual JID (i.e. not
the JID of the component itself, but the one linked to a account, see
`SatXMPPComponent.getVirtualClient`).

rel 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
127d383eb5 tests (ap-gateway): fix use of outbox URL to get items 2022-03-21 16:37:19 +01:00
Goffi
a8ec84f3ec doc (components): update AP component documentation:
- add `configuration` section
- update instructions on AP actor handle <=> JID/node conversion
- explain how to get AP messages from XMPP
- explain how to get XMPP items for AP
- notes to explain tricks and implementations details

fix 363
2022-01-31 18:35:52 +01:00
Goffi
d1a623d12b tests (unit): AP gateway unit tests:
are covered:

- AP actor handle to XMPP JID/pubsub node
- XMPP JID/pubsub node to AP actor handle
- AP request to JID/pubsub node (AP collection to items/RSM metadata conversion)
- pubsub request to AP actor (pubsub request with RSM to AP collection/pagination requests
  conversion)

ticket 363
2022-01-31 18:35:52 +01:00
Goffi
e393c908b0 tools (xml_tools): fix widget_args modification in _dataFormField2XMLUIData:
in `textbox` widget, the first arg was modified with all values, lettings other ones
unchanger, resulting in invalid number of arguments. This has been fixed by replacing all
args with the new value.
2022-01-31 18:35:52 +01:00
Goffi
589468041a tests (e2e/CLI/set_get): fix RSM request:
items are stored in chronological order in Pubsub, and as we want the more recent one, we
need to set `before=''`. Otherwise, we can get a wrong item from a previous test.
2022-01-31 18:35:52 +01:00
Goffi
a8cadf7fc3 docker: don't move .egg_info files anymore:
moving `.egg_info` cause trouble, and doesn't seem necessary anymore.
2022-01-31 18:35:52 +01:00
Goffi
3801db7835 component AP gateway: split plugin in several files:
constants, HTTP server and Pubsub service have been put in separated files.

rel: 363
2022-01-31 18:35:49 +01:00
Goffi
643d491e80 component AP gateway: JID/node ⟺ AP outbox conversion:
- convert a combination of JID and optional pubsub node to AP actor handle (see
  `getJIDAndNode` for details) and vice versa
- the gateway now provides a Pubsub service
- retrieve pubsub node and convert it to AP collection, AP pagination is converted to RSM
- do the opposite: convert AP collection to pubsub and handle RSM request. Due to
  ActivityStream collection pagination limitations, some RSM request produce inefficient
  requests, but caching should be used most of the time in the future and avoid the
  problem.
- set specific name to HTTP Server
- new `local_only` setting (`True` by default) to indicate if the gateway can request or
  not XMPP Pubsub nodes from other servers
- disco info now specifies important features such as Pubsub RSM, and nodes metadata

ticket 363
2022-01-25 17:54:06 +01:00
Goffi
23640ed33f cli (blog/get): fix default output when a value is None 2022-01-25 17:27:39 +01:00
Goffi
01a1bf8691 plugin XEP-0060, XEP-0163, XEP-0277, text syntaxes: make those plugins usable with components 2022-01-25 17:26:05 +01:00
Goffi
9b5d3ea17d tools (common): new async_utils module with an async version of lru_cache 2022-01-25 17:25:10 +01:00
Goffi
ab4468a50a plugin XEP-0277: various fixes + async:
- `NS_ATOM` is now set at class level, so it can be accessed by other plugins
- set `author` to `None` when no `name` element is found
- make `data2entry` a corountine
- fix incorrect use of yield in `trigger.point`
2022-01-25 17:22:15 +01:00
Goffi
738ef6ccf4 plugin XEP-0060: None must not be used for getItems's node 2022-01-25 17:16:37 +01:00
Goffi
e94df887d4 component file sharing: set server name at render time 2022-01-25 17:15:00 +01:00
Goffi
0d214783a3 component file sharing: fix incorrect use of returnValue in items async method 2022-01-25 17:13:32 +01:00
Goffi
5c6bac6ade memory (sqla): fix complete setting when index is None in getItems 2022-01-25 17:09:54 +01:00
Goffi
d7945138f7 memory (sqla): don't set keys with None as value for RSM in getItems 2022-01-25 17:09:11 +01:00
Goffi
7ed5c0ff9d memory (disco), core (main): new hasIdentity method 2022-01-25 17:07:15 +01:00
Goffi
7216345e31 plugin XEP-0384: fix typo in attribute 2022-01-25 17:06:28 +01:00
Goffi
03ca0037f3 tools (xml_tools): implement list-multi in _dataFormField2XMLUIData:
`list-multi` was missing and thus these data form field type was not supported, resulting
in those fields shown as a text field.

Due to legacy, current implementation use a hack to split values, this should be fixed
later by using proper serialisation.
2021-12-08 15:45:57 +01:00
Goffi
7b05d97229 merge bookmark 0.9 2021-12-01 16:13:31 +01:00
Goffi
f9ee1f6bc9 Added tag v0.8.0 for changeset f97be63871e4 2021-11-30 23:31:09 +01:00
Goffi
9f66c8f769 v0.8.0 release 2021-11-30 23:31:07 +01:00
Goffi
9eecdc184c tools (common/async_process): use parent environment by default 2021-11-30 17:28:42 +01:00
Goffi
97f6d1010a core (memory/param): don't crash when getting unset int value 2021-11-30 17:28:03 +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
0008d3478e plugin events: store interest_id in data:
ID of the item in list of interest is needed to correctly modify (and notably retract) an
event.
2021-11-12 17:18:23 +01:00
Goffi
099128918d changelog: minor update following renaming 2021-11-12 17:16:40 +01:00
Goffi
2cc637cdfe cli (base): use XTERM_VERSION to detect XTerm:
Using `TERM` is not good as it is used by other terminal emulators which are incompatible
with ANSI sequences (seen with `cool-retro-term`).
2021-11-06 18:53:00 +01:00
Goffi
1419f29df6 cli (debug/theme): display currently used background 2021-11-06 17:09:28 +01:00
Goffi
b1529c1ebf cli (base): better background detection:
- ANSI escape code detection is only used on terminals known to be compatible (currently
  xterm, konsole, and all VTE based ones)
- `COLORFGBG` environment variable is used as fallback
- if both methods fail, `dark` is used

This should avoid problems with incompatible terminals (e.g. on QTerminal, users had to
press `[ENTER]` each time).

fix 406
2021-11-06 17:08:50 +01:00
Goffi
b374f17eb6 tests (e2e/web): add basic tests for generic lists 2021-11-05 18:11:24 +01:00
Goffi
b7c1579919 tests (e2e/run_e2e): fix inappropriate use of -T option 2021-11-05 18:11:24 +01:00
Goffi
38ec47a4da plugin comp file sharing: don't use Deferred in return value 2021-11-05 18:11:24 +01:00
Goffi
ecc6f96990 plugin email invitations: re-use existing invitation for a given email:
if an invitation is done on an email which has already received an invitation, it is
re-used and no new XMPP account or Libervia profile is created (the name is modified
though).

This is currently done in an inefficient way due to `LazyPersistentBinaryDict` limitations
(all invitations are loaded and checked to find the email). A more efficient check should
be easier to implement with storage changes in 0.9 .
2021-11-05 18:11:18 +01:00
Goffi
d39a80ee5f plugin XEP-0264: replace SIZE_FULL_SCREEN by SIZE_BIG:
`SIZE_FULL_SCREEN` may result in large files, and BoB is currently used to transfer them,
resulting in potentially large stanza. As a result, Libervia profile can be disconnected
from server if stanza max size is reached.

As a temporary workaround, `SIZE_BIG` is now the maximum size used. This should be fixed
in 0.9 with a proper way to transfer large thumbnails (i.e. not BoB).
2021-11-05 18:08:39 +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
3838f04169 install: requirements update 2021-11-04 18:13:55 +01:00