Commit graph libervia-backend/sat
Author SHA1 Message Date
Goffi
02472de2c4 plugin XEP-0234: make fileJingleRequest async to fix call of initiate 2020-12-04 12:32:05 +01:00
Goffi
3f9e61662c core (constants): added EXIT_CONFLICT 2020-12-04 12:30:46 +01:00
Goffi
125addc542 plugin XEP-0077: use xmpp_domain when set for host 2020-11-27 16:29:06 +01:00
Goffi
6ebc7da1f1 tools(utils): fixed error catching when getting repository data with pkg_resources 2020-11-16 14:44:43 +01:00
Goffi
190f473cab plugin app manager: fixed public_url value check 2020-11-14 21:20:48 +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
aab9a8bf91 plugin XEP-0166: new trigger point + coroutines + helper methods:
- a new `XEP-0166_initiate` async trigger point is available
- `initate` is now a coroutine
- `jingleSessionInit` in applications and transports handlers are now called using
  `utils.adDeferred`
- new `getApplication` helper method, to retrieve application from its namespace
- new `getContentData` helper method to retrieve application and its argument from content
2020-11-12 14:53:15 +01:00
Goffi
46c763cbf7 plugin file, XEP-0234: registering is now done by class + use of async:
- instead of registering a callback, a file sending manager now register itself and must
  implement some well known method (`fileSend`, `canHandleFileSend`) and optionally a
  `name` attribute
- `utils.asDeferred` is now used for callbacks, so all type of methods including
  coroutines can be used.
- feature checking is now handled by `canHandleFileSend` method instead of simple
  namespace check, this allows to use a method when namespace can't be checked (this is
  the case when a file is sent to a bare jid with jingle)
2020-11-12 14:53:15 +01:00
Goffi
afacc8d4c1 plugin XEP-0329: minor reformatting 2020-11-12 14:53:15 +01:00
Goffi
1fc6c1f66b plugin XEP-0065: some cleaning:
- reordered imports and removed useless try/except
- log warning before sending error
- avoid crash if connection is lost before session has has been received in server mode.
- fixed missing string formatting keywords
- renamed incorrect attribute and show explicitly that it's not used
2020-11-12 14:53:15 +01:00
Goffi
876ec80598 plugin XEP-0077: disconnect client when deleting self account:
where profile's XMPP account is deleted, its client must be explicitely disconnected to
avoid automatic reconnection, which would obviously fail.
2020-11-12 14:53:15 +01:00
Goffi
06503f83aa plugin XEP-0363: fixed invalid reference to slot in catched exception:
`slot` was referenced in an exception where it can't exist. This fix avoid a crash and
skip the handler when a StanzaError is catched.
2020-11-12 14:53:15 +01:00
Goffi
e5a0948b71 test: fixed use of client.host in legacy test:
those tests are not maintained anymore, but as the use of `client.host` as been fixed
elsewhere, it was the occasion to do it there too. Those legacy tests should be ported or
to the new workflow, or deleted if they are not relevant anymore.
2020-11-12 14:53:15 +01:00
Goffi
2d3d30d42b tools (async_trigger): use utils.asDeferred for async triggers:
A corouting or blocking method can now be used for async triggers.
2020-11-12 14:53:15 +01:00
Goffi
1aeeffd399 tools (xml_tools): domish.Element pretty formatting functions:
- `pFmtElt`: pretty format a `domish.Element`
- `ppElt`: use the above function to pretty print a `domish.Element`
2020-11-12 14:53:15 +01:00
Goffi
54494409d2 tools (xml_tools): added with_parent and with_children argument to elementCopy 2020-11-12 14:53:15 +01:00
Goffi
4e803712f7 plugin XEP-0060: use xml_tools.parse instead of wokkel.generic.parseXml:
`xml_tools.parse` does a better parsing, as wokkel's `parseXml` may be missing text
nodes.
2020-11-12 14:53:15 +01:00
Goffi
1167c12c6f tools(xml_tools): fixed <div> unwrapping + added parse instance:
`<div>` unwrapping could fail when a text node was a sibling of the top element (could
easily happen ith a `\n` line feed added by an editor). This is fixed by filtering on
IElement with `elements()`.

A `parse` instance has been added as it is not necessary to create a new `ElementParser`
each time that we want to parse something.
2020-11-12 14:53:15 +01:00
Goffi
d52d8af6cf plugin XEP-0047: fixed file reading and content encoding 2020-11-12 14:53:15 +01:00
Goffi
4bc90ee0bc plugin ip: don't set to anymore for IQ stanza, as we send it to our server 2020-11-12 14:53:15 +01:00
Goffi
b6d26f3a67 core (memory/params): removed legacy "Register new account" label, it's not used anymore 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
a3be4ed11d plugin app manager docker: typo 2020-10-20 09:12:38 +02:00
Goffi
a692ba8e2e tools (common/tls): removed unused import 2020-10-19 09:28:26 +02: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
e91cd1cc66 plugin app manager docker: weblate SàT app file for Docker 2020-09-28 21:10:33 +02:00
Goffi
e08be7f855 plugin app managed docker: handle Docker application with App Manager 2020-09-28 21:10:33 +02:00
Goffi
e1f123f120 plugin app manager: first draft:
/!\ new optional dependency: pyyaml

this plugin manage the life cycle of external applications. Application handlers register
to it.

Data needed to launch an application as set in YAML files. Local data types are used to
get values directly from SàT:

- !sat_conf to retrieve a configuration value
- !sat_generate_pwd to generate a password
- !sat_param for parameters specified a launch

Data can be exposed when an instance is launched, this can be used to specify the port
(notably the one used for web), or a generated password.
2020-09-28 21:10:30 +02:00
Goffi
0250053e19 core (memory/memory): added getCachePath method to get a cache dir from a namespace. 2020-09-28 17:00:14 +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
03cffe789c core: minor typos, docstring/comments update 2020-09-20 14:05:40 +02:00
Goffi
f7a83dd054 component file sharing: added missing owner filtering in _retrieveFiles 2020-09-20 14:04:22 +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
93e1250a59 plugin XEP-0329: fix filtering by owner on components 2020-09-20 11:03:24 +02:00
Goffi
f3bb26f9d9 core (memory/memory): public_id should not be used when creating parent dirs 2020-09-17 23:07:12 +02:00
Goffi
c9b2c1d27d component file sharing: fix used of self.files_path in _retrieveFiles 2020-09-17 21:42:14 +02:00
Goffi
629901674b plugin XEP-0329: fix conflict check + directory creation in onComponentCreateDir 2020-09-17 21:41:19 +02:00
Goffi
280f86881a core (memory/memory): fixed directory creation in setFile 2020-09-17 21:40:23 +02:00
Goffi
6601714e0e plugin XEP-0329: typo 2020-09-17 19:01:02 +02:00
Goffi
f321952cbe plugin XEP-0329: added FISCreateDir method:
This method is used to create a directory for component file sharing, and optionally set
its configuration.
2020-09-17 16:42:00 +02:00
Goffi
a82f7108a2 core (memory/memory): use str for path in getFiles and setFile to allow use of Path instances 2020-09-17 16:34:22 +02:00
Goffi
fca70e1710 plugin XEP-0313: fix getting MAM archive when history is empty 2020-09-17 11:27:57 +02:00
Goffi
e60b64d876 plugin XEP-0313: fixed MAMGet signature 2020-09-17 10:46:13 +02:00
Goffi
7f713e39f3 plugin XEP-0329: better error handling in onComponentAffiliationsGet 2020-09-14 09:23:23 +02:00
Goffi
4c5c6a081a plugin XEP-0077: fixed "check_certificate" handling 2020-09-13 22:49:12 +02:00
Goffi
5ec9d7ffec plugin invitation: if "thumb_url" is not set, try to use one from list of interests 2020-09-05 20:23:25 +02:00