Commit graph

11598 commits

Author SHA1 Message Date
Kim Alvefur
0d5bd3974d mod_http_file_share: Handle content-type being optional 2021-01-27 09:47:21 +01:00
Kim Alvefur
8485e85c70 mod_http_file_share: Reject invalid file sizes 2021-01-27 00:36:49 +01:00
Kim Alvefur
4b74c6abb7 mod_http_file_share: Fix name of max-file-size tag 2021-01-27 00:29:12 +01:00
Kim Alvefur
435af38451 mod_http_file_share: Expand registry to fix extra tag
Error registry compact format doesn't support extra.tag so needs to be
the more verbose format
2021-01-27 00:28:42 +01:00
Kim Alvefur
19be6e8a27 mod_http_file_share: Verify final file size on completion of upload 2021-01-27 00:09:49 +01:00
Kim Alvefur
afa3ec821a mod_http_file_share: Add file type filter
Unlike mod_http_upload, this can't be bypassed by uploading with a
different file extension.
2021-01-26 14:53:43 +01:00
Kim Alvefur
ba59af458c mod_http_file_share: Add file size limit (default 10M) 2021-01-26 14:53:24 +01:00
Kim Alvefur
71267fd111 mod_http_file_share: Validate that filename does not contain '/' 2021-01-26 14:52:37 +01:00
Kim Alvefur
2c09796dda mod_http_file_share: Return proper error if unauthorized 2021-01-26 14:51:55 +01:00
Kim Alvefur
a28c769e1a mod_http_file_share: Add basic access control
Partly lifted from mod_external_services
2021-01-26 14:39:11 +01:00
Kim Alvefur
52a969df34 mod_http_file_share: Add support for external file upload service
PUT /upload/:slot/:filename
Authorization: Bearer JWT{ uploader, filename, filesize, filetype, exp }
2021-01-26 14:27:51 +01:00
Kim Alvefur
5b1f885242 mod_http_file_share: Let's write another XEP-0363 implementation
This variant is meant to improve upon mod_http_upload in some ways:

* Handle files much of arbitrary size efficiently
* Allow GET and PUT URLs to be different
* Remember Content-Type sent by client
* Avoid dependency on mod_http_files
* Built-in way to delegate storage to another httpd
2021-01-26 03:19:17 +01:00
Kim Alvefur
e91db8d935 util.interpolation: Add test for #1623 2021-01-25 21:27:05 +01:00
Kim Alvefur
414c232247 Merge 0.11->trunk 2021-01-25 21:26:45 +01:00
Kim Alvefur
acdd02670b util.interpolation: Fix combination of filters and fallback values #1623 2021-01-25 20:58:11 +01:00
Kim Alvefur
7146762a6d util.startup: Make installer_plugin_path relative to data directory
Having it relative to current working directory is problematic since
this depends on how Prosody was started and changes to the data
directory during startup (but after this point).
2021-01-24 16:12:53 +01:00
Kim Alvefur
4b30620234 util.startup: Don't create installer plugin path (as root)
Since this runs before dropping root, the directory ends up being owned
by root, resulting in luarocks failing to install anything, since by
then it would be running as the prosody user.

luarocks creates this directory if needed, so creating it during startup
is not necessary.

One potential issue is if the directory is somewhere where Prosody can't
write, but then you will simply have to create it yourself with the
appropriate permissions.
2021-01-24 15:57:48 +01:00
Kim Alvefur
dc043e287f util.prosodyctl.check: Recognise global options related to plugin installer 2021-01-21 23:38:44 +01:00
Kim Alvefur
8681102aa7 net.unbound: Fix to initialize under prosodyctl
Lazy initialization only worked for async queries, but prosodyctl check
dns uses sync queries.
2021-01-21 23:33:59 +01:00
Kim Alvefur
e073b85487 prosodyctl: Add reference to #1602 (plugin installer docs) in comment 2021-01-21 19:23:15 +01:00
Kim Alvefur
99db323c2a prosodyctl: Move message after condition
If the condition is false, the message becomes a lie!
2021-01-21 19:20:08 +01:00
Kim Alvefur
d08faec302 util.prosodyctl: Remove unused calculation [luacheck] 2021-01-21 19:18:38 +01:00
Kim Alvefur
ece1e74b93 util.prosodyctl: Rename unused variable to '_' [luacheck] 2021-01-21 19:17:31 +01:00
Kim Alvefur
f33c04b487 prosodyctl: Fix copypaste oversight 2021-01-21 19:16:24 +01:00
Kim Alvefur
4b22be7651 util.prosodyctl: Always return exit code from luarocks
os.exit(true) errors on Lua 5.1
2021-01-21 19:15:28 +01:00
Kim Alvefur
6b72b61a11 prosodyctl: Abort if no plugin source specified for the installer
Better than having a non-working default.
2021-01-21 19:11:27 +01:00
Kim Alvefur
a97dd68fa1 prosodyctl: Move UI related calls out of util.prosodyctl
I think this follows the general separation of duties between prosodyctl
and util.prosodyctl better.
2021-01-21 19:04:57 +01:00
Kim Alvefur
37628ed867 prosodyctl: Use luarocks status code as exit code
Enables some shell level error handling
2021-01-21 19:02:03 +01:00
Kim Alvefur
1b02539390 util.prosodyctl: Reword message to sound more natural
English is hard. "to" might also work, but we'll go with this for now.

18:32:11 <MattJ> s/at/in/ ?
18:32:19 <MattJ> to match luarocks :)
2021-01-21 18:50:19 +01:00
Kim Alvefur
560261b88e util.prosodyctl: Propagate status from luarocks invocation 2021-01-21 18:43:16 +01:00
Kim Alvefur
3319886e03 util.prosodyctl: Use installer path prepared by util.startup 2021-01-21 18:39:18 +01:00
Kim Alvefur
a322538f89 lint: Add initial semgrep config 2021-01-18 17:28:34 +01:00
Kim Alvefur
c15f7674f0 util.datamanager: Fix not passing variables as format string to logger (thanks semgrep)
Passing error messages as format string could lead to errors, although
not a problem anymore since util.format sanitizes this.
2021-01-16 15:49:46 +01:00
Kim Alvefur
81181623fd core.modulemanager: Fix resource location compat with LuaRocks 2.x
The path doesn't include lua version, at least least on Debian, which
still has luarocks 2.x
2021-01-16 00:24:06 +01:00
Matthew Wild
ea16bff7c8 MUC: Allow modules to add to the room registration form, and handle the result 2021-01-15 18:42:45 +00:00
Matthew Wild
1facf3eca0 doc/doap.xml: Fix attribute name 2021-01-15 14:02:10 +00:00
Kim Alvefur
adea70ea3d mod_mam: Workaround scansion test flakyness
The empty ID fields are sometimes accepted, sometimes not.
2021-01-13 16:26:56 +01:00
Kim Alvefur
e332c17410 mod_storage_sql: Fix compatibilty with Lua 5.1
string.rep() doesn't have the 3rd argument before Lua 5.2

Revert once we drop support for Lua 5.1
2021-01-13 15:33:44 +01:00
Kim Alvefur
7b4c3318d8 mod_muc_mam: Copy extended MAM support from mod_mam
mod_mam and mod_muc_mam are just different enough that having them be
the same module gets complicated, but close enough to have overlapping
code.
2021-01-12 19:32:10 +01:00
Kim Alvefur
ec6a96d0b0 mod_mam: Advertise extended MAM when archive storage is capable 2021-01-12 19:25:29 +01:00
Kim Alvefur
a481f7b6ea mod_mam: Allow querying by set of IDs 2021-01-12 19:00:44 +01:00
Kim Alvefur
37ce2dfd7e mod_storage_sql: Support query for set of IDs
Not compatible with Lua 5.1
2021-01-12 18:46:17 +01:00
Kim Alvefur
768d52008a mod_storage_internal: Support query for set of IDs
Based on implementation in mod_storage_memory
2021-01-12 18:06:55 +01:00
Kim Alvefur
5d5615daff mod_storage_memory: Support query for set of IDs 2021-01-12 18:06:33 +01:00
Kim Alvefur
0cac5b3ff9 storage tests: Add test for querying a set of IDs 2021-01-12 18:03:40 +01:00
Kim Alvefur
d114613e30 mod_storage_internal: Add support for full ID range query
Based on the mod_storage_memory implementation
2021-01-12 17:00:27 +01:00
Kim Alvefur
7ed7be7957 mod_storage_memory: Support full ID range queries 2021-01-12 16:58:10 +01:00
Kim Alvefur
ddd3fff2e9 storage tests: Test querys with both before and after IDs
Needed for extended MAM, supported by SQL storage already.
2021-01-12 15:52:14 +01:00
Kim Alvefur
45a89cbb0c net.adns: Prevent empty packets from being sent on "connect" (fix #1619)
Thanks Ge0rG for testing
2021-01-12 13:25:08 +01:00
Kim Alvefur
d2b73ddd3e net.server_epoll: Fix off-by-one in 2c559953ad41
Thanks tmolitor
2021-01-10 14:54:03 +01:00