Commit Graph

5511 Commits

Author SHA1 Message Date
Evgeny Khramtsov 43da45cf67 Improve type specs of mod_muc_room 2019-07-09 15:21:17 +03:00
Evgeny Khramtsov 11fa02cd6c Improve type specs of mod_roster 2019-07-09 14:30:59 +03:00
Evgeny Khramtsov 590849e2c3 Avoid returning 'stopped' from ejabberd_hooks:run_fold() 2019-07-09 14:30:25 +03:00
Evgeny Khramtsov f7ad25108c Get rid of unused API functions in ejabberd_hooks
Also improve code formatting and type specs
2019-07-09 01:26:48 +03:00
Evgeny Khramtsov 3e88a0b0b4 Don't expose internal FSM API of ejabberd_c2s 2019-07-09 01:01:56 +03:00
Evgeny Khramtsov 9cbc0685db Don't expose internal FSM API of mod_muc_room 2019-07-09 00:47:54 +03:00
Evgeny Khramtsov cbe84eb50c Check virtual host before running the command 2019-07-08 23:14:31 +03:00
Evgeny Khramtsov 0545e0a797 Ignore late arrival of an already cancelled timer 2019-07-08 19:32:37 +03:00
Evgeny Khramtsov e8eb6bc2b4 Avoid crashing of ejabberd_iq process on invalid callback 2019-07-08 10:45:13 +03:00
Evgeny Khramtsov d4d352492c Debug hooks 2019-07-08 09:57:33 +03:00
Evgeny Khramtsov 83e6741117 Use maps instead of dict 2019-07-08 09:55:32 +03:00
Evgeny Khramtsov 92ab59a581 Use ets and maps instead of dict 2019-07-08 09:46:50 +03:00
Evgeny Khramtsov 80beb6d6f6 Improve formatting of exceptions 2019-07-07 22:12:14 +03:00
Evgeny Khramtsov 368858a744 Fix return type in try_set_password()
Fixes #2932
2019-07-07 12:16:04 +03:00
Evgeny Khramtsov fd8e5ffce7 Avoid routing packets through a single process 2019-07-06 12:30:57 +03:00
Evgeny Khramtsov 1663e78cf7 Fix validator of option ejabberd_service->hosts
Fixes #2929
2019-07-06 10:38:25 +03:00
Evgeny Khramtsov 61a58f6e67 Do not call the same function twice 2019-07-06 10:21:01 +03:00
Paweł Chmielowski 756adaba55 Restore room when receiving message or generic iq for not started room 2019-07-05 13:46:48 +02:00
Paweł Chmielowski d7e86d1d32 Limit number of rooms that we return for disco_items from muc
We will limit it to max_room_discoitems and return rsm that would allow
fetching more
2019-07-05 11:08:32 +02:00
Evgeny Khramtsov f82de80c66 Add forgotten file 2019-07-05 10:49:27 +03:00
Evgeny Khramtsov b3caade0a0 Distribute routing of MUC messages accross all CPU cores
Also relay as less stanzas as possible through mod_muc workers
2019-07-05 10:35:31 +03:00
Evgeny Khramtsov 05461d1686 Propagate max_fsm_queue to all modules started as gen_server 2019-07-04 10:26:59 +03:00
Evgeny Khramtsov d411e68a2e Make return type of sql_transaction() consistent 2019-07-04 09:27:51 +03:00
Evgeny Khramtsov 4658d478b4 Don't call ejabberd_option from ejabberd_options 2019-07-03 19:23:05 +03:00
Evgeny Khramtsov b7f6620166 Fix jwt_key option processing 2019-07-03 19:16:54 +03:00
Evgeny Khramtsov 0d0ad9d1d9 Use correct virtual host 2019-07-03 19:08:38 +03:00
Evgeny Khramtsov 8180bc22ee Fix formatting 2019-07-03 12:58:59 +03:00
Evgeny Khramtsov 6e2502ea7d Monitor routes
Clean route table from the process that died unexpectedly.
This usually may happen when the corresponding process
gets killed by OOM killer during overload.
2019-07-03 10:39:03 +03:00
Evgeny Khramtsov 0fc190e2ef Fix 'request_handlers' transformation
Fixes #2925
2019-07-03 09:54:56 +03:00
Evgeny Khramtsov 9f9e308241 Avoid using ! in ejabberd_router and mod_offline 2019-07-03 09:42:18 +03:00
Alexey Shchepin ff6884f313 Read jwt_key from file 2019-07-03 05:33:35 +03:00
Evgeny Khramtsov f68da70f3e Avoid last handled stanzas cache to grow indefinitely 2019-07-01 20:43:57 +03:00
Paweł Chmielowski 40c360c607 Invalidate proper cache when using mam for offline in pop_messages 2019-07-01 14:30:39 +02:00
Alexey Shchepin 8956b7d60d Fix a condition in ejabberd_auth_jwt 2019-07-01 14:44:28 +03:00
Paweł Chmielowski 3e8f3573a3 Make count_offline_messages cache work when offline uses mam for storage
This also replace existing cache for checking if spool is empty with this
cache.
2019-07-01 13:36:41 +02:00
Evgeny Khramtsov c5fde9d5af Get rid of useless dialyzer instructions 2019-07-01 10:36:20 +03:00
Evgeny Khramtsov 3d82a5eee6 Fix ejabberd_auth_jwt return types and regenerate ejabberd_option.erl 2019-07-01 09:05:33 +03:00
Alexey Shchepin 3e5c0a1df8 Authentication using JWT tokens 2019-07-01 05:01:55 +03:00
Evgeny Khramtsov 4aebd2fd8e Cache number of offline messages 2019-06-30 21:14:37 +03:00
Evgeny Khramtsov 253ec13971 Use new ets_cache API in ejabberd_auth 2019-06-30 17:15:43 +03:00
Evgeny Khramtsov a2a061c1c8 Avoid using broad p1_queue:queue() type wherever possible 2019-06-28 22:16:29 +03:00
Evgeny Khramtsov 6011135d24 Use yconf validator for custom Mnesia schemas 2019-06-27 15:23:21 +03:00
Evgeny Khramtsov 39cf8d86d6 Avoid using broad map() type wherever possible 2019-06-27 15:22:27 +03:00
Evgeny Khramtsov 6b684c866b Use correct rr_type() 2019-06-27 11:35:56 +03:00
Evgeny Khramtsov 2abca350e0 Fix type specs 2019-06-27 11:32:54 +03:00
Evgeny Khramtsov 4e5daf4d72 Make sure queue bouncing doesn't yield into infinite recursion 2019-06-26 11:56:25 +03:00
Evgeny Khramtsov ffe1c722e0 Deprecate 'route_subdomains' option
This option was introduced to fulfill requirement of RFC3920 10.3,
but in practice it was very inconvenient and many admins were
forced to change its value to 's2s' (i.e. to behaviour that
violates the RFC). Also, it seems like in RFC6120 this requirement
no longer presents.

Those admins who used this option to block s2s with their subdomains
can use 's2s_access' option for the same purpose.
2019-06-26 10:45:58 +03:00
Evgeny Khramtsov b479fe5315 Use correct stacktrace in logging macros
By calling erlang:get_stacktrace() inside a lager function
we obtain actually a stacktrace of the lager function, not
the one we got during exception. This is not a problem for
newest Erlang versions though.
2019-06-26 00:05:41 +03:00
Evgeny Khramtsov 6697a3e3f1 Use proper loglevel to log resumption failures 2019-06-25 20:42:54 +03:00
Paweł Chmielowski 7b35690bc9 Store muc_subscribers in process dict if get_subscribed_rooms not available 2019-06-25 16:41:47 +02:00
Evgeny Khramtsov 8b300d734b Don't propagate downstream already handled message 2019-06-25 14:36:17 +03:00
Evgeny Khramtsov 28b1d88772 Call ejabberd_s2s:allow_host/2 with correct virtual host 2019-06-24 21:18:57 +03:00
Evgeny Khramtsov a3e0cbbdd8 Make logging messages more consistent 2019-06-24 20:32:34 +03:00
Evgeny Khramtsov 370226417a Check if mod_last is loaded before calling its functions 2019-06-24 18:47:51 +03:00
Evgeny Khramtsov db9e8220ec Deprecated access_commands option 2019-06-24 17:20:29 +03:00
Evgeny Khramtsov 1d239ec6fb Make ejabberd_xmlrpc working as a listening module again
Fixes #2915
2019-06-24 17:13:34 +03:00
Evgeny Khramtsov d0b65a3c95 Don't crash on empty avatar data 2019-06-24 17:00:51 +03:00
Evgeny Khramtsov c2cbb4d879 Use correct virtual host for s2s options 2019-06-23 19:37:54 +03:00
Evgeny Khramtsov 4b65fcab62 Avoid code duplication in gen_mod 2019-06-23 17:06:53 +03:00
Evgeny Khramtsov deee194522 Let it crash on unspecified option 2019-06-23 16:54:01 +03:00
Evgeny Khramtsov 83c291c064 Respond with 'Bad Request' to unexpected 'Host' header
Where "unexpected" means the host in 'Host' header is not
a registered route. The rationale is to avoid propagation
of uknown "Host" further in the code, which may lead to
nasty errors related to reading configuration values, calling
functions from ejabberd_router.erl, etc.
2019-06-23 13:12:00 +03:00
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 Hrist 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
LOU Xun 8d6455460d
Protect against bad muc#owner requests 2019-06-06 15:40:13 +00: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