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

6230 Commits

Author SHA1 Message Date
Paweł Chmielowski
46c947bc76 Define batch delete function types in coresponding behaviours 2022-06-17 10:35:02 +02:00
Paweł Chmielowski
a2efde185a Fix mam delete_old_messages_batch for sql backend
Too much copy/paste from spool equivalent...
2022-06-17 10:22:57 +02:00
Paweł Chmielowski
a89b1f332d Use INSERT ... ON DUPLICATE KEY UPDATE for upsert on mysql
This can be used for all upsert expressions (where REPLACE INTO used
previously were only possible to use for subset of queries), and may
potentially help with deadlocks reported by mysql when we issues multiple
querier for same key in quick succession.
2022-06-10 16:25:50 +02:00
Badlop
5a2e58e066 Fix regression on stop_ping in clustering context (thanks to fdie)(#3817) 2022-05-23 16:52:27 +02:00
Badlop
0e25f8d43e Fix mod_conversejs crash when mod_register not enabled (#3824) 2022-05-23 16:49:35 +02:00
Paweł Chmielowski
99064548e8 Fix parsing of scram password from prosody
Looks like parsed integer no longer are convered to floats on erlang side,
so let's make check for them less restrictive.
2022-05-17 13:21:30 +02:00
Badlop
4f8e6fe844 Fix errors and warnings for "rebar3 edoc" 2022-05-17 10:42:02 +02:00
Paweł Chmielowski
a916d94000 Pass room state to muc_{un}subscribed hook 2022-05-09 17:32:34 +02:00
Paweł Chmielowski
ed7fc956d5 Allow muc_{un}subscribe hooks to modify sent packets 2022-05-09 16:34:27 +02:00
Paweł Chmielowski
84d8c156a0 Fix spec 2022-05-06 10:15:23 +02:00
Paweł Chmielowski
c7ab3274c5 Return userinfo from misc:uri_parse 2022-05-06 10:14:50 +02:00
Paweł Chmielowski
3d4f2d365f Have consistent schema type in misc:uri_parse 2022-05-06 10:06:13 +02:00
Paweł Chmielowski
bc9e5c5363 Fix one more place where misc:uri_parse is used 2022-05-05 13:46:02 +02:00
Paweł Chmielowski
54a1fcc5e8 Improve misc:uri_parse 2022-05-05 13:07:03 +02:00
Badlop
aa190ca896 Run 'make options' 2022-05-04 18:01:46 +02:00
Badlop
30b3c6c908 Annotate options and commands recently added 2022-05-04 18:00:58 +02:00
Badlop
2739a52e0f Update options configurable in default_room_options 2022-05-02 20:20:21 +02:00
Paweł Chmielowski
6f11210edd Implement batch operations in mnesia backend 2022-05-02 15:05:55 +02:00
Holger Weiss
b5a76fb4de mod_push: Keep push session ID on session resume
Don't forget the push session ID if the client resumes a stream
management session.  This makes sure no push notifications are generated
for a connected client with a resumed stream management session.

Thanks to Thilo Molitor for spotting the issue.
2022-05-02 01:54:42 +02:00
Holger Weiss
c148ab4430 Adapt mod_push_keepalive to mod_push changes
Adjust mod_push_keepalive to work with the mod_push changes applied by
commit 11574f0a43.
2022-05-01 17:51:07 +02:00
Holger Weiss
a30d5875ed mod_push: Rename "timestamp" to "push session ID"
The fact that mod_push uses a timestamp as a push session ID is just an
implementation detail.  Rename things accordingly to avoid confusion.

However, stick to "timestamp" in the storage modules, as it corresponds
to the database column names/types, there.
2022-05-01 15:49:22 +02:00
Holger Weiss
11574f0a43 mod_push: Fix notifications for pending sessions
Fix the problem that no push notifications were triggered in the case
where all of the following conditions applied:

- The XEP-0198 session has been resumed at least once.
- The XEP-0198 session is pending (i.e., the client is disconnected).
- The message wasn't stored in the user's MAM archive (e.g., because it
  was of type "groupchat").

The problem was introduced in cd336369a5.

Many thanks to Friedrich Altheide for reporting the issue and to Thilo
Molitor for his help with tracking it down.
2022-05-01 15:26:21 +02:00
Paweł Chmielowski
d65d04cc9a Compile elixir_logger_backend only when lager is used 2022-04-29 12:35:16 +02:00
Paweł Chmielowski
881cc42168 Attach meta field with real jid to mucsub subscription events 2022-04-29 11:58:38 +02:00
Jérôme Sautret
69a5a22810 Delete ping timer if resource is gone after the ping has been sent 2022-04-28 14:54:41 +02:00
Paweł Chmielowski
b34291762a Remove dialyzer warning 2022-04-28 10:18:29 +02:00
Paweł Chmielowski
6fd4315a0c Guard agains erlang:system_info(logical_processors) not always returning number 2022-04-28 09:51:51 +02:00
Jérôme Sautret
f4959c8b28 Don't send ping if resource is gone 2022-04-26 18:56:38 +02:00
Alexey Shchepin
74e86611ab Stop empty MUC rooms 30 seconds after creation 2022-04-21 14:38:50 +03:00
Paweł Chmielowski
155261f78a Fix dialyzer warning 2022-04-20 19:20:16 +02:00
Paweł Chmielowski
e59043db2c Make oauth_revoke_token work with all backends 2022-04-20 19:07:52 +02:00
Badlop
87445bc74b Clarify mod_offline's use_mam_for_storage option 2022-04-13 17:33:08 +02:00
Badlop
d8642fc7c2 Fix syntax of some commands' result_example 2022-04-13 17:33:04 +02:00
Badlop
19019bbe32 Add support for MUC room vCard in get_vcard commands 2022-04-12 13:35:55 +02:00
Badlop
10481ed895 mod_cron from ejabberd-contrib is another possible frontend to run commands 2022-04-11 17:04:53 +02:00
Paweł Chmielowski
feb2ad0664 Don't use floor - doesn't exist in R19 2022-04-08 18:27:58 +02:00
Paweł Chmielowski
0870f32c59 Add rate limited delete_old_messages 2022-04-08 17:48:53 +02:00
Paweł Chmielowski
b86fe14ef0 Add rate limited delete_old_mam_messages command 2022-04-08 17:23:42 +02:00
Licaon_Kter
6dbd1118a2 mod_conversejs example, use newer dark theme
ref: https://github.com/conversejs/converse.js/releases/tag/v9.1.0
2022-04-06 18:21:43 +02:00
Badlop
170ea134d6 Set Converse auth and register options based on ejabberd configuration 2022-04-06 11:11:21 +02:00
Badlop
b405a3b61e Fix compilation with Erlang 19 2022-04-06 11:11:18 +02:00
badlop
e3ff868fcd
Merge pull request #3756 from pouriya/Add-Process-Hook-Tracing
Add process hook tracing
2022-04-06 11:10:57 +02:00
Holger Weiss
121fc716b0 domain_balancing: Allow for specifying 'type' only
Allow for specifying the 'type' of 'domain_balancing' without specifying
the 'component_number' (as per the example in the documentation).  The
balancing 'type' is then applied to the dynamic number of component
instances.
2022-04-04 00:14:32 +02:00
Badlop
152956c194 Add more configuration examples 2022-04-01 12:04:08 +02:00
Badlop
6cdb517454 New conversejs_options to setup additional options for Converse 2022-04-01 12:04:07 +02:00
Badlop
94186a36d0 The *_url options now support 'auto' 2022-04-01 12:04:05 +02:00
Badlop
f461bcb597 Improved mod_conversejs to support @HOST@, auto and conversejs_resources
Changes:
- The options can use the @HOST@ keyword
- default_domain option is @HOST@ by default, not the first defined vhost
- New conversejs_resources option to serve converse.js files (no need for web server)
- conversejs_* now support 'auto', which uses local or remote Converse files
2022-04-01 12:04:03 +02:00
Badlop
8065ec831e New mod_host_meta to serve host-meta files, see XEP-0156 2022-04-01 12:04:01 +02:00
Badlop
f19219f5a0 Terminate ejabberd_sm before everything else to ensure sessions closing (#3641) 2022-03-25 12:53:25 +01:00
Badlop
0f73d3f4d1 Don't define restart and stop in ejabberd_ctl, use the corresponding commands 2022-03-25 12:51:27 +01:00
Badlop
91c9b0446c Don't export password attribute when it's empty (it's invalid)(#3705) 2022-03-25 12:51:24 +01:00
Simon Paitrault
68762146d7
Checking users is active in SM for JWT authenticated user (#3795)
Signed-off-by: Freyskeyd <simon.paitrault@gmail.com>
2022-03-24 17:03:50 +01:00
Alexey Shchepin
5506b838c8 Add TLS certificate authentication for MQTT connections 2022-03-14 15:41:01 +03:00
Stu Tomlinson
dca49f508f
Sync old-to-new schema script with reality (#3790)
Update the update_sql function to match current "new" sql schema
2022-03-08 13:56:27 +01:00
Paweł Chmielowski
3520869e36 Use correct timestamp when hibernation_time is not set at all 2022-03-07 17:38:04 +01:00
Alexey Shchepin
d5841785e1 Don't request the whole MUC room state in get_room_occupants_number command (#3684) (#1964) 2022-03-07 08:42:42 +03:00
Badlop
d4f288d3c6 Add link in mod_http_api documentation to the docs API section 2022-02-24 01:02:48 +01:00
Badlop
c407b73803 Fix WebSocket uppercase 2022-02-24 01:02:46 +01:00
Badlop
22b469f55d The lager dependency is used only with old Erlang versions 2022-02-24 01:02:41 +01:00
Paweł Chmielowski
d4bf29e3ff Improve compatibility with various db engine versions 2022-02-18 20:43:56 +01:00
Paweł Chmielowski
4247501dc6 Fix compilation on OTP < 21 and remove dialyzer warning 2022-02-18 17:21:22 +01:00
Paweł Chmielowski
f86055378d Optimize room_unused_* commands
Previously to check if hibernated room was old enough we had to fetch info
about all rooms from database. Now we repurpose created_at field in sql
to store that info, that allow us to have more efficient query just for it.
2022-02-18 14:02:04 +01:00
Badlop
b3211b1f71 Update copyright year to 2022 2022-02-11 09:39:25 +01:00
Badlop
4d093ac03e ejabberd_sql_pt got USE_NEW_SCHEMA in 78dfb83 and removed in e15595d 2022-02-11 09:39:11 +01:00
Badlop
dda60fcf0d Implement Get List of Registered/Online Users from XEP-0133 2022-02-11 09:39:05 +01:00
Badlop
25e0326f87 Improve explanation of s2s_access option. Add link to access_rules option 2022-02-03 18:21:53 +01:00
Badlop
c92478f7c2 Use the same wording in all the identical options db_type and ram_db_type 2022-02-03 18:21:51 +01:00
Badlop
adbccbe852 New "make relive" similar to "ejabberdctl live" without installing
Prepare with:
  ./autogen.sh && ./configure --with-rebar=./rebar3 && make
Or use this if you installed Elixir:
  ./autogen.sh && ./configure --with-rebar=mix && make
Start without installing (it recompiles when necessary):
  make relive
It stores config, database and logs in _build/relive/
There's available the well-known script:
  _build/relive/ejabberdctl

Please note this fails immediately:
  r3:do(compile).
This crashes a few seconds later:
  rebar3:run(["compile"]).
Workaround that works correctly:
  ejabberd_admin:update().
2022-02-03 18:21:47 +01:00
Holger Weiss
67b5de05c7 mod_pubsub: Unsubscribe JID on whitelist removal
If a JID is removed from the affiliation lists of a node with access
model 'whitelist', remove it from the list of subscribers as well.
2022-02-02 22:35:28 +01:00
Paweł Chmielowski
11c725018b Make dialyzer happy 2022-02-02 18:33:45 +01:00
Paweł Chmielowski
9542cca0db One more place where we need to handle socket field not being available 2022-02-02 16:26:39 +01:00
Paweł Chmielowski
8824a912ef Don't expect that socket will be available in c2s_terminated hook
For detached connection we free socket, so let's make code account for this
(and we really need it for printing debug informations).

This makes sure we call ejabberd_sm:close_session
2022-02-02 16:19:13 +01:00
Paweł Chmielowski
cae4fbb40b Store all mucsub notifications not only message notifications
Previously we stored only message/subject change notifications, but if user
request also change notificaitons for affiliation/config/subscribers then
i don't see reason why we shouldn't store it as well.
2022-02-01 15:18:50 +01:00
Holger Weiss
52ac941034 mod_shared_roster: Adjust special group cache size
Let the size of the cache used for 'special' groups (such as @all@ or
@online@) depend on the number of virtual hosts, as the cache will
contain seperate entries per domain.

Thanks to Ingo Jrgensmann for reporting the issue.
2022-01-25 16:57:27 +01:00
Badlop
1b192987d2 Support MQTT subscriptions spread over the cluster (#3750) 2022-01-25 13:20:31 +01:00
Badlop
585afcbc77 Pass property name as expected in mqtt_codec (fixes login using MQTT 5) 2022-01-25 13:16:07 +01:00
Kian-Meng Ang
adf0f87e99 Fix typos 2022-01-24 08:02:04 +08:00
Pouriya Jahanbakhsh
259876cb74 feat: event handling
run multiple event handlers
generate new events in timing event handlers

print human-readable times

output each callback time info is optional and by default is disabled
2022-01-22 18:17:11 +03:30
Pouriya Jahanbakhsh
20326e8908 feat: process hook tracing 2022-01-21 03:18:55 +03:30
Holger Weiss
0f2d36dc53 mod_pubsub: Allow for limiting item_expire value
If mod_pubsub's 'max_item_expire_node' option is specified, reject node
configurations with an 'item_expire' value that exceeds the specified
limit.
2022-01-17 19:08:36 +01:00
Holger Weiss
8e88fa3884 mod_shared_roster: Normalize JID on unset_presence
Don't forget to normalize the JID handed over from ejabberd_sm on
presence-unavailable.  Without normalization, mod_shared_roster might
fail to look up the storage backend for the given host name, for
example.

Fixes #3752.
2022-01-15 18:18:24 +01:00
Badlop
a9ac10e876 Document that 'unregister' command deletes data associated with the account 2022-01-13 19:34:37 +01:00
Badlop
1fb908b70f Document option subscrube_room_many_max_users introduced in fc34661b6 2022-01-13 19:34:10 +01:00
Badlop
1ce3bd256b Update section URLs in ldap documentation 2022-01-13 19:34:07 +01:00
Badlop
ce14c28faf Fix version when this command was really updated 2022-01-11 17:28:36 +01:00
Badlop
03a11c63bd Fix login when generating client id, keep connection record (#3593) 2022-01-11 17:19:12 +01:00
Paweł Chmielowski
9ba20d26cb Add better descripion of subscribe_room_many command 2022-01-05 16:44:05 +01:00
Badlop
cc7ebb86b4 Fix Dialyzer, related to Luerl API update from 0.3 to 1.0 2022-01-04 23:06:30 +01:00
Holger Weiss
59c9500944 mod_muc_room: Fix function name typo 2021-12-30 21:17:11 +01:00
Holger Weiss
3c46e6aba5 Merge remote-tracking branch 'processone/pr/3735'
* processone/pr/3735:
  node_pep: Add config-node and multi-items features
2021-12-20 09:37:37 +01:00
Alexey Shchepin
fc34661b6f Add subscribe_room_many command 2021-12-20 09:42:02 +03:00
Alexey Shchepin
a26c9d2475 Optimize user removal handling in mod_muc 2021-12-20 09:42:02 +03:00
Alexey Shchepin
536beedeb6 Accept more types of ejabberdctl commands arguments as JSON-encoded 2021-12-20 09:42:02 +03:00
Linus Jahn
7196f46730
node_pep: Add config-node and multi-items features
Fixes #3714.
2021-12-19 21:06:33 +01:00
Holger Weiss
42bdb501ca mod_stun_disco: Fix parsing of IPv6 listeners
Don't crash if `mod_stun_disco` is used with `offer_local_services`
and an IPv6 listener has an explicit `ip:` address configured.

Thanks to Daniel Kenzelmann for reporting the issue.
2021-12-18 17:50:26 +01:00
Badlop
7e07cba406 Let get_all_rooms handle "global" argument, fixes rooms_unsued_... (#3726) 2021-12-15 00:50:17 +01:00
Alexey Shchepin
8b7da70b57 Handle user removal in mod_muc 2021-12-14 09:55:55 +03:00
Badlop
d1bfd6c90d Annotate modules, options and command major changes in 21.12 2021-12-09 10:55:21 +01:00
Paweł Chmielowski
8d8a3177e1 Eliminate xref warning from last commit 2021-12-06 15:46:52 +01:00
Paweł Chmielowski
7897c3d0e1 Add workaround for bug in older erlang version in rest module 2021-12-06 15:08:10 +01:00