Commit graph

12512 commits

Author SHA1 Message Date
Kim Alvefur
a696800291 core.modulemanager: Fix global flag on per-host instances of shared modules (fix #1736)
This flag is something of a shortcut for `module.host == "*"` and should
always be equal to that. Its absence on the proxy object made the
property of the global module instance visible, causing problems such as
with URL reporting in mod_http
2022-04-04 18:44:57 +02:00
Matthew Wild
0f493bd245 configmanager: Clearer errors when providing unexpected values after VirtualHost (fixes #1735, thanks arawaks) 2022-04-03 12:56:11 +01:00
Kim Alvefur
1e2d4026f9 util.random: Test whether util.crand works before using it (fix #1734)
util.crand can be configured at compile time to use the Linux
getrandom() system call, available from Linux 3.17, but it is still
possible to load it with an older kernel lacking that system call, where
attempting to use it throws an ENOSYS error.

By testing for this on load we can fall back to /dev/urandom in this
case.
2022-04-02 16:33:27 +02:00
Matthew Wild
f19f1088b7 mod_http (and dependent modules): Make CORS opt-in by default (fixes #1731)
The same-origin policy enforced by browsers is a security measure that should
only be turned off when it is safe to do so. It is safe to do so in Prosody's
default modules, but people may load third-party modules that are unsafe.

Therefore we have flipped the default, so that modules must explicitly opt in
to having CORS headers added on their requests.
2022-03-28 14:53:24 +01:00
Matthew Wild
331ede129e mod_http: Reintroduce support for disabling or limiting CORS (fixes #1730)
This is far better than pre-0.12, because we now have a universal way to
configure and enable/disable CORS on a per-module basis.
2022-03-28 14:40:21 +01:00
Matthew Wild
fdd5f22b8a prosodyctl: check config: Report paths of loaded configuration files (fixed #1729) 2022-03-28 11:41:57 +01:00
Matthew Wild
a52c531dc5 configmanager: Add method to report loaded config files (part of #1729 fix) 2022-03-28 11:41:32 +01:00
Matthew Wild
4272c931ae mod_tombstones: Add caching to improve performance on busy servers (fixes #1728) 2022-03-28 11:08:18 +01:00
Matthew Wild
1426d52e39 mod_turn_external: Update status and friendlier handling of missing secret option (fixes #1727) 2022-03-28 10:47:21 +01:00
Kim Alvefur
c50c315705 prosodyctl about: Report version of lua-readline
Good to know since it affects how well the shell works
2022-03-27 14:05:56 +02:00
Matthew Wild
cbcb57fa24 MUC: Allow kicking users with the same affiliation as the kicker (fixes #1724)
This is allowed by XEP-0045, which states:

"A moderator SHOULD NOT be allowed to revoke moderation privileges from
someone with a higher affiliation than themselves (i.e., an unaffiliated
moderator SHOULD NOT be allowed to revoke moderation privileges from an admin
or an owner, and an admin SHOULD NOT be allowed to revoke moderation
privileges from an owner)."
2022-03-23 13:38:55 +00:00
Kim Alvefur
e950ca77eb mod_external_services: Move error message to correct place (fix #1725)
This message was misplaced in c4599a7c534c when the @type and @host
check was introduced.
2022-03-23 15:29:01 +01:00
Matthew Wild
ea9ea67911 mod_pubsub: Don't attempt to use server actor as publisher (fixes #1723) 2022-03-21 12:36:20 +00:00
Matthew Wild
ff2a6d764e util.startup: Show error for unrecognized arguments passed to 'prosody' (fixes #1722) 2022-03-21 10:06:48 +00:00
Matthew Wild
df4ba58b9f CHANGES: Update to reflect 0.12.0 release 2022-03-19 11:41:05 +00:00
Matthew Wild
f8690bf151 mod_admin_socket: Improve error reporting when socket can't be created (fixes #1719) 2022-03-19 11:38:21 +00:00
Matthew Wild
afbef6406b prosodyctl: check turn: Fail with error if our own address is supplied for the ping test 2022-03-19 11:09:10 +00:00
Matthew Wild
d0bd1e71d9 prosodyctl: check config: Skip bare JID components in orphan check 2022-03-19 09:28:27 +00:00
Kim Alvefur
7badf61246 mod_admin_socket: Comment on LuaSocket UNIX compat code
Ref #1717
2022-03-16 19:32:17 +01:00
Kim Alvefur
8e5fec3220 mod_admin_socket: Compat for luasocket prior to unix datagram support
The "socket.unix" module exported only a function before
aa1b8cc9bc
when datagram support was added.

Fixes #1717

Thanks rsc and lucas for reporting and testing
2022-03-15 10:48:46 +01:00
Kim Alvefur
ba11d64191 mod_invites_register: Push invitee contact entry to inviter
Invitee would not show up in the roster of the invite creator unless
they fetch their roster afterwards.

Fixes #1715

Thanks gerald
2022-03-15 21:59:51 +01:00
Matthew Wild
681ac46aae prosodyctl: check turn: warn about external port mismatches behind NAT
Some NATs don't preserve port numbers, which can cause the TURN server's
reported relay address to be incorrect (the TURN server has no way to predict
what the external port is, so it can't be corrected in config like an IP
mismatch can).
2022-03-11 20:33:03 +00:00
Matthew Wild
c1fdd3a877 Added tag 0.12.0 for changeset 50fcd3879482 2022-03-08 12:34:03 +00:00
Kim Alvefur
c9e223e4f7 spelling: non-existing mistakes (thanks timeless) 2022-03-07 00:35:29 +01:00
Kim Alvefur
43351d2b54 Spelling: Fix various spelling mistakes (thanks timeless)
Words, sometimes I wonder how they even work

Maybe I missed something.
2022-03-07 00:13:56 +01:00
Kim Alvefur
ece896d253 net.websocket.frames: Replace bit fiddling code with util.struct
Fallback code for not having either the string.pack and string.unpack
functions available in Lua 5.4 or the struct lib is no longer needed
since the struct lib was imported as util.struct in 3ce3633527af
2022-03-06 15:13:50 +01:00
Matthew Wild
9a86373fd1 prosodyctl: check turn: compare correct addresses for relay mismatch detection (thanks Zash) 2022-03-05 20:47:40 +00:00
Matthew Wild
046b4085cb prosodyctl: check turn: Add check for private IP returned from STUN. 2022-03-05 20:34:58 +00:00
Matthew Wild
f7adea5040 prosodyctl: check turn: improve warning text to suggest issues 2022-03-05 20:34:24 +00:00
Matthew Wild
750f3a78d5 prosodyctl: check turn: fix traceback when server does not provide realm/nonce
As coturn when installed out of the box on Debian (because auth isn't enabled?)
2022-03-05 20:32:47 +00:00
Matthew Wild
08777eb3d6 prosodyctl: check turn: fix formatting of multiple warnings 2022-03-05 20:31:17 +00:00
Matthew Wild
c2af455ac0 prosodyctl: check turn: always show debug info even if test fails 2022-03-05 16:07:47 +00:00
Matthew Wild
2320d07021 prosodyctl: check turn: Clearer error when unable to resolve external service host 2022-03-05 16:06:39 +00:00
Matthew Wild
0e1111f892 CHANGES: Mention STUN/TURN support in 'prosodyctl check' 2022-03-05 14:46:57 +00:00
Matthew Wild
0babcb6c06 prosodyctl: check: include TURN checks by default 2022-03-05 11:53:53 +00:00
Matthew Wild
5af6db124a prosodyctl: check: Slightly improved argument handling 2022-03-05 11:36:38 +00:00
Matthew Wild
1af4939c11 prosodyctl: check turn: show relayed address(es) in verbose mode 2022-03-05 11:31:22 +00:00
Matthew Wild
fa68985f24 net.stun: Support for xor-relayed-address attribute 2022-03-05 11:30:55 +00:00
Matthew Wild
9df580f997 prosodyctl: check turn: Allow specifying port for the ping service 2022-03-05 11:15:25 +00:00
Matthew Wild
357c7e0142 prosodyctl: check turn: Add support for testing data relay with an external STUN server via --ping 2022-03-05 11:10:18 +00:00
Matthew Wild
d405c11918 net.stun: Add xor-peer-address helper 2022-03-05 11:04:25 +00:00
Matthew Wild
ac06bd8c97 net.stun: Factor out address unpack, an operation common to multiple attributes 2022-03-05 11:03:44 +00:00
Matthew Wild
6e9d71259c net.stun: Name some more attributes from TURN 2022-03-05 11:00:08 +00:00
Matthew Wild
ab77f7fcdb net.stun: Add lookup table generation helper, reduces code duplication 2022-03-05 10:59:19 +00:00
Matthew Wild
572bff0087 net.stun: Hyphenate method names for consistency 2022-03-05 10:57:47 +00:00
Matthew Wild
7b23d9d136 util.bitcompat: Add some simple tests 2022-03-04 19:48:01 +00:00
Matthew Wild
a905ccb71a util.bit53: Support for more than 2 arguments, for compat with bit32 2022-03-04 19:37:59 +00:00
Kim Alvefur
ffb37f3ef3 make: Fix build of util.struct on *BSD 2022-03-04 17:46:33 +01:00
Matthew Wild
8eadf174b4 net.stun: tests: Remove stray print() from debugging 2022-03-04 16:46:47 +00:00
Matthew Wild
b47c7951d5 Merge config-updates+check-turn from timber 2022-03-04 16:33:41 +00:00