24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-02 21:17:12 +02:00
Commit Graph

5361 Commits

Author SHA1 Message Date
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