Commit graph libervia-backend/sat/plugins/plugin_comp_file_sharing.py
Author SHA1 Message Date
Goffi
f4fa679e9c comp file sharing: handle admins in quotas 2022-05-15 14:15:24 +02: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
14d00a9dda merge bookmark @ 2021-11-12 17:21: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
d7d40a6d50 merge bookmark @ 2021-09-26 16:41:49 +02:00
Goffi
31985ed0fc component (file-sharing): use file-sharing instead of file_sharing:
a dash is used instead of underscore for entry-point and config section., as it is best
practice to use dash on command-line.
2021-09-26 16:35:56 +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
76392e9377 component file sharing: forbid jingle upload by entities which are not in allowed hosts 2021-05-05 15:41:19 +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
2cfffc5f6c component (file sharing): fix retrieving owner from jid when user part is not specified 2021-05-01 18:22:53 +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
dc86957043 date update 2021-03-19 15:45:14 +01:00
Goffi
f7a83dd054 component file sharing: added missing owner filtering in _retrieveFiles 2020-09-20 14:04:22 +02:00
Goffi
c9b2c1d27d component file sharing: fix used of self.files_path in _retrieveFiles 2020-09-17 21:42:14 +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
33eab526b9 component file sharing: generate thumbnails for videos 2020-08-25 08:55:16 +02:00
Goffi
937a1db89f component file sharing: added Access-Control-Expose-Headers CORS header:
without this header, the range header in response was not exposed to client. This could
cause trouble is a javascript application was needing to access it.
2020-08-15 20:28:07 +02:00
Goffi
bfa4bbae9e comp file sharing: minor core re-organisation 2020-08-13 23:46:18 +02:00
Goffi
7e404b9f98 plugin XEP-0264: updated size to get values closest to standard one:
- sizes used for thumbnails are now matching common resolutions.
- added BIG and FULL_SCREEN sizes
- sort thumbnails by sizes when parsing them.
2020-08-13 23:45:59 +02:00
Goffi
d7844a98b4 component file sharing: add/parse affiliation when possible 2020-07-17 13:00:10 +02:00
Goffi
86aaf35b60 comp file sharing: file paths are now quoted on upload to allow unicode 2020-06-19 14:56:45 +02:00
Goffi
87298f8a19 comp file sharing: handle upload with headers:
`Xmpp-File-Path` can now be used to specify file path, and `Xmpp-File-No-Http` when file
must not be served publicly by HTTP.
2020-06-09 06:23:01 +02:00
Goffi
4ecdb41695 comp file sharing: CORS:
- added CORS headers to allow using the HTTP server from an other domain
- added `Content-Security-Policy`
2020-06-09 06:21:23 +02:00
Goffi
ca655f01a8 component file sharing: don't initialise the plugin if not component use it 2020-06-01 11:15:16 +02:00
Goffi
5a14c5aebd plugin comp file sharing: files can now be uploaded/downloaded via HTTP:
plugin XEP-0363 can now be used by components, and file sharing uses it.
The new `public_id` file metadata is used to serve files.
Files uploaded are put in the `/uploads` path.
2020-05-29 21:55:45 +02:00
Goffi
a39349fe64 dates update 2020-01-29 09:50:54 +01:00
Goffi
fbfe96c505 Python 3 port:
/!\ this is a huge commit
/!\ starting from this commit, SàT is needs Python 3.6+
/!\ SàT maybe be instable or some feature may not work anymore, this will improve with time

This patch port backend, bridge and frontends to Python 3.

Roughly this has been done this way:

- 2to3 tools has been applied (with python 3.7)
- all references to python2 have been replaced with python3 (notably shebangs)
- fixed files not handled by 2to3 (notably the shell script)
- several manual fixes
- fixed issues reported by Python 3 that where not handled in Python 2
- replaced "async" with "async_" when needed (it's a reserved word from Python 3.7)
- replaced zope's "implements" with @implementer decorator
- temporary hack to handle data pickled in database, as str or bytes may be returned,
  to be checked later
- fixed hash comparison for password
- removed some code which is not needed anymore with Python 3
- deactivated some code which needs to be checked (notably certificate validation)
- tested with jp, fixed reported issues until some basic commands worked
- ported Primitivus (after porting dependencies like urwid satext)
- more manual fixes
2019-08-13 19:08:41 +02:00
Goffi
1dd3518943 plugin comp file sharing: file sharing management first draft:
the new "component file sharing management" plugin add ad-hoc commands to changes permission of one or several shared files, delete one or more files, or regenerate thumbnails.
This is a temporary plugin to make file sharing through a component usable with other entities, but should be removed (at least permission management and file deletion) in the future if we move on a pubsub based solution.
2019-04-28 09:00:51 +02:00
Goffi
6b83ef5c51 plugins: removed useless execute permission 2019-04-14 08:21:51 +02:00
Goffi
8e338bf913 date update 2019-01-12 12:25:31 +01:00
Goffi
7a9ee35cfc misc: replaced all "dummy" by the more conventional and readable "__" ("_" being used for gettext) 2019-01-11 11:13:15 +01:00
Goffi
744cb0c503 code style reformatting using black 2018-06-27 20:14:46 +02:00
Goffi
80ef13612b core, setup: huge cleaning:
- moved directories from src and frontends/src to sat and sat_frontends, which is the recommanded naming convention
- move twisted directory to root
- removed all hacks from setup.py, and added missing dependencies, it is now clean
- use https URL for website in setup.py
- removed "Environment :: X11 Applications :: GTK", as wix is deprecated and removed
- renamed sat.sh to sat and fixed its installation
- added python_requires to specify Python version needed
- replaced glib2reactor which use deprecated code by gtk3reactor

sat can now be installed directly from virtualenv without using --system-site-packages anymore \o/
2018-04-02 19:44:50 +02:00
Renamed from src/plugins/plugin_comp_file_sharing.py (Browse further)