aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* mod_pubsub: Send correct jid attribute in disco#itemsKim Alvefur2023-07-081-1/+1
| | | | Fixes use in PEP where the JID does not equal the bare domain.
* mod_http: Fix error if 'access_control_allow_origins' is setKim Alvefur2023-06-101-1/+1
| | | | | | | | | | | Because it changes the type of the 'opt_origins' variable from util.set to the internal _items table so next time an http app is added an error "attempt to call a nil value (method 'empty')" is triggered. The value is not used anywhere else. Noticed when reviewing uses of the '_items' set property. Not reported by any users, implying this setting is rarely used.
* util.array: Expose new() on module tableKim Alvefur2023-06-101-0/+2
| | | | | | For consistency with other utils. Consistency is good.
* util.prosodyctl.check: Fix error where hostname can't be turned into A labelKim Alvefur2023-05-311-4/+5
| | | | | | | | | Where gethostname or tohostname returns an invalid name, e.g. containing underscores or something, to_ascii would reject this and return nil, which triggers an error in the dns lookup. Reported by prova2 in the chat, for whom tohostname returned a long name containing underscores.
* mod_s2s: Add event where resolver for s2sout can be tweakedKim Alvefur2022-08-182-0/+6
| | | | | | | | Could be used to implement custom connection methods (c.f. mod_onions) without needing to duplicate the rest of route_to_new_session(). Adds a feature to enable detection since it can be difficult to detect support for an event otherwise.
* mod_csi_simple: Disable revert-to-inactive timer when going to active modeKim Alvefur2023-05-011-0/+4
| | | | This timer shouldn't kick in in the middle of active mode.
* mod_csi_simple: Clear delayed active mode timer on disableKim Alvefur2023-05-011-0/+4
| | | | | | It should not be there afterwards. Noticed that it seems to fire some time after resumption claiming that the queue size is nil, implying that it may hold a reference to an expired session somehow.
* util.error: Fix error on conversion of invalid error stanza, fix #1805Kim Alvefur2023-04-191-1/+1
| | | | | | | | | Error stanzas should have an <error> element, but if you pass a stanza without one to util.error.from_stanza() it triggers an attempt to index a nil value, which this patch avoids. In the conditional, it should be safe to assume error_tag is non-nil since condition can't have those values then.
* mod_admin_shell: Fix display of remote cert status when expired etcKim Alvefur2023-04-061-1/+1
| | | | | Looks like autocomplete unhelpfully capitalized this word, but it's lowercase where it is set in mod_s2s_auth_certs
* prosodyctl: Fix using variable content in a format stringMatthew Wild2023-04-071-1/+1
| | | | This broke if the error message contained a format specified such as '%s'.
* mod_smacks: Replace existing watchdog when starting hibernationKim Alvefur2023-04-021-0/+4
| | | | | | There shouldn't be one here but if there is, for some reason, it's better to close it than have it around to wake up and possibly try to destroy the session.
* mod_smacks: Fix stray watchdog closing sessionsKim Alvefur2023-04-021-1/+6
| | | | | | Unsure exactly how this happens, but sometimes a watchdog appears to close a session that isn't hibernating, or hasn't hibernating long enough.
* mod_http: Unhook CORS handlers only if active (fixes #1801)Kim Alvefur2023-03-051-3/+7
|
* util.prosodyctl.check: Suggest 'http_cors_override' instead of older CORS ↵Kim Alvefur2023-02-221-2/+2
| | | | | | | | settings The cross_domain_* settings were added here prior to http_cors_override being added back in 17d87fb2312a, so for a time there was no replacement, but now there is.
* Added tag 0.12.3 for changeset 0598d822614fMatthew Wild2023-02-210-0/+0
|
* mod_websocket: Fire pre-session-close event (fixes #1800)0.12.3Matthew Wild2023-02-201-0/+3
| | | | | | | | | | | | | | | | This event was added in a7c183bb4e64 and is required to make mod_smacks know that a session was intentionally closed and shouldn't be hibernated (see fcea4d9e7502). Because this was missing from mod_websocket's session.close(), mod_smacks would always attempt to hibernate websocket sessions even if they closed cleanly. That mod_websocket has its own copy of session.close() is something to fix another day (probably not in the stable branch). So for now this commit makes the minimal change to get things working again. Thanks to Damian and the Jitsi team for reporting.
* net.http.parser: Fix off-by-one error in chunk parserMatthew Wild2023-02-172-5/+53
|
* mod_admin_socket: Return error on unhandled input to prevent apparent freezeKim Alvefur2023-02-162-1/+7
| | | | | | When mod_admin_socket is loaded without mod_admin_shell, attempt to use `prosodyctl shell` will appear to freeze after any input, since no response is returned.
* net.http.server: Add new API to get HTTP request from a connectionMatthew Wild2023-02-161-0/+4
| | | | | | | | | | | This information is sometimes necessary in the context where we have a connection that we know (or believe to be) associated with an incoming HTTP request. For example, it can be used to retrieve the IP address of a request (which may differ from the IP address of the connection, due to X-Forwarded-For and co). Thanks to the Jitsi team for highlighting this gap in the API.
* net.http.parser: Improve handling of responses without content-lengthMatthew Wild2023-02-092-9/+14
| | | | | | This ensures that we support responses without a content-length header, and allow streaming them through the streaming handler interface. An example of such a response would be Server-Sent Events streams.
* net.http: Add missing log parameterMatthew Wild2023-02-091-1/+1
|
* sessionmanager: Improve logging around session destructionMatthew Wild2023-02-091-3/+10
|
* core.sessionmanager: Mark session as destroyed to prevent reentryKim Alvefur2023-01-191-0/+1
| | | | | If it reaches this point, then the session will be most definitely be destroyed, so try to prevent destroy_session() from being called again.
* core.sessionmanager: Skip log when (not) destroying destroyed sessionsKim Alvefur2023-01-191-2/+1
| | | | | | | | | On regular disconnects, </stream> is sent, then sessionmanager.destroy_session() is called, then sessionmanager.destroy_session() is called again when the TCP connection is closed, from ondisconnect in mod_c2s. It is a bit annoying and doesn't really tell you much.
* util.startup: Close state on exit to ensure GC finalizers are calledKim Alvefur2023-01-222-5/+5
| | | | | | | | | | | | | Ensures a last round of garbage collection and that finalizers are called. Fixes things like proper closing of SQLite3 state. There are more calls to os.exit() but most of them exit with an error or in a case where a final GC sweep might not matter as much. It would be nice if this was the default. Calling util.statup.exit() everywhere may be sensible, but would be more involved, requiring imports everywhere.
* util.prosodyctl.shell: Close state on exit to fix saving shell historyKim Alvefur2023-01-221-2/+2
| | | | | | | | | | | | | | | | | | This ensures a last round of garbage collection and finalizers, which should include flushing the readline history file. Test procedure: ``` $ ./prosodyctl shell prosody> s2s:show() -- any command that is not the last in history ... output prosody> bye $ ./prosodyctl shell prosody> ^P ``` After this, the shell prompt should contain the last command from before the "bye". Before this patch, recent history is gone most of the time.
* mod_muc_mam: Copy "include total" behavior from mod_mamKim Alvefur2023-01-211-1/+5
| | | | | Not sure why this was missing from MUC MAM, it already had some of the code for dealing with it.
* mod_muc_mam: Add mam#extended form fields #1796 (Thanks Rain)Kim Alvefur2023-01-211-0/+10
| | | | Oversight in cabb022f31c0
* mod_mam,mod_muc_mam: Minimize differences (reorder, copy some comments)Kim Alvefur2023-01-212-8/+11
| | | | | Should have no functional difference, but makes it easier keeping mod_mam and mod_muc_mam in sync.
* mod_smacks: Log something when hibernation startsKim Alvefur2023-01-191-0/+1
| | | | | Will hopefully save future confusion about sessions being destroyed when they are in fact not.
* prosodyctl check dns: Check for Direct TLS SRV records even if not ↵Kim Alvefur2023-01-141-4/+8
| | | | | | | configured (fix #1793) Existing such records may cause timeouts or errors in clients and servers trying to connect, despite prosodyctl check saying all is well
* mod_invites: Prefer landing page over xmpp URI in shell commandKim Alvefur2023-01-101-2/+2
| | | | To mirror behavior of prosodyctl invocation
* net.http.server: Fix #1789Kim Alvefur2023-01-081-1/+1
| | | | | | | | | Unregistering the response before sending the trailer of the chunked transfer encoding prevents opportunistic writes from being invoked and running this code again when, which may cause an error when closing the file handle a second time. Normally the file size is known, so no chuck headers are sent.
* mod_storage_sql: Fix #1639Kim Alvefur2023-01-011-14/+12
| | | | Patch by Peter Kieser
* configure: Fix quoting of $LUA_SUFFIX (thanks shellcheck/Zash)Matthew Wild2022-12-291-1/+1
| | | | Transplanted 6b43bf85032b from trunk
* mod_storage_sql: Don't avoid initialization under prosodyctl (fix #1787)Kim Alvefur2022-12-291-1/+0
| | | | | | | | | Fixes `prosodyctl adduser` etc. Prior to d580e6a57cbb the line did nothing. Sometimes storage in the prosodyctl context does cause weirdness, as it is not in a host context, but rather a variant of global.
* Tag 0.12.2Kim Alvefur2022-12-120-0/+0
|
* Merge 0.11->0.120.12.2Kim Alvefur2022-12-121-1/+5
|\
| * Tag 0.11.14Kim Alvefur2022-12-120-0/+0
| |
| * util.stanza: Allow U+7F0.11.14Kim Alvefur2022-11-221-1/+5
| | | | | | | | | | | | | | | | Allowed by XML despite arguably being a control character. Drops the part of the range meant to rule out octets invalid in UTF-8 (\247 starts a 4-byte sequence), since UTF-8 correctness is validated by util.encodings.utf8.valid().
| * Added tag 0.11.13 for changeset ebeb4d959fb3Matthew Wild2022-01-240-0/+0
| |
* | mod_smacks: Disable resumption behavior on s2sKim Alvefur2022-11-131-1/+2
| | | | | | | | | | | | | | Since resumption is not supported on s2s currently, there is no point in allocating resumption tokens. The code that removes entries from session_registry is only invoked for c2s sessions, thus enabling resumable smacks on s2s adds an entry that never goes away.
* | util.json: Accept empty arrays with whitespace (fixes #1782)Matthew Wild2022-11-042-5/+22
| |
* | 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
| |
* | util.startup: Ensure import() is available in prosodyctl (thanks keyzer)Kim Alvefur2022-10-201-1/+1
| | | | | | | | | | Fixes error in mod_authz_internal due to import() being unavailable as it was only loaded in Prosody proper
* | util.jsonschema: Use same integer/float logic on Lua 5.2 and 5.3Kim Alvefur2022-10-091-2/+2
| | | | | | | | | | Fixes test case type.json:0:1 covering treatment of 1.0 as an integer according to the JSON definition
* | util.jsonschema: Fix Lua 5.2 integer compatKim Alvefur2022-10-091-1/+1
| | | | | | | | | | math.type() is unavailable before Lua 5.3 so this should use the compat function added at the top
* | util.jsonschema: Ignore test case for JavaScript specific detailKim Alvefur2022-10-091-0/+1
| | | | | | | | Also touching on how arrays are indistinguishable from tables in Lua