Commit graph

3,538 commits

Author SHA1 Message Date
Goffi
241fc0165f bridge (constructor/base_constructor): add args_no_default to completion 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
1ad8de5726 doc: config file is now libervia.conf (even if sat.conf still works, for now) 2021-06-03 15:15:11 +02:00
Goffi
838b4a7947 core (memory/sqlite): return 0 instead of None when user has no file yet 2021-05-06 21:39:08 +02:00
Goffi
b6779cd0fd plugin upload: don't run available_cb if upload_jid is used in upload method 2021-05-06 18:11:33 +02:00
Goffi
7e6026e090 core (xmpp): fix typo in sendError 2021-05-06 18:10:09 +02:00
Goffi
76392e9377 component file sharing: forbid jingle upload by entities which are not in allowed hosts 2021-05-05 15:41:19 +02:00
Goffi
3c12c4f797 component file sharing (management): add values of quota and used size on result form 2021-05-05 15:37:33 +02:00
Goffi
3da29896df plugin XEP-0050: show notes when there is a data form on completed command:
Notes are now added on completed command, as text widgets.
2021-05-05 15:37:33 +02:00
Goffi
63875ae4f1 component file sharing (plugin management): new command to get available quota/used space. 2021-05-05 15:37:33 +02:00
Goffi
ac8f9f7817 component file sharing: quotas implementation:
quotas can now be specified using the `quotas_json` option of `component file_sharing`
section in settings. This must be a dict where:
    - `users` key contains default quotas for all users
    - `admins` key contains quotas for administrators (not implemented yet)
    - `jids` contain bare JID to quota mapping, to have user-specific quota

The value can be either a int for quota in bytes, or a case insensitive string with an
optional multiplier symbol (e.g. "500 Mio"). `None` can be used for explicit unlimited
quota (which is the default is `users` is not set).

When a file size is too big for quota, upload is refused with an error message indicating
allowed quota, used space, and the size of the file that user wants to upload.
2021-05-05 15:37:33 +02:00
Goffi
8ed9e310c5 plugin XEP-0166, XEP-0234: better management of terminate:
- new `text` argument to specify human readable reason of termination
- handling of `FirstError` (used when a error happens in a DeferredList)
- handling of `StanzaError`
- (XEP-0234): show human readable text of the reason if present
2021-05-05 15:37:33 +02:00
Goffi
3024ae2be0 plugin XEP-0363: allow async callbacks in handlers + method to generate file-too-large element 2021-05-05 15:37:33 +02:00
Goffi
6e6bc64eab tools (async_trigger): new asyncReturnPoint method 2021-05-05 15:37:33 +02:00
Goffi
4e36667134 tools (common/utils): new methods to parse and generate file size with symbols:
- `parseSize` lets parse a size which can be either a int, or a string with a symbol like
  `Mio`
- `getSizeMultiplier` returns a tuple of size with it's multiplier symbol
- `getHumanSize` returns a string with size and adapted multiplier.
2021-05-05 15:37:33 +02:00
Goffi
06054ceeaf core (memory, sqlite): new fileGetUsedSpace method 2021-05-05 15:37:21 +02:00
Goffi
672d35d44f core (xmpp): added appCondition argument to sendError 2021-05-05 12:58:11 +02:00
Goffi
fb01bd4bcc jp (pubsub, blog): rename commands implementation 2021-05-01 18:39:34 +02:00
Goffi
8f7c74e3b3 jp (blog/get): fix comments node parsing 2021-05-01 18:38:58 +02:00
Goffi
435027c1c9 plugin XEP-0060, XEP-0277: new rename methods (psItemRename, mbRename):
Those methods recreate an item to given new ID, and if successful, delete the former one.
2021-05-01 18:37:57 +02:00
Goffi
af053c5f34 tools (common/date_utils): fix date_only for short, long and full format 2021-05-01 18:36:13 +02:00
Goffi
3ea9c6fdd9 plugin XEP-0353: don't use Jingle Message Initiation for components:
Jingle Message Initiation is currently not useful for components, and the message workflow
is different in Libervia between clients and components (as a result, `messageReceived`
trigger is never called, and the session proposal is never answered).
2021-05-01 18:30:01 +02:00
Goffi
f8eeeeaa0c plugin XEP-0329: fix root node retrieval and _fileSendingRequestTrigger return value 2021-05-01 18:25:42 +02:00
Goffi
6456df58fb plugin misc forums: use rich content in createTopic 2021-05-01 18:23:42 +02:00
Goffi
2cfffc5f6c component (file sharing): fix retrieving owner from jid when user part is not specified 2021-05-01 18:22:53 +02:00
Goffi
0af68b683a XEP-0277: new preview/mbPreview method:
This method does more or less the same thing as sending, but without actually sending the
item, and parse the generated element just after. This way, the triggers are run, and a
preview of the item can be made for the resulting microblog data.
2021-04-29 15:49:59 +02:00
Goffi
65e519efd3 docker: separate build instructions for demo compose file 2021-04-23 10:08:58 +02:00
Goffi
a2e7469f09 docker: add demo images and compose file 2021-04-23 09:59:16 +02:00
Goffi
e07aa31cfe jp (list): implement set and delete subcommands. 2021-04-22 18:21:33 +02:00
Goffi
75a5716e17 plugin XEP-0346: bridge method to retrieve template, submitted, or application namespaces 2021-04-22 18:20:41 +02:00
Goffi
c96670e5f3 plugin list: delete implementation:
`delete` is similar to XEP-0060's retractItem, but node is set to default ticket one if
not specified.
2021-04-22 18:19:52 +02:00
Goffi
a7704f4da1 comp file sharing: fix port type:
when port was retrieved from config, it was a string instead of a int
2021-04-22 18:18:09 +02:00
Goffi
3768e8bb4d plugin misc account: fix missing arg 2021-04-22 18:17:15 +02:00
Goffi
2695a5a15b doc: more renaming 2021-04-22 18:16:19 +02:00
Goffi
1eeb48b115 CHANGELOG: update 2021-04-21 11:44:47 +02:00
Goffi
3377136c62 plugin misc account: specify domain in new account email sent to admins 2021-04-21 11:36:26 +02:00
Goffi
9df77100c4 plugin XEP-0277: user friendly ID:
when publishing a blog post without `id` specified, instead of using uuid, a user friendly
ID based on title or content is used. This allow to have better URLs in web frontend.

There is a (very low) risk of name collision if several articles with the same title or
content are published on the same pubsub node, user friendly ID can be deactivated by
using `user_friendly_id=False` in blog data to avoid that.
2021-04-16 18:33:00 +02:00
Goffi
2596f7ae77 tools (common/regex): move code to make user friendly URLs from web frontend 2021-04-16 18:32:44 +02:00
Goffi
618917e0ef plugin XEP-0329: check files conflict also for root files 2021-04-16 18:32:40 +02:00
Goffi
18cbbee1a5 memory: new getFilesOwner method:
this method is used by `getFiles` and `setFile` and fill `owner` when it's missing to
avoid getting accidentally files from other users.

`owner` is not filled in some case (no client, `file_id` or `parent` specified) and an
exception is raised if a component has neither `owner` nor `peer_jid` specified.
2021-04-16 18:32:37 +02:00
Goffi
adb09a719f tests: update following names change 2021-04-16 18:32:34 +02:00
Goffi
363788de7d docker: update following name changes:
`backend_e2e` now print properly backend logs
2021-04-16 18:32:16 +02:00
Goffi
19da80743b core: remove print which may provoke undesired side effects 2021-04-14 15:54:26 +02:00
Goffi
b186f74b17 core: apply wokkel patches if they are not already:
this case may happen if a sat module is used without the backend being launched (e.g. in
tests)
2021-04-14 14:09:50 +02:00
Goffi
1ab5488e0d frontends (primitivus): SECTION_NAME is now CONFIG_SECTION 2021-04-01 13:57:20 +02:00
Goffi
a2e79b0c28 plugin XEP-0277: be sure to have an author_jid set 2021-03-27 14:59:50 +01:00
Goffi
69112bcd79 plugin XEP-0277: better resilience to broken items:
- if `author` element can't be found, `publisher` attribute, then `IQ`'s `from` attributes
  are used as fallback to find author jid
- fix categories (tags) parsing if `author` element is not found
- remove items which have failed parsing from `mbGet` results (instead of using `None`).
2021-03-27 14:38:27 +01:00
Goffi
839aea4e2b tools (xml_tools): new findAncestor method:
this methods help to find a `domish.Element` ancestor with specific name/namespace
2021-03-27 14:35:07 +01: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
881a638821 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
all settings are to be put in `[DEFAULT]` section
- `bridge_pb_connection_type` can be set to `unix_socket` or `socket`
- for `socket`, `bridge_pb_host` and `bridge_pb_port` can be specified
2021-03-21 22:00:55 +01:00