Commit graph

3,443 commits

Author SHA1 Message Date
Goffi
48cd6ca473 contrat social: replaced formulation about censorship:
The formulation "Nous ferons tout notre possible pour lutter contre toute tentative de
censure." as been replaced by "Nous ferons tout
notre possible pour lutter contre toute tentative de censure, y compris en protégeant la
parole des victimes de harcèlement, discours haineux, menaces, humiliations et tout ce
qui pourrait mener à de l'autocensure."

This as been requested in annual general meeting of 2019-11-23
2020-12-05 11:53:11 +01:00
Goffi
639a185b54 contrat social (en): replaced "Mankind" by "Humanity":
this was requested in annual general meeting of 2019-11-23
2020-12-05 11:45:36 +01:00
Goffi
50fd4f48d0 tests (e2e/libervia): more stable test_user_can_log_in + photos tests 2020-12-04 12:39:44 +01:00
Goffi
b034e46543 tests (e2e): new fixture to share data between tests:
this is usefull in some edge cases when tests are dependents of each other.
2020-12-04 12:38:38 +01:00
Goffi
ad3aea8ec0 tests, doc(testing): added pytest-dependency plugin to backend_e2e image + doc 2020-12-04 12:37:38 +01:00
Goffi
7527b54bd7 tests (e2e/libervia/conftest): new log_in_account1_s2 fixture 2020-12-04 12:36:06 +01:00
Goffi
0328129b98 tests (e2e/conftest): create a test account on server3.test 2020-12-04 12:35:00 +01:00
Goffi
736f91e557 tests (e2e/conftest): check new exit code for conflict to avoid crashing if test accounts already exist 2020-12-04 12:34:24 +01:00
Goffi
095ec0c71a jp (account): better exit code handling 2020-12-04 12:32:56 +01:00
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
b552e37a5b docker (e2e): use shared volume for SàT's local dir:
It is necessary to have a shared local dir to let libervia access files.
2020-12-04 12:30:00 +01:00
Goffi
be611f8a53 doc (testing): typos 2020-12-04 12:27:38 +01:00
Goffi
77e3f7a782 doc: documentation for testing in new contributing section 2020-11-27 16:40:26 +01:00
Goffi
fb216829c3 tests, docker(e2e): added e2e tests for Libervia:
- moved jp tests to `e2e/jp`
- new fixtures
- adapted docker-compose
- improved `run_e2e` with several flags + report on failure
- doc to come
2020-11-27 16:39:40 +01:00
Goffi
ac4a8aecc7 tests: added testing files (photos) 2020-11-27 16:32:40 +01:00
Goffi
a9614470aa docker (backend_e2e): added packages necessary to test Libervia + some debugging tools 2020-11-27 16:31:05 +01:00
Goffi
125addc542 plugin XEP-0077: use xmpp_domain when set for host 2020-11-27 16:29:06 +01:00
Goffi
36ec44730d docker (e2e): added libervia and libervia.test in certificates 2020-11-27 16:26:36 +01:00
Goffi
96bf65cb7a docker(libervia): build site in the image:
this will avoid a build each time the container starts fresh (notably with tests), as this
is time and resource consuming (notably with node modules which would need to be
downloaded each time).
2020-11-27 16:25:02 +01:00
Goffi
b2cf3efd8b docker: added libervia e2e image and include it in docker-compose_e2e:
The `libervia_e2e` image is based on main `libervia` one, and add, register and set the
same test certificates as the ones used in `backend_e2e`.
2020-11-16 14:51:15 +01:00
Goffi
670bea6e55 docker (backend_e2e): set xmpp_domain in conf. 2020-11-16 14:51:13 +01:00
Goffi
2df24ca3b1 docker (backend): fixed media_dir in conf. 2020-11-16 14:50:55 +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
2556a2c332 docker (libervia): expose HTTP and HTTPS ports 2020-11-15 17:05:47 +01:00
Goffi
18fc12222b docker (compose): name libervia image 2020-11-15 17:05:14 +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
fffc08be54 tests: end-2-end tests first draft:
- e2e tests are launched inside the new docker e2e test environment
- `run_e2e.py` launch the docker container, mount the current code base in it, launch the
  e2e tests and print report in real time
- `conftest.py` are pytest fixtures managing many things such as account creation, fake files
  management, JSON or Domish.Element parsing, fake editor, etc.
- `test_jp.py` are end-to-end test done with `jp`. `sh` library is used to make tests
  writting as user-friendly as possible. The `SAT_TEST_ENV_E2E` environment variable is
  checked, and tests will be skipped if it's not set.
2020-11-12 14:53:16 +01:00
Goffi
92e424e685 jp (roster): delete implementation 2020-11-12 14:53:16 +01:00
Goffi
df6428c14c jp (pubsub/node/info, pubsub/get): better exit code:
the correct exit code is now returned in case of NOT_FOUND or bridge exception. If the
exception is not a bridge exception, an internal error exit code is used.
2020-11-12 14:53:16 +01:00
Goffi
d818f1737b jp (base, pubsub/set): new --quiet argument:
`--quiet` can be used to only return essential data from command. This is notably useful
to remove message and trailing line feed when returning a data which must be parsed by an
other program.
2020-11-12 14:53:16 +01:00
Goffi
1d9d13dc04 jp: follow best practices and use a dash (-) instead of underscore (_) for long options. 2020-11-12 14:53:16 +01:00
Goffi
cc61784c2e jp (file/receive): display or answer to C.META_TYPE_NOT_IN_ROSTER_LEAK dialog:
when a file is proposed by an entity not in roster, the dialog asking for confirmation
is displayed. If the bare jid of the sender is explicitely waited (i.e. it's in
arguments), then the dialog is automatically confirmed.
2020-11-12 14:53:16 +01:00
Goffi
f1ec7b4d43 jp: new confirm method:
it completes `confirmOrQuit` method to ask confirmation without quitting.
2020-11-12 14:53:16 +01:00
Goffi
ed39d5340d jp (file/send): don't add main resource to bare jid anymore:
bare jid sending is now managed by backend (at least for Jingle), so resource must not be
added automatically anymore.
2020-11-12 14:53:16 +01:00
Goffi
f4c7f5e55e jp: replace no_lf argument by end in disp (same as in print) 2020-11-12 14:53:16 +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