aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
Commit message (Collapse)AuthorAgeFilesLines
* mod_http: Allow disabling CORS in the http_cors_override option and by defaultMatthew Wild2022-10-311-4/+11
| | | | | | | | | | | | | | | | | | | Fixes #1779. Due to an oversight in the logic, if the user set 'enabled' to false in an override, it would disable the item's requested CORS settings, but still apply Prosody's default CORS policy. This change ensures that 'enabled = false' will now disable CORS entirely for the requested item. Due to the new structure of the code, it was necessary to have a flag to say whether CORS is to be applied at all. Rather than hard-coding 'true' here, I chose to add a new option: 'http_default_cors_enabled'. This is a boolean that allows the operator to disable Prosody's default CORS policy entirely (the one that is used when a module or config does not override it). This makes it easier to disable CORS and then selectively enable it only on services you want it on.
* mod_admin_shell: Ensure available connection for column 'secure'Kim Alvefur2022-10-231-1/+1
| | | | Similar to #1777
* mod_admin_shell: Ensure connection exists to get port from (fixes #1777)Kim Alvefur2022-10-231-1/+5
|
* mod_s2s: Fix firing buffer drain eventsKim Alvefur2022-08-261-2/+2
| | | | | Fixes the same kind of issue as in 65563530375b but once and for all, while improving similarity between incoming and outgoing connections.
* mod_admin_shell: Switch names for user role management commandsKim Alvefur2022-08-151-4/+8
| | | | | | | user:roles() does not convey that this is the mutating command, it should have been called setroles from the start but wasn't due to lack of foresight. This has to accidentally removing roles when wanting to show them.
* mod_storage_sql: Fix summary API with Postgres (fixes #1766)Kim Alvefur2022-07-221-4/+2
| | | | | | | The ORDER BY and LIMIT clauses are not needed and don't even make much sense. This part was most likely a leftover from the :find method. Tested with sqlite and postgres 14
* mod_http_files: Log warning about legacy modules using mod_http_filesKim Alvefur2022-07-171-2/+1
| | | | | | | | | It is time. Most community modules should have been adjusted to work with the new (net.http.files) way. At some point this usage should be prevented. Related to #1765
* mod_bookmarks: Reduce error about not having bookmarks to debug (thanks tom)Kim Alvefur2022-07-261-1/+5
| | | | | | | | | | | | | | | This is happens if the account is new and doesn't have any bookmarks yet, which is not a problem. Rarely seen since most clients currently use the older version of XEP-0084 stored in XEP-0049 rather than in PEP, but at least one (Converse.js )does. One scenario in which this would show up often is with Converse.js as a guest chat using anonymous authentication, where all "accounts" would always be new and not have any bookmarks. This scenario probably does not need to have mod_bookmarks at all, but if enabled globally it would likely become loaded onto the VirtualHost unless explicitly disabled.
* mod_storage_sql: Fix bypass of load procedure under prosodyctlKim Alvefur2022-07-261-1/+1
| | | | | | | | | | | There's no 'prosody.prosodyctl' property other than this one, introduced in 6216743c188c in 2015. Guessing that the intent was to skip this when running as a prosodyctl command. The module.command code does its own version of this initialization, so this seems likely. Thanks raja for noticing
* mod_smacks: Fix #1761 by setting a flag earlierKim Alvefur2022-06-121-1/+1
| | | | | | This ensures that the flag is set even if the pre-drain callback is called from send(), as would be the case if opportunistic writes are enabled.
* mod_smacks: Bounce unhandled stanzas from local origin (fix #1759)0.12.1Kim Alvefur2022-05-271-2/+1
| | | | | | | | | Sending stanzas with a remote session as origin when the stanzas have a local JID in the from attribute trips validation in core.stanza_router, leading to warnings: > Received a stanza claiming to be from remote.example, over a stream authed for localhost.example Using module:send() uses the local host as origin, which is fine here.
* mod_smacks: Fix bounce of stanzas directed to full JID on unclean disconnectKim Alvefur2022-05-271-1/+1
| | | | | | | | | | | | | | | Fixes #1758 Introduced in 1ea01660c79a In e62025f949f9 to and from was inverted since it changed from acting on a reply to acting on the original stanza (or a clone thereof) Unsure of the purpose of this check, you don't usually send stanzas to your own full JID. Perhaps guarding against routing loops? The check was present in the original commit of mod_smacks, prosody-modules rev 9a7671720dec
* mod_smacks: Fix to use current method of counting acked stanzasKim Alvefur2022-05-261-3/+2
| | | | | | | | | Fixes #1757 These places seem to have been left since e62025f949f9 The logic around expected_h in should_ack() misbehaved, always comparing with 0 + unacked instead of acked + unacked.
* mod_admin_shell: Tighten up type checks to fix #1754 (thanks clouded)Kim Alvefur2022-05-151-2/+2
| | | | | | Due to the dummy statistics provider (see core.statsmanager line 250) having a metatable that allows infinite indexing where everything is always the same table, which end up in suf() in the concatenation line.
* mod_invites_adhoc: Fall back to generic allow_user_invites for role-less usersMatthew Wild2022-05-061-1/+5
| | | | Fixes #1752
* mod_cron: Fix recording last task run time #1751Kim Alvefur2022-05-051-0/+1
| | | | | | | The type checks, they do nothing! Observed: Tasks that were supposed to run weekly or daily were running each hour.
* mod_s2s: Improve robustness of outgoing s2s certificate verificationMatthew Wild2022-04-251-0/+11
| | | | | | | | | This change ensures we have positively verified the certificates of the server we are connecting to before marking the session as authenticated. It protects against situations where the verify-or-close stage of the connection was interrupted (e.g. due to an uncaught error). Thanks to Zash for discovery and testing.
* mod_storage_xep0227: Fix mapping of nodes without explicit configurationKim Alvefur2022-04-081-3/+1
| | | | | | | Turns out this table was wrong, it's missing some fields which are required and it's 'name', not 'node'. Setting it to the boolean true invokes compatibility behavior in mod_pep which results in the correct default structure.
* mod_storage_xep0227: Fix conversion of SCRAM into internal format (fix #1741)Kim Alvefur2022-04-081-1/+1
| | | | | Looks like this function was a copy of hex_to_base64 without modifying it to do its inverse.
* mod_storage_xep0227: Support basic listing of PEP nodes in absence of ↵Kim Alvefur2022-03-311-2/+11
| | | | | | pubsub#admin data Allows migrating PEP nodes with default settings
* mod_storage_xep0227: Improve loggingKim Alvefur2022-03-291-1/+1
| | | | What were we looking at?
* mod_storage_xep0227: Handle missing {pubsub#owner}pubsub element (fixes #1740)Matthew Wild2022-04-071-0/+3
|
* mod_http (and dependent modules): Make CORS opt-in by default (fixes #1731)Matthew Wild2022-03-284-1/+8
| | | | | | | | | 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.
* mod_http: Reintroduce support for disabling or limiting CORS (fixes #1730)Matthew Wild2022-03-281-13/+31
| | | | | 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.
* mod_tombstones: Add caching to improve performance on busy servers (fixes #1728)Matthew Wild2022-03-281-11/+42
|
* mod_turn_external: Update status and friendlier handling of missing secret ↵Matthew Wild2022-03-281-1/+4
| | | | option (fixes #1727)
* MUC: Allow kicking users with the same affiliation as the kicker (fixes #1724)Matthew Wild2022-03-231-4/+5
| | | | | | | | | | 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)."
* mod_external_services: Move error message to correct place (fix #1725)Kim Alvefur2022-03-231-2/+2
| | | | | This message was misplaced in c4599a7c534c when the @type and @host check was introduced.
* mod_pubsub: Don't attempt to use server actor as publisher (fixes #1723)Matthew Wild2022-03-211-1/+1
|
* mod_admin_socket: Improve error reporting when socket can't be created ↵Matthew Wild2022-03-191-2/+10
| | | | (fixes #1719)
* mod_admin_socket: Comment on LuaSocket UNIX compat codeKim Alvefur2022-03-161-0/+6
| | | | Ref #1717
* mod_admin_socket: Compat for luasocket prior to unix datagram supportKim Alvefur2022-03-151-0/+3
| | | | | | | | | | The "socket.unix" module exported only a function before https://github.com/lunarmodules/luasocket/commit/aa1b8cc9bc35e56de15eeb153c899e4c51de82a8 when datagram support was added. Fixes #1717 Thanks rsc and lucas for reporting and testing
* mod_invites_register: Push invitee contact entry to inviterKim Alvefur2022-03-151-0/+1
| | | | | | | | | Invitee would not show up in the roster of the invite creator unless they fetch their roster afterwards. Fixes #1715 Thanks gerald
* spelling: non-existing mistakes (thanks timeless)0.12.0Kim Alvefur2022-03-071-1/+1
|
* Spelling: Fix various spelling mistakes (thanks timeless)Kim Alvefur2022-03-072-3/+3
| | | | | | Words, sometimes I wonder how they even work Maybe I missed something.
* Merge config-updates+check-turn from timberMatthew Wild2022-03-049-12/+12
|\
| * util.hex: Deprecate to/from in favour of encode/decode, for consistency!Matthew Wild2022-03-042-3/+3
| |
| * usermanager, mod_saslauth: Default to internal_hashed if no auth module ↵Matthew Wild2022-02-101-1/+1
| | | | | | | | | | | | | | | | | | | | specified The default config was updated in this way long ago, but if no option was present in the config, Prosody would load internal_plain. This change can result in changes (for the better) for people using very old configuration files lacking an 'authentication' setting.
| * various: Require encryption by default for realKim Alvefur2021-12-255-6/+6
| | | | | | | | | | | | | | | | | | These options have been specified (and enabled) in the default config file for a long time. However if unspecified in the config, they were not enabled. Now they are. This may result in a change of behaviour for people using very old config files that lack the require_encryption options. But that's what we want.
| * mod_invites_register: Default to require encryptionMatthew Wild2022-02-101-1/+1
| | | | | | | | In line with the Prosody-wide default change for 0.12.
| * mod_legacyauth: Default to require encryptionMatthew Wild2022-02-101-1/+1
| |
* | mod_c2s,mod_s2s: Fix error on shutdown (Thanks Martin)Kim Alvefur2022-02-222-2/+2
| | | | | | | | | | Since there are two calls to done() that can happen, if the timing is right (or wrong) both can happen, which previously triggered an error.
* | mod_c2s,mod_s2s: Wrap callback to improve tracebacksKim Alvefur2022-02-222-2/+2
| | | | | | | | | | Should make traces point here instead of timer dispatch, making debugging easier
* | mod_carbons: Allow plugging into decision of whether to carbon-copyKim Alvefur2022-02-211-1/+9
| | | | | | | | Similar procedure as mod_csi_simple and mod_mam
* | mod_mam: Fix a commentKim Alvefur2021-12-111-1/+1
| | | | | | | | This is the noop that gets replaced later
* | mod_mam: Allow plugging into archive decisionKim Alvefur2021-12-101-4/+13
|/ | | | Similar procedure as mod_csi_simple
* mod_admin_shell: Use a table to show help sectionsKim Alvefur2022-02-201-17/+19
| | | | Because tables make everything better and more readable!
* mod_c2s: Ignore unused event payload [luacheck]Kim Alvefur2022-02-181-1/+1
|
* mod_c2s,mod_s2s: Wait for sessions to close before proceeding with shutdown ↵Kim Alvefur2022-02-172-2/+32
| | | | | | | | | | steps Ensures unavailable presence and other outgoing stanzas are sent. Waiting for c2s sessions to close first before proceeding to disable and close s2s ensures that unavailable presence can go out, even if it requires dialback to complete first.
* mod_c2s: Close ports in a separate, earlier event from closing sessionsKim Alvefur2022-02-181-0/+2
| | | | | Lets other things step in and do things while c2s ports are closed, e.g. mod_smacks, or other modules with port handlers that forward to c2s.