24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-22 22:23:42 +02:00
Commit Graph

5449 Commits

Author SHA1 Message Date
Evgeny Khramtsov
e477a8c220 Validate and set 'version' option at an earlier stage 2019-06-23 12:23:22 +03:00
Evgeny Khramtsov
00f2a736eb Improve extraction of translated strings
Now every such string MUST be encapsulated into ?T() macro.
The macro itself is defined in include/translate.hrl.
Example:

-module(foo).
-export([bar/1]).
-include("translate.hrl").

bar(Lang) ->
    translate:translate(Lang, ?T("baz")).
2019-06-22 17:08:45 +03:00
Evgeny Khramtsov
4f69325e3c Fix shaper selection in ejabberd_c2s 2019-06-22 10:19:17 +03:00
Evgeny Khramtsov
e9a78d0de7 Make option 'validate_stream' global 2019-06-21 21:06:32 +03:00
Evgeny Khramtsov
a0d3fb3b23 Don't attempt to query 'undefined' active list
Also code formatting was improved
2019-06-21 19:37:47 +03:00
Evgeny Khramtsov
72572d990a Allow multiple definitions of host_config and append_host_config 2019-06-21 15:37:51 +03:00
Evgeny Khramtsov
f3d5916236 Correct mod_mix_pam protocol version
Fixes #2913
2019-06-21 14:47:10 +03:00
Evgeny Khramtsov
be35350b9c Fix usage of TLS in mod_mqtt
Fixes #2919
2019-06-21 14:39:46 +03:00
Holger Weiss
026540f7e6 mod_pubsub: Check access_model when publishing PEP
Don't just adhere to the node's access_model when delivering the last
PEP item but also when a new item is published.

Many thanks to Philipp Hörist for spotting this.
2019-06-20 18:18:14 +02:00
Badlop
c318b5f8a2 Rename remaining command arguments from Server to Host (#2908) 2019-06-19 09:31:12 +02:00
Badlop
fb77e2e8c0 Add support for backwards compatibility in command argument names (#2908) 2019-06-19 09:30:53 +02:00
Badlop
ad98d4a515 Fix support for nonexistent or empty access_commands in ejabberd_xmlrpc 2019-06-19 09:19:32 +02:00
Evgeny Khramtsov
5a5f188767 Require opt_type/1 callback 2019-06-17 20:51:04 +03:00
Evgeny Khramtsov
ef3753aa86 Generate more readable exception 2019-06-17 20:49:43 +03:00
Evgeny Khramtsov
0c4818daca Reflect recent pubsub changes in configuration transformer 2019-06-17 13:42:58 +03:00
Evgeny Khramtsov
21d9bd8325 Bump supported version of XEP-0355 2019-06-17 12:53:15 +03:00
Evgeny Khramtsov
50af436fad Fix component routes unregistration
Fixes #2910
2019-06-17 12:29:04 +03:00
Christophe Romain
c9d3beb9eb Remove deprecated pubsub plugins 2019-06-17 11:19:28 +02:00
Evgeny Khramtsov
e84391a6a9 Use list_to_existing_atom/1 wherever possible 2019-06-15 15:14:45 +03:00
Evgeny Khramtsov
a205ebad2b Get rid of "well-known" type 2019-06-15 12:53:16 +03:00
Evgeny Khramtsov
67fbbe7a0b Remove default_db/1 and add default_db/3
Same for default_ram_db/1 and default_ram_db/3
2019-06-15 12:10:35 +03:00
Evgeny Khramtsov
cfaed70fe3 Warn about 'service_url' option during config transformation 2019-06-14 17:38:55 +03:00
Evgeny Khramtsov
9e2e590061 Fix exception formatting on old Erlang 2019-06-14 16:58:39 +03:00
Evgeny Khramtsov
377748b688 Fix validator of mod_avatar 2019-06-14 16:42:22 +03:00
Evgeny Khramtsov
d85cf7780c Introduce option 'captcha_url'
Option 'captcha_host' is now deprecated in favor of 'captcha_url'.
However, it's not replaced automatically at startup, i.e. both options
are supported with 'captcha_url' being the preferred one.
2019-06-14 16:06:04 +03:00
Evgeny Khramtsov
a589843abd Remove mod_echo module 2019-06-14 14:47:46 +03:00
Evgeny Khramtsov
a02cff0e78 Use new configuration validator 2019-06-14 12:33:26 +03:00
Paweł Chmielowski
d48c067681 Return jid_malformed error when sending presence without nick to conference 2019-06-13 18:42:02 +02:00
badlop
b48b6dbda5
Merge pull request #2651 from Iperity/fix-privacy-race-condition
Fix mod_privacy race condition
2019-06-13 09:34:58 +02:00
Mickaël Rémond
267ce0dde0
Debug log to help troubleshoot delegation ACLs 2019-06-11 18:52:44 +02:00
Christophe Romain
88a3e1b510 Revert "Fix pubsub compliance XEP-0060 § 7.1.3.6 (#2864)"
This reverts commit 2fff4d1ea6.
This commit broke the XEP compliance. more details here
https://xmpp.org/extensions/xep-0060.html#events
2019-06-11 10:18:36 +02:00
Nathan Bruning
8410a203ec Refactor mod_privacy patch; move logic user_receive_packet to
user_send_packet.
2019-06-10 14:10:37 +02:00
Nathan Bruning
aa489c5a8b Fix user_send_packet in mod_privacy; was failing on newly created users 2019-06-10 12:49:39 +02:00
Nathan Bruning
570800a540 Fix mod_privacy race condition
mod_privacy updates the c2s state in user_receive_packet, which
tracks the *result* of the IQ set for active privacy lists.

When a second stanza is sent directly after a privacy list request,
the second stanza will be processed using the old privacy list,
because the IQ result has not yet been routed.
2019-06-10 12:49:39 +02:00
Evgeny Khramtsov
80b7d50628 Use system_time/1 instead of monotonic_time/1
The value of monotonic_time/1 may differ significantly between
nodes in a cluster due to different erlang:time_offset/0 values.

Thanks to Christoph Scholz for spotting this
2019-06-06 21:26:50 +03:00
Holger Weiss
6c0d6f0774 mod_register_web: Don't crash if user exists
Since commit 633b68db11,
ejabberd_auth:try_register/3 returns {error, exists} rather than
{atomic, exists}.

Thanks to Thomas Leister for reporting the issue.
2019-06-05 18:28:35 +02:00
Badlop
ed1cbc2c31 Fix example argument in private_set, don't include Query element 2019-05-29 19:41:36 +02:00
Holger Weiss
274a507590 mod_stream_mgmt: Drop unused code
Revert the changes applied to mod_stream_mgmt in commit
b76f90fe39, as the new implementation of
mod_offline's 'use_mam_for_storage' feature doesn't need them.
2019-05-29 00:30:59 +02:00
Paweł Chmielowski
571a786b9b Change implementation of mod_offline use_mam_for_storage
Previous version was trying to determine range of messages that should
be fetched from mam by storing time when last user resource disconnected.

But that had couple edge cases that could cause problems, for example in
case of node crash we could not store information about user disconnect
and with that we didn't have data to initiate mam query.

New version don't track user disconnects, but simply ensure that we have
timestamp of first message that is gonna be put in storage, after some
measurements cost of that check with caching on top is not that costly,
and as much more robust i decided to introduce that change.
2019-05-28 14:32:17 +02:00
Evgeny Khramtsov
4eaba13189 Don't check mod_register restrictions in 'register' command
The commit reverts behaviour introduced in
1f2b8adc28
2019-05-28 15:14:45 +03:00
Holger Weiss
8b301fc93e mod_http_upload: Avoid catch-all error handling 2019-05-27 21:56:37 +02:00
Mickaël Rémond
a06bdb1721
Improve captcha blocking alert wording 2019-05-25 11:30:04 +02:00
Paweł Chmielowski
50f93023f5 Fix last commit 2019-05-24 15:18:15 +02:00
Paweł Chmielowski
226c09f031 Make mod_admin_extra add/delete_rosteritem reuse code from mod_roster 2019-05-24 14:02:17 +02:00
Evgeny Khramtsov
3f7a850ae8 Use different cache tables per auth module
Fixes #2322
2019-05-23 11:32:55 +03:00
Evgeny Khramtsov
17f9ffb7e7 Merge branch 'master' of github.com:processone/ejabberd 2019-05-19 11:23:29 +03:00
Evgeny Khramtsov
2b523030cf Report better errors on SQL terms decode failure 2019-05-19 11:22:41 +03:00
Alexey Shchepin
63e9b82a46 Fix PostgreSQL compatibility in mod_offline_sql:remove_old_messages (#2695) 2019-05-18 21:16:45 +03:00
Badlop
937f07a4cc Fix typo in Change User Password adhoc command (thanks to lovetox)(#2884) 2019-05-17 15:48:03 +02:00
Badlop
2db547b557 Vcard search doesn't support * in mnesia, fix search form (#633) 2019-05-17 15:26:44 +02:00
Evgeny Khramtsov
2aa181658a Fix mod_legacy_auth to reflect recent changes 2019-05-15 20:55:17 +03:00
Evgeny Khramtsov
a4c3ea0dfb Don't process failed EXTERNAL authentication by mod_fail2ban
This will only lead to confusion because it's not considered
possible to brute force client certificates.
2019-05-15 18:13:31 +03:00
Evgeny Khramtsov
3c95764d1a Modify arguments of c2s_auth_result hook
The hook now accepts `true | {false, Reason :: binary()}` arguments
instead of just `true | false`
2019-05-15 17:21:09 +03:00
Badlop
e996579dd1 Preliminary support for SQL in process_rosteritems, and move code (#2448) 2019-05-15 10:57:55 +02:00
Paweł Chmielowski
122cb4b959 Don't put duplicate polling attribute in bosh payload
This fixes issue #2790
2019-05-14 17:32:19 +02:00
Holger Weiss
1452023c93 mod_http_upload: Case-insensitive host comparison
Perform a case-insensitive lookup of the host name specified by the HTTP
client.

Fixes #2827.
2019-05-12 11:57:17 +02:00
Evgeny Khramtsov
3d8711f708 Avoid late arrival of get_disco_item response 2019-05-11 19:27:56 +03:00
Evgeny Khramtsov
4b6f1195c6 Handle TCP errors in websockets 2019-05-09 22:06:23 +03:00
Christophe Romain
2fff4d1ea6 Fix pubsub compliance XEP-0060 § 7.1.3.6 (#2864) 2019-05-07 16:23:36 +02:00
Christophe Romain
a6f7d7ce23 Raise api hook right before performing the call 2019-05-07 11:46:04 +02:00
Paweł Chmielowski
4dc8549738 Make anonymous auth don't {de}register user when there are other resources
This should fix issue reported in #2878
2019-05-07 11:02:53 +02:00
Paweł Chmielowski
7d23cd2899 When applying limit of max msgs in spool check only spool size 2019-05-07 09:58:14 +02:00
Paweł Chmielowski
8207ea18bf Remove compiler warnings 2019-05-06 20:03:10 +02:00
Paweł Chmielowski
83b790c7c9 Do not store mucsub wrapped messages with no-store hint in offline storage
We already don't store those messages in mam and we don't store messages
that aren't wrapped with that hint in offline, so it make sense to extend
it also to mucsub messages.
2019-05-06 19:22:18 +02:00
Paweł Chmielowski
3d434cfcef Handle get_subscribed_rooms call from mod_muc_room pid
Previously sometimes we tried to post message to all online rooms, and
if that was called from muc room pid, we were not able to process that
message for that room and send response, and this did lead to timeout.
2019-05-06 19:15:48 +02:00
Paweł Chmielowski
4e7bf9207e Do not declare mod_muc as dependency of mod_mam to prevent loop in deps 2019-05-06 12:22:19 +02:00
Mickael Remond
7a8de9cfcf
Make some standard admin command to get Mnesia info 2019-05-03 14:59:24 +02:00
Badlop
6b0f7f2a24 Fix bug that appears when importing privacy from Prosody (#2872) 2019-05-02 21:10:21 +02:00
Badlop
7a107c02a5 Store imported room in the correct ServerHost (#2874) 2019-05-02 20:32:10 +02:00
Paweł Chmielowski
cd2d62bffd Set from/to in activity marker messages 2019-05-02 13:19:54 +02:00
Christophe Romain
f7bc969729 Fix typo and remove forgotten log from 492da2ba 2019-05-02 12:05:20 +02:00
Christophe Romain
492da2baac Remove logging from REST lib 2019-05-02 11:40:53 +02:00
Paweł Chmielowski
25f7ce0cb6 Always store ActivityMarker messages 2019-05-02 11:12:47 +02:00
Paweł Chmielowski
0d2720d7ab Don't issue count/message fetch queries for offline from mam when not needed 2019-05-02 11:12:22 +02:00
Paweł Chmielowski
7eb5a0877b Sqlite doesn't recognize concat() so use || on it instead 2019-04-30 18:33:12 +02:00
Paweł Chmielowski
eac7a77b6a Fix room state cleanup from db on change of persistent option change 2019-04-30 17:34:49 +02:00
Paweł Chmielowski
b83d30fd07 Make get_subscribed_rooms work even for non-persistant rooms
This will store info about non-persistant rooms in db, but rooms with that
that option enabled will not be restored on server restart.

This will save info about room only on subscribers change.
2019-04-30 13:41:03 +02:00
Paweł Chmielowski
b071c4906f Fix escaping for sql part of mamsub from muc mam 2019-04-30 13:36:31 +02:00
Evgeny Khramtsov
c7d04a82a2 Deprecate some listening options
Those are: captcha, register, web_admin, http_bind and xmlrpc
The option `request_handlers` should be used instead, e.g.:

listen:
  ...
  -
    module: ejabberd_http
    request_handlers:
      "/admin": ejabberd_web_admin
      "/bosh": mod_bosh
      "/captcha": ejabberd_captcha
      "/register": mod_register_web
      "/": ejabberd_xmlrpc
2019-04-30 11:14:14 +03:00
Evgeny Khramtsov
268750e3b7 Provide a suggestion when unknown request handler is detected 2019-04-30 10:31:03 +03:00
Evgeny Khramtsov
11e963aa78 Provide a suggestion when unknown command is detected 2019-04-30 10:05:06 +03:00
Evgeny Khramtsov
4af99f7b03 Rename ejabberd_config:similar_option/2 -> misc:best_match/2 2019-04-30 09:36:38 +03:00
Evgeny Khramtsov
c56209a27d Provide a suggestion when unknown module is detected 2019-04-29 21:15:52 +03:00
Evgeny Khramtsov
39bbc7cad8 Provide a suggestion when unknown option is detected 2019-04-29 20:57:59 +03:00
Evgeny Khramtsov
1db22c9656 Improve code for directory deletion 2019-04-29 18:50:54 +03:00
Paweł Chmielowski
a0f48cf52f Fix offline from mam on mnesia 2019-04-29 17:25:06 +02:00
Paweł Chmielowski
eff70951c5 Add tests for offline with mam storage 2019-04-29 16:40:47 +02:00
Paweł Chmielowski
c550d36581 Properly handle infinity as max number of message in mam offline storage 2019-04-29 16:37:21 +02:00
Paweł Chmielowski
aaf674160b Sort messages by stanza_id when using mam storage in mod_offline 2019-04-29 16:32:19 +02:00
Paweł Chmielowski
faf9b20ac0 Return correct value from count_offline_messages with mam storage option 2019-04-29 16:31:37 +02:00
Paweł Chmielowski
17ff62d4af Make mod_offline put msg ignored by mam in spool when mam storage is on 2019-04-29 16:30:45 +02:00
Paweł Chmielowski
b716b835c4 Add tests for offline use_mam_for_storage 2019-04-29 11:35:18 +02:00
Paweł Chmielowski
b76f90fe39 Add mod_offline option for fetching data from mam instead of from spool table
This commit introduces `use_mam_for_storage` option that take boolean
argument. Enabling it will make mod_offline not use spool table for storing
offline message, but instead will use mam archive to retrieve messages
stored when offline.

Enabling this option have couple drawback currently, only messages that
were stored in mam will be available, most of flexible message retrieval
queries don't work (those that allow retrieval/deletion of messages by id).
2019-04-26 19:59:06 +02:00
Paweł Chmielowski
bcfe50f817 Return "Bad request" error when origin in websocket connection doesn't match
This also allow websocket_origin option to accept multiple values instead
of just single one.
2019-04-26 15:29:43 +02:00
Paweł Chmielowski
17444ba84e Allow non-moderator subscribers to get list of room subscribers 2019-04-25 14:52:47 +02:00
Evgeny Khramtsov
a0c8c70c9c Use binary framing in MQTT WebSockets 2019-04-25 14:30:42 +03:00
Paweł Dorofiejczyk
cc5829bc33 Fix RFC6454 violation on websocket connection when validating Origin header 2019-04-24 16:59:54 +02:00
Paweł Chmielowski
8b501f5fe6 Catch potential exceptions in gen_mod:wait_for_process
Seems that at ejabberd shutdown, process may terminate before that function
is called, and in that case erlang:monitor throws exception.
2019-04-24 13:46:16 +02:00
Evgeny Khramtsov
fc043dd8cf Reformat try_set_password/4 function 2019-04-23 21:25:10 +03:00
Evgeny Khramtsov
cbf3fec2c8 Don't call to mod_register when it's not loaded
Fixes #2828
2019-04-23 21:05:21 +03:00