25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-10-31 15:21:38 +01:00
Commit Graph

5702 Commits

Author SHA1 Message Date
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
Evgeny Khramtsov
edba1aebb5 Add WebSockets support to mod_mqtt
Example configuration:

listen:
  ...
  -
    port: 5280
    module: ejabberd_http
    request_handlers:
      "/mqtt": mod_mqtt

modules:
  ...
  mod_mqtt: {}
2019-04-23 19:18:22 +03:00
Paweł Chmielowski
d2ea905926 Fix handling of list arguments on pgsql 2019-04-23 17:46:42 +02:00
Evgeny Khramtsov
feb4c7f5e9 Support other socket modules for MQTT 2019-04-23 16:22:27 +03:00
Evgeny Khramtsov
5faae61bef Move websocket options 2019-04-23 16:21:06 +03:00
Evgeny Khramtsov
cc892ddc01 Improve request_handlers validator 2019-04-23 16:19:26 +03:00
Evgeny Khramtsov
7c45b52c86 Correctly support cache tags in ejabberd_auth 2019-04-19 15:42:24 +03:00
Evgeny Khramtsov
0789a145fc Allow returning HTTP headers in REST responses 2019-04-19 15:16:47 +03:00
Evgeny Khramtsov
7f14826564 Use new ets_cache api in ejabberd_auth 2019-04-19 15:08:41 +03:00
Paweł Chmielowski
875b2daff1 Add hook room_destroyed called when room gets destroyed 2019-04-17 18:56:25 +02:00
Paweł Chmielowski
4e2c95fe58 Change implementation of misc:unique_timestamp() 2019-04-16 11:20:55 +02:00
Paweł Chmielowski
83653c0338 Handle cdata in initial data probe of ws module 2019-04-16 10:56:11 +02:00
Paweł Chmielowski
3706e35b86 Make misc:unique_timestamp not overflow microsecond part.
This should fix issue #2860
2019-04-16 10:24:28 +02:00
Paweł Chmielowski
c96a925fde Add hooks for tracking mucsub subscriptions changes 2019-04-15 12:03:30 +02:00
Evgeny Khramtsov
009b9a1fd0 Feed whole image to eimp:identify/1
Fixes #2859
2019-04-14 17:05:16 +03:00
Paweł Chmielowski
8761e6e0e0 Handle correctly case where ExtraUsername is empty 2019-04-11 12:00:13 +02:00
Paweł Chmielowski
c5a06e9d06 When making mucsub message from mam archive check for subject 2019-04-09 11:17:14 +02:00
Evgeny Khramtsov
2e007f1607 Use xml:lang from stanza when it's missing in <command/> element
Thanks to Philipp Hörist for spotting this
2019-04-06 18:27:28 +03:00
Evgeny Khramtsov
9f3ccd604e Add 'sessionid' attribute when required
Fixes #2852
2019-04-06 16:52:22 +03:00
Evgeny Khramtsov
909a505d65 Update mod_muc_riak 2019-04-03 16:04:58 +03:00
Evgeny Khramtsov
3013f1b9bc Update mod_mam dependencies 2019-04-03 15:01:20 +03:00
Evgeny Khramtsov
17b9dc6035 Decrease ugliness of the ugly code 2019-04-03 14:50:56 +03:00
Evgeny Khramtsov
e66f594901 Change mucsub API for database backends 2019-04-03 14:20:37 +03:00
Badlop
4e591a73c5 Add ext_mod paths before checking config (processone/ejabberd-contrib#263) 2019-04-03 13:10:11 +02:00
Paweł Chmielowski
623a9ec3ba Return proper error message for duplicate or missing args in http_api call 2019-04-03 12:05:39 +02:00
Paweł Chmielowski
65a6532cd9 Log message when trying to execute http_api command with extra arguments 2019-04-03 11:50:15 +02:00
Paweł Chmielowski
33c10867e3 Formating fix 2019-04-03 11:48:59 +02:00
Paweł Chmielowski
d085fff14b Make http_api command execution exception catcher log also command and args 2019-04-03 11:33:07 +02:00
Badlop
cbac8a604a cache_size not applied to mod_roster on reload_config (#2769) 2019-04-02 19:52:07 +02:00
Evgeny Khramtsov
d96ab48c6b Fix previous commit
Fixes #2847
2019-04-02 09:58:12 +03:00
Evgeny Khramtsov
ed2abe471a Rename listening callback from start/2 to start/3
This will prevent conflicts in callback names in mod_mqtt
Old callback function is still supported.
2019-04-01 16:53:28 +03:00
Paweł Chmielowski
7eef966a04 Fix issue with creating HostMatch in mod_mam_sql
This fixes issue #2844
2019-04-01 10:56:03 +02:00
Evgeny Khramtsov
5c69122bbe Use xmpp:get_subtags/2 2019-04-01 10:47:29 +03:00
Paweł Chmielowski
9b040f65a3 Don't use deprecated gen_mod:db_type 2019-03-29 18:41:51 +01:00
Paweł Chmielowski
24b9b69783 Fix issue with mam tests
Too much copy/paste...
2019-03-29 17:18:30 +01:00
Paweł Chmielowski
0c78e01088 Implement mod_muc_sql:select_with_mucsub
This allows us to limit number of issued queries required by
user_mucsub_from_muc_archive option
2019-03-29 16:11:50 +01:00
Paweł Chmielowski
a7310ffea1 Make misc:add_delay_info properly handle multiple delay tags in element 2019-03-29 11:25:35 +01:00
Paweł Chmielowski
8e05fd1d24 Add option user_mucsub_from_muc_archive to mod_muc
This option disable storing separate mucsub message for each individual
subscriber but instead when user fetches archive virtual mucsub messages
are generated from muc archives.
2019-03-28 17:42:25 +01:00
Paweł Chmielowski
063869603a Include id in mucsub notification message 2019-03-28 14:43:28 +01:00
Badlop
ee2b441b0f Add 'config' tag to the reload_config command 2019-03-27 11:51:43 +01:00
Badlop
1f2b8adc28 Fix Register command to respect mod_register's Access option (#2837) 2019-03-22 15:02:51 +01:00
Badlop
6545d55473 Fix crash in mod_muc_admin:web_page_main/2 caused by just_created (#2830) 2019-03-18 17:11:00 +01:00
Paweł Dorofiejczyk
6129720838 Origin header validation on websocket connection (#2821) 2019-03-15 12:19:14 +01:00
Christophe Romain
4a920dca5a Add newline to error_logger log format 2019-03-15 11:51:48 +01:00
Paweł Chmielowski
5077d39600 Add check for ljid when setting up subscribers 2019-03-14 15:54:51 +01:00
Paweł Chmielowski
3b16afeda7 Flip default bounce_groupchat flag value, muc will drop bounces anyway 2019-03-14 15:40:34 +01:00
Paweł Chmielowski
89db022da4 Add option to mod_offline to make it not bounce mucsub/groupchat messages 2019-03-14 15:17:25 +01:00
Evgeny Khramtsov
0715e62a41 Use jid() instead of ljid() 2019-03-14 14:34:15 +03:00
Evgeny Khramtsov
7a622c3392 Improve formatting of hook crashes 2019-03-14 12:28:37 +03:00
Badlop
629e568294 Delete the ping timer only when timeout_action=kill (#2820) 2019-03-13 11:28:31 +01:00
Holger Weiss
333b010d54 mod_muc: Simplify room creation checks 2019-03-12 00:05:59 +01:00
Holger Weiss
1af2b2cfc7 Merge remote-tracking branch 'processone/pr/2811'
* processone/pr/2811:
  allow room recreate for admins even if nonempty
2019-03-11 23:30:22 +01:00
Holger Weiss
328553ea3f mod_push: Check for payload in encrypted messages
While distinguishing actual chat messages from other message types,
don't classify all <encrypted/> messages as chat messages, but only
those that have a <payload/> element.
2019-03-11 22:58:53 +01:00
Alexey Shchepin
e921b43754 Fix transaction aborting and restarting in ejabberd_sql 2019-03-07 22:14:13 +03:00
Christoph Scholz
b5fa3b0e2b allow room recreate for admins even if nonempty 2019-03-05 16:51:57 +01:00
Badlop
a4222fe9b3 Handle info log level when using MySQL (#2541) 2019-03-04 18:02:02 +01:00
Holger Weiss
2f46aebca2 mod_http_upload: Log nicer warning on unknown host
If an HTTP client issues a request against an unknown host, log a
readable warning (rather than an unreadable error) and respond with a
404 (rather than a 500) status.
2019-02-28 00:28:46 +01:00
Paweł Chmielowski
456e87e8b2 Copy p1_time_compat:unique_timestamp() to misc and make use of it 2019-02-27 11:00:02 +01:00
Paweł Chmielowski
538f35d05a Replace code using p1_time_compat wrapper with native functions
Since we now require R19, we shouldn't need that anymore.

There are still couple places where p1_time_compat:unique_timestamp() is
used as there is no direct equivalent.
2019-02-27 09:56:31 +01:00
Paweł Chmielowski
77ac0584ed Remove now() calls that sneaked in in pull requests 2019-02-27 09:56:31 +01:00
Evgeny Khramtsov
0250826cf9 Update mod_mqtt_mnesia.erl 2019-02-26 13:45:53 +03:00
Christoph Scholz
e257bc3d32 acl for mam_preferences 2019-02-25 22:21:30 +01:00
Paweł Chmielowski
d04a2454cc Add Accept header to requests issued by rest.erl 2019-02-25 16:18:13 +01:00
Evgeny Khramtsov
a3df791373 Add MQTT support 2019-02-25 11:42:09 +03:00
Holger Weiss
3491fa3fea mod_muc_admin: Fix indentation 2019-02-23 23:50:14 +01:00
Christoph Scholz
dd7754bc59 only destroy rooms if mam is enabled
when using ejabberdctl rooms_empty_list or rooms_empty_destroy only
select rooms that are have mam enabled. Otherwise you may accidently
destroy rooms which seem to be unsused due to archive being empty
2019-02-23 22:48:15 +01:00
Holger Weiss
f63dcdb790 mod_mam_sql: Improve check for empty archive
Avoid counting the messages of an archive to check whether it's empty.
2019-02-21 23:50:16 +01:00
Holger Weiss
9a3a7369cb mod_mam_mnesia: Fix check for empty archive
Don't return 'true' if the key exists but points to an empty archive.
Also, avoid looking up all keys.
2019-02-21 22:19:29 +01:00
Evgeny Khramtsov
1684436bfe Merge branch 'mix' 2019-02-21 12:36:33 +03:00
Holger Weiss
9c66cc5885 Merge remote-tracking branch 'processone/pr/2763'
* processone/pr/2763:
  disallow room creation if archive not empty and clear_archive_on_room_destroy is false
  check if mod_mam is loaded before calling mod_mam:is_empty_for_room
  added cmds to list and destroy empty rooms by ejabberdctl
  allow check if archive is empty for or user or room
  option to prevent archive removal on room destroy
2019-02-20 17:01:34 +01:00
Evgeny Khramtsov
8def827f9c Don't crash on malformed 'modules' section 2019-02-19 12:31:18 +03:00
Christoph Scholz
5e7f234ac8 disallow room creation if archive not empty and
clear_archive_on_room_destroy is false
2019-02-18 13:42:45 +01:00
Christoph Scholz
f987db5a39 check if mod_mam is loaded before calling mod_mam:is_empty_for_room 2019-02-18 13:42:45 +01:00
Christoph Scholz
a47c566b39 added cmds to list and destroy empty rooms by ejabberdctl 2019-02-18 13:42:45 +01:00
Christoph Scholz
2e586000d7 allow check if archive is empty for or user or room 2019-02-18 13:42:45 +01:00
Christoph Scholz
89b9e25588 option to prevent archive removal on room destroy 2019-02-18 13:42:45 +01:00
Paweł Chmielowski
b30775a357 Don't perform roster push for non-local contacts in mod_shared_roster
If group have member with jid from external server we tried to make
mod_roster sent roster push to it, and it sometimes didn't like to get
bogus data like that, so let's check if it's local user before doing this.
2019-02-18 12:37:42 +01:00
Holger Weiss
abdbc5df13 mod_push: Improve notification error handling
Don't disable push notifications if the app server returned a temporary
error, and log the app server's notification response.
2019-02-11 22:29:49 +01:00
Badlop
e18522f74c Once just_created isn't true, use it to keep room process creation (#2787) 2019-02-11 16:56:33 +01:00
Paweł Chmielowski
ea32d3f02c Send mucsub subscriber notification events with from set to room jid 2019-02-11 13:04:06 +01:00
Badlop
2819e26c8f Add notice about rooms_unused_destroy using the room history (#2787) 2019-02-06 16:34:02 +01:00
Badlop
6cd458d205 Don't consider room's lack of history when history_size is zero (#2787) 2019-02-06 16:33:59 +01:00
Badlop
c41c5b2185 Fix support to restart module with live options in WebAdmin 2019-02-06 13:30:30 +01:00
Badlop
7074a39ff3 Handle versioning result when shared roster group has remote account (#2692) 2019-02-06 12:36:01 +01:00
Badlop
8baced0d8b Merge branch 'mod_ping_no_kill' of https://github.com/fdie/ejabberd into 3 2019-02-01 16:21:58 +01:00
Frank Diebolt
4ff4711d4f catch badarg exceptions on invalid callback procs 2019-01-31 18:14:36 +01:00
Christophe Romain
9577fe3ba8 Fix argument name consistency 2019-01-31 18:05:39 +01:00
Frank Diebolt
9b66894dda ! may raise exceptions on invalid proc 2019-01-31 17:44:11 +01:00
Christophe Romain
ae7b391657 Do not overwrite odbc config file (#2295) 2019-01-31 13:25:56 +01:00
Paweł Chmielowski
bbffd396f6 Produce better error for http_api request with extra parameters 2019-01-30 16:35:06 +01:00
Paweł Chmielowski
56baa07d48 Reject request http_api request that have malformed Authentication header 2019-01-30 16:34:29 +01:00
Paweł Chmielowski
096b4a50e5 Require that both tag and module matched in from of api_permission 2019-01-30 13:09:06 +01:00
Paweł Chmielowski
62ad1e5e4f Allow specifying tag for listener for api_permission purposes
This commit will allow adding tag to http listeners:

listener:
  - port: 4000
  - module: ejabberd_http
  - tag: "magic_listener"

that later can be used to have special api_permission just for it:

api_permissions:
  "magic_access":
    from:
      - tag: "magic_listener"
    who: all
    what: "*"
2019-01-30 12:57:03 +01:00
Frank Diebolt
7df03ef56f Revert "Apply shaping to websocket connections"
This reverts commit dda89aeda0.
2019-01-30 10:37:26 +01:00
Frank Diebolt
dda89aeda0 Apply shaping to websocket connections 2019-01-30 09:57:17 +01:00
Frank Diebolt
dd57950103 Fix ping IQ reply/timeout processing ("mod_ping" regression since 17.x that may cause resources leakage) 2019-01-29 18:13:28 +01:00
AquarHEAD Lou
3f3e04812b
Rename two presence functions
send_self_presence is actually implementing XEP-0115, while
send_initial_presence is implementing the "self-presence" step as
described in XEP-0045
2019-01-27 16:48:05 +00:00
Paweł Chmielowski
9e0baef233 Make last commit compile on R19 2019-01-22 14:40:01 +01:00
Paweł Chmielowski
74731a5816 Make sure that room_destroyed is called even when some code throws in terminate
We observed that some code was throwing exception in muc_room:terminate()
and that make this room not properly unregister itself from muc_online
table.
2019-01-22 14:22:23 +01:00
Badlop
0c794c105f Fix crash when running reload_config and sql_pool_size option is used
Fixes #2541
2019-01-21 13:35:21 +01:00
Evgeny Khramtsov
5e9945f060 Improve validation of configured language options 2019-01-19 11:29:45 +03:00
Paweł Chmielowski
a8b1a58cc8 Add os_mon to included_application, but start it in ej_system_monitor 2019-01-16 15:40:10 +01:00
Paweł Chmielowski
a30bfefb98 Move some apps back to included_applications 2019-01-16 15:01:32 +01:00
Paweł Chmielowski
0d952abe7d Start ejabberd_mnesia before starting mnesia 2019-01-15 18:34:19 +01:00
Paweł Chmielowski
7183fe6b80 Guard agains sm:get_user_info returning offline
This fixes issue #2765
2019-01-15 10:04:15 +01:00
Evgeny Khramtsov
1b0d481f41 Don't produce a crash on config reload when SQL is not configured 2019-01-12 23:40:33 +03:00
Christophe Romain
e4067df85e
Merge pull request #2748 from area-42/add_acl_for_mam_in_mod_muc
add acl for mam in mod_muc
2019-01-10 14:29:02 +01:00
Paweł Chmielowski
5bbb4da397 Start ejabberd_logger also when ejabberd:start() is not called 2019-01-09 19:03:36 +01:00
Paweł Chmielowski
d47bc1efdb Use OTP application startup infrastructure for starting dependencies 2019-01-09 18:14:50 +01:00
badlop
325877446a
Merge pull request #2680 from Iperity/fix-privacy-check-on-presence-probe
Privacy lists: set from/to on packet *before* calling privacy_check_p…
2019-01-09 16:31:14 +01:00
Christophe Romain
3fa68b17d9 Remove slash producing url /admin//additions.js 2019-01-09 11:55:42 +01:00
Badlop
55417dfb37 Update copyright to 2019 (#2756) 2019-01-08 22:53:27 +01:00
Holger Weiss
c3a807832d mod_private: Hardcode item ID for PEP bookmarks
Set the item ID to "current" when publishing bookmarks via PEP.
XEP-0060 says: For singleton nodes, "it is RECOMMENDED for the publisher
to specify an ItemID of 'current' to ensure that the publication of a
new item will overwrite the existing item."
2019-01-08 21:23:21 +01:00
Evgeny Khramtsov
edf03b0f3d mod_offline: make some database callbacks optional 2019-01-08 13:41:16 +03:00
Paweł Chmielowski
06d69c5277 Fix decompressing of custom elements with custom namespace 2019-01-07 16:08:58 +01:00
Christoph Scholz
7e4287ff83 add acl for mam in mod_muc 2019-01-04 15:56:41 +01:00
badlop
9631baaa63
Merge pull request #2599 from gardenia/master
Eliminate some repeated SQL queries [Issue #1656]
2019-01-04 12:20:50 +01:00
Evgeny Khramtsov
9af70913b5 mod_mam: more checks for database failure 2019-01-02 21:11:22 +03:00
Badlop
1246a7a50f Add no-store hint to CAPTCHA challenge stanzas (#2730) 2018-12-26 14:04:36 +01:00
Evgeny Khramtsov
d5fab856f4 mod_mam: Additional checks for database failures 2018-12-21 22:29:20 +03:00
Badlop
740ea3a047 Handle Prosody storage attributes key, when, with (#2724) 2018-12-21 15:15:02 +01:00
Badlop
011cf55eb5 Handle persist=false in roster items (#2722) 2018-12-21 15:15:00 +01:00
Paweł Chmielowski
e9d537527c We are handling groupchat in other branch now 2018-12-20 13:51:05 +01:00
Paweł Chmielowski
69a986a09e Add option to mod_offline that would allow storing group chat messages 2018-12-20 13:28:18 +01:00
Badlop
788d829823 Fix PIEFXIS export of user when password is scrammed (#2721) 2018-12-19 13:17:28 +01:00
Badlop
590bb0e64a Search also for _jid when importing room from prosody (#2723) 2018-12-19 12:11:59 +01:00
Badlop
0b151f5902 Parse persistent and archiving room options importing from prosody (#2720) 2018-12-19 12:11:56 +01:00
Paweł Chmielowski
c88a2d0569 Add code for handling deprecations of get_stacktrace() 2018-12-13 11:46:53 +01:00
Christophe Romain
f6a557ec86 Add hook on api call 2018-12-11 11:07:07 +01:00
Holger Weiss
1c1694c6bf mod_roster: Don't set version to "not_found"
Don't include a "ver" attribute with roster pushes if no roster version
is available.
2018-12-10 21:38:14 +01:00
Badlop
446ff9257c Don't require a full JID as argument, instead set a dummy resource (#2710) 2018-12-10 21:06:26 +01:00
Badlop
f2bd2f6e37 When unknown roster version, return an acceptable version ID binary (#2709) 2018-12-10 20:30:42 +01:00
Evgeny Khramtsov
33202d59c0 Merge branch 'master' into mix 2018-12-10 17:07:28 +03:00
Evgeny Khramtsov
8295bcebec Fix (un)setting of priority 2018-12-10 17:06:21 +03:00
Evgeny Khramtsov
e568dc3866 Get rid of outdated mod_mix module 2018-12-10 16:50:13 +03:00
Evgeny Khramtsov
74e8c0376f Merge branch 'master' into mix 2018-12-10 11:57:04 +03:00
Evgeny Khramtsov
6cd8d1025c Don't lose carbons on presence change or session resumption 2018-12-10 11:53:27 +03:00
Evgeny Khramtsov
a5ac1d15e7 Avoid badfun in multicast/6 2018-12-07 21:34:49 +03:00
Evgeny Khramtsov
0e954da3fa Fix wording 2018-12-07 20:48:13 +03:00
Evgeny Khramtsov
4f5552128b Fix mod_mix_mnesia get_participants/3 callback 2018-12-07 20:41:37 +03:00
Evgeny Khramtsov
6afefd7bbf Fix submission-id and channel resource 2018-12-07 11:06:26 +03:00
Paweł Chmielowski
3b1c0dc27f Normalize hostname when processing host_config 2018-12-06 15:12:23 +01:00
Paweł Chmielowski
755f34d3ef Start fast_tls before pkix 2018-12-06 13:42:08 +01:00
Holger Weiss
160ffce090 mod_private: Add "bookmarks_to_pep" command
The "bookmarks_to_pep" command exports the bookmarks of the specified
user from private XML storage to PEP.
2018-12-05 22:04:40 +01:00
Holger Weiss
074ebd80f6 mod_pubsub: Improve PEP behavior for 'whitelist'
If a PEP node's access_model is set to 'whitelist' (or 'authorize'),
send last PEP notifications to the node owner.
2018-12-05 18:25:40 +01:00
Paweł Chmielowski
45eb08d05c Add auth:which_user_exist to bulk checking existence of list of users 2018-12-05 14:22:09 +01:00
Paweł Chmielowski
a6c06964e1 Add list types to sql_pt 2018-12-05 13:11:52 +01:00
Badlop
0ae3f624ca Revert "Let deliver unsubscribe stanza when no roster push is required (#2598)"
This reverts commit 86048f8a25.
2018-12-05 12:17:16 +01:00
Badlop
86048f8a25 Let deliver unsubscribe stanza when no roster push is required (#2598) 2018-12-05 11:45:54 +01:00
Evgeny Khramtsov
d5e4da54cf Update MIX code to reflect newest specification
Note that support for older specification is completely dropped,
i.e. no backward compatibility is provided since the XEPs are
still very experimental and being changed drastically
2018-12-05 13:14:29 +03:00
Alexey Shchepin
8ebcba4d08 Fix PostgreSQL compatibility in mod_offline_sql:remove_old_messages (#2695) 2018-12-05 01:56:39 +03:00
Paweł Chmielowski
e85fa96cf7 Proxy protocol may send additional data after addresses 2018-12-04 15:23:28 +01:00
Paweł Chmielowski
6845896d12 Add support for proxy protocol
This add support for version 1 and 2 of protocol specified in
http://www.haproxy.org/download/1.8/doc/proxy-protocol.txt

To enable it you need add option use_proxy_protocol: true to listener.
2018-12-04 14:22:45 +01:00
Paweł Chmielowski
9139ea86fb Format list of {{name,string}, {value, _}} as json struct name/val 2018-12-03 13:53:07 +01:00
Paweł Chmielowski
59a148d80b Make mod_http_api assume that missing args of type list are empty list 2018-12-03 13:53:07 +01:00
Evgeny Khramtsov
109ed8f2f6 Keep info about carbons inside session table
Accordingly, Mnesia/SQL/Riak table 'carboncopy' is not used anymore
and can be safely removed.

As a consequence, the commit deprecates the following options of
mod_carboncopy:
- ram_db_type
- use_cache
- cache_size
- cache_missed
- cache_life_time

Fixes #2663
2018-12-01 13:33:44 +03:00
Holger Weiss
a9539fef22 ejabberd_s2s_in: Check for subdomain configuration
If an incoming s2s connection to a subdomain such as
conference.example.com is accepted, check for host-specific
configuration settings for that subdomain rather than for example.com.
This is for consistency with ejabberd_s2s_out, and with my previous
commit.
2018-12-01 10:14:04 +01:00
Holger Weiss
122dfec03d ejabberd_s2s_in: Check for subdomain certificate
If an incoming s2s connection to a subdomain such as
conference.example.com is accepted and a separate certificate is
available for that subdomain, offer that certificate instead of the one
for example.com.

Thanks to Mike Kuketz for reporting the bug.
2018-12-01 10:08:28 +01:00
Holger Weiss
2eb907dc7f mod_register: Don't advertise IBR unconditionally
Don't advertise the IBR stream feature if registration is disabled in
the configuration.
2018-12-01 07:21:41 +01:00
Evgeny Khramtsov
59ce0ba6c8 Apply new cache options on mod_stream_mgmt reload 2018-11-30 18:12:27 +03:00
Evgeny Khramtsov
5d27c975dc Keep last handled stanzas number in cache rather than session table 2018-11-30 16:19:00 +03:00
Badlop
b8883b5a61 New command unban_ip (#2620) 2018-11-30 13:36:10 +01:00
Evgeny Khramtsov
b07b10bdaa Drop some macros related to OTP<19 2018-11-29 13:01:00 +03:00
Evgeny Khramtsov
624485fe26 Implement XEP-0410: MUC Self-Ping optimization
Fixes #2630
2018-11-29 12:16:12 +03:00
Evgeny Khramtsov
3f901b3793 Advertise disco#info and disco#items by MUC room
Fixes #2661
2018-11-29 10:35:03 +03:00
Paweł Chmielowski
0b31aa490b Add xml compression to sql backend of mam 2018-11-28 11:25:16 +01:00
Badlop
e37a1a73f1 Add specific Var names to CAPTCHA fallback form fields (#2672) 2018-11-27 19:10:42 +01:00
Badlop
133bc764cd Fix typo in recent PR commit (#2697) 2018-11-23 13:23:00 +01:00
badlop
cc9a1a0917
Merge pull request #2697 from Snowmanko/master
Update - fixed ejabberdctl push_roster description
2018-11-23 12:55:44 +01:00
Evgeny Khramtsov
fcff3c60b1 Only advertise conversion feature when mod_pubsub is loaded 2018-11-23 14:01:06 +03:00
Evgeny Khramtsov
1cdca1ab99 Support for XEP-0411: Bookmarks Conversion 2018-11-23 13:33:29 +03:00
Evgeny Khramtsov
87f8355908
Merge pull request #2690 from nosnilmot/stopping-hook
Add ejabberd_stopping hook
2018-11-22 23:21:45 +03:00
Snowman
9ed5ba01b2
Update - fixed ejabberdctl push_roster description 2018-11-22 16:32:05 +01:00
Christophe Romain
4b3db3a9cb Relax result matching to fix pgsql keepalive (#2632) 2018-11-21 18:06:32 +01:00
Stu Tomlinson
d4cd3ddc32 Add ejabberd_stopping hook
This hook allows modules to detect when ejabberd is stopping and adjust
behaviour if desired
2018-11-19 15:11:33 +00:00
Badlop
06e9d34018 Handle some malformed URL requests in ejabberd_http (#2687) 2018-11-16 12:13:17 +01:00
Evgeny Khramtsov
1d80addb7d Get rid of 'catch-all' statements 2018-11-15 15:07:58 +03:00
Evgeny Khramtsov
43498b39c1 Replace dict with maps
This will improve performance and memory consumptions of large MUCs
2018-11-15 14:13:45 +03:00
Holger Weiss
133c45ce2b Don't suppress notifications on PEP node removal
Send node deletion notifications (as per XEP-0060, #8.4.2) also for PEP
nodes.
2018-11-12 12:54:53 +01:00
Nathan Bruning
e965119c0e Privacy lists: set from/to on packet *before* calling privacy_check_packet 2018-11-10 16:56:34 +01:00
Badlop
da9bcc3370 Recover logging of user joining room, lost in 32de9a56 (thanks to elexis1) 2018-11-09 13:21:35 +01:00
Alexey Shchepin
48594544ed Fix for the previous commit 2018-11-09 14:18:48 +03:00
Alexey Shchepin
d16b99d830 Track presences sent via a multicast service 2018-11-09 03:27:24 +03:00
Badlop
9f7d3520aa Fix unused variable warning 2018-11-06 00:08:45 +01:00
Badlop
602bfa3c3c Local stanzas are routed one by one, not by multicast 2018-11-06 00:07:34 +01:00
Holger Weiss
dd93c0b457 ejabberd_logger: Disable debug logging properly
Don't forget to disable xmpp's debug logging when reducing the log level
from 5 to a lower value.
2018-10-31 02:42:54 +01:00
Badlop
a73aac691e Don't preprocess arguments, format_args verifies and prepares them (#2629) 2018-10-31 01:34:04 +01:00
Badlop
36891175ec Don't hide result of mod_*:set_* calls 2018-10-30 23:07:30 +01:00
Paweł Chmielowski
cb2b927085 Add send_ws_ping to c2s 2018-10-29 12:30:59 +01:00
Holger Weiss
30393bb690 Move unwrap_mucsub_message/1 into misc 2018-10-25 01:22:57 +02:00
Holger Weiss
a8b11b6474 Move some functions from xmpp back into ejabberd 2018-10-25 01:05:45 +02:00
Paweł Chmielowski
432ca80db6 Do no add 127.0.0.1 address to trusted_proxies list by default 2018-10-24 15:16:32 +02:00
Paweł Chmielowski
5181983d97 Recognize not_exists error in http_api 2018-10-19 10:30:05 +02:00
Badlop
b010a1a0a0 Affiliations other than admin and owner cannot invite to members_only rooms
This is explained in the paragraph:
 If the room is members-only, the service MAY also add the invitee to the
 member list. (Note: Invitation privileges in members-only rooms SHOULD be
 restricted to room admins; if a member without privileges to edit the
 member list attempts to invite another user, the service SHOULD return
 a <forbidden/> error to the occupant; for details, see the Modifying the
 Member List section of this document.)
https://xmpp.org/extensions/xep-0045.html#invite-mediated
2018-10-17 12:57:18 +02:00
Holger Weiss
3d4f65812e ejabberd_s2s_in: Fix indentation 2018-10-15 23:03:53 +02:00
Paweł Chmielowski
914fae3d3e Change logic for archiving mucsub messages
This change should apply usual logic for message wrapped in mucsub except
check for groupchat message, so messages without bodies for example
should be rejected
2018-10-10 18:12:35 +02:00
Paweł Chmielowski
a16acd77ed Archive messages with type=normal and pubsub payload (like mucsub messages) 2018-10-08 15:56:44 +02:00
Evgeny Khramtsov
ebd50f8a69 Report available options in lexical order 2018-10-04 14:31:41 +03:00
Evgeny Khramtsov
d8f831de09 Run ejabberd_started hook earlier 2018-09-29 23:06:34 +03:00
Evgeny Khramtsov
73af98a8dc Add forgotten TURN options to validator
Fixes #2621
2018-09-29 23:05:41 +03:00
Evgeny Khramtsov
984a00195a Fix bugs introduced by previous commit 2018-09-28 00:28:34 +03:00
Evgeny Khramtsov
39fa1a810d Move certificates processing code to pkix application
==== WARNING: MUST BE ADDED TO RELEASE NOTES =====
The commit introduces the following incompatibility:
- Option 'ca_path' is deprecated and has no effect anymore:
  option 'ca_file' should be used instead if needed.
==================================================
2018-09-27 20:37:27 +03:00
Holger Weiss
e3a03394c7 mod_avatar: Reduce log level for too large avatars
Log a warning rather than an error when publishing an avatar fails due
to its size exceeding the ?MAX_PAYLOAD_SIZE for PubSub items.
2018-09-26 21:00:52 +02:00
Holger Weiss
aa162f30df ejabberd_regexp: Support Unicode 2018-09-26 19:10:32 +02:00
Christophe Romain
c109d3eff0 Add odbc connection robustness (#2428) 2018-09-25 16:59:49 +02:00
Badlop
e054c2800b Allow a subscribed owner/admin to kick lower-affiliation moderator 2018-09-25 10:55:57 +02:00
Badlop
49f1b4a691 Allow an occupant owner/admin to kick lower-affiliation moderator 2018-09-25 10:55:56 +02:00
Badlop
8b61c7fe4b Allow a subscribed owner/admin to kick participants and visitors 2018-09-25 10:55:54 +02:00
Badlop
9bac2fa185 Allow a subscribed owner/admin to change participant<->visitor 2018-09-25 10:55:51 +02:00
Paweł Chmielowski
0394baaa7a Allow changing invitation message from muc_invite hook 2018-09-21 16:37:52 +02:00
Paweł Chmielowski
1b3a6dd54a Recognize more fields that aren't atom in format_room_option 2018-09-20 18:02:47 +02:00
Evgeny Khramtsov
6d1ea222c0 Remove forgotten debug line 2018-09-19 23:17:04 +03:00
Evgeny Khramtsov
08f3d066b1 Switch more log message to warning level
The commit is supposed to improve logging at loglevel 3, which
is the recommended level for high loaded ejabberd servers
2018-09-19 23:12:14 +03:00
Evgeny Khramtsov
ddca2e8b4a Switch mod_fail2ban log messages to warning level 2018-09-19 19:33:33 +03:00
Evgeny Khramtsov
a2b2a27bb6 Resize SQL pool on configuration reload
Fixes #2541
2018-09-19 11:55:40 +03:00
Evgeny Khramtsov
d60d72d7bf Don't hide 'undef' exceptions during config validation 2018-09-19 01:00:50 +03:00
Evgeny Khramtsov
7ff5f2d3fa Fail early when loading unavailable SIP or STUN modules 2018-09-18 18:19:42 +03:00
Evgeny Khramtsov
1866b56e3b Report real address of a listener 2018-09-18 14:51:42 +03:00
Evgeny Khramtsov
e96bfbdbfa Remove useless type specs 2018-09-18 13:24:06 +03:00
Evgeny Khramtsov
3cc964fbcc Fix listeners child specs creation 2018-09-18 13:22:34 +03:00
Evgeny Khramtsov
29f6c43ae3 Remove forgotten debug line 2018-09-18 12:58:29 +03:00
Evgeny Khramtsov
03de853e4f Refactor ejabberd_listener 2018-09-18 12:53:36 +03:00
Holger Weiss
d2cdfa66f9 mod_http_upload: Log error if 'put_url' is reused
Log a proper [error] message if a single 'put_url' is used for multiple
virtual hosts.
2018-09-17 21:46:37 +02:00
Badlop
d5c1174385 Revert "New option tombstone_expiry locks recent room creation after destroy (#2546)"
This reverts commit efb4fd0d10.
2018-09-17 12:28:39 +02:00
Evgeny Khramtsov
dd888f90ec Improve error formatting 2018-09-17 12:08:04 +03:00
Badlop
bb9593dd12 Remove unused variables 2018-09-17 10:42:29 +02:00
Evgeny Khramtsov
de385591d0 Refactor ejabberd listener API 2018-09-17 11:21:02 +03:00
Holger Weiss
adf0d7de91 mod_muc_room: Fix the room's CAPS hash
Don't forget the room's xdata when calculating the CAPS hash.
2018-09-14 00:18:17 +02:00
Marc Schink
c156eabb24 mod_register: Remove unused error 'too_many_users' 2018-09-13 21:34:12 +02:00
Badlop
1d6cbd2561 Trigger hook for user_send_packet in send_message command (#2604) 2018-09-13 18:21:30 +02:00
AquarHEAD Lou
8673d2926d
Expect mnesia_up event when joining cluster 2018-09-12 11:01:05 +00:00
colm
b0b188aa68 remove some chatty SQL queries by pulling back all groups with opts and filtering in memory. move a call to get_group_name outside of a loop to eliminate redundant repeated queries 2018-09-10 00:08:00 +01:00
Evgeny Khramtsov
2d246f61dd Fix some dialyzer warnings 2018-09-09 09:59:08 +03:00
root
b545301f63 fix for freetds UTF-8 corruption 2018-09-07 19:56:39 +03:00
Evgeny Khramtsov
145c0116bf Bump lager version
This is needed for OTP-21 compatibility
2018-09-07 18:03:36 +03:00
Paweł Chmielowski
79c511a441 Add information about real sender to mucsub message meta 2018-09-06 13:36:59 +02:00
Paweł Chmielowski
57936bfa4e Don't stop sending pings when receiving timeout for timeout_action=none 2018-09-04 09:52:41 +02:00
Evgeniy Khramtsov
5c931d7004 Correctly handle empty result with RSM
Fixes #2588
2018-09-02 00:37:07 +03:00
Evgeniy Khramtsov
88d0b71d58 Get stacktrace out of lager context
Calling erlang:get_stacktrace() inside lager functions produces
stacktraces of the logging function itself, not the function which has failed.
2018-09-01 19:37:26 +03:00
Evgeniy Khramtsov
b416527e4f Don't set termination reason into presence-unavailable status
Fixes https://github.com/processone/xmpp/issues/35
2018-09-01 17:39:39 +03:00
Holger Weiss
8c8c480477 ejabberd_s2s_in: Log message on connection close
Log a message when an incoming s2s connection is closed, analogous to
the message on outgoing s2s connection close.
2018-08-29 16:23:56 +02:00
Evgeniy Khramtsov
b30a9f2f75 Better formatting of unexpected return from Module:start/2 2018-08-28 10:41:57 +03:00
Badlop
0cbd41fbdc Fix max_user_conferences in Mnesia to consider only one MUC service (#2556) 2018-08-20 15:47:53 +02:00
Evgeniy Khramtsov
5b055d7eec Use "localhost" as a default host 2018-08-17 18:42:09 +03:00
Evgeniy Khramtsov
f0f3ec211e Disable cache for anonymous auth backend
Fixes #2566
2018-08-17 17:56:23 +03:00
Badlop
c3361bab95 Handle get_presence(Pid) when session doesn't exist (#2547) 2018-08-15 12:16:01 +02:00
Badlop
f3f3b1586e Fix typo in command description 2018-08-13 16:42:16 +02:00
Badlop
10e01b7bfc Return human error messages when calling export2sql with wrong path (#2480) 2018-08-13 13:56:29 +02:00
Badlop
8f0e066135 In response with list of room subscriptions include also events (#2272) 2018-08-13 12:52:33 +02:00
Badlop
dfd96b6037 Remove num_active_users as it uses calls to last_activity mnesia table (#2448) 2018-08-08 14:18:49 +02:00
Badlop
5b373470ac Remove direct calls to muc_room mnesia table in mod_muc_admin (#2448) 2018-08-08 14:18:34 +02:00
Badlop
0146189b65 Add markdown options as specified in the docs git repo 2018-08-07 16:59:26 +02:00
Badlop
4c4c82897c Add import_prosody explanation from docs git repo 2018-08-07 16:58:53 +02:00
Badlop
5509e648ad Allow acme and oauth commands to be read by gen_markdown_doc_for_commands 2018-08-07 16:58:48 +02:00
Badlop
c9ba0e83d2 Handle ejabberd_captcha error reports in mod_register_web (#2553) 2018-08-02 18:36:41 +02:00
Marcel Waldvogel
9b48dc9cc3 Make it possible to join extauth pools 2018-07-30 22:49:18 +02:00
Badlop
efb4fd0d10 New option tombstone_expiry locks recent room creation after destroy (#2546)
Setting the new mod_muc option tombstone_expiry to a positive integer
will make that any room destroyed gets replaced with a room tombstone.
That tombstone cannot be joined, so it blocks accessing the old room JID
until the expiry seconds have passed.
The default value is 0 seconds, so tombstones are not created.
2018-07-30 19:24:35 +02:00
Holger Weiss
83e2462853 mod_mam: Don't strip offline message stanza IDs
As mod_offline currently doesn't preserve metadata, add an explicit
check for messages retrieved from offline storage to avoid stripping
their stanza IDs.

Thanks to Zuglufttier for spotting this.
2018-07-27 00:27:10 +02:00
Holger Weiss
cdfd0cce7b mod_mam: Make sure stanza IDs aren't reused
Strip the stanza ID from the metadata of outgoing messages to make sure
it's not reused for the (local) recipient's MAM archive.
2018-07-27 00:14:48 +02:00
Holger Weiss
2d45832a39 ejabberd_auth: Restore lost case clause
Let check_password_with_authmodule/6 handle the case where
validate_credentials/2 returns an error.  This got lost in commit
4f8af723c6.
2018-07-26 22:37:25 +02:00
Paweł Chmielowski
1af2cf37ea Wait for more data than just <stream:stream> before sending in bosh
This fixes issue #2545
2018-07-26 18:56:05 +02:00
Paweł Chmielowski
ca022b6d1f Make sure that we always start inactivity timer from drop_holding_receiver 2018-07-26 17:29:35 +02:00
Paweł Chmielowski
e54f1a8485 Set wait_timer to undefined when timer was triggered 2018-07-26 17:29:35 +02:00
Badlop
1be2112634 Fix search for User in vjud
See https://stackoverflow.com/questions/51478247/ejabberd-search-module-failed-to-handle-the-query
2018-07-24 20:01:22 +02:00
Holger Weiss
57a3512dcc mod_http_upload: Adjust default value of 'put_url'
Let the default 'put_url' point to the HTTPS listener specified in the
new default configuration.
2018-07-18 19:44:56 +02:00
Holger Weiss
8ad6afd652 mod_http_upload: Deprecate 'service_url' option
Users should migrate to the 'external_secret' interface.
2018-07-18 18:16:42 +02:00
Holger Weiss
e433a63105 mod_http_upload: Avoid function-like macros 2018-07-17 22:28:31 +02:00
Holger Weiss
68c9328a9c Move cancel_timer/1 function into 'misc' module 2018-07-17 20:50:58 +02:00
Holger Weiss
6601f182c4 mod_http_upload: Add "Allow" to OPTIONS response
RFC 2616 says: "A 200 response SHOULD include any header fields that
indicate optional features implemented by the server and applicable to
that resource (e.g., Allow) [...]."
2018-07-17 19:42:57 +02:00
Holger Weiss
326db5535c mod_muc: Don't set default for muc#roomconfig_lang
For the muc#roomconfig_lang setting, no default is preferable over a
possibly incorrect default value.
2018-07-16 15:15:36 +02:00
Holger Weiss
2539be1a04 mod_http_upload: Avoid timers from timer module
Use erlang:start_timer/3 instead of timer:send_after/2, as the former is
more efficient.
2018-07-16 00:17:11 +02:00
Holger Weiss
4e9930597d mod_http_upload: Don't store "external" slots
Don't store requested upload slots if an 'external_secret' is
configured.
2018-07-15 21:53:50 +02:00
Evgeniy Khramtsov
8faa6afa67 Require Redis version >= 3.2.0
Since we now use Lua scripting for cleaning up c2s sessions
the minimum supported Redis version is 3.2.0 or above because
we need to work correctly with Redis replication mechanism.

****** BACKWARD INCOMPATIBILITY WARNING *******
** THIS SHOULD BE ADDED TO THE RELEASE NOTES **
*** PACKAGE MAINTAINERS SHOULD BE INFORMED  ***
***********************************************
2018-07-15 09:52:03 +03:00
Holger Weiss
12e537c43f Avoid "ejabberdctl status" crash 2018-07-14 20:27:30 +02:00
Evgeniy Khramtsov
420e05fa0d Clean up contributed code for Redis SM 2018-07-14 17:53:00 +03:00
Evgeny Khramtsov
e2fb154fe9
Merge pull request #2525 from satish-olx/master
Use lua scripting to clear redis sessions.
2018-07-14 16:53:45 +03:00
Evgeniy Khramtsov
e9f219a0ac Improve wording 2018-07-14 16:52:09 +03:00
Evgeny Khramtsov
711c5c0d54
Merge pull request #2526 from nosnilmot/enforce-pubsub-option-attributes
Enforce pubsub option required/rejected attributes
2018-07-14 16:42:15 +03:00
Stu Tomlinson
f9ed34db4d Enforce pubsub option required/rejected attributes
XEP-0060 states that 'node' and 'jid' attributes to <options> element MUST NOT
be included when <options> are specified at same time as <subscribe> :

https://xmpp.org/extensions/xep-0060.html#subscriber-configure-subandconfig

mod_pubsub will require 'node' and 'jid' attributes on standalone pubsub
options requests, and reject subscribe requests that have options that include
either 'node' or 'jid'
2018-07-14 11:55:38 +01:00
Evgeny Khramtsov
9a895058e7
Merge pull request #2522 from weiss/bump-max-user-conferences
mod_muc: Increase default 'max_user_conferences' value
2018-07-14 08:51:11 +03:00
Paweł Chmielowski
e76a57e144 Ensure that returned priority in a number in mod_admin_extra 2018-07-13 09:51:19 +02:00
satish-olx
6fc6bdefc2
Update ejabberd_sm_redis.erl 2018-07-12 16:14:26 +05:30
satish-olx
96e35a3248
Lua script for cleaning redis sessions
Changes:
1. Added extra keys for tracking node -> session mapping
2. Lua script for clearing the sessions in redis itself.
2018-07-12 16:10:24 +05:30
Paweł Chmielowski
48be8e7b1e Adopt code that uses parse_listener_portip after result change 2018-07-11 14:07:24 +02:00
Badlop
f40f3a9da7 Fix piefxis import of privacy lists (thanks to crosser)(#2412) 2018-07-11 12:56:57 +02:00
Badlop
f81b49fe44 Fix piefxis import of vCard elements (#2514) 2018-07-11 12:56:38 +02:00
Evgeniy Khramtsov
395d2e86bc Improve listener errors formatting 2018-07-11 09:29:55 +03:00
Holger Weiss
c5dd1bdd9d mod_http_upload_quota: Fix process name lookup
Fix mod_http_upload_quota's process name lookup for the case where a
slot is requested by a JID whose domain part is not the virtual host the
mod_http_upload_quota process is running on.
2018-07-10 21:19:15 +02:00
Evgeniy Khramtsov
d03432a956 Fix regression: list SASL EXTERNAL mechanism for inbound s2s 2018-07-10 10:14:08 +03:00
Holger Weiss
4b747c2c78 mod_muc: Increase 'max_user_conferences' default
Let up to 100 clients of a given account join MUC rooms by default.  The
old default value can be too small, e.g., when users join many (private)
rooms with multiple devices.
2018-07-10 01:00:06 +02:00
Holger Weiss
3a566e3cdf mod_stream_mgmt: Remove dead case clauses 2018-07-10 00:52:27 +02:00
Holger Weiss
b915469f5e mod_stream_mgmt: Add descriptive text to errors
Closes #2485.
2018-07-10 00:46:48 +02:00
Evgeniy Khramtsov
8b9166d067 Improve value formatting 2018-07-09 20:32:01 +03:00
Paweł Chmielowski
dc6861eb73 Use ejabberd_config:get_version in ejabberdctl status 2018-07-09 17:11:40 +02:00
Evgeniy Khramtsov
8c796ed027 Better format invalid values when logging them 2018-07-08 20:42:53 +03:00
Evgeniy Khramtsov
68d12017cc Better detection of duplicated routes/hosts 2018-07-08 20:28:11 +03:00
Evgeniy Khramtsov
491993d401 Reload internal room's configuration when mod_muc is reloaded
Fixes #2513
2018-07-08 14:52:12 +03:00
Christoph Scholz
fbdcc44fd9 fix HMAC for external_secret 2018-07-07 17:01:39 +02:00
Evgeniy Khramtsov
11811e5f48 Only lookup FQDN at configuration (re)loading 2018-07-06 09:18:27 +03:00
Evgeniy Khramtsov
0bb14d16c7 Move XMPP stream and SASL processing to xmpp repo 2018-07-06 01:07:36 +03:00
Evgeniy Khramtsov
ed1ee6061e Move move randoms module to p1_utils repo 2018-07-05 11:51:49 +03:00
Evgeniy Khramtsov
50b645aa92 Move shaper to p1_utils repo 2018-07-05 09:31:55 +03:00
Evgeniy Khramtsov
52f2a7de4b Set 'from' attribute for client connections when it is absent 2018-07-04 08:59:14 +03:00
Evgeniy Khramtsov
bce8922e5d Don't set from/to attributes in resource binding iq 2018-07-04 08:57:28 +03:00
Evgeniy Khramtsov
86236431b9 mod_http_upload: Treat file and network errors differently 2018-07-04 08:55:52 +03:00
Evgeniy Khramtsov
295bec8551 Don't ignore send() result 2018-07-03 13:44:58 +03:00
Evgeniy Khramtsov
b341a3cef3 Increase default buffer size for mod_proxy65 2018-07-03 13:38:49 +03:00
Evgeniy Khramtsov
fface33d54 HTTP Upload: introduce new option 'external_secret'
The option makes it possible to offload all HTTP Upload processing
to a separate HTTP server. Both ejabberd and the HTTP server
should share this secret and behave exactly as described at
at https://modules.prosody.im/mod_http_upload_external.html
in the 'Implementation' section. Example configuration:

modules:
  ...
  mod_http_upload:
    ...
    put_url: "http://separate.http.server/upload"
    external_secret: "foo bar baz"
  ...
2018-07-02 16:53:44 +03:00
Evgeniy Khramtsov
77163c43d2 Simplify the default configuration file
After some discussion with the community it was decided to
clean the configuration file from excessive comments and
explicitly configured default values. Also, mod_mam and
mod_http_upload have been added.

The rationale for this is to have a clean and not bloated
configuration file which doesn't scare away newcomers and
which has all features from the Compliance Suite 2018 (XEP-0387)
enabled by default.

For further configuration an admin is encouraged to read the
documentation at https://docs.ejabberd.im/admin/configuration
2018-07-01 23:57:27 +03:00
Evgeniy Khramtsov
6b8bc811ac Don't crash on most common gen_server:call errors 2018-07-01 14:26:49 +03:00
Evgeniy Khramtsov
b662ec2a78 Accept IP address as a return value from resolve/2 callback 2018-06-30 10:19:58 +03:00
Evgeniy Khramtsov
a463f5a25a Replace hardcoded disco features with macros 2018-06-29 14:48:07 +03:00
Paweł Chmielowski
1fbb36c34a Fix misc:try_url for erlang < R20 2018-06-29 11:13:29 +02:00
Evgeniy Khramtsov
dff940b89e Support both filenames and URLs in 'cssfile' option of mod_muc_log
If filename is provided, its content is inserted into the HTML page.
If URL is provided, it's used as a value of 'href' HTML attribute.
2018-06-29 11:34:53 +03:00
Evgeniy Khramtsov
66591b1c0d Improve URLs validation 2018-06-29 11:06:24 +03:00
Evgeniy Khramtsov
b094ce8ea5 HTTP Upload: increase gen_server call timeout 2018-06-29 10:32:53 +03:00
Evgeniy Khramtsov
9c82c2f6d0 HTTP Upload: put more info in log messages 2018-06-29 09:58:33 +03:00
Evgeniy Khramtsov
8879d1d533 Avoid code duplication when checking presence subscription 2018-06-28 10:37:20 +03:00
Evgeniy Khramtsov
71ae7e9fd9 Work-around against public_key incompatibility introduced in OTP21
The commit introduced the incompatility is
304dd8f81e

Thanks to Stu Tomlinson for spotting the issue.

Fixes #2488
2018-06-27 19:40:03 +03:00
Evgeniy Khramtsov
644873dae9 Don't check packets sent to self 2018-06-27 15:02:03 +03:00
Evgeniy Khramtsov
9a11db91f9 Use lists:foldl/3 2018-06-27 13:36:58 +03:00
Evgeniy Khramtsov
af8c6d2428 Generate HTTP Upload form using xdata codec 2018-06-27 13:29:38 +03:00
Evgeniy Khramtsov
87357c700f Do not ignore a certificate containing no domain names
Log a warning instead and assign it to an "empty" domain
2018-06-27 11:27:39 +03:00
Evgeniy Khramtsov
7881c5670c Don't replace valid certificates with invalid ones
When building the certificates chains, if several certificates
are found matching the same domain their validity is checked:

* the invalid one is ignored and the valid one is picked
* if both are valid or both are invalid, then the one with
  sooner expiration is ignored.

Fixes #2454
2018-06-27 10:55:37 +03:00
Evgeniy Khramtsov
881e02632b Improve error formatting in mod_http_upload 2018-06-26 19:32:29 +03:00
Evgeniy Khramtsov
47d117c1bf Support SASL PLAIN by xmpp_stream_out
Also, SASL mechanisms chaining is now supported:
if several mechanisms are supported and authentication
fails, next mechanism in the list is picked, until the
list is exhausted. In the case of a failure, the latest
SASL failure reason is returned within handle_auth_failure/3
callback.
2018-06-25 19:16:33 +03:00
Evgeniy Khramtsov
cf6f540d53 Don't pass sockmod to xmpp_stream_out 2018-06-25 15:28:02 +03:00
Evgeniy Khramtsov
557e6ecdd0 Introduce resolve/2 and connect_options/3 callbacks for xmpp_stream_out 2018-06-25 15:19:49 +03:00
Evgeniy Khramtsov
5dd3f4c22b Allow gen_server process registration 2018-06-25 14:55:33 +03:00
Evgeniy Khramtsov
e7c3b57b8b Allow reconnecting from disconnected state 2018-06-25 14:52:33 +03:00
Evgeniy Khramtsov
c907915695 Intercept EXIT signal 2018-06-25 14:46:31 +03:00
Evgeniy Khramtsov
911ed4a7ca Add Resource Binding support to xmpp_stream_out 2018-06-25 13:50:35 +03:00
Evgeniy Khramtsov
499ae96254 Don't use 'unsupported-version' inside SM <failed/> element
This error condition is defined within stream errors, however,
XEP-0198 says:

> This element SHOULD contain an error condition, which MUST
> be one of the **stanza** error conditions defined in RFC 6120.
2018-06-25 09:56:44 +03:00
Evgeniy Khramtsov
ac31c85866 Use error formatting functions from xmpp library 2018-06-25 09:45:45 +03:00
Evgeniy Khramtsov
c4c91cc956 Generate SASL failures on unencrypted connections only for s2s 2018-06-23 20:31:01 +03:00
Evgeniy Khramtsov
6ffb120fce Fix typo 2018-06-21 15:14:19 +03:00
Evgeniy Khramtsov
55f8aa1b22 Add new options for OOM watchdog
* oom_watermark: 1..100
  Start OOM watchdog only when system memory usage exceeds
  this value in percents. When the usage drops below the value,
  OOM watchdog is stopped. The default is 80 (percents).
  Note that once OOM watchdog is started, it performs full garbage
  collection periodically: this can be seen as spikes in CPU
  utilization and drops in RAM usage. If your system is permanently
  above the watermark, it may cause significant CPU overhead.

* oom_queue: positive integer
  Only trigger OOM killer when total amount of messages in all queues
  of all Erlang processes is above this value. The default is 10000.
  Note that this value only takes effect when `oom_killer` is set
  to `true` (this is the default). Otherwise, only a warning will
  be logged.
2018-06-21 14:35:19 +03:00
Paweł Chmielowski
274e9fe7b5 Guard against pres_last=undefined in mod_offline 2018-06-20 12:16:10 +02:00
Evgeniy Khramtsov
9e83c45b3c Restore forgotten translations from previous commit 2018-06-20 12:50:36 +03:00
Evgeniy Khramtsov
446e6e6f3b Update ejabberd.pot 2018-06-20 12:32:10 +03:00
Evgeniy Khramtsov
3a5d2dbed8 Move mod_irc to ejabberd-contrib 2018-06-20 12:27:44 +03:00
Holger Weiss
23cc0f8c3c mod_push: Include a static body text by default
Set the 'include_body' option to a static text by default.  Some app
servers check for the presence of a 'last-message-body' field to
distinguish between notifications generated for actual chat messages and
notifications triggered by other types of traffic.
2018-06-19 23:12:27 +02:00
Holger Weiss
81f4dd0e6a mod_push_keepalive: Increase default timeout
Set the default session timeout to three days.  This way, sessions will
survive a weekend without traffic, for example.
2018-06-19 22:26:08 +02:00
Paweł Chmielowski
dee3081df1 Fix reset_stream in websocket using pre-rfc protocol 2018-06-19 17:51:09 +02:00
Evgeniy Khramtsov
6acac7c93f Render roomname, allowinvites and allowpm in room disco#info 2018-06-19 14:02:45 +03:00
Holger Weiss
c2f664f941 mod_push_mnesia: Simplify record matching
Omit record fields that aren't used for matching.
2018-06-18 23:12:27 +02:00
Holger Weiss
75127a0deb mod_push_mnesia: Fix lookup of all host sessions 2018-06-18 23:05:08 +02:00
Holger Weiss
bb76da03ea mod_mam: Don't replace existing stanza ID
Preserve the original stanza ID for resent messages.  This avoids
storing duplicates in the MAM archive.
2018-06-16 00:43:22 +02:00
Paweł Chmielowski
3099702039 New shaper implementation 2018-06-15 11:56:46 +02:00