Commit Graph

4959 Commits

Author SHA1 Message Date
Paweł Chmielowski 6ac8f6eaee Relax check for valid command name in access_persmissions 2018-05-11 12:24:00 +02:00
Evgeniy Khramtsov 35a076c251 Stop ejabberd initialization on invalid/unknown options
Since now, ejabberd doesn't ignore unknown options and doesn't
allow to have options with malformed values. The rationale for
this is to avoid unexpected behaviour during runtime, i.e. to
conform to "fail early" approach. Note that it's safe to reload
a configuration with potentialy invalid and/or unknown options:
this will not halt ejabberd, but will only prevent the configuration
from loading.

***NOTE FOR PACKAGE BUILDERS***
This new behaviour should be documented in the upgrade notes.
2018-05-09 11:44:24 +03:00
Evgeniy Khramtsov 680384c342 Reduce IQ handler code copying 2018-05-09 10:30:00 +03:00
Evgeniy Khramtsov 11ff2a1ccf Fix a typo 2018-05-09 09:44:26 +03:00
Badlop de85c1718e Bypass account creation error when password is empty, caused by extauth 2018-05-08 18:19:07 +02:00
Evgeniy Khramtsov 8766854870 Get rid of ?FUNCTION_NAME macro (it's OTP19+ feature) 2018-05-08 12:06:58 +03:00
Evgeniy Khramtsov 61ae0ff02c Improve logging of external authentication failures 2018-05-08 09:36:34 +03:00
Evgeniy Khramtsov 5522403e8e Don't stop on out-of-date requests 2018-05-07 22:43:01 +03:00
Evgeniy Khramtsov b23d5754e8 Improve robustness of external authentication backends
Now all external ports are attached to supervising processes
and requests are balanced in round-robin manner until the pool
is exhausted.

The commit also deprecates `extauth_instances` option and introduces
`extauth_pool_size` option instead, with the default value of a number
of logical processors (i.e. CPU cores).

Fixes #2403
2018-05-07 19:27:18 +03:00
Paweł Chmielowski b1a03cc346 Make trusted_proxied ejabberd_http option accept ip masks 2018-05-04 09:53:07 +02:00
Paweł Chmielowski ca94cbfd31 Teach acl ip matching about ipv4 mapped ipv6 addresses 2018-05-04 09:52:06 +02:00
Holger Weiss 410db89167 ejabberd_auth: Don't use cache if it's disabled
Don't let the check whether a user exists use the cache if caching was
disabled in the configuration.
2018-05-03 00:31:33 +02:00
Holger Weiss 638f2d2e67 mod_blocking: Use #block_item{} record 2018-05-02 22:17:32 +02:00
Evgeniy Khramtsov 4ea481d1dd Add validator for 'accept_interval' listening option 2018-04-30 11:52:00 +03:00
Holger Weiss 538e0d4844 misc: Catch all Base64 decoding errors 2018-04-24 18:29:10 +02:00
Holger Weiss f3795e9d03 mod_http_upload: Add MIME type for M4A files 2018-04-24 18:16:16 +02:00
Christophe Romain 3df919244c PubSub purge_node must use a transaction (#2231) 2018-04-24 15:58:56 +02:00
Evgeniy Khramtsov 6774418a7f Introduce new mod_muc option: access_register
The option is an ACL rule defining who is able to register
nicknames within the conference service. The default is `all`
(for backward compatibility).
2018-04-24 12:29:59 +03:00
Evgeniy Khramtsov ad6fcc7865 Get rid of useless memory/disk usage warnings 2018-04-24 12:12:48 +03:00
Evgeniy Khramtsov ca28faa51a Fix get_affiliation/2 2018-04-24 12:07:10 +03:00
Paweł Chmielowski 5b730cdbf2 Use httpc directly instead of using p1_http wrapper 2018-04-23 17:40:44 +02:00
Paweł Chmielowski 9ed0357760 Use correct headers in rest calls 2018-04-23 12:29:56 +02:00
Evgeniy Khramtsov 06ce884aa8 Add stubs for affiliation-specific backend callbacks 2018-04-23 11:35:43 +03:00
Paweł Chmielowski 3fc0eb4f5b Use correct db backend for remove_mam_for_user_with_peer 2018-04-20 14:06:23 +02:00
Paweł Chmielowski 3bfa683586 Fix mnesia call in mam archive management function 2018-04-20 13:36:54 +02:00
Paweł Chmielowski 5be49cc0fa Add commands for cleaning up mam archive 2018-04-20 13:27:46 +02:00
Christophe Romain 42c029d5f7 Fix type of rest:url/2 2018-04-19 13:21:33 +02:00
Christophe Romain a567abcfdf Fix deprecated call injected by 265c7b62 2018-04-18 14:16:56 +02:00
Christophe Romain 265c7b62c7 Add flexibility on rest url config 2018-04-18 13:16:08 +02:00
Holger Weiss 332567693c mod_push_keepalive: Reset timeout on messages only
Some mobile apps might only be notified on actual chat messages with
a body, so don't let mod_push_keepalive reset the stream management
timeout on other types of traffic.
2018-04-17 00:27:07 +02:00
Holger Weiss de7dc4affa mod_push: Optionally include message sender/body
Add 'include_sender' and 'include_body' options.  If one or both of them
are set to 'true', a urn:xmpp:push:summary form with the enabled
field(s) is included in push notifications that are generated for
messages with a body.

The 'include_body' option can instead be set to a static text.  In this
case, the specified text will be included in place of the actual message
body.  This can be useful to signal the push service whether the
notification was triggered by a message with body (as opposed to other
types of traffic) without leaking actual message contents.
2018-04-16 23:18:03 +02:00
Holger Weiss 48c5ab59f1 mod_http_upload*: Remove empty lines after specs
Remove blank lines following function specifications in mod_http_upload
and mod_http_upload_quota for consistency with other modules.
2018-04-16 18:22:54 +02:00
Holger Weiss b2855d63a7 mod_http_upload*: Add function specifications 2018-04-16 18:17:28 +02:00
Holger Weiss 0282cf64a0 mod_push: Add function specification 2018-04-16 18:14:07 +02:00
Holger Weiss e5cb9dad40 mod_push: Add/adjust debug messages 2018-04-16 18:12:46 +02:00
Evgeniy Khramtsov acc162f4f4 Carefully validate options list 2018-04-16 15:48:06 +03:00
Evgeniy Khramtsov b8505f3e78 Don't crash on invalid module's sub-options
Fixes #2387
2018-04-16 11:06:57 +03:00
Holger Weiss 8a71e2e4f7 mod_push: Don't notify on stream errors
If a pending stream management session is closed with a stream error,
this is usually due to the client opening a new stream that conflicts
with the old one.  Don't generate a push notification in this situation.
2018-04-16 01:08:56 +02:00
Evgeniy Khramtsov a5284229cb Merge branch 'muc-self-presence' 2018-04-14 18:32:12 +03:00
Evgeniy Khramtsov d0f36537fb Clear fast_tls cache on configuration reload 2018-04-13 11:10:20 +03:00
Holger Weiss 3cf4fbc7b0 mod_roster: Use 'lserver' for configuration lookup 2018-04-13 00:12:07 +02:00
Paweł Chmielowski fe4b1a492c Fix notification payload generated by pubsub 2018-04-12 18:02:32 +02:00
Paweł Chmielowski c3b4b4ce4f Pass access option from websocket to c2s
This fixes issue #2223
2018-04-12 17:42:59 +02:00
Christophe Romain d28064518b Improve pubsub#itemreply implementation (#2325) 2018-04-12 15:38:12 +02:00
Christophe Romain 99444f2d0e Fix illegal match on previous commit 2018-04-10 15:02:03 +02:00
Christophe Romain 4c0f87b2ff Improve fix for #2288, don't mask errors on get_item 2018-04-10 14:47:18 +02:00
Holger Weiss 54363f8476 gen_mod: Support global module processes 2018-04-04 18:25:19 +02:00
Holger Weiss 094f586811 gen_mod: Remove frontend process support
ejabberd doesn't support frontend processes anymore.
2018-04-04 18:22:59 +02:00
Paweł Chmielowski 45a3c7e0ce Improve mod_multicast 2018-04-04 12:06:35 +02:00
Holger Weiss e2652ce02f mod_http_upload: Accept characters of any script
Accept all alphanumeric characters of any script in user and file names
rather than replacing non-ASCII characters with underscores.  However,
non-alphanumeric characters are still replaced, except for "." and "-".

Closes #2346.
2018-04-03 21:00:15 +02:00
Holger Weiss df651d893e Remove old hex conversion functions
Depend on list_to_integer/2 and integer_to_list/2 being available.
2018-04-03 00:21:33 +02:00
Holger Weiss a2e1f5c882 Move ejabberd_http:url_encode/1 to 'misc' module 2018-04-03 00:12:43 +02:00
Badlop 7f5796fe31 Fix Code format when logging a MUC room kick/ban 2018-04-02 13:51:19 +02:00
Holger Weiss 5f1191b9f5 mod_client_state: Add 'csi_activity' hook
Closes #2358.
2018-04-01 17:13:04 +02:00
Pouriya Jahanbakhsh e17a16a300 fix: run 'component_send_packet' hook in global mode 2018-03-30 23:19:33 +04:30
Pouriya Jahanbakhsh 7b3d26992b feat: add hook for sending packet from component
New hook 'component_send_packet' added.
Callback function must accept one argument {Pkt, ComponentState} and should yield 'drop' or {NewPkt, NewComponentState}.
2018-03-30 21:31:30 +04:30
Evgeniy Khramtsov 9373ad20ca Don't produce a crash dump during intentional exit
Also halt faster without relying on timeouts for buffers flushing
2018-03-29 12:14:31 +03:00
Evgeniy Khramtsov b283cfa6f2 Remove unused variable 2018-03-29 10:34:09 +03:00
Paweł Chmielowski dfbdffad44 Fix process_discoitems_result in mod_multicast 2018-03-28 11:23:28 +02:00
Evgeniy Khramtsov ea9c3fd8f7 Fix returning value from mod_vcard_ldap's search() callback
Fixes #2335
2018-03-25 10:53:46 +03:00
Evgeniy Khramtsov f39dbe6e49 Get rid of 'fs' package dependency
Certificates auto-reloading will be fixed later.
For now to reload certificates call `reload-config` ejabberd command.
2018-03-23 16:40:26 +03:00
Evgeniy Khramtsov 50de427570 Set empty least as a default for force_node_config 2018-03-23 16:09:18 +03:00
Evgeniy Khramtsov 55604b2d97 Move force_node_config defaults into ejabberd.yml.example 2018-03-23 16:08:12 +03:00
Evgeniy Khramtsov f5bab5d6c4 Fetch 'registration_watchers' option from the correct module
Fixes #2337
2018-03-23 09:42:55 +03:00
Christophe Romain 0bda169a5a Remove items of unregistered user (#2129) 2018-03-22 11:59:24 +01:00
Paweł Chmielowski 96c183c04b Accept atoms in api_permission command lists and commands with numbers in them 2018-03-21 12:53:46 +01:00
Badlop b4b3ff50d6 If mod_last is disabled, return error instead of crashing (#2330) 2018-03-20 22:18:43 +01:00
Evgeniy Khramtsov 8962397cf3 Report meaningful error when luerl is not available 2018-03-19 20:09:35 +03:00
Evgeniy Khramtsov b1ecd8ac01 Set -protocol() directive for mod_avatar 2018-03-19 19:23:15 +03:00
Evgeniy Khramtsov 4f1d7c4b66 Avoid logging IP addresses in mod_register when it's not desired
Fixes #2326
2018-03-19 18:23:52 +03:00
Evgeniy Khramtsov bb20e5f3fa Apply some dirty hacks for mod_shared_roster
Probably this fixes #1846
2018-03-19 12:32:43 +03:00
Evgeniy Khramtsov e1e7986918 Hardcode ACL rules used by ejabberd_web_admin 2018-03-19 12:29:07 +03:00
Christophe Romain 7ba6fae67c Improve result of XEP-0060 §6.5.9.12 (#2288)
Moving get_item result control to keep item-not-found on transaction
error when node does not exists
2018-03-17 10:59:34 +01:00
Christophe Romain 7beb19b01e Fix result of XEP-0060 §6.5.9.12 (#2288) 2018-03-16 17:48:42 +01:00
Christophe Romain a84dd0f627 Add transient notification condition (#2267) 2018-03-16 17:26:51 +01:00
Christophe Romain d8f9219b4f Refactor publish_item conditions (#2267) 2018-03-16 17:17:53 +01:00
Evgeniy Khramtsov ddc29d42de Fulfill all requirements of XEP-0398 v0.2.0
These include:
- Avoid rewriting vcardupdate tags with empty <photo/> element
- Advertise "urn:xmpp:pep-vcard-conversion:0" feature
2018-03-16 12:10:57 +03:00
Alexey Shchepin e15595df64 Add 'new_sql_schema' config option, --enable-new-sql-schema now sets its default value to true (#2239) 2018-03-15 17:55:05 +03:00
Evgeniy Khramtsov 99b41146b1 Get rid of catch-all in mod_pubsub 2018-03-13 22:10:58 +03:00
Evgeniy Khramtsov 6b079c0ab3 Preserve modules order
When modules for some virtual host are about to be started,
they are topologically sorted to preserve dependencies order.
We now keep this order for stop/reload functions to work properly.
2018-03-13 18:18:53 +03:00
badlop c5aea779b4
Merge pull request #2314 from oxpa/mod_admin_extra_hashes
allow using hashes from "crypto" applications in mod_admin_extra
2018-03-12 15:20:53 +01:00
Badlop be33c93344 Return errors in admin#add-user command response stanza (#2321) 2018-03-12 13:33:44 +01:00
Evgeniy Khramtsov 2785f1dfd2 Introduce force_node_config for mod_pubsub
The option can be used to override configuration options of a
particular PubSub node. Example:

mod_pubsub:
  ...
  force_node_config:
    "eu.siacs.conversations.axolotl.*":
      access_model: whitelist
    "*":
      persist_items: true

Fixes #2276
2018-03-11 16:54:35 +03:00
Evgeniy Khramtsov c3eeb8624b Strip duplicates from module's options 2018-03-07 17:46:16 +03:00
Holger Weiss bc808ffcde mod_stream_mgmt: Clean up on timed out resumption
During resumption, make sure the old process and the corresponding
session entry are disposed also in the case where the call that queries
the old process times out.
2018-03-06 21:03:31 +01:00
Evgeniy Khramtsov d9bf5a6865 Don't forget to remove mgmt_force_enqueue flag 2018-03-06 16:18:03 +03:00
Holger Weiss 67fe5d38a7 mod_push_keepalive: Preserve timeout on resumption
Don't forget to carry over the original XEP-0198 resumption timeout
value while resuming.
2018-03-05 01:10:12 +01:00
Evgeniy Khramtsov 63dba3fd64 Merge branch 'master' into muc-self-presence 2018-03-03 21:09:27 +03:00
Evgeniy Khramtsov da1a5036fe Revert "Support for default values in default_room_opts"
This reverts commit 5054a9933f.
The commit is plain wrong: similar options are not required to
be in pair.
2018-03-03 21:08:05 +03:00
Evgeniy Khramtsov 0d3637d18f Simplify ejabberd_sup code 2018-03-03 18:05:12 +03:00
oxpa f2a3118ecc allow using hashes from "crypto" applications in mod_admin_extra 2018-03-02 04:10:30 -09:00
Badlop dbf1cabdcd Fix: mod_offline:store_offline_msg/1 expects a message, not list (#2312) 2018-03-02 11:44:10 +01:00
Badlop ad0fd1eac1 Simplify result of get_room_affiliation command (#2301) 2018-03-01 19:45:16 +01:00
badlop 3003307e60
Merge pull request #2301 from tsaqova/ejabberd_commands_get_room_affiliation
add ejabberd_command to get affiliation of a user in MUC room
2018-03-01 19:37:55 +01:00
Evgeniy Khramtsov 76f827ac83 Increase log level for DIGEST-MD5 FQDN
SASL DIGEST-MD5 anyway deprecated anyway, so not point in
logging this. This is now logged in `debug` mode.
2018-02-28 21:43:43 +03:00
Stu Tomlinson da81590fef Validate additional listen opts
The options "inet", "inet6" and "backlog" are valid listen options, but are
currently logged as errors (even though they do work):

2018-02-28 16:08:44.141 [error] <0.338.0>@ejabberd_listener:validate_module_option:630 unknown listen option 'backlog' for 'ejabberd_c2s' will be likely ignored, available options are: access, shaper, certfile, ciphers, dhfile, cafile, client_cafile, protocol_options, tls, tls_compression, starttls, starttls_required, tls_verify, zlib, max_fsm_queue

This adds the necessary validators so they are correctly recognized.
2018-02-28 16:14:35 +00:00
Yusro Tsaqova 8a41cfc0f5 add ejabberd_command to get affiliation of a user in MUC room 2018-02-28 20:22:27 +07:00
Badlop 5054a9933f Support for default values in default_room_opts 2018-02-26 17:22:37 +01:00
Paweł Chmielowski b2095ebcfe Simplify code for splitting auth string in cyrsasl
This may fix problem from issue #2296
2018-02-26 09:36:56 +01:00
Holger Weiss c2235860ab xmpp_stream_in: Run auth result callbacks earlier
Call Mod:handle_auth_success/4 and Mod:handle_auth_failure/4 before
sending the SASL response rather than afterwards.  This way, callbacks
can send a custom response and disconnect.
2018-02-26 00:06:35 +01:00