Compare commits

..

251 Commits

Author SHA1 Message Date
Paweł Chmielowski a94209a0e0 Update stun and esip dependencies
CI / Tests (ubuntu-18.04, 19.3, 2) (push) Has been cancelled
CI / Tests (ubuntu-20.04, 24, 3) (push) Has been cancelled
CI / Binaries (ubuntu-20.04, 21.3, 3) (push) Has been cancelled
2021-12-09 12:13:48 +01:00
Badlop ed5ba1f645 Update CHANGELOG.md to 21.12 2021-12-09 11:07:43 +01:00
Badlop 1915f29d4b Update Chinese translation (thanks to Eric and 52871299hzy) 2021-12-09 10:55:26 +01:00
Badlop 333eaef6dc Update French translation (thanks to Éfrit and ButterflyOfFire) 2021-12-09 10:55:23 +01:00
Badlop d1bfd6c90d Annotate modules, options and command major changes in 21.12 2021-12-09 10:55:21 +01:00
Badlop ca143c1873 Update man page 2021-12-09 10:55:19 +01:00
Badlop e10f2a9e47 OTP 24 means whatever version provided by Actions... nowadays it's 24.1 2021-12-09 10:55:16 +01:00
Badlop 0f9a0156c6 Handle mix version when running docker-ejabberd/ecs/build.sh latest 2021-12-08 16:31:36 +01:00
Badlop 68ea5834c8 Relax strictness in mix dependency versions 2021-12-08 16:31:34 +01:00
Holger Weiss 4a52042435 Merge remote-tracking branch 'processone/pr/3724'
* processone/pr/3724:
  Remove CTLLOCKDIR (/var/lock/ejabberdctl) from Makefile.in
2021-12-07 10:19:59 +01:00
Florian Schmaus 6b1f78e87a Remove CTLLOCKDIR (/var/lock/ejabberdctl) from Makefile.in
Flock'ing /var/lock/ejabberdctl by ejabberdctl was removed with
f7d4aae64d ("Use UUID for ctl node name (#1021)"), however the
according recipies in the Makefile where never removed. This commit
does that.
2021-12-07 10:15:47 +01:00
Badlop 3f4423e996 Use P1's coveralls-erl fork to handle unicode in git commit author 2021-12-07 01:33:16 +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
badlop b173ec0a78 Merge pull request #3652 from weiss/bump-max-items
PubSub: Bump default value for 'max_items' limit
2021-12-03 16:11:18 +01:00
Badlop 7fd0eefa30 Run make options 2021-12-03 16:09:58 +01:00
Badlop dab4c0cc10 New allow_modules option to restrict registration modules 2021-12-03 16:09:55 +01:00
Badlop 0372878ba5 Minor improvements in conversejs documentation 2021-12-03 16:09:10 +01:00
Paweł Chmielowski ad3c91b86e Update mix deps 2021-11-29 15:36:57 +01:00
Paweł Chmielowski 75b133d968 Update deps 2021-11-29 15:20:10 +01:00
Alexey Shchepin 89ad8a5502 Add mod_conversejs 2021-11-23 08:43:54 +03:00
Badlop 15d3ebb842 Fix Dialyzer warning, old passwd tuple don't match current tuple definition 2021-11-17 17:26:44 +01:00
Badlop 689749a563 Update Jose to 1.11.1 (the last in hex.pm correctly versioned) 2021-11-17 13:22:34 +01:00
Badlop a590e81922 Add DIAGNOSTIC to rebar3 coveralls, this fails since some days ago 2021-11-17 13:20:33 +01:00
Paweł Chmielowski 405a5172d5 Improve mod_multicast 2021-11-17 11:32:42 +01:00
Paweł Chmielowski 97b8373fd2 Better version of dialyzer fix 2021-11-16 10:59:53 +01:00
Paweł Chmielowski bdd4e52699 Make dialyzer happy 2021-11-16 10:57:15 +01:00
Paweł Chmielowski 03817de827 Make s2s connection table cleanup more robust
Using monitors instead of doint that from terminate() makes us immune to
s2s handler processes being forcefully killed.
2021-11-16 10:25:03 +01:00
Paweł Chmielowski 132ebb8f2d Fix exception in mucsub {un}subscription events multicast handler
While those event are wrapped in mucsub envelope they doesn't
contain regular messages that require updating 'to' attribute,
so don't process in that same way as events with wrapped
message in them.
2021-11-10 17:04:50 +01:00
Holger Weiss 2cdda4cf49 mod_caps: Don't forget caps on XEP-0198 resumption
Many thanks to Thilo Molitor for spotting the issue and testing the fix.
2021-11-06 23:48:49 +01:00
Badlop 4e014d23bd Improve documentation of some commands 2021-11-05 15:58:00 +01:00
Badlop b6a2eeebeb Mention "help" as an available ejabberdctl command 2021-11-05 15:57:57 +01:00
Badlop 684ef60ec3 Annotate support for XEP-0317: Hats, since commit 5d0e599f1 2021-11-05 15:57:53 +01:00
Holger Weiss 6e3df8e80b Update 'stun' dependency
The new 'stun' release should improve UDP performance quite a bit.
2021-11-02 12:34:19 +01:00
Holger Weiss c4f6c9dfe7 mod_muc_room.hrl: Work around old Dialyzer bug
On Erlang/OTP versions older than 21, Dialyzer stumbles over non-empty
map type specifications for record fields (OTP-15098).
2021-10-31 21:59:00 +01:00
Holger Weiss 13cbd7c35d mod_pubsub: Remove unused check_opt_range/3 clause 2021-10-31 21:38:49 +01:00
Holger Weiss 65a900668c node_pep: Fix remove_expired_items/2 argument name 2021-10-31 21:32:45 +01:00
Holger Weiss 2f1611f918 mod_pubsub: Fix get_max_items_node/1 specification
Make it explicit that the get_max_items_node/1 function returns
?MAXITEMS if the 'max_items_node' option isn't specified.  The function
didn't actually fall back to 'undefined' (but to the 'max_items_node'
default; i.e., ?MAXITEMS) anyway.  This change just clarifies the
behavior and adjusts the function specification accordingly.
2021-10-30 13:45:10 +02:00
Holger Weiss 29dcc9b94c PubSub: Add delete_expired_pubsub_items command
Support XEP-0060's pubsub#item_expire feature by adding a command for
deleting expired PubSub items.

Thanks to Ammonit Measurement GmbH for sponsoring this work.
2021-10-30 13:19:30 +02:00
Alexey Shchepin 5d48329a3f Update 'xmpp' dependency 2021-10-29 05:48:03 +03:00
Alexey Shchepin 5d0e599f17 Support MUC hats (XEP-0317, conversejs/prosody compatible) 2021-10-29 05:35:16 +03:00
Badlop 5462a26a0a Remove obsolete cookie preparation in spool dir, it's now stored in HOME 2021-10-21 16:12:41 +02:00
Badlop 5f3c8dcca4 Use the configured user in systemd's ejabberd.service 2021-10-21 16:12:38 +02:00
Badlop 54c23a65db Fix create_room_with_opts when using SQL storage (#3700) 2021-10-21 12:44:51 +02:00
Badlop 4d384b6bf5 If tests succeed, test also new SQL schema 2021-10-15 16:59:32 +02:00
Badlop c2db003431 When tests fail, show also error.log as it may have meaningful content 2021-10-15 16:59:28 +02:00
Badlop d3aa329769 Fix vcard_search definition in pgsql new schema (thanks to Stu Tomlinson)(#3695)
How to update an existing database:
ALTER TABLE vcard_search DROP CONSTRAINT vcard_search_pkey;
ALTER TABLE vcard_search ADD PRIMARY KEY (server_host, lusername);
2021-10-14 15:28:00 +02:00
Badlop db920b7d7b Only install some files when option enabled in configure (#3633) 2021-10-14 15:26:41 +02:00
Holger Weiss 6b0fa44386 Update 'xmpp' dependency
Fixes #3529.
2021-10-09 10:56:30 +02:00
Badlop 964cb3aaca Github Actions: use MD5 pass encryption to support PostgreSQL 14 (#3691) 2021-10-07 16:54:27 +02:00
Holger Weiss 1377dcf6d2 mod_mam: Declare XEP-0441 support 2021-10-06 01:13:11 +02:00
Badlop 595b016019 Use mod_register in web register form, so its restrictions are used (#3688) 2021-10-04 12:08:59 +02:00
Badlop 85408662ff Use mod_register to format some common error messages 2021-10-04 12:08:56 +02:00
Badlop d205e6ff1f Support old scram records before xmpp's 651050f9 and ejabberd's e5cad9be6 (#3680) 2021-09-27 17:12:17 +02:00
Badlop dd359a7328 Add indexes from 95fa43aa to the old-to-new MySQL schema update script 2021-09-27 16:33:23 +02:00
Badlop f74a715713 Add indexes from 95fa43aa to the old-to-new schema update function 2021-09-27 13:05:18 +02:00
Badlop af4b49f720 Update export/import of scram password to XEP-0227 1.1 (#3676) 2021-09-22 16:15:22 +02:00
Badlop ceeba3eea1 Don't crash when exporting a module that is not enabled 2021-09-22 15:30:11 +02:00
Badlop cfc393a12e When exporting mod_mam, MUC entries are assigned to the MUC service (#3680) 2021-09-22 11:12:28 +02:00
Alexey Shchepin c9c5839da4 Fix roster_tests:get_items 2021-09-21 13:30:52 +03:00
Alexey Shchepin bf068f5659 Small optimization in mod_roster_sql:get_roster 2021-09-21 12:10:00 +03:00
Alexey Shchepin 32cf44827d Use INSERT ... ON CONFLICT in SQL_UPSERT for PostgreSQL >= 9.5 2021-09-19 06:20:20 +03:00
Alexey Shchepin 0c403c0f0e Fix SQL_UPSERT in mod_push_sql:store_session 2021-09-19 06:20:20 +03:00
Badlop 2f5b15129a Fix previous commit: add forgotten endline blankspaces 2021-09-14 15:13:37 +02:00
Badlop f8167fc5d0 Update documentation to match the implemented options values (#3675) 2021-09-14 13:47:41 +02:00
Alexey Shchepin 5abc03ff8f Optimize MucSub processing 2021-09-13 08:20:47 +03:00
Holger Weiss 3114ce4ed2 ejabberd_admin: Fix ejabberd_piefxis commands
These days, the ejabberd_piefxis commands expect their arguments to be
handed over as binary strings.
2021-09-08 18:34:20 +02:00
Holger Weiss 868387a405 mod_http_upload_quota: Avoid 'max_days' race
Try to spread clean-up runs for multiple hosts, rather than scheduling
them in parallel.  This should reduce I/O spikes, and avoid race
conditions where multiple processes detect and then try to delete the
same old files (if multiple hosts have the same 'docroot').

Fixes #3497.
2021-09-05 20:00:05 +02:00
Holger Weiss caf07692db mod_register_web: Handle unknown host gracefully
Return a proper error message on registration attempts against unknown
hosts, rather than crashing.

Thanks to Ingo Jrgensmann for reporting the bug.
2021-09-05 13:24:51 +02:00
Badlop 91350ad472 Fix WebAdmin recent change 2021-08-27 13:39:06 +02:00
badlop d967103d89 Merge pull request #3668 from longlene/master
rebar version get minor fix
2021-08-27 13:23:56 +02:00
Badlop f77686481a Add internal links in WebAdmin Vhosts page 2021-08-27 13:23:24 +02:00
Badlop b0da69f050 Send ping from server, not bare user JID (#3658) 2021-08-27 13:23:15 +02:00
loong0 9643e18be7 minor fix 2021-08-26 20:33:37 +08:00
Holger Weiss ebf03a3745 node_flat: Avoid catch-all clauses for RSM
Apply the change made in the previous commit to Mnesia storage as well.
2021-08-23 22:04:03 +02:00
Holger Weiss c952cc420b node_flat_sql: Avoid catch-all clauses for RSM
Explicitly catch invalid <before/> and <after/> timestamps specified by
clients in RSM queries, but crash on other errors, rather than silently
ignoring those.
2021-08-23 21:28:15 +02:00
Badlop 4d0503b6b3 Fix syntax in mod_disco example configuration 2021-08-23 15:49:52 +02:00
Badlop 8b6c90c2d9 Tell dialyzer that gen_tags only cares about markdown output, not html 2021-08-23 15:39:01 +02:00
Badlop 655dcbcb74 New command to produce markdown with tags and their associated commands 2021-08-23 14:04:54 +02:00
Badlop ac4f240261 Produce module names with specific syntax, docs Makefile will convert to links 2021-08-23 14:04:52 +02:00
Badlop 506e2f3b97 Use specific syntax so modules and top-level will be links
If we use _`whatever`_ here in ejabberd man pages,
it is converted to *`whatever`* in markdown,
and docs.ejabberd.im/Makefile converts to the proper links
2021-08-23 14:04:49 +02:00
Badlop 30ae66e99e Improve formatting and add sections links 2021-08-23 14:04:46 +02:00
Badlop f5038b86f8 Copy log_rotate_count explanation from docs site 2021-08-23 14:04:44 +02:00
Badlop 9446b251fd Export function, so ACME API commands are listed in the documentation 2021-08-23 14:04:42 +02:00
Badlop 94fb0a65b0 Change set_master command tag from mnesia to cluster 2021-08-23 14:04:40 +02:00
Badlop 69d362595e Remove obsolete mod_register_web ideas and improve documentation 2021-08-23 14:04:37 +02:00
Badlop b7f7713fae Add example config to mod_http_api documentation 2021-08-23 14:04:35 +02:00
Badlop 8af66b0831 Update API Reference page menu name and order 2021-08-23 14:04:31 +02:00
Holger Weiss 7e9c9703dd Merge remote-tracking branch 'processone/pr/3666'
* processone/pr/3666:
  PubSub: Add delete_old_pubsub_items command
  PubSub: Optimize publishing on large nodes (SQL)
  PubSub: Support unlimited number of items
  PubSub: Support 'max_items=max' node configuration
2021-08-22 15:17:02 +02:00
Holger Weiss 8d5025076f PubSub: Add delete_old_pubsub_items command
Add a command for keeping only the specified number of items on each
node and removing all older items.  This might be especially useful if
nodes may be configured to have no 'max_items' limit.

Thanks to Ammonit Measurement GmbH for sponsoring this work.
2021-08-22 12:44:50 +02:00
Holger Weiss 29751a6174 PubSub: Optimize publishing on large nodes (SQL)
Avoid an unnecessary SQL query while publishing an item on a PubSub node
without 'max_items' limit.  The query in question can be expensive if
the node has a large number of items.

Thanks to Ammonit Measurement GmbH for sponsoring this work.
2021-08-21 20:02:58 +02:00
Holger Weiss 1b0e59bb13 PubSub: Support unlimited number of items
Allow for setting the mod_pubsub option 'max_items_node' to 'unlimited'.
If clients then request a 'max_items' limit of 'max', old items aren't
deleted when publishing new ones.

Thanks to Ammonit Measurement GmbH for sponsoring this work.
2021-08-21 12:29:37 +02:00
Holger Weiss 8f8de0403b PubSub: Support 'max_items=max' node configuration
Let clients request the maximum limit for the node configuration option
'max_items' by specifying the special value 'max' instead of an integer.
This was added to XEP-0060, revision 1.17.0 (and clarified in revision
1.20.0).

Thanks to Ammonit Measurement GmbH for sponsoring this work.
2021-08-20 20:30:11 +02:00
badlop 8afc320aba Merge pull request #3660 from ballerburg9005/patch-1
"sort -R" command in captcha-ng.sh is not POSIX - added "shuf" and "cat" as fallback
2021-08-16 13:16:43 +02:00
badlop 545a2f0097 Merge pull request #3656 from pitchum/master
Add missing pgsql migration for table push_session
2021-08-16 12:47:45 +02:00
ballerburg9005 14bf197be1 "sort -R" command not POSIX, added "shuf" and "cat" as fallback 2021-08-12 15:14:31 +02:00
Holger Weiss 3e942bf4ac mod_mam_sql: Remove duplicated functions 2021-08-07 12:57:57 +02:00
Badlop fdfd202a30 Determine the default handlerid at runtime
Apparently Elixir's default is not called 'default'
2021-08-05 13:53:12 +02:00
Badlop 5b0a28bbc9 Fix CHANGELOG: rebar2's elixir workaround was problematic and was reverted
Problems:
- That workaround required running "make" twice
- CEAN (used to build installers) doesn't support that make && make
- Support for Elixir in rebar3 doesn't yet exist
- Preferable path for Elixir usage: install Elixir and use --with-rebar=mix
2021-08-05 13:52:52 +02:00
Badlop aefc374317 Fix typo when creating index (thanks to Millesimus)
Reference: https://github.com/processone/ejabberd/commit/95fa43aa96514b7e8b77fa7c29d2c0b5b1c1331a#r54157330
2021-08-05 13:52:38 +02:00
Paweł Chmielowski 4c61ea9091 Update tests after last commit 2021-08-04 17:52:23 +02:00
Paweł Chmielowski d7e330c8ef Allow storing non-composing x:events in offline 2021-08-04 15:30:29 +02:00
Holger Weiss 99ffd9bb95 mod_pubsub: Fix check_opt_range/3 spec 2021-08-02 21:09:55 +02:00
pitchum 76c49f314f Add missing SQL migration for table push_session 2021-08-01 09:53:07 +02:00
Badlop ab5e726176 Use the most specific tag for ejabberd commands with several ones 2021-07-30 01:14:36 +02:00
Badlop b22779f018 Show tags and definer module in generated API document when it's a gen_mod 2021-07-30 01:14:34 +02:00
Badlop 41808a63a0 Show definer module in "ejabberdctl help" when it's a gen_mod 2021-07-30 01:14:31 +02:00
Badlop ccb4328d06 Store who defines a command, specially when defined by ejabberd modules 2021-07-30 01:14:27 +02:00
Holger Weiss 2050cdffb4 PubSub: Use configured 'max_items' by default
If clients don't ask for a specific 'max_items' limit, use the value of
mod_pubsub's 'max_items_node' option as default, rather than the
hard-coded ?MAXITEMS value.  This makes sure clients cannot circumvent a
smaller, configured limit.
2021-07-28 18:53:15 +02:00
Holger Weiss fce7fe8558 PubSub: Bump default value for 'max_items' limit
Bump the default value for mod_pubsub's 'max_items_node' option, which
hard-limits the 'max_items' value requested by clients.

These days, use cases such as microblogging or XEP-0402 may need a large
number of items per node.  Bumping the limit makes sure such
functionality is properly supported with the default configuration.
2021-07-28 18:29:19 +02:00
Holger Weiss 103e98b8da mod_push: Fix handling of MUC/Sub messages
Don't fail to include the sender/body of MUC/Sub messages if the
recipient is offline.

Closes #3651.
2021-07-28 18:22:39 +02:00
Badlop 8e553decb0 When vsn is an exact tag, append .0 to satisfy SemVer 2021-07-26 16:36:21 +02:00
Paweł Chmielowski e3875482ba Remove stringprep override from mix.exs 2021-07-26 16:06:43 +02:00
Paweł Chmielowski 6e4e5a0190 Add missing fields from config inside mod_muc_admin:change_options 2021-07-23 10:14:45 +02:00
Paweł Chmielowski c96de092fe Revert "Add workaround so rebar2 can use Elixir 1.12.0"
CI / Tests (ubuntu-18.04, 19.3, 2) (push) Has been cancelled
CI / Tests (ubuntu-20.04, 24.0, 3) (push) Has been cancelled
CI / Binaries (ubuntu-20.04, 21.3, 3) (push) Has been cancelled
This reverts commit 937e1c2e37.
2021-07-22 15:51:43 +02:00
Badlop cf72c5ee18 Remove leading zeros in ejabberd version number to satisfy Elixir SemVer 2021-07-21 21:29:04 +02:00
Badlop 69fa79b154 Add 21.07 changes to CHANGELOG 2021-07-21 17:58:35 +02:00
Badlop ea795e4bd7 Update man page 2021-07-21 17:58:32 +02:00
Badlop 537c8b966e In "make dev" don't create link ejabberdctl, seems buggy 2021-07-21 17:58:27 +02:00
Paweł Chmielowski 142e494d52 Update mix.lock 2021-07-21 14:50:18 +02:00
Badlop 50242cec78 Annotate the srg_create command as changed in 21.07 2021-07-21 13:11:09 +02:00
Badlop 33f821d4f7 Simplify the --with-rebar example in README 2021-07-21 13:11:06 +02:00
Badlop 9a823e5a16 Update Portuguese translation from Weblate (thanks to Ssantos) 2021-07-21 13:07:31 +02:00
Badlop 686ce01534 Update Italian translation from Weblate (thanks to Alessandro Mandelli) 2021-07-21 13:07:29 +02:00
Badlop 4225f14e8b Update Indonesian translation from Weblate (thanks to Reza Almanda) 2021-07-21 13:07:26 +02:00
Paweł Chmielowski a3478b7f0f Update pam 2021-07-21 11:37:32 +02:00
Paweł Chmielowski bab9543c1f Update dependences 2021-07-21 11:12:54 +02:00
Paweł Chmielowski c3169e9eea Typo 2021-07-20 17:07:40 +02:00
Badlop c04b6b2908 Update CHANGELOG.md with 21.04 and 21.01 (#3646) 2021-07-19 17:23:50 +02:00
Badlop 937e1c2e37 Add workaround so rebar2 can use Elixir 1.12.0
Notice that Elixir 1.12.0 requires Erlang/OTP 21 or higher
BTW, this workaround works only with rebar2... unfortunately
rebar3 doesn't compile the elixir files from lib/
2021-07-16 16:43:08 +02:00
Badlop 91763bbc61 As Mix config now must be evaluated at runtime, rename to runtime.exs 2021-07-16 13:57:25 +02:00
Badlop e0c9a6308d erlang:phash is deprecated in OTP 24, let's use phash2 2021-07-16 13:57:08 +02:00
Badlop e14cd5dd17 Mention in README.md the updated --with-rebar and "make dev" 2021-07-16 13:36:28 +02:00
Badlop e31919914b Add support to build release with back to old Elixir 1.10.3
However, to build a release with OTP 24 requires Elixir 1.11.4 or higher
2021-07-16 13:36:27 +02:00
Badlop fcbd72f2d7 Add rebar3 3.15.2
Reference: https://ferd.ca/you-ve-got-to-upgrade-rebar3.html
2021-07-16 13:36:25 +02:00
Badlop 4c5641a648 Add support for mix to: ./configure --enable-rebar=mix 2021-07-16 13:36:23 +02:00
Badlop 1fd452dca9 Update setup-dev.sh to work perfectly both with rebar3 and mix 2021-07-16 13:36:22 +02:00
Badlop f35d304582 Minor mix.exs definitions copied from the template file 2021-07-16 13:36:20 +02:00
Badlop 8ca12d4d23 Add support to build release with mix 2021-07-16 13:36:19 +02:00
Badlop 72e069d9ec Get ejabberd version from vars.config 2021-07-16 13:36:17 +02:00
Badlop df8b0cb1a5 Add sql to package files (#3251) 2021-07-16 13:36:15 +02:00
Badlop a00a11e38a Add vars.config to package files: version and cond_deps use it 2021-07-16 13:36:13 +02:00
Badlop 94949c9617 Sort package files 2021-07-16 13:36:10 +02:00
Badlop e2aaca7cdd Update mix applications list to fix error "p1_utils is listed as both..." 2021-07-16 13:36:04 +02:00
Badlop 3afaacab76 With the recent changes it seems mod_mix supports 0.14.1 (#3634) 2021-07-15 17:19:32 +02:00
badlop 57be0e38d8 Merge pull request #3634 from lnjX/mix-identity-conf-mix
mod_mix: Use disco identity conference/mix
2021-07-15 17:15:48 +02:00
Paweł Chmielowski 27c69f263c Allow multicast hook registering by host 2021-07-14 13:58:53 +02:00
Badlop e22ed8081a Provide proper error message when create_room fails with invalid_service 2021-07-13 20:43:52 +02:00
Badlop 5beaf50c67 Fix spec: xmpp:set_from_to/3 allows undefined as second argument 2021-07-13 20:43:44 +02:00
Paweł Chmielowski a07029dcad Fix previous commit to pass all tests 2021-07-13 17:56:16 +02:00
Paweł Chmielowski 0de6f1c538 Use multicast routing for more packets generated by muc 2021-07-13 16:01:25 +02:00
Badlop 2e2667bbd7 Update documentation: mod_muc ram_db_type supports SQL since 17.04 (#3632) 2021-07-08 12:29:16 +02:00
Badlop 271a9f097d After create_room, store in DB if it's persistent (#3632) 2021-07-08 12:29:13 +02:00
Badlop 7e3276f3a8 Ignore captcha scripts copied by relx after "make dev" 2021-07-08 12:29:03 +02:00
badlop 42fdac0b41 Merge pull request #3639 from McPo/xep0033-bcc-strip-fix
Correctly strip only third-party bcc addresses
2021-07-07 19:07:21 +02:00
Emmet McPoland 509331a563 Correctly strip only other bcc addresses i.e. bcc receiver should still be able to see their bcc address element and no other bcc address element 2021-07-07 16:44:58 +01:00
Badlop 08c2d0a83e Tell relx to include src, so that the tar will contain include/ (#3633)
That's the only way to ensure that tar.gz will contain include/
of ejabberd and its dependencies, which is required to compile
ejabberd-contrib modules with "ejabberdctl module_install ..."
2021-07-06 13:37:14 +02:00
Badlop bb0c6e1e02 Show messages with next configuration steps when installing a module 2021-07-06 13:37:04 +02:00
badlop 331a67f5f8 Merge pull request #3566 from Robbilie/feature/mqtt-shared-roster-groups-placeholder
allow shared roster group placeholder in mqtt topic
2021-07-06 13:36:41 +02:00
Paweł Chmielowski e3e4dae583 Yet another dialyzer warning fix 2021-06-28 12:53:30 +02:00
Paweł Chmielowski b669e4499c Fix dialyzer warning 2021-06-28 12:18:19 +02:00
Paweł Chmielowski 6e900d6a8f Add send_timeout option to listener 2021-06-28 11:31:45 +02:00
Paweł Chmielowski 795addca7d Try to limit serial access when checking api permissions 2021-06-28 11:31:43 +02:00
Badlop 774de2bdc5 Include odbc app in release only when required (#3633) 2021-06-27 17:32:09 +02:00
Badlop b5b2ad560a Copy captcha scripts in release (#3633) 2021-06-27 17:32:06 +02:00
Badlop b93fc4333c Let "make dev" always update SCRIPT_DIR in ejabberdctl, even if link exists 2021-06-27 17:32:04 +02:00
Linus Jahn d7c9809c59 mod_mix: Use disco identity conference/mix
Probably someone has forgotten to update it here.
https://xmpp.org/extensions/xep-0369.html#example-5

Fixes #2901.
2021-06-27 01:20:45 +02:00
Badlop ac06161f30 There are so many targets... add "make help" 2021-06-25 12:53:47 +02:00
Badlop 0fe2aea709 New "make dev" and "./ejabberdctl" (requires using rebar3) 2021-06-25 12:53:43 +02:00
Badlop 21b021d912 Set SCRIPT_DIR as done by the ejabberd script generated by "rebar3 release" 2021-06-25 12:53:30 +02:00
Badlop d5adcaea61 Add support for rebar3 to "make rel" 2021-06-25 12:53:22 +02:00
Holger Weiss 9d4c01d425 mod_push_keepalive: Fix 'resume_timeout' docs
The default 'resume_timeout' value is 72 hours, not 72 minutes.
2021-06-25 01:30:10 +02:00
Badlop ea97be9124 Don't cache rebar3 binaries... compiling is less than 2 minutes anyway 2021-06-21 11:46:10 +02:00
Paweł Chmielowski 2458f55837 Update stringprep in mix 2021-06-18 11:45:18 +02:00
badlop 1ef9f28f2d Merge pull request #3622 from pouriya/fix-ws-typos
ref: fix WS typos
2021-06-14 17:21:33 +02:00
Badlop 3ed41e39f6 CI: don't cache dialyzer output file: when there are several, ln fails 2021-06-14 17:20:57 +02:00
Badlop 4ee10c155d Fix reverse order of items when using <before/> in Pubsub with RSM (#3621) 2021-06-14 12:22:37 +02:00
Badlop c2d8bc7b2f Add mqtt_pub table definition for MSSQL (#3097) 2021-06-14 12:22:21 +02:00
Pouriya Jahanbakhsh b5bafca640 ref: fix WS typos 2021-06-12 20:27:30 +04:30
Badlop 9a93562b94 Revert luerl from v0.4 which has a compilation warning; v0.3 is enough
Revert "Update luerl dependency from v0.3 to v0.4"

This reverts commit 64f3f3287a.
2021-06-08 19:00:46 +02:00
Badlop bf8b4acf01 Return proper index when using after of before in PubSub with RSM (#3618)
This fixes Index attribute in examples from:
https://xmpp.org/extensions/xep-0059.html#forwards
https://xmpp.org/extensions/xep-0059.html#backwards
2021-06-08 19:00:44 +02:00
Badlop 41fd2afeb3 Fix index attribute when getting last page from PubSub with RSM (#3618)
This fixes Example 11 from "2.5 Requesting the Last Page in a Result Set":
https://xmpp.org/extensions/xep-0059.html#last
2021-06-08 19:00:41 +02:00
Badlop 4520d5f3c1 Support for simple limiting the number of items in PubSub with RSM (#3618)
This fixes crash in Example 1 from "2.1 Limiting the Number of Items":
https://xmpp.org/extensions/xep-0059.html#limit
2021-06-08 19:00:39 +02:00
Badlop ccadbf45a2 Get explicitely rebar3 3.15 binary that works with Erlang 21.3 2021-06-07 12:13:22 +02:00
Badlop 2b0d724aef Workaround so coveralls website shows git commit information
References:
https://github.com/markusn/coveralls-erl/pull/36
https://github.com/deadtrickster/prometheus.erl/pull/123
2021-06-06 16:56:29 +02:00
Badlop 9010c35193 CI: Get rebar3 compatible with previous OTP, the one in Ubuntu 20.04 is not 2021-05-28 16:56:05 +02:00
Badlop 2c20414453 Update eredis dependency from v1.0.8 to v1.2.0 2021-05-28 16:54:58 +02:00
Badlop 64f3f3287a Update luerl dependency from v0.3 to v0.4 2021-05-28 16:53:09 +02:00
Badlop 1befa8d8b7 Update lager dependency from 3.6.10 to 3.9.1 to make Dialyzer happy 2021-05-28 16:51:59 +02:00
Holger Weiß 3b5ddf0254 mod_muc_room: Don't leak owner JIDs (#3615)
Avoid publishing room owner JIDs (via the muc#roominfo form) without
their explicit consent.

Closes #3609.
2021-05-28 16:43:49 +02:00
Badlop 33fd45a960 Remove .travis.yml as it's superseded by ci.yml (#3613) 2021-05-25 19:16:06 +02:00
Badlop 77ef03e104 New ci.yml with all static and dynamic testing suites (#3613)
It supports all that was already in .travis.yml and tests.yml, plus:
- exclude paths that don't affect source code
- two very distinct scenarios, ancient a recent (OTP, Rebar, Ubuntu)
- cache binaries and dialyzer for small speedup and network usage
- separated results, to view comfortably where and what failed
- use coveralls example rebar3 code, instead of custom rebar2
- upload binaries.zip that can be used with Binary Installers
2021-05-25 18:45:31 +02:00
Badlop 70640e71f1 Remove tests.yml github workflow, a new reworked one is coming (#3613) 2021-05-25 18:40:28 +02:00
Badlop 1ee64091b3 Fix extauth.py failure in test suite with Python 3 (#3612) 2021-05-25 18:39:18 +02:00
Nikat 7b33499811 MySQL Backend Patch for scram-sha512 (#3582)
* Update mysql.new.sql

scram-sha512 does not work, because serverkey is longer, then that array. All passwords was unhashed.

* Update mysql.sql
2021-05-20 13:32:50 +02:00
Badlop d94bae241c Align numbers in WebAdmin tables to the right 2021-05-19 15:00:22 +02:00
Badlop 58a623778f Show uptime date in WebAdmin, it's easier to understand that uptime seconds 2021-05-19 15:00:19 +02:00
Badlop 494ba9a635 Show mnesia table memory in bytes, not in words 2021-05-19 15:00:16 +02:00
Paweł Chmielowski 95fa43aa96 Add missing indexes to sql sr_group tables 2021-05-18 18:29:32 +02:00
Badlop 16af8a4739 New simple webadmin pages to view mnesia tables information and content 2021-05-17 16:16:26 +02:00
Badlop 57202d958a Use G macro name for tag, as T overlapped T from translation 2021-05-17 16:14:39 +02:00
Badlop d741f6f5f2 Update documentation references for import_prosody and export2sql 2021-05-14 16:07:03 +02:00
Badlop 20b4deffe3 Apply improvement from 29462f005 to delete/2, and fix delete/3 (#3564) 2021-05-14 16:06:59 +02:00
Badlop ee3796b925 When exporting for SQLite, use its specific escape options (#2576) 2021-05-14 16:06:43 +02:00
Badlop 8e08703833 Tell io_lib:print to not care about line length, to avoid newlines in SQL export 2021-05-14 16:06:39 +02:00
Paweł Chmielowski 3b716d2cb0 Update econf:vcard() to generate correct vcard_temp record 2021-05-12 21:46:36 +02:00
Paweł Chmielowski 0f51a03d08 Update xmpp to bring updated vcard 2021-05-12 18:05:11 +02:00
Mickaël Rémond 20247af6f6 Use the new Github container registry 2021-05-12 11:51:40 +02:00
Mickaël Rémond 2698024b82 Use latest version of the container
This is the only image available for now
2021-05-12 11:22:45 +02:00
Mickaël Rémond a142dc4b11 Remove set up already set in prebuilt image 2021-05-12 11:17:26 +02:00
Mickaël Rémond 2844a2d73e Use a prebuilt image 2021-05-12 11:16:46 +02:00
Badlop 160cd11c83 Minor fixes for new_sql_schema support in SQLite (#3303) 2021-05-11 18:36:16 +02:00
Badlop 4fdebd296a Document that update_sql command only supports postgresql (#3439) 2021-05-11 18:36:14 +02:00
Badlop b18f622984 Use the deps versions defined in rebar.config, not the latest available 2021-05-11 18:36:11 +02:00
Badlop f61607df65 Don't add ejabberd version in API page either, following 3e4ebfae7 2021-05-11 18:36:08 +02:00
Mickaël Rémond 5d0c0eb03d Expose port label 2021-05-11 09:00:44 +00:00
Mickaël Rémond ef1d9a0723 Ignore basic Mnesia directory 2021-05-11 08:32:44 +00:00
Mickaël Rémond 5465e7ed2f Forward XMPP legacy SSL and MQTT ports 2021-05-11 08:29:38 +00:00
Mickaël Rémond 7edd9e3766 Install Erlang and Elixir VSCode extensions as default 2021-05-11 08:06:44 +00:00
Mickaël Rémond 7a6425544c Remove file syntax deprecation 2021-05-11 08:06:16 +00:00
Mickaël Rémond 97e7f25e6e Merge pull request #3595 from processone/codespaces
Codespaces
2021-05-11 09:50:46 +02:00
Badlop 916653e234 Cast as boolean when exporting privacy_list_data to PostgreSQL (#1773) 2021-05-10 12:04:52 +02:00
Badlop 6db228fcb3 Document that sql_ssl can be used with MySQL too 2021-05-05 11:57:08 +02:00
Badlop c2821be94c Use the new 'note' field to annotate changes in 20.01..21.03 2021-05-05 11:57:05 +02:00
Badlop 999d0af502 New 'note' field in commands and options documentation 2021-05-05 11:57:02 +02:00
Paweł Chmielowski 78c09789f7 Fix invalid_encoding error when using extended plane characters in vcard. 2021-04-29 14:21:37 +02:00
Paweł Chmielowski 5a8f1ca528 Display extender error message in ejabberdctl
This for example makes error from register explain what account
can't be registered

For reference https://github.com/processone/ejabberd/discussions/3584
2021-04-22 11:56:58 +02:00
badlop 2d38d48a55 Merge pull request #3578 from tappytaps/srg-cache-fix
Fixed srg_create params and shared roster groups cache issues
2021-04-20 21:22:25 +02:00
Jindrich Sarson dcc5d8704f delete cache after performing change to be sure that in cache will be up to date data 2021-04-17 19:07:21 +02:00
Jindrich Sarson c10e4fa275 update srg_create API to use label parameter instead of name 2021-04-17 18:49:26 +02:00
Paweł Chmielowski e462f0a584 Fix dialyzer warnings 2021-04-16 11:55:48 +02:00
Paweł Chmielowski 45bbbd0284 Fix syntax not recognized by older erlang 2021-04-16 10:46:28 +02:00
Paweł Chmielowski 5b0f0d8352 Improve database and caching in mod_shared_roster
This makes us keep cache of groups that use wildcards no matter
of cache settings, and tries to not same fetch data multiple times
in roster get operations.
2021-04-16 10:34:32 +02:00
Paweł Chmielowski 54916caf65 Use proper source for cache options in mod_shared_roster 2021-04-16 10:20:13 +02:00
Paweł Chmielowski c8afb5ceb6 Reconfigure cache in mod_shared_roster when options change 2021-04-16 10:19:09 +02:00
Badlop b3374e1f99 Remove SMP option from ejabberdctl.cfg, -smp was removed in OTP 21 (#3560) 2021-04-15 20:28:43 +02:00
Badlop 4914b33f8c Support the recent changes in the "ejabberdctl help" command (#3569) 2021-04-15 20:25:54 +02:00
Badlop 0ec69f0279 Major changes in ejabberdctl help output (#3569)
ejabberdctl: show list of commands
ejabberdctl some-command: if wrong number of arguments, shows command help
ejabberdctl help: show explanation of how to use "help"
ejabberdctl help tags: list tags with list of commands
ejabberdctl help commands: list tags with commands details
ejabberdctl help whatever*: filters commands and tags
2021-04-15 20:25:52 +02:00
Badlop 6f565147cb Change tag name because there's already a command called "stats" 2021-04-15 20:25:49 +02:00
Badlop f8a02f5d9d Get the arguments definition from the record (#3569)
This fixes "ejabberdctl help help"
2021-04-15 20:25:47 +02:00
Badlop 327dc31e62 Copy a change from include file available since OTP 17.0
See:
https://github.com/erlang/otp/commit/5e575f65629f6d99ed423bc646219c162f6bfa1a
2021-04-15 20:25:44 +02:00
Mickaël Rémond f77a163341 Update bug_report.md 2021-04-15 15:30:23 +02:00
Mickaël Rémond c280d172b1 Update feature_request.md 2021-04-15 15:30:06 +02:00
Badlop b860a25c82 When using OTP 24.0, use the new 'application' record definition (#3568)
This fixes "ejabberdctl update_list", "update", and the equivalent feature
on ejabberd's WebAdmin that got broken when using Erlang/OTP 24
2021-04-14 17:12:08 +02:00
Mickaël Rémond ab2b499869 Update devcontainer.json 2021-04-13 10:25:05 +02:00
Mickaël Rémond 0a55e07326 Use Dockerfile 2021-04-13 08:24:01 +00:00
Mickaël Rémond 22cc7cedff Use Dockerfile 2021-04-12 09:54:06 +00:00
Mickaël Rémond cdbfd91ec4 Update devcontainer.json
Disable docker compose for now
2021-04-12 11:45:59 +02:00
Mickaël Rémond 9359bab677 Create docker-compose.yml 2021-04-12 11:44:10 +02:00
Robert Schuh 0e93f70e38 allow shared roster group placeholder in mqtt topic 2021-04-08 23:21:15 +02:00
Holger Weiss 10905b0447 mod_push: Handle MUC/Sub events correctly
Unwrap MUC/Sub messages so that our check for a message body yields the
correct result.

Many thanks to Robert Schuh for pointing out the issue and suggesting a
fix.

Closes #3565.
2021-04-08 19:36:16 +02:00
142 changed files with 5120 additions and 1877 deletions
+2 -40
View File
@@ -1,42 +1,4 @@
# Update the VARIANT arg in docker-compose.yml to pick an Elixir version: 1.9, 1.10, 1.10.4
# Update the VARIANT arg to pick an Elixir version: latest, 1.11.4, etc.
ARG VARIANT=latest
FROM elixir:${VARIANT}
# This Dockerfile adds a non-root user with sudo access. Update the “remoteUser” property in
# devcontainer.json to use it. More info: https://aka.ms/vscode-remote/containers/non-root-user.
ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID
# Options for common package install script
ARG INSTALL_ZSH="true"
ARG UPGRADE_PACKAGES="true"
ARG COMMON_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/master/script-library/common-debian.sh"
ARG COMMON_SCRIPT_SHA="dev-mode"
# Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies.
RUN apt-get update \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends curl ca-certificates 2>&1 \
&& curl -sSL ${COMMON_SCRIPT_SOURCE} -o /tmp/common-setup.sh \
&& ([ "${COMMON_SCRIPT_SHA}" = "dev-mode" ] || (echo "${COMMON_SCRIPT_SHA} */tmp/common-setup.sh" | sha256sum -c -)) \
&& /bin/bash /tmp/common-setup.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \
#
# Install dependencies
&& apt-get install -y build-essential \
#
# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y
#RUN su ${USERNAME} -c "mix local.hex --force \
# && mix local.rebar --force \
# && mix archive.install --force hex phx_new ${PHOENIX_VERSION}"
# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update \
# && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
# [Optional] Uncomment this line to install additional package.
# RUN mix ...
FROM ghcr.io/processone/elixir:${VARIANT}
+36 -4
View File
@@ -1,16 +1,48 @@
{
"name": "ejabberd",
"dockerComposeFile": "docker-compose.yml",
// "dockerComposeFile": "docker-compose.yml",
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "latest" // 1.11.4
}
},
"workspaceFolder": "/workspace",
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/zsh",
"terminal.integrated.defaultProfile.linux": "/bin/zsh",
},
// Add the IDs of extensions you want installed when the container is created.
// "extensions": [],
"extensions": ["pgourlain.erlang", "jakebecker.elixir-ls"],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [5222, 5280, 5269],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "sh .devcontainer/post-create.sh",
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
"remoteUser": "vscode",
"portsAttributes": {
"1883": {
"label": "MQTT"
},
"5222": {
"label": "XMPP C2S"
},
"5223": {
"label": "Legacy XMPP C2S"
},
"5269": {
"label": "XMPP S2S"
},
"5280": {
"label": "ejabberd HTTP"
},
"5443": {
"label": "ejabberd HTTPS"
}
}
}
+8
View File
@@ -0,0 +1,8 @@
ejabberd:
image: ejabberd/ecs
ports:
- 5222:5222
- 5223:5223
- 5269:5269
- 5280:5280
- 1883:1883
+3
View File
@@ -6,6 +6,9 @@ assignees: ''
---
Before creating a ticket, please consider if this should fit the discussion forum better:
https://github.com/processone/ejabberd/discussions
## Environment
- ejabberd version: 18.09
@@ -7,6 +7,9 @@ assignees: ''
---
Before creating a ticket, please consider if this should fit the discussion forum better:
https://github.com/processone/ejabberd/discussions
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+291
View File
@@ -0,0 +1,291 @@
name: CI
on:
push:
paths-ignore:
- '.devcontainer/**'
- 'examples/**'
- 'lib/**'
- 'man/**'
- 'priv/**'
- '**.md'
pull_request:
paths-ignore:
- '.devcontainer/**'
- 'examples/**'
- 'lib/**'
- 'man/**'
- 'priv/**'
- '**.md'
jobs:
tests:
name: Tests
strategy:
fail-fast: false
matrix:
otp: ['19.3', '24']
include:
- otp: '19.3'
rebar: 2
os: ubuntu-18.04
- otp: '24'
rebar: 3
os: ubuntu-20.04
runs-on: ${{ matrix.os }}
services:
redis:
image: redis
ports:
- 6379:6379
steps:
- uses: actions/checkout@v2
- name: Get previous Erlang/OTP
uses: ErlGang/setup-erlang@master
if: matrix.otp != 24
with:
otp-version: ${{ matrix.otp }}
- name: Prepare databases
run: |
sudo sed -i 's|#password_encryption.*|password_encryption = md5|g' /etc/postgresql/14/main/postgresql.conf
sudo sed -i 's|scram-sha-256|md5|g' /etc/postgresql/14/main/pg_hba.conf
sudo systemctl start mysql.service
sudo systemctl start postgresql.service
mysql -u root -proot -e "CREATE USER 'ejabberd_test'@'localhost'
IDENTIFIED BY 'ejabberd_test';"
mysql -u root -proot -e "CREATE DATABASE ejabberd_test;"
mysql -u root -proot -e "GRANT ALL ON ejabberd_test.*
TO 'ejabberd_test'@'localhost';"
mysql -u root -proot ejabberd_test < sql/mysql.sql
pg_isready
sudo -u postgres psql -c "CREATE USER ejabberd_test
WITH PASSWORD 'ejabberd_test';"
sudo -u postgres psql -c "CREATE DATABASE ejabberd_test;"
sudo -u postgres psql ejabberd_test -f sql/pg.sql
sudo -u postgres psql -c "GRANT ALL PRIVILEGES
ON DATABASE ejabberd_test TO ejabberd_test;"
sudo -u postgres psql ejabberd_test -c "GRANT ALL PRIVILEGES ON ALL
TABLES IN SCHEMA public
TO ejabberd_test;"
sudo -u postgres psql ejabberd_test -c "GRANT ALL PRIVILEGES ON ALL
SEQUENCES IN SCHEMA public
TO ejabberd_test;"
- name: Prepare libraries
run: |
sudo apt-get -qq update
sudo apt-get -qq install libexpat1-dev libgd-dev libpam0g-dev \
libsqlite3-dev libwebp-dev libyaml-dev
- name: Prepare rebar
id: rebar
run: |
echo '{xref_ignores, [{eldap_filter_yecc, return_error, 2}
]}.' >>rebar.config
echo '{xref_checks, [deprecated_function_calls, deprecated_functions,
locals_not_used, undefined_function_calls, undefined_functions]}.
% Disabled: exports_not_used,' >>rebar.config
echo '{dialyzer, [{get_warnings, true}, {plt_extra_apps, [cache_tab,
eimp, epam, esip, ezlib, fast_tls, fast_xml, fast_yaml,
mqtree, p1_acme, p1_mysql, p1_oauth2, p1_pgsql, p1_utils, pkix,
sqlite3, stringprep, stun, xmpp, yconf]} ]}.' >>rebar.config
echo '{ct_extra_params, "-verbosity 20"}.' >>rebar.config
- name: Cache rebar2
if: matrix.rebar == 2
uses: actions/cache@v2
with:
path: |
deps/
dialyzer/
ebin/
key: ${{matrix.otp}}-${{matrix.rebar}}-${{hashFiles('rebar.config')}}
- name: Cache rebar3
if: matrix.rebar == 3
uses: actions/cache@v2
with:
path: ~/.cache/rebar3/
key: ${{matrix.otp}}-${{matrix.rebar}}-${{hashFiles('rebar.config')}}
- name: Compile
run: |
./autogen.sh
[[ ${{ matrix.rebar }} = 2 ]] && REBAR=rebar || REBAR=`which rebar3`
./configure --with-rebar=$REBAR \
--prefix=/tmp/ejabberd \
--enable-all \
--disable-elixir \
--disable-odbc
make update
make
- run: make rel
- run: make install -s
- run: make hooks
- run: make options
- run: make xref
- run: make dialyzer
- run: make test
- name: Check results
if: always()
run: |
[[ -d _build ]] && ln -s _build/test/logs/ logs \
&& ln `find _build/ -name "*dialyzer_warnings"` \
logs/dialyzer.log \
|| ln dialyzer/error.log logs/dialyzer.log
ln `find logs/ -name suite.log` logs/suite.log
grep 'TEST COMPLETE' logs/suite.log
grep -q 'TEST COMPLETE,.* 0 failed' logs/suite.log
test $(find logs/ -empty -name error.log)
- name: View dialyzer report
run: cat logs/dialyzer.log
- name: View full suite.log
run: cat logs/suite.log
- name: View suite.log failures
if: failure()
run: cat logs/suite.log | awk
'BEGIN{RS="\n=case";FS="\n"} /=result\s*failed/ {print "=case" $0}'
- name: View full ejabberd.log
if: failure()
run: find logs/ -name ejabberd.log -exec cat '{}' ';'
- name: View error.log
if: failure()
run: find logs/ -name error.log -exec cat '{}' ';'
- name: View exunit.log
if: failure()
run: find logs/ -name exunit.log -exec cat '{}' ';'
- name: Send to coveralls
if: matrix.otp == 24
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
DIAGNOSTIC=1 rebar3 as test coveralls send
curl -v -k https://coveralls.io/webhook \
--header "Content-Type: application/json" \
--data '{"repo_name":"$GITHUB_REPOSITORY",
"repo_token":"$GITHUB_TOKEN",
"payload":{"build_num":$GITHUB_RUN_ID,
"status":"done"}}'
- name: Prepare new schema
run: |
[[ -d logs ]] && rm -rf logs
[[ -d _build/test/logs ]] && rm -rf _build/test/logs
mysql -u root -proot -e "DROP DATABASE ejabberd_test;"
sudo -u postgres psql -c "DROP DATABASE ejabberd_test;"
mysql -u root -proot -e "CREATE DATABASE ejabberd_test;"
mysql -u root -proot -e "GRANT ALL ON ejabberd_test.*
TO 'ejabberd_test'@'localhost';"
mysql -u root -proot ejabberd_test < sql/mysql.new.sql
sudo -u postgres psql -c "CREATE DATABASE ejabberd_test;"
sudo -u postgres psql ejabberd_test -f sql/pg.new.sql
sudo -u postgres psql -c "GRANT ALL PRIVILEGES
ON DATABASE ejabberd_test TO ejabberd_test;"
sudo -u postgres psql ejabberd_test -c "GRANT ALL PRIVILEGES ON ALL
TABLES IN SCHEMA public
TO ejabberd_test;"
sudo -u postgres psql ejabberd_test -c "GRANT ALL PRIVILEGES ON ALL
SEQUENCES IN SCHEMA public
TO ejabberd_test;"
sudo sed -i 's|new_schema, false|new_schema, true|g' test/suite.erl
- run: CT_BACKENDS=mysql,pgsql make test
- name: Check results
if: always()
run: |
[[ -d _build ]] && ln -s _build/test/logs/ logs \
|| ln dialyzer/error.log logs/dialyzer.log
ln `find logs/ -name suite.log` logs/suite.log
grep 'TEST COMPLETE' logs/suite.log
grep -q 'TEST COMPLETE,.* 0 failed' logs/suite.log
test $(find logs/ -empty -name error.log)
- name: View full suite.log
run: cat logs/suite.log
- name: View suite.log failures
if: failure()
run: cat logs/suite.log | awk
'BEGIN{RS="\n=case";FS="\n"} /=result\s*failed/ {print "=case" $0}'
- name: View full ejabberd.log
if: failure()
run: find logs/ -name ejabberd.log -exec cat '{}' ';'
- name: View error.log
if: failure()
run: find logs/ -name error.log -exec cat '{}' ';'
- name: View exunit.log
if: failure()
run: find logs/ -name exunit.log -exec cat '{}' ';'
binaries:
name: Binaries
needs: [tests]
strategy:
fail-fast: false
matrix:
otp: ['21.3']
include:
- otp: '21.3'
rebar: 3
os: ubuntu-20.04
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 150
- name: Get last git tag
run: |
export TAGLAST=`git ls-remote --tags --refs origin 'refs/tags/2*' \
| tail -1 | awk '{print $2}'`
git fetch origin "$TAGLAST:$TAGLAST"
git describe
- name: Get previous Erlang/OTP
uses: ErlGang/setup-erlang@master
with:
otp-version: ${{ matrix.otp }}
- name: Get a compatible Rebar3
run: |
wget https://github.com/erlang/rebar3/releases/download/3.15.2/rebar3 \
&& chmod +x rebar3
- name: Cache Rebar3
uses: actions/cache@v2
with:
path: ~/.cache/rebar3/
key: ${{matrix.otp}}-${{matrix.rebar}}-${{hashFiles('rebar.config')}}
- name: Prepare libraries
run: |
sudo apt-get -qq update
sudo apt-get -qq install libexpat1-dev libgd-dev libpam0g-dev \
libsqlite3-dev libwebp-dev libyaml-dev
- name: Compile
run: |
./autogen.sh
./configure --with-rebar=./rebar3 \
--prefix=/tmp/ejabberd \
--disable-debug \
--enable-all \
--disable-elixir
make update
make
- run: make install -s
- name: Strip binaries
run: echo 'beam_lib:strip_files(filelib:wildcard(
"/tmp/ejabberd/lib/*/ebin/*beam")), init:stop().' \
| erl -boot start_clean
- name: Upload binaries
uses: actions/upload-artifact@v2
with:
name: ejabberd-binaries
path: /tmp/ejabberd/lib
retention-days: 7
-83
View File
@@ -1,83 +0,0 @@
name: Tests
on:
push:
paths-ignore:
- 'examples/**'
- 'man/**'
- 'priv/**'
- 'sql/**'
- 'test/**'
pull_request:
paths-ignore:
- 'examples/**'
- 'man/**'
- 'priv/**'
- 'sql/**'
- 'test/**'
jobs:
dialyzer:
name: Dialyzer
runs-on: ubuntu-20.04
strategy:
fail-fast: true
max-parallel: 1
matrix:
erlang: ["19.3", "latest"]
container:
image: erlang:${{ matrix.erlang }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Rebar3 cache
uses: actions/cache@v2
env:
cache-name: cache-rebar3-deps
with:
path: ~/.cache/rebar3/
key: rebar3-${{ runner.os }}-erlang-${{ matrix.erlang }}
- name: System versions
run: |
uname -a
cat /etc/issue
erl -version
rebar3 version
- name: Libraries
run: |
apt-get -qq update
apt-get -qq install libgd-dev libpam-dev
- name: Compile
run: |
./autogen.sh
./configure --with-rebar=`which rebar3` \
--enable-latest-deps \
--enable-all --disable-elixir
make
- name: Hooks
run: make hooks
- name: Options
run: make options
- name: Xref
run: |
echo "{xref_ignores, [{eldap_filter_yecc, return_error, 2}]}." >>rebar.config
echo "{xref_checks, [deprecated_function_calls, deprecated_functions,
locals_not_used, undefined_function_calls, undefined_functions]}.
% Disabled: exports_not_used," >>rebar.config
make xref
- name: Dialyzer
run: |
echo "{dialyzer, [{get_warnings, true}, {plt_extra_apps, [cache_tab,
eimp, epam, esip, ezlib, fast_tls, fast_xml, fast_yaml,
mqtree, p1_acme, p1_mysql, p1_oauth2, p1_pgsql, p1_utils, pkix,
sqlite3, stringprep, stun, xmpp, yconf]} ]}." >>rebar.config
make dialyzer
+5
View File
@@ -9,6 +9,7 @@
/Makefile
/config.log
/config.status
/config/releases.exs
/configure
/aclocal.m4
/*.cache
@@ -17,14 +18,17 @@
/ebin/
/ejabberd.init
/ejabberd.service
/ejabberdctl
/ejabberdctl.example
/rel/ejabberd/
/rel/overlays/
/src/eldap_filter_yecc.erl
/vars.config
/dialyzer/
/test/*.beam
/test/*.ctc
/logs/
/priv/bin/captcha*sh
/priv/sql
/rel/ejabberd
/_build
@@ -32,3 +36,4 @@
/.rebar
/rebar.lock
/log/
Mnesia.nonode@nohost/
-68
View File
@@ -1,68 +0,0 @@
language: erlang
otp_release:
- 19.3
- 23.1.2
os: linux
dist: xenial
services:
- redis
- mysql
- postgresql
before_install:
- sudo apt-get -qq update
- pip install --user coveralls-merge
install:
- sudo apt-get -qq install libexpat1-dev libyaml-dev libpam0g-dev libsqlite3-dev libgd-dev libwebp-dev
before_script:
# Ulimit: See Travis-CI issue report: https://github.com/travis-ci/travis-ci/issues/3328
- mysql -u root -e "CREATE USER 'ejabberd_test'@'localhost' IDENTIFIED BY 'ejabberd_test';"
- mysql -u root -e "CREATE DATABASE ejabberd_test;"
- mysql -u root -e "GRANT ALL ON ejabberd_test.* TO 'ejabberd_test'@'localhost';"
- mysql -u root ejabberd_test < sql/mysql.sql
- psql -U postgres -c "CREATE USER ejabberd_test WITH PASSWORD 'ejabberd_test';"
- psql -U postgres -c "CREATE DATABASE ejabberd_test;"
- psql -U postgres ejabberd_test -f sql/pg.sql
- psql -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE ejabberd_test TO ejabberd_test;"
- psql -U postgres ejabberd_test -c "GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO ejabberd_test;"
- psql -U postgres ejabberd_test -c "GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO ejabberd_test;"
cache:
directories:
- deps/
script:
- ./autogen.sh
- ./configure --prefix=/tmp/ejabberd --enable-all --disable-odbc --disable-elixir
- make update
- make
- make install -s
- make xref
- ./tools/hook_deps.sh ebin
- sed -i -e 's/ct:pal/ct:log/' test/suite.erl
- ln -sf ../sql priv/
- echo "" >> rebar.config
- echo '{ct_extra_params, "-verbosity 20"}.' >> rebar.config
- escript ./rebar skip_deps=true ct -v
- grep -q 'TEST COMPLETE,.* 0 failed' logs/raw.log
- test $(find logs -empty -name error.log)
after_script:
- find logs -name suite.log -exec cat '{}' ';'
after_failure:
- find logs -name exunit.log -exec cat '{}' ';'
- find logs -name ejabberd.log -exec cat '{}' ';'
- find logs -name suite.log -exec cat '{}' ';' | awk 'BEGIN{RS="\n=case";FS="\n"} /=result\s*failed/ {print "=case" $0}'
after_success:
- coveralls-merge erlang.json
notifications:
email: false
+168 -2
View File
@@ -1,8 +1,174 @@
# Version 21.12
Commands
- `create_room_with_opts`: Fixed when using SQL storage
- `change_room_option`: Add missing fields from config inside `mod_muc_admin:change_options`
- piefxis: Fixed arguments of all commands
Modules
- mod_caps: Don't forget caps on XEP-0198 resumption
- mod_conversejs: New module to serve a simple page for Converse.js
- mod_http_upload_quota: Avoid `max_days` race
- mod_muc: Support MUC hats (XEP-0317, conversejs/prosody compatible)
- mod_muc: Optimize MucSub processing
- mod_muc: Fix exception in mucsub {un}subscription events multicast handler
- mod_multicast: Improve and optimize multicast routing code
- mod_offline: Allow storing non-composing x:events in offline
- mod_ping: Send ping from server, not bare user JID
- mod_push: Fix handling of MUC/Sub messages
- mod_register: New allow_modules option to restrict registration modules
- mod_register_web: Handle unknown host gracefully
- mod_register_web: Use mod_register configured restrictions
PubSub
- Add `delete_expired_pubsub_items` command
- Add `delete_old_pubsub_items` command
- Optimize publishing on large nodes (SQL)
- Support unlimited number of items
- Support `max_items=max` node configuration
- Bump default value for `max_items` limit from 10 to 1000
- Use configured `max_items` by default
- node_flat: Avoid catch-all clauses for RSM
- node_flat_sql: Avoid catch-all clauses for RSM
SQL
- Use `INSERT ... ON CONFLICT` in SQL_UPSERT for PostgreSQL >= 9.5
- mod_mam export: assign MUC entries to the MUC service
- MySQL: Fix typo when creating index
- PgSQL: Add SASL auth support, PostgreSQL 14
- PgSQL: Add missing SQL migration for table `push_session`
- PgSQL: Fix `vcard_search` definition in pgsql new schema
Other
- `captcha-ng.sh`: "sort -R" command not POSIX, added "shuf" and "cat" as fallback
- Make s2s connection table cleanup more robust
- Update export/import of scram password to XEP-0227 1.1
- Update Jose to 1.11.1 (the last in hex.pm correctly versioned)
# Version 21.07
Compilation
- Add rebar3 3.15.2 binary
- Add support for mix to: `./configure --enable-rebar=mix`
- Improved `make rel` to work with rebar3 and mix
- Add `make dev` to build a development release with rebar3 or mix
- Hex: Add `sql/` and `vars.config` to Hex package files
- Hex: Update mix applications list to fix error `p1_utils is listed as both...`
- There are so many targets in Makefile... add `make help`
- Fix extauth.py failure in test suite with Python 3
- Added experimental support for GitHub Codespaces
- Switch test service from TravisCI to GitHub Actions
Commands:
- Display extended error message in ejabberdctl
- Remove SMP option from ejabberdctl.cfg, `-smp` was removed in OTP 21
- `create_room`: After creating room, store in DB if it's persistent
- `help`: Major changes in its usage and output
- `srg_create`: Update to use `label` parameter instead of `name`
Modules:
- ejabberd_listener: New `send_timeout` option
- mod_mix: Improvements to update to 0.14.1
- mod_muc_room: Don't leak owner JIDs
- mod_multicast: Routing for more MUC packets
- mod_multicast: Correctly strip only other bcc addresses
- mod_mqtt: Allow shared roster group placeholder in mqtt topic
- mod_pubsub: Several fixes when using PubSub with RSM
- mod_push: Handle MUC/Sub events correctly
- mod_shared_roster: Delete cache after performing change to be sure that in cache will be up to date data
- mod_shared_roster: Improve database and caching
- mod_shared_roster: Reconfigure cache when options change
- mod_vcard: Fix invalid_encoding error when using extended plane characters in vcard
- mod_vcard: Update econf:vcard() to generate correct vcard_temp record
- WebAdmin: New simple pages to view mnesia tables information and content
- WebSocket: Fix typos
SQL:
- MySQL Backend Patch for scram-sha512
- SQLite: When exporting for SQLite, use its specific escape options
- SQLite: Minor fixes for new_sql_schema support
- mod_privacy: Cast as boolean when exporting privacy_list_data to PostgreSQL
- mod_mqtt: Add mqtt_pub table definition for MSSQL
- mod_shared_roster: Add missing indexes to `sr_group` tables in all SQL databases
# Version 21.04
API Commands:
- `add_rosteritem/...`: Add argument guards to roster commands
- `get_user_subscriptions`: New command for MUC/Sub
- `remove_mam_for_user_with_peer`: Fix when removing room archive
- `send_message`: Fix bug introduced in ejabberd 21.01
- `set_vcard`: Return modules errors
Build and setup:
- Allow ejabberd to be compatible as a dependency for an Erlang project using rebar3
- CAPTCHA: New question/answer-based CAPTCHA script
- `--enable-lua`: new configure option for luerl instead of --enable-tools
- Remove support for HiPE, it was experimental and Erlang/OTP 24 removes it
- Update `sql_query` record to handle the Erlang/OTP 24 compiler reports
- Updated dependencies to fix Dialyzer warnings
Miscellaneous:
- CAPTCHA: Update `FORM_TYPE` from captcha to register
- LDAP: fix eldap certificate verification
- MySQL: Fix for "specified key was too long"
- Translations: updated the Esperanto, Greek, and Japanese translations
- Websocket: Fix PONG responses
Modules:
- `mod_block_strangers`: If stanza is type error, allow it passing
- `mod_caps`: Don't request roster when not needed
- `mod_caps`: Skip reading roster in one more case
- `mod_mam`: Remove `queryid` from MAM fin element
- `mod_mqtt`: When deregistering XMPP account, close its MQTT sessions
- `mod_muc`: Take in account subscriber's affiliation when checking access to moderated room
- `mod_muc`: Use monitors to track online and hard-killed rooms
- `mod_muc`: When occupant is banned, remove his subscriptions too
- `mod_privacy`: Make fetching roster lazy
- `mod_pubsub`: Don't fail on PEP unsubscribe
- `mod_pubsub`: Fix `gen_pubsub_node:get_state` return value
- `mod_vcard`: Obtain and provide photo type in vCard LDAP
# Version 21.01
Miscellaneous changes:
- `log_rotate_size` option: Fix handling of infinity value
- `mod_time`: Fix invalid timezone
- Auth JWT: New `check_decoded_jwt` hook runs the default JWT verifier
- MUC: Allow non-occupant non-subscribed service admin send private MUC message
- MUC: New `max_password` and `max_captcha_whitelist` options
- OAuth: New `oauth_cache_rest_failure_life_time` option
- PEP: Skip reading pep nodes that we know wont be requested due to caps
- SQL: Add sql script to migrate mysql from old schema to new
- SQL: Dont use REPLACE for upsert when there are “-” fields.
- Shared Rosters LDAP: Add multi-domain support (and flexibility)
- Sqlite3: Fix dependency version
- Stun: Block loopback addresses by default
- Several documentation fixes and clarifications
Commands:
- `decide_room`: Use better fallback value for room activity time when skipping room
- `delete_old_message`: Fix when using sqlite spool table
- `module_install`: Make ext_mod compile module with debug_info flags
- `room_unused_*`: Dont fetch subscribers list
- `send_message`: Dont include empty in messages
- `set_room_affiliation`: Validate affiliations
Running:
- Docker: New `Dockerfile` and `devcontainer.json`
- New `ejabberdctl foreground-quiet`
- Systemd: Allow for listening on privileged ports
- Systemd: Integrate nicely with systemd
Translations:
- Moved gettext PO files to a new `ejabberd-po` repository
- Improved several translations: Catalan, Chinese, German, Greek, Indonesian, Norwegian, Portuguese (Brazil), Spanish.
# Version 20.12
- Add support for `SCRAM-SHA-{256,512}-{PLUS}` authentication
- Don't use same value in cache for user don't exist and wrong password
- outgoing_s2s_ipv*_address: New options to set ipv4/ipv6 outbound s2s out interface
- `outgoing_s2s_ipv*_address`: New options to set ipv4/ipv6 outbound s2s out interface
- s2s_send_packet: this hook now filters outgoing s2s stanzas
- start_room: new hook runs when a room process is started
- check_decoded_jwt: new hook to check decoded JWT after success authentication
@@ -10,7 +176,7 @@
* Admin
- Docker: Fix DB initialization
- New sql_odbc_driver option: choose the mssql ODBC driver
- Rebar3: Fully supported. Enable with ./configure --with-rebar=/path/to/rebar3
- Rebar3: Fully supported. Enable with `./configure --with-rebar=/path/to/rebar3`
- systemd: start ejabberd in foreground
* Modules:
+2 -2
View File
@@ -96,10 +96,10 @@ Before you submit your pull request consider the following guidelines:
git push origin my-fix-branch
```
* In GitHub, send a pull request to `ejabberd:master`. This will trigger the Travis integration and run the test.
* In GitHub, send a pull request to `ejabberd:master`. This will trigger the automated testing.
We will also notify you if you have not yet signed the [contribution agreement][cla].
* If you find that the Travis integration has failed, look into the logs on Travis to find out
* If you find that the tests have failed, look into the logs to find out
if your changes caused test failures, the commit message was malformed etc. If you find that the
tests failed or times out for unrelated reasons, you can ping a team member so that the build can be
restarted.
+80 -22
View File
@@ -1,4 +1,5 @@
REBAR = @ESCRIPT@ @rebar@
MIX = @rebar@
INSTALL = @INSTALL@
SED = @SED@
ERL = @ERL@
@@ -67,12 +68,6 @@ LUADIR = $(PRIVDIR)/lua
# /var/lib/ejabberd/
SPOOLDIR = $(DESTDIR)@localstatedir@/lib/ejabberd
# /var/lock/ejabberdctl
CTLLOCKDIR = $(DESTDIR)@localstatedir@/lock/ejabberdctl
# /var/lib/ejabberd/.erlang.cookie
COOKIEFILE = $(SPOOLDIR)/.erlang.cookie
# /var/log/ejabberd/
LOGDIR = $(DESTDIR)@localstatedir@/log/ejabberd
@@ -97,16 +92,38 @@ ifneq ($(INSTALLGROUP),)
G_USER=-g $(INSTALLGROUP)
endif
IS_REBAR3:=$(shell expr `$(REBAR) --version | awk -F '[ .]' '/rebar / {print $$2}'` '>=' 3)
ifeq "$(MIX)" "mix"
REBAR_VER:=6
else
REBAR_VER:=$(shell $(REBAR) --version | awk -F '[ .]' '/rebar / {print $$2}')
endif
ifeq "$(IS_REBAR3)" "1"
ifeq "$(REBAR_VER)" "6"
REBAR=$(MIX)
SKIPDEPS=
LISTDEPS=deps.tree
UPDATEDEPS=deps.update
DEPSPATTERN="s/.*─ \([a-z0-9_]*\) .*/\1/p;"
DEPSBASE=_build
DEPSDIR=$(DEPSBASE)/dev/lib
GET_DEPS= deps.get
CONFIGURE_DEPS=
EBINDIR=$(DEPSDIR)/ejabberd/ebin
REBARREL=MIX_ENV=prod $(REBAR) release --overwrite
REBARDEV=MIX_ENV=dev $(REBAR) release --overwrite
else
ifeq "$(REBAR_VER)" "3"
SKIPDEPS=
LISTDEPS=tree
UPDATEDEPS=upgrade
DEPSPATTERN="s/ (.*//; /^ / s/.* \([a-z0-9_]*\).*/\1/p;"
DEPSBASE=_build
DEPSDIR=$(DEPSBASE)/default/lib
GET_DEPS= get-deps
CONFIGURE_DEPS=$(REBAR) configure-deps
EBINDIR=$(DEPSDIR)/ejabberd/ebin
REBARREL=$(REBAR) as prod tar
REBARDEV=REBAR_PROFILE=dev $(REBAR) release
else
SKIPDEPS=skip_deps=true
LISTDEPS=-q list-deps
@@ -114,7 +131,12 @@ else
DEPSPATTERN="/ TAG / s/ .*// p; / REV / s/ .*// p; / BRANCH / s/ .*// p;"
DEPSBASE=deps
DEPSDIR=$(DEPSBASE)
GET_DEPS= get-deps
CONFIGURE_DEPS=$(REBAR) configure-deps
EBINDIR=ebin
REBARREL=$(REBAR) generate
REBARDEV=
endif
endif
all: deps src
@@ -125,10 +147,10 @@ $(DEPSDIR)/.got:
rm -rf $(DEPSDIR)/.got
rm -rf $(DEPSDIR)/.built
mkdir -p $(DEPSDIR)
$(REBAR) get-deps && :> $(DEPSDIR)/.got
$(REBAR) $(GET_DEPS) && :> $(DEPSDIR)/.got
$(DEPSDIR)/.built: $(DEPSDIR)/.got
$(REBAR) configure-deps
$(CONFIGURE_DEPS)
$(REBAR) compile && :> $(DEPSDIR)/.built
src: $(DEPSDIR)/.built
@@ -212,13 +234,24 @@ $(sort $(call TO_DEST,$(MAIN_DIRS) $(DEPS_DIRS))):
$(call TO_DEST,priv/sql/lite.sql): sql/lite.sql $(call TO_DEST,priv/sql)
$(INSTALL) -m 644 $< $@
$(call TO_DEST,priv/sql/lite.new.sql): sql/lite.new.sql $(call TO_DEST,priv/sql)
$(INSTALL) -m 644 $< $@
$(call TO_DEST,priv/bin/captcha.sh): tools/captcha.sh $(call TO_DEST,priv/bin)
$(INSTALL) -m 755 $(O_USER) $< $@
$(call TO_DEST,priv/lua/redis_sm.lua): priv/lua/redis_sm.lua $(call TO_DEST,priv/lua)
$(INSTALL) -m 644 $< $@
copy-files-sub2: $(call TO_DEST,$(DEPS_FILES) $(MAIN_FILES) priv/bin/captcha.sh priv/sql/lite.sql priv/lua/redis_sm.lua)
ifeq (@sqlite@,true)
SQLITE_FILES = priv/sql/lite.sql priv/sql/lite.new.sql
endif
ifeq (@redis@,true)
REDIS_FILES = priv/lua/redis_sm.lua
endif
copy-files-sub2: $(call TO_DEST,$(DEPS_FILES) $(MAIN_FILES) priv/bin/captcha.sh $(SQLITE_FILES) $(REDIS_FILES))
.PHONY: $(call TO_DEST,$(DEPS_FILES) $(MAIN_DIRS) $(DEPS_DIRS))
@@ -267,7 +300,8 @@ install: copy-files
chmod 755 ejabberd.init
#
# Service script
$(SED) -e "s*@ctlscriptpath@*$(SBINDIR)*g" ejabberd.service.template \
$(SED) -e "s*@ctlscriptpath@*$(SBINDIR)*g" \
-e "s*@installuser@*$(INIT_USER)*g" ejabberd.service.template \
> ejabberd.service
chmod 644 ejabberd.service
#
@@ -275,12 +309,6 @@ install: copy-files
$(INSTALL) -d -m 750 $(O_USER) $(SPOOLDIR)
$(CHOWN_COMMAND) -R @INSTALLUSER@ $(SPOOLDIR) >$(CHOWN_OUTPUT)
chmod -R 750 $(SPOOLDIR)
[ ! -f $(COOKIEFILE) ] || { $(CHOWN_COMMAND) @INSTALLUSER@ $(COOKIEFILE) >$(CHOWN_OUTPUT) ; chmod 400 $(COOKIEFILE) ; }
#
# ejabberdctl lock directory
$(INSTALL) -d -m 750 $(O_USER) $(CTLLOCKDIR)
$(CHOWN_COMMAND) -R @INSTALLUSER@ $(CTLLOCKDIR) >$(CHOWN_OUTPUT)
chmod -R 750 $(CTLLOCKDIR)
#
# Log directory
$(INSTALL) -d -m 750 $(O_USER) $(LOGDIR)
@@ -330,7 +358,6 @@ uninstall-all: uninstall-binary
rm -rf $(ETCDIR)
rm -rf $(EJABBERDDIR)
rm -rf $(SPOOLDIR)
rm -rf $(CTLLOCKDIR)
rm -rf $(LOGDIR)
clean:
@@ -354,15 +381,20 @@ distclean: clean clean-rel
rm -f ejabberdctl.example ejabberd.init ejabberd.service
[ ! -f ../ChangeLog ] || rm -f ../ChangeLog
rel: all
$(REBAR) generate
rel:
$(REBARREL)
DEV_CONFIG = _build/dev/rel/ejabberd/etc/ejabberd/ejabberd.yml
dev $(DEV_CONFIG):
$(REBARDEV)
TAGS:
etags *.erl
Makefile: Makefile.in
ifeq "$(IS_REBAR3)" "1"
ifeq "$(REBAR_VER)" "3"
dialyzer:
$(REBAR) dialyzer
else
@@ -416,3 +448,29 @@ test:
.PHONY: src edoc dialyzer Makefile TAGS clean clean-rel distclean rel \
install uninstall uninstall-binary uninstall-all translations deps test \
quicktest erlang_plt deps_plt ejabberd_plt xref hooks options
help:
@echo ""
@echo " [all] Compile dependencies and ejabberd"
@echo " src Compile ejabberd"
@echo " deps Get dependencies"
@echo " update Update dependencies' source code"
@echo " clean Clean binary files"
@echo " distclean Clean completely the development files"
@echo ""
@echo " install Install ejabberd to /usr/local"
@echo " uninstall Uninstall ejabberd (buggy)"
@echo " uninstall-all Uninstall also configuration, logs, mnesia... (buggy)"
@echo ""
@echo " rel Build a production release"
@echo " dev Build a development release"
@echo ""
@echo " edoc Generate edoc documentation (unused)"
@echo " options Generate ejabberd_option.erl"
@echo " translations Extract translation files (requires --enable-tools)"
@echo " tags Generate tags file for text editors"
@echo ""
@echo " dialyzer Run Dialyzer static analyzer"
@echo " hooks Run hooks validator"
@echo " test Run Common Tests suite"
@echo " xref Run cross reference analysis"
+21 -5
View File
@@ -1,8 +1,7 @@
ejabberd Community Edition
==========================
[![Build Status](https://travis-ci.org/processone/ejabberd.svg?branch=master "Common Tests in Travis")](https://travis-ci.org/processone/ejabberd)
[![Dialyzer](https://github.com/processone/ejabberd/actions/workflows/tests.yml/badge.svg "Dialyzer tests in Github Actions")](https://github.com/processone/ejabberd/actions/workflows/tests.yml)
[![CI](https://github.com/processone/ejabberd/actions/workflows/ci.yml/badge.svg)](https://github.com/processone/ejabberd/actions/workflows/ci.yml)
[![Coverage Status](https://coveralls.io/repos/github/processone/ejabberd/badge.svg?branch=master "Coverage in coveralls.io")](https://coveralls.io/github/processone/ejabberd?branch=master)
[![Translation status](https://hosted.weblate.org/widgets/ejabberd/-/ejabberd-po/svg-badge.svg "Translation status in Weblate")](https://hosted.weblate.org/projects/ejabberd/ejabberd-po/)
[![Hex version](https://img.shields.io/hexpm/v/ejabberd.svg "Hex version")](https://hex.pm/packages/ejabberd)
@@ -119,6 +118,7 @@ To compile ejabberd you need:
- PAM library. Optional. For Pluggable Authentication Modules (PAM).
- ImageMagick's Convert program and Ghostscript fonts. Optional. For CAPTCHA
challenges.
- Elixir ≥ 1.10.3. Optional. Alternative to build ejabberd
If your system splits packages in libraries and development headers, you must
install the development packages also.
@@ -156,9 +156,25 @@ start and stop ejabberd. For example:
ejabberdctl start
For detailed information please refer to the ejabberd Installation and
Operation Guide available online and in the `doc` directory of the source
tarball.
For detailed information please refer to the
[ejabberd Documentation](https://docs.ejabberd.im)
### 3. Use ejabberd locally
Alternatively, you can setup ejabberd without installing in your system:
./configure --with-rebar=rebar3
make dev
Or, if you have Elixir available and plan to develop Elixir code:
./configure --with-rebar=mix
make dev
Check the full list of targets:
make help
Development
-10
View File
@@ -1,10 +0,0 @@
use Mix.Config
# This is standard path in the context of ejabberd release
config :ejabberd,
file: "config/ejabberd.yml",
log_path: 'log/ejabberd.log'
# Customize Mnesia directory:
config :mnesia,
dir: 'database/'
+12
View File
@@ -0,0 +1,12 @@
import Config
rootpath = System.get_env("RELEASE_ROOT", "")
# This is standard path in the context of ejabberd release
config :ejabberd,
file: Path.join(rootpath, "etc/ejabberd/ejabberd.yml"),
log_path: Path.join(rootpath, 'var/log/ejabberd/ejabberd.log')
# Customize Mnesia directory:
config :mnesia,
dir: Path.join(rootpath, 'var/lib/ejabberd/')
+1 -1
View File
@@ -30,7 +30,7 @@ fi
AC_ARG_WITH(rebar,
AC_HELP_STRING([--with-rebar=bin],
[use rebar specified]),
[use the rebar/rebar3/mix binary specified]),
[if test "$withval" = "yes" -o "$withval" = "no" -o "X$with_rebar" = "X"; then
rebar="rebar"
else
+2 -2
View File
@@ -4,8 +4,8 @@ After=network.target
[Service]
Type=notify
User=ejabberd
Group=ejabberd
User=@installuser@
Group=@installuser@
LimitNOFILE=65536
Restart=on-failure
RestartSec=5
-14
View File
@@ -12,20 +12,6 @@
#
#POLL=true
#.
#' SMP: SMP support ([enable|auto|disable])
#
# Explanation in Erlang/OTP documentation:
# enable: starts the Erlang runtime system with SMP support enabled.
# This may fail if no runtime system with SMP support is available.
# auto: starts the Erlang runtime system with SMP support enabled if it
# is available and more than one logical processor are detected.
# disable: starts a runtime system without SMP support.
#
# Default: auto
#
#SMP=auto
#.
#' ERL_MAX_PORTS: Maximum number of simultaneously open Erlang ports
#
+3 -3
View File
@@ -2,7 +2,6 @@
# define default configuration
POLL=true
SMP=auto
ERL_MAX_PORTS=32000
ERL_PROCESSES=250000
ERL_MAX_ETS_TABLES=1400
@@ -11,7 +10,8 @@ INET_DIST_INTERFACE=""
ERLANG_NODE=ejabberd@localhost
# define default environment variables
SCRIPT_DIR=$(cd "${0%/*}" && pwd)
[ -z "$SCRIPT" ] && SCRIPT=$0
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT")" && pwd -P)"
ERL="{{erl}}"
IEX="{{bindir}}/iex"
EPMD="{{epmd}}"
@@ -69,7 +69,7 @@ done
: "${EJABBERD_LOG_PATH:="$LOGS_DIR/ejabberd.log"}"
# define erl parameters
ERLANG_OPTS="+K $POLL -smp $SMP +P $ERL_PROCESSES $ERL_OPTIONS"
ERLANG_OPTS="+K $POLL +P $ERL_PROCESSES $ERL_OPTIONS"
if [ -n "$FIREWALL_WINDOW" ] ; then
ERLANG_OPTS="$ERLANG_OPTS -kernel inet_dist_listen_min ${FIREWALL_WINDOW%-*} inet_dist_listen_max ${FIREWALL_WINDOW#*-}"
fi
+2
View File
@@ -51,6 +51,7 @@
desc = "" :: string() | '_' | '$3',
longdesc = "" :: string() | '_',
version = 0 :: integer(),
note = "" :: string(),
weight = 1 :: integer(),
module :: atom() | '_',
function :: atom() | '_',
@@ -58,6 +59,7 @@
policy = restricted :: open | restricted | admin | user,
%% access is: [accessRuleName] or [{Module, AccessOption, DefaultAccessRuleName}]
access = [] :: [{atom(),atom(),atom()}|atom()],
definer = unknown :: atom(),
result = {res, rescode} :: rterm() | '_' | '$2',
args_rename = [] :: [{atom(),atom()}],
args_desc = none :: none | [string()] | '_',
+13 -4
View File
@@ -65,6 +65,7 @@
captcha_whitelist = (?SETS):empty() :: gb_sets:set(),
mam = false :: boolean(),
pubsub = <<"">> :: binary(),
enable_hats = false :: boolean(),
lang = ejabberd_option:language() :: binary()
}).
@@ -87,6 +88,16 @@
nick = <<>> :: binary(),
nodes = [] :: [binary()]}).
-record(muc_subscribers,
{subscribers = #{} :: subscribers(),
subscriber_nicks = #{} :: subscriber_nicks(),
subscriber_nodes = #{} :: subscriber_nodes()
}).
-type subscribers() :: #{ljid() => #subscriber{}}.
-type subscriber_nicks() :: #{binary() => [ljid()]}.
-type subscriber_nodes() :: #{binary() => subscribers()}.
-record(activity,
{
message_time = 0 :: integer(),
@@ -106,8 +117,7 @@
jid = #jid{} :: jid(),
config = #config{} :: config(),
users = #{} :: users(),
subscribers = #{} :: subscribers(),
subscriber_nicks = #{} :: subscriber_nicks(),
muc_subscribers = #muc_subscribers{} :: #muc_subscribers{},
last_voice_request_time = treap:empty() :: treap:treap(),
robots = #{} :: robots(),
nicks = #{} :: nicks(),
@@ -115,6 +125,7 @@
history = #lqueue{} :: lqueue(),
subject = [] :: [text()],
subject_author = <<"">> :: binary(),
hats_users = #{} :: map(), % FIXME on OTP 21+: #{ljid() => #{binary() => binary()}},
just_created = erlang:system_time(microsecond) :: true | integer(),
activity = treap:empty() :: treap:treap(),
room_shaper = none :: ejabberd_shaper:shaper(),
@@ -126,5 +137,3 @@
-type robots() :: #{jid() => {binary(), stanza()}}.
-type nicks() :: #{binary() => [ljid()]}.
-type affiliations() :: #{ljid() => affiliation() | {affiliation(), binary()}}.
-type subscribers() :: #{ljid() => #subscriber{}}.
-type subscriber_nicks() :: #{binary() => [ljid()]}.
+1 -1
View File
@@ -23,7 +23,7 @@
-define(ERR_EXTENDED(E, C), mod_pubsub:extended_error(E, C)).
%% The actual limit can be configured with mod_pubsub's option max_items_node
-define(MAXITEMS, 10).
-define(MAXITEMS, 1000).
%% this is currently a hard limit.
%% Would be nice to have it configurable.
+291 -81
View File
@@ -2,12 +2,12 @@
.\" Title: ejabberd.yml
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 03/26/2021
.\" Date: 12/08/2021
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "EJABBERD\&.YML" "5" "03/26/2021" "\ \&" "\ \&"
.TH "EJABBERD\&.YML" "5" "12/08/2021" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -82,7 +82,7 @@ All options can be changed in runtime by running \fIejabberdctl reload\-config\f
.sp
Some options can be specified for particular virtual host(s) only using \fIhost_config\fR or \fIappend_host_config\fR options\&. Such options are called \fIlocal\fR\&. Examples are \fImodules\fR, \fIauth_method\fR and \fIdefault_db\fR\&. The options that cannot be defined per virtual host are called \fIglobal\fR\&. Examples are \fIloglevel\fR, \fIcertfiles\fR and \fIlisten\fR\&. It is a configuration mistake to put \fIglobal\fR options under \fIhost_config\fR or \fIappend_host_config\fR section \- ejabberd will refuse to load such configuration\&.
.sp
It is not recommended to write ejabberd\&.yml from scratch\&. Instead it is better to start from "default" configuration file available at https://github\&.com/processone/ejabberd/blob/21\&.01/ejabberd\&.yml\&.example\&. Once you get ejabberd running you can start changing configuration options to meet your requirements\&.
It is not recommended to write ejabberd\&.yml from scratch\&. Instead it is better to start from "default" configuration file available at https://github\&.com/processone/ejabberd/blob/21\&.12/ejabberd\&.yml\&.example\&. Once you get ejabberd running you can start changing configuration options to meet your requirements\&.
.sp
Note that this document is intended to provide comprehensive description of all configuration options that can be consulted to understand the meaning of a particular option, its format and possible values\&. It will be quite hard to understand how to configure ejabberd by reading this document only \- for this purpose the reader is recommended to read online Configuration Guide available at https://docs\&.ejabberd\&.im/admin/configuration\&.
.SH "TOP LEVEL OPTIONS"
@@ -316,14 +316,46 @@ means that the same username can be taken multiple times in anonymous login mode
.PP
\fBanonymous_protocol\fR: \fIlogin_anon | sasl_anon | both\fR
.RS 4
Define what anonymous protocol will be used:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fIlogin_anon\fR
means that the anonymous login method will be used\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fIsasl_anon\fR
means that the SASL Anonymous method will be used\&.
\fIboth\fR
means that SASL Anonymous and login anonymous are both enabled\&. The default value is
\fIsasl_anon\fR\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fIboth\fR
means that SASL Anonymous and login anonymous are both enabled\&.
.RE
.RE
.sp
The default value is \fIsasl_anon\fR\&.
.PP
\fBapi_permissions\fR: \fI[Permission, \&.\&.\&.]\fR
.RS 4
@@ -375,20 +407,44 @@ A list of authentication methods to use\&. If several methods are defined, authe
This is used by the contributed module
\fIejabberd_auth_http\fR
that can be installed from the
\fIejabberd\-contrib\fR
ejabberd\-contrib
Git repository\&. Please refer to that module\(cqs README file for details\&.
.RE
.sp
\fINote\fR about the next option: improved in 20\&.01:
.PP
\fBauth_password_format\fR: \fIplain | scram\fR
.RS 4
The option defines in what format the users passwords are stored\&.
The option defines in what format the users passwords are stored:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fIplain\fR: The password is stored as plain text in the database\&. This is risky because the passwords can be read if your database gets compromised\&. This is the default value\&. This format allows clients to authenticate using: the old Jabber Non\-SASL (XEP\-0078), SASL PLAIN, SASL DIGEST\-MD5, and SASL SCRAM\-SHA\-1\&.
\fIscram\fR: The password is not stored, only some information that allows to verify the hash provided by the client\&. It is impossible to obtain the original plain password from the stored information; for this reason, when this value is configured it cannot be changed to plain anymore\&. This format allows clients to authenticate using: SASL PLAIN and SASL SCRAM\-SHA\-1\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fIscram\fR: The password is not stored, only some information that allows to verify the hash provided by the client\&. It is impossible to obtain the original plain password from the stored information; for this reason, when this value is configured it cannot be changed to plain anymore\&. This format allows clients to authenticate using: SASL PLAIN and SASL SCRAM\-SHA\-1\&. The default value is
\fIplain\fR\&.
.RE
.RE
.PP
\fBauth_scram_hash\fR: \fIsha | sha256 | sha512\fR
.RS 4
Hash algorith that should be used to store password in SCRAM format\&. You shouldn\(cqt change this if you already have passwords generated with a different algorithm \- users that have such passwords will not be able to authenticate\&.
Hash algorith that should be used to store password in SCRAM format\&. You shouldn\(cqt change this if you already have passwords generated with a different algorithm \- users that have such passwords will not be able to authenticate\&. The default value is
\fIsha\fR\&.
.RE
.PP
\fBauth_use_cache\fR: \fItrue | false\fR
@@ -474,7 +530,7 @@ For server conections, this \fIca_file\fR option is overriden by the s2s_cafile
\fBcache_life_time\fR: \fItimeout()\fR
.RS 4
The time of a cached item to keep in cache\&. Once it\(cqs expired, the corresponding item is erased from cache\&. The default value is
\fIone hour\fR\&. Several modules have a similar option; and some core ejabberd parts support similar options too, see
\fI1 hour\fR\&. Several modules have a similar option; and some core ejabberd parts support similar options too, see
\fIauth_cache_life_time\fR,
\fIoauth_cache_life_time\fR,
\fIrouter_cache_life_time\fR, and
@@ -505,7 +561,9 @@ A maximum number of items (not memory!) in cache\&. The rule of thumb, for all t
.PP
\fBcaptcha_cmd\fR: \fIPath\fR
.RS 4
Full path to a script that generates CAPTCHA images\&. There is no default value: when this option is not set, CAPTCHA functionality is completely disabled\&.
Full path to a script that generates
CAPTCHA
images\&. There is no default value: when this option is not set, CAPTCHA functionality is completely disabled\&.
.RE
.PP
\fBcaptcha_host\fR: \fIString\fR
@@ -517,13 +575,17 @@ instead\&.
.PP
\fBcaptcha_limit\fR: \fIpos_integer() | infinity\fR
.RS 4
Maximum number of CAPTCHA generated images per minute for any given JID\&. The option is intended to protect the server from CAPTCHA DoS\&. The default value is
Maximum number of
CAPTCHA
generated images per minute for any given JID\&. The option is intended to protect the server from CAPTCHA DoS\&. The default value is
\fIinfinity\fR\&.
.RE
.PP
\fBcaptcha_url\fR: \fIURL\fR
.RS 4
An URL where CAPTCHA requests should be sent\&. NOTE: you need to configure
An URL where
CAPTCHA
requests should be sent\&. NOTE: you need to configure
\fIrequest_handlers\fR
for
\fIejabberd_http\fR
@@ -813,7 +875,8 @@ Path to the file that contains the JWK Key\&. The default value is
.RS 4
The option defines the default language of server strings that can be seen by XMPP clients\&. If an XMPP client does not possess
\fIxml:lang\fR
attribute, the specified language is used\&.
attribute, the specified language is used\&. The default value is
\fI"en"\fR\&.
.RE
.PP
\fBldap_backups\fR: \fI[Host, \&.\&.\&.]\fR
@@ -946,7 +1009,11 @@ section for details\&.
\fBlog_rotate_count\fR: \fINumber\fR
.RS 4
The number of rotated log files to keep\&. The default value is
\fI1\fR\&.
\fI1\fR, which means that only keeps
ejabberd\&.log\&.0,
error\&.log\&.0
and
crash\&.log\&.0\&.
.RE
.PP
\fBlog_rotate_size\fR: \fIpos_integer() | infinity\fR
@@ -987,8 +1054,7 @@ seconds\&.
.RS 4
This option can be used to tune tick time parameter of
\fInet_kernel\fR\&. It tells Erlang VM how often nodes should check if intra\-node communication was not interrupted\&. This option must have identical value on all nodes, or it will lead to subtle bugs\&. Usually leaving default value of this is option is best, tweak it only if you know what you are doing\&. The default value is
\fI1\fR
minute\&.
\fI1 minute\fR\&.
.RE
.PP
\fBnew_sql_schema\fR: \fItrue | false\fR
@@ -996,7 +1062,7 @@ minute\&.
Whether to use
\fInew\fR
SQL schema\&. All schemas are located at
https://github\&.com/processone/ejabberd/tree/21\&.01/sql\&. There are two schemas available\&. The default legacy schema allows to store one XMPP domain into one ejabberd database\&. The
https://github\&.com/processone/ejabberd/tree/21\&.12/sql\&. There are two schemas available\&. The default legacy schema allows to store one XMPP domain into one ejabberd database\&. The
\fInew\fR
schema allows to handle several XMPP domains in a single ejabberd database\&. Using this
\fInew\fR
@@ -1029,6 +1095,8 @@ Same as
\fIcache_missed\fR
will be used\&.
.RE
.sp
\fINote\fR about the next option: added in 21\&.01:
.PP
\fBoauth_cache_rest_failure_life_time\fR: \fItimeout()\fR
.RS 4
@@ -1110,12 +1178,16 @@ Specify which address families to try, in what order\&. The default is
\fI[ipv4, ipv6]\fR
which means it first tries connecting with IPv4, if that fails it tries using IPv6\&.
.RE
.sp
\fINote\fR about the next option: added in 20\&.12:
.PP
\fBoutgoing_s2s_ipv4_address\fR: \fIAddress\fR
.RS 4
Specify the IPv4 address that will be used when establishing an outgoing S2S IPv4 connection, for example "127\&.0\&.0\&.1"\&. The default value is
\fIundefined\fR\&.
.RE
.sp
\fINote\fR about the next option: added in 20\&.12:
.PP
\fBoutgoing_s2s_ipv6_address\fR: \fIAddress\fR
.RS 4
@@ -1384,8 +1456,7 @@ if the latter is not set\&.
\fBs2s_timeout\fR: \fItimeout()\fR
.RS 4
A time to wait before closing an idle s2s connection\&. The default value is
\fI10\fR
minutes\&.
\fI10 minutes\fR\&.
.RE
.PP
\fBs2s_tls_compression\fR: \fItrue | false\fR
@@ -1542,6 +1613,8 @@ An SQL database name\&. For SQLite this must be a full path to a database file\&
.RS 4
An interval to make a dummy SQL request to keep alive the connections to the database\&. There is no default value, so no keepalive requests are made\&.
.RE
.sp
\fINote\fR about the next option: added in 20\&.12:
.PP
\fBsql_odbc_driver\fR: \fIPath\fR
.RS 4
@@ -1574,6 +1647,8 @@ for PostgreSQL and
\fI1433\fR
for MS SQL\&. The option has no effect for SQLite\&.
.RE
.sp
\fINote\fR about the next option: added in 20\&.01:
.PP
\fBsql_prepared_statements\fR: \fItrue | false\fR
.RS 4
@@ -1605,10 +1680,12 @@ if the latter is not set\&.
A hostname or an IP address of the SQL server\&. The default value is
\fIlocalhost\fR\&.
.RE
.sp
\fINote\fR about the next option: improved in 20\&.03:
.PP
\fBsql_ssl\fR: \fItrue | false\fR
.RS 4
Whether to use SSL encrypted connections to the SQL server\&. The option is only available for PostgreSQL\&. The default value is
Whether to use SSL encrypted connections to the SQL server\&. The option is only available for MySQL and PostgreSQL\&. The default value is
\fIfalse\fR\&.
.RE
.PP
@@ -1781,24 +1858,7 @@ Details for some commands:
\fIsrg\-create\fR: If you want to put a group Name with blankspaces, use the characters "\*(Aq and \*(Aq" to define when the Name starts and ends\&. See an example below\&.
.RE
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBAvailable options:\fR
.RS 4
.PP
\fBmodule_resource\fR: \fIResource\fR
.RS 4
Indicate the resource that the XMPP stanzas must use in the FROM or TO JIDs\&. This is only useful in the
\fIget_vcard*\fR
and
\fIset_vcard*\fR
commands\&. The default value is
\fImod_admin_extra\fR\&.
.RE
.RE
The module has no options\&.
.sp
.it 1 an-trap
.nr an-no-space-flag 1
@@ -1821,8 +1881,7 @@ access_rules:
vcard_set:
\- allow: adminextraresource
modules:
mod_admin_extra:
module_resource: "modadminextraf8x,31ad"
mod_admin_extra: {}
mod_vcard:
access_set: vcard_set
.fi
@@ -1870,7 +1929,7 @@ ejabberdctl srg\-create g1 example\&.org "\*(AqGroup number 1\*(Aq" this_is_g1 g
.RE
.SS "mod_admin_update_sql"
.sp
This module can be used to update existing SQL database from the default to the new schema\&. Check the section Default and New Schemas for details\&. When the module is loaded use \fIupdate_sql\fR ejabberdctl command\&.
This module can be used to update existing SQL database from the default to the new schema\&. Check the section Default and New Schemas for details\&. Please note that only PostgreSQL is supported\&. When the module is loaded use \fIupdate_sql\fR API\&.
.sp
The module has no options\&.
.SS "mod_announce"
@@ -2307,6 +2366,78 @@ While a client is inactive, queue presence stanzas that indicate (un)availabilit
The module provides server configuration functionality via XEP\-0050: Ad\-Hoc Commands\&. This module requires \fImod_adhoc\fR to be loaded\&.
.sp
The module has no options\&.
.SS "mod_conversejs"
.sp
This module serves a simple page for the Converse XMPP web browser client\&.
.sp
To use this module, in addition to adding it to the \fImodules\fR section, you must also enable it in \fIlisten\fR → \fIejabberd_http\fR → request_handlers\&.
.sp
You must also setup either the option \fIwebsocket_url\fR or \fIbosh_service_url\fR\&.
.sp
By default, the options \fIconversejs_css\fR and \fIconversejs_script\fR point to the public Converse\&.js client\&. Alternatively, you can host the client locally using \fImod_http_fileserver\fR\&.
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBAvailable options:\fR
.RS 4
.PP
\fBbosh_service_url\fR: \fIBoshURL\fR
.RS 4
BOSH service URL to which Converse\&.js can connect to\&.
.RE
.PP
\fBconversejs_css\fR: \fIURL\fR
.RS 4
Converse\&.js CSS URL\&.
.RE
.PP
\fBconversejs_script\fR: \fIURL\fR
.RS 4
Converse\&.js main script URL\&.
.RE
.PP
\fBdefault_domain\fR: \fIDomain\fR
.RS 4
Specify a domain to act as the default for user JIDs\&. The default value is the first domain defined in the ejabberd configuration file\&.
.RE
.PP
\fBwebsocket_url\fR: \fIWebsocketURL\fR
.RS 4
A websocket URL to which Converse\&.js can connect to\&.
.RE
.RE
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBExample:\fR
.RS 4
.sp
.if n \{\
.RS 4
.\}
.nf
listen:
\-
port: 5280
module: ejabberd_http
request_handlers:
/websocket: ejabberd_http_ws
/conversejs: mod_conversejs
modules:
mod_conversejs:
websocket_url: "ws://example\&.org:5280/websocket"
.fi
.if n \{\
.RE
.\}
.RE
.SS "mod_delegation"
.sp
This module is an implementation of XEP\-0355: Namespace Delegation\&. Only admin mode has been implemented by now\&. Namespace delegation allows external services to handle IQ using specific namespace\&. This may be applied for external PEP service\&.
@@ -2465,11 +2596,11 @@ server_info:
\-
modules: all
name: abuse\-addresses
urls: [mailto:abuse@shakespeare\&.lit]
urls: ["mailto:abuse@shakespeare\&.lit"]
\-
modules: [mod_muc]
name: "Web chatroom logs"
urls: [http://www\&.example\&.org/muc\-logs]
urls: ["http://www\&.example\&.org/muc\-logs"]
\-
modules: [mod_disco]
name: feedback\-addresses
@@ -2549,13 +2680,40 @@ The number of C2S authentication failures to trigger the IP ban\&. The default v
.sp
This module provides a ReST API to call ejabberd commands using JSON data\&.
.sp
To use this module, in addition to adding it to the \fImodules\fR section, you must also add it to \fIrequest_handlers\fR of some listener\&.
To use this module, in addition to adding it to the \fImodules\fR section, you must also enable it in \fIlisten\fR → \fIejabberd_http\fR → request_handlers\&.
.sp
To use a specific API version N, when defining the URL path in the request_handlers, add a \fIvN\fR\&. For example: \fI/api/v2: mod_http_api\fR
.sp
To run a command, send a POST request to the corresponding URL: \fIhttp://localhost:5280/api/<command_name>\fR
.sp
The module has no options\&.
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBExample:\fR
.RS 4
.sp
.if n \{\
.RS 4
.\}
.nf
listen:
\-
port: 5280
module: ejabberd_http
request_handlers:
/api: mod_http_api
modules:
mod_http_api: {}
.fi
.if n \{\
.RE
.\}
.RE
.SS "mod_http_fileserver"
.sp
This simple module serves files from the local disk over HTTP\&.
@@ -2683,7 +2841,7 @@ modules:
.sp
This module allows for requesting permissions to upload a file via HTTP as described in XEP\-0363: HTTP File Upload\&. If the request is accepted, the client receives a URL for uploading the file and another URL from which that file can later be downloaded\&.
.sp
In order to use this module, it must be configured as a \fIrequest_handler\fR for \fIejabberd_http\fR listener\&.
In order to use this module, it must be enabled in \fIlisten\fR \fIejabberd_http\fR → request_handlers\&.
.sp
.it 1 an-trap
.nr an-no-space-flag 1
@@ -2732,7 +2890,9 @@ This option defines the permission bits of uploaded files\&. The bits are specif
.PP
\fBget_url\fR: \fIURL\fR
.RS 4
This option specifies the initial part of the GET URLs used for downloading the files\&. By default, it is set to the same value as
This option specifies the initial part of the GET URLs used for downloading the files\&. The default value is
\fIundefined\fR\&. When this option is
\fIundefined\fR, this option is set to the same value as
\fIput_url\fR\&. The keyword @HOST@ is replaced with the virtual host name\&. NOTE: if GET requests are handled by
\fImod_http_upload\fR, the
\fIget_url\fR
@@ -2781,7 +2941,7 @@ A name of the service in the Service Discovery\&. This will only be displayed by
.PP
\fBput_url\fR: \fIURL\fR
.RS 4
This option specifies the initial part of the PUT URLs used for file uploads\&. The keyword @HOST@ is replaced with the virtual host name\&. NOTE: different virtual hosts cannot use the same PUT URL\&. The default value is "https://@HOST@:5443"\&.
This option specifies the initial part of the PUT URLs used for file uploads\&. The keyword @HOST@ is replaced with the virtual host name\&. NOTE: different virtual hosts cannot use the same PUT URL\&. The default value is "https://@HOST@:5443/upload"\&.
.RE
.PP
\fBrm_on_unregister\fR: \fItrue | false\fR
@@ -3516,21 +3676,24 @@ This option specifies who is allowed to administrate the Multi\-User Chat servic
.PP
\fBaccess_create\fR: \fIAccessName\fR
.RS 4
To configure who is allowed to create new rooms at the Multi\-User Chat service, this option can be used\&. By default any account in the local ejabberd server is allowed to create rooms\&.
To configure who is allowed to create new rooms at the Multi\-User Chat service, this option can be used\&. The default value is
\fIall\fR, which means everyone is allowed to create rooms\&.
.RE
.PP
\fBaccess_mam\fR: \fIAccessName\fR
.RS 4
To configure who is allowed to modify the
\fImam\fR
room option\&. By default any account in the local ejabberd server is allowed to modify that option\&.
room option\&. The default value is
\fIall\fR, which means everyone is allowed to modify that option\&.
.RE
.PP
\fBaccess_persistent\fR: \fIAccessName\fR
.RS 4
To configure who is allowed to modify the
\fIpersistent\fR
room option\&. By default any account in the local ejabberd server is allowed to modify that option\&.
room option\&. The default value is
\fIall\fR, which means everyone is allowed to modify that option\&.
.RE
.PP
\fBaccess_register\fR: \fIAccessName\fR
@@ -3749,12 +3912,16 @@ option is not specified, the only Jabber ID will be the hostname of the virtual
\fI@HOST@\fR
is replaced with the real virtual host name\&.
.RE
.sp
\fINote\fR about the next option: added in 21\&.01:
.PP
\fBmax_captcha_whitelist\fR: \fINumber\fR
.RS 4
This option defines the maximum number of characters that Captcha Whitelist can have when configuring the room\&. The default value is
\fIinfinity\fR\&.
.RE
.sp
\fINote\fR about the next option: added in 21\&.01:
.PP
\fBmax_password\fR: \fINumber\fR
.RS 4
@@ -3807,7 +3974,8 @@ This option defines the number of service admins or room owners allowed to enter
.PP
\fBmax_users_presence\fR: \fINumber\fR
.RS 4
This option defines after how many users in the room, it is considered overcrowded\&. When a MUC room is considered overcrowed, presence broadcasts are limited to reduce load, traffic and excessive presence "storm" received by participants\&.
This option defines after how many users in the room, it is considered overcrowded\&. When a MUC room is considered overcrowed, presence broadcasts are limited to reduce load, traffic and excessive presence "storm" received by participants\&. The default value is
\fI1000\fR\&.
.RE
.PP
\fBmin_message_interval\fR: \fINumber\fR
@@ -3840,10 +4008,11 @@ Same as top\-level
option, but applied to this module only\&.
.RE
.PP
\fBram_db_type\fR: \fImnesia\fR
\fBram_db_type\fR: \fImnesia | sql\fR
.RS 4
Define the type of volatile (in\-memory) storage where the module will store room information\&. The only available value for this module is
\fImnesia\fR\&.
Define the type of volatile (in\-memory) storage where the module will store room information (\fImuc_online_room\fR
and
\fImuc_online_users\fR)\&.
.RE
.PP
\fBregexp_room_id\fR: \fIstring()\fR
@@ -4479,8 +4648,7 @@ This module implements support for XEP\-0199: XMPP Ping and periodic keepalives\
\fBping_ack_timeout\fR: \fItimeout()\fR
.RS 4
How long to wait before deeming that a client has not answered a given server ping request\&. The default value is
\fI32\fR
seconds\&.
\fIundefined\fR\&.
.RE
.PP
\fBping_interval\fR: \fItimeout()\fR
@@ -4512,7 +4680,7 @@ means destroying the underlying connection,
\fInone\fR
means to do nothing\&. NOTE: when
\fImod_stream_mgmt\fR
module is loaded and stream management is enabled by a client, killing the client connection doesn\(cqt mean killing the client session \- the session will be kept alive in order to give the client a chance to resume it\&. The default value is
is loaded and stream management is enabled by a client, killing the client connection doesn\(cqt mean killing the client session \- the session will be kept alive in order to give the client a chance to resume it\&. The default value is
\fInone\fR\&.
.RE
.RE
@@ -5117,10 +5285,16 @@ or
\fIfalse\fR\&. If not defined, pubsub does not cache last items\&. On systems with not so many nodes, caching last items speeds up pubsub and allows to raise user connection rate\&. The cost is memory usage, as every item is stored in memory\&.
.RE
.PP
\fBmax_items_node\fR: \fIMaxItems\fR
\fBmax_item_expire_node\fR: \fItimeout() | infinity\fR
.RS 4
Specify the maximum item epiry time\&. Default value is:
\fIinfinity\fR\&.
.RE
.PP
\fBmax_items_node\fR: \fInon_neg_integer() | infinity\fR
.RS 4
Define the maximum number of items that can be stored in a node\&. Default value is:
\fI10\fR\&.
\fI1000\fR\&.
.RE
.PP
\fBmax_nodes_discoitems\fR: \fIpos_integer() | infinity\fR
@@ -5418,11 +5592,11 @@ The module depends on \fImod_push\fR\&.
.PP
\fBresume_timeout\fR: \fItimeout()\fR
.RS 4
This option specifies the period of time until the session of a disconnected push client times out\&. This timeout is only in effect as long as no push notification is issued\&. Once that happened, the resumption timeout configured for the
This option specifies the period of time until the session of a disconnected push client times out\&. This timeout is only in effect as long as no push notification is issued\&. Once that happened, the resumption timeout configured for
\fImod_stream_mgmt\fR
module is restored\&. The default value is
is restored\&. The default value is
\fI72\fR
minutes\&.
hours\&.
.RE
.PP
\fBwake_on_start\fR: \fItrue | false\fR
@@ -5480,7 +5654,7 @@ Change the password from an existing account on the server\&.
Delete an existing account on the server\&.
.RE
.sp
This module reads also another option defined globally for the server: \fIregistration_timeout\fR\&. Please check that option documentation in the section with top\-level options\&.
This module reads also the top\-level \fIregistration_timeout\fR option defined globally for the server, so please check that option documentation too\&.
.sp
.it 1 an-trap
.nr an-no-space-flag 1
@@ -5509,11 +5683,18 @@ doesn\(cqt allow to register new accounts from s2s or existing c2s sessions\&. Y
Specify rules to restrict access for user unregistration\&. By default any user is able to unregister their account\&.
.RE
.PP
\fBallow_modules\fR: \fIall | [Module, \&.\&.\&.]\fR
.RS 4
List of modules that can register accounts, or
\fIall\fR\&. The default value is
\fIall\fR, which is equivalent to something like
\fI[mod_register, mod_register_web]\fR\&.
.RE
.PP
\fBcaptcha_protected\fR: \fItrue | false\fR
.RS 4
Protect registrations with CAPTCHA (see section
CAPTCHA
of the Configuration Guide)\&. The default is
Protect registrations with
CAPTCHA\&. The default is
\fIfalse\fR\&.
.RE
.PP
@@ -5532,7 +5713,8 @@ This option sets the minimum
Shannon entropy
for passwords\&. The value
\fIEntropy\fR
is a number of bits of entropy\&. The recommended minimum is 32 bits\&. The default is 0, i\&.e\&. no checks are performed\&.
is a number of bits of entropy\&. The recommended minimum is 32 bits\&. The default is
\fI0\fR, i\&.e\&. no checks are performed\&.
.RE
.PP
\fBredirect_url\fR: \fIURL\fR
@@ -5591,13 +5773,40 @@ Change the password from an existing account on the server\&.
Unregister an existing account on the server\&.
.RE
.sp
This module supports CAPTCHA image to register a new account\&. To enable this feature, configure the options \fIcaptcha_cmd\fR and \fIcaptcha_url\fR, which are documented in the section with top\-level options\&.
This module supports CAPTCHA to register a new account\&. To enable this feature, configure the top\-level \fIcaptcha_cmd\fR and top\-level \fIcaptcha_url\fR options\&.
.sp
As an example usage, the users of the host \fIexample\&.org\fR can visit the page: \fIhttps://example\&.org:5281/register/\fR It is important to include the last / character in the URL, otherwise the subpages URL will be incorrect\&.
As an example usage, the users of the host \fIlocalhost\fR can visit the page: \fIhttps://localhost:5280/register/\fR It is important to include the last / character in the URL, otherwise the subpages URL will be incorrect\&.
.sp
The module depends on \fImod_register\fR where all the configuration is performed\&.
This module is enabled in \fIlisten\fR → \fIejabberd_http\fR → request_handlers, no need to enable in \fImodules\fR\&. The module depends on \fImod_register\fR where all the configuration is performed\&.
.sp
The module has no options\&.
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBExample:\fR
.RS 4
.sp
.if n \{\
.RS 4
.\}
.nf
listen:
\-
port: 5280
module: ejabberd_http
request_handlers:
/register: mod_register_web
modules:
mod_register: {}
.fi
.if n \{\
.RE
.\}
.RE
.SS "mod_roster"
.sp
This module implements roster management as defined in RFC6121 Section 2\&. The module also adds support for XEP\-0237: Roster Versioning\&.
@@ -5891,8 +6100,9 @@ option, but applied to this module only\&.
.PP
\fBdb_type\fR: \fImnesia | sql\fR
.RS 4
Define the type of storage where the module will create the tables and store user information\&. The default is the storage defined by the global option
\fIdefault_db\fR, or
Define the type of storage where the module will create the tables and store user information\&. The default is the storage defined by the top\-level
\fIdefault_db\fR
option, or
\fImnesia\fR
if omitted\&. If
\fIsql\fR
@@ -6502,7 +6712,8 @@ minute\&.
.RS 4
Same as top\-level
\fIcache_life_time\fR
option, but applied to this module only\&.
option, but applied to this module only\&. The default value is
\fI48 hours\fR\&.
.RE
.PP
\fBcache_size\fR: \fIpos_integer() | infinity\fR
@@ -6556,7 +6767,7 @@ minutes\&.
.RE
.SS "mod_stun_disco"
.sp
This module allows XMPP clients to discover STUN/TURN services and to obtain temporary credentials for using them as per XEP\-0215: External Service Discovery\&.
This module allows XMPP clients to discover STUN/TURN services and to obtain temporary credentials for using them as per XEP\-0215: External Service Discovery\&. This module is included in ejabberd since version 20\&.04\&.
.sp
.it 1 an-trap
.nr an-no-space-flag 1
@@ -6575,8 +6786,7 @@ This option defines which access rule will be used to control who is allowed to
\fBcredentials_lifetime\fR: \fItimeout()\fR
.RS 4
The lifetime of temporary credentials offered to clients\&. If ejabberd\(cqs built\-in TURN service is used, TURN relays allocated using temporary credentials will be terminated shortly after the credentials expired\&. The default value is
\fI12\fR
hours\&. Note that restarting the ejabberd node invalidates any temporary credentials offered before the restart unless a
\fI12 hours\fR\&. Note that restarting the ejabberd node invalidates any temporary credentials offered before the restart unless a
\fIsecret\fR
is specified (see below)\&.
.RE
@@ -7102,7 +7312,7 @@ The module depends on \fImod_vcard\fR\&.
.ps -1
.br
.sp
Nowadays XEP\-0153 is used mostly as "read\-only", i\&.e\&. modern clients don\(cqt publish their avatars inside vCards\&. Thus in the majority of cases the module is only used along with \fImod_avatar\fR module for providing backward compatibility\&.
Nowadays XEP\-0153 is used mostly as "read\-only", i\&.e\&. modern clients don\(cqt publish their avatars inside vCards\&. Thus in the majority of cases the module is only used along with \fImod_avatar\fR for providing backward compatibility\&.
.sp .5v
.RE
.sp
@@ -7170,13 +7380,13 @@ TODO
ProcessOne\&.
.SH "VERSION"
.sp
This document describes the configuration file of ejabberd 21\&.01\&.81\&. Configuration options of other ejabberd versions may differ significantly\&.
This document describes the configuration file of ejabberd 21\&.12\&. Configuration options of other ejabberd versions may differ significantly\&.
.SH "REPORTING BUGS"
.sp
Report bugs to https://github\&.com/processone/ejabberd/issues
.SH "SEE ALSO"
.sp
Default configuration file: https://github\&.com/processone/ejabberd/blob/21\&.01/ejabberd\&.yml\&.example
Default configuration file: https://github\&.com/processone/ejabberd/blob/21\&.12/ejabberd\&.yml\&.example
.sp
Main site: https://ejabberd\&.im
.sp
+127 -16
View File
@@ -1,9 +1,9 @@
defmodule Ejabberd.Mixfile do
defmodule Ejabberd.MixProject do
use Mix.Project
def project do
[app: :ejabberd,
version: "21.4.0",
version: version(),
description: description(),
elixir: "~> 1.4",
elixirc_paths: ["lib"],
@@ -13,10 +13,25 @@ defmodule Ejabberd.Mixfile do
erlc_paths: ["asn1", "src"],
# Elixir tests are starting the part of ejabberd they need
aliases: [test: "test --no-start"],
start_permanent: Mix.env() == :prod,
language: :erlang,
releases: releases(),
package: package(),
deps: deps()]
end
def version do
case config(:vsn) do
:false -> "0.0.0" # ./configure wasn't run: vars.config not created
'0.0' -> "0.0.0" # the full git repository wasn't downloaded
'latest.0' -> "0.0.0" # running 'docker-ejabberd/ecs/build.sh latest'
[_, _, ?., _, _] = x ->
head = String.replace(:erlang.list_to_binary(x), ~r/0+([0-9])/, "\\1")
<<head::binary, ".0">>
vsn -> String.replace(:erlang.list_to_binary(vsn), ~r/0+([0-9])/, "\\1")
end
end
def description do
"""
Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)
@@ -25,12 +40,13 @@ defmodule Ejabberd.Mixfile do
def application do
[mod: {:ejabberd_app, []},
applications: [:kernel, :stdlib, :sasl, :ssl],
included_applications: [:lager, :mnesia, :inets, :p1_utils, :cache_tab,
:fast_tls, :stringprep, :fast_xml, :xmpp, :mqtree,
:stun, :fast_yaml, :esip, :jiffy, :p1_oauth2,
:eimp, :base64url, :jose, :pkix, :os_mon, :yconf,
:p1_acme, :idna]
extra_applications: [:mix],
applications: [:idna, :inets, :kernel, :sasl, :ssl, :stdlib,
:base64url, :fast_tls, :fast_xml, :fast_yaml, :jiffy, :jose,
:p1_utils, :stringprep, :stun, :yconf],
included_applications: [:lager, :mnesia, :os_mon,
:cache_tab, :eimp, :esip, :mqtree, :p1_acme,
:p1_oauth2, :pkix, :xmpp]
++ cond_apps()]
end
@@ -71,6 +87,8 @@ defmodule Ejabberd.Mixfile do
if_version_below('23', [{:d, :USE_OLD_CRYPTO_HMAC}]) ++
if_version_below('23', [{:d, :USE_OLD_PG2}]) ++
if_version_below('24', [{:d, :COMPILER_REPORTS_ONLY_LINES}]) ++
if_version_below('24', [{:d, :SYSTOOLS_APP_DEF_WITHOUT_OPTIONAL}]) ++
if_function_exported(:uri_string, :normalize, 1, [{:d, :HAVE_URI_STRING}])
if_function_exported(:erl_error, :format_exception, 6, [{:d, :HAVE_ERL_ERROR}])
defines = for {:d, value} <- result, do: {:d, value}
result ++ [{:d, :ALL_DEFS, defines}]
@@ -86,7 +104,7 @@ defmodule Ejabberd.Mixfile do
end
defp deps do
[{:base64url, "~> 0.0.1"},
[{:base64url, "~> 1.0"},
{:cache_tab, "~> 1.0"},
{:distillery, "~> 2.0"},
{:eimp, "~> 1.0"},
@@ -97,8 +115,8 @@ defmodule Ejabberd.Mixfile do
{:fast_yaml, "~> 1.0"},
{:idna, "~> 6.0"},
{:jiffy, "~> 1.0.5"},
{:jose, "~> 1.8"},
{:lager, "~> 3.6.0"},
{:jose, "~> 1.11.1"},
{:lager, "~> 3.9.1"},
{:mqtree, "~> 1.0"},
{:p1_acme, "~> 1.0"},
{:p1_mysql, "~> 1.0"},
@@ -106,7 +124,7 @@ defmodule Ejabberd.Mixfile do
{:p1_pgsql, "~> 1.1"},
{:p1_utils, "~> 1.0"},
{:pkix, "~> 1.0"},
{:stringprep, "~> 1.0"},
{:stringprep, ">= 1.0.26"},
{:stun, "~> 1.0"},
{:xmpp, "~> 1.5"},
{:yconf, "~> 1.0"}]
@@ -127,7 +145,7 @@ defmodule Ejabberd.Mixfile do
defp cond_deps do
for {:true, dep} <- [{config(:pam), {:epam, "~> 1.0"}},
{config(:redis), {:eredis, "~> 1.0"}},
{config(:redis), {:eredis, "~> 1.2.0"}},
{config(:zlib), {:ezlib, "~> 1.0"}},
{config(:lua), {:luerl, "~> 0.3.1"}},
{config(:sqlite), {:sqlite3, "~> 1.1"}}], do:
@@ -139,14 +157,15 @@ defmodule Ejabberd.Mixfile do
{config(:mysql), :p1_mysql},
{config(:odbc), :odbc},
{config(:pgsql), :p1_pgsql},
{config(:sqlite), :sqlite3},
{config(:zlib), :ezlib}], do:
{config(:sqlite), :sqlite3}], do:
app
end
defp package do
[# These are the default files included in the package
files: ["lib", "src", "priv", "mix.exs", "include", "README.md", "COPYING", "rebar.config", "rebar.config.script"],
files: ["include", "lib", "priv", "sql", "src",
"COPYING", "README.md",
"mix.exs", "rebar.config", "rebar.config.script", "vars.config"],
maintainers: ["ProcessOne"],
licenses: ["GPLv2"],
links: %{"Site" => "https://www.ejabberd.im",
@@ -169,6 +188,98 @@ defmodule Ejabberd.Mixfile do
end
end
defp releases do
maybe_tar = case Mix.env() do
:prod -> [:tar]
_ -> []
end
[
ejabberd: [
include_executables_for: [:unix],
# applications: [runtime_tools: :permanent]
steps: [&copy_extra_files/1, :assemble | maybe_tar]
]
]
end
defp copy_extra_files(release) do
assigns = [
version: version(),
rootdir: config(:rootdir),
installuser: config(:installuser),
libdir: config(:libdir),
sysconfdir: config(:sysconfdir),
localstatedir: config(:localstatedir),
docdir: config(:docdir),
erl: config(:erl),
epmd: config(:epmd),
bindir: Path.join([config(:release_dir), "releases", version()]),
release_dir: config(:release_dir),
erts_vsn: "erts-#{release.erts_version}"
]
ro = "rel/overlays"
File.rm_rf(ro)
# Elixir lower than 1.12.0 don't have System.shell
execute = fn(command) ->
case function_exported?(System, :shell, 1) do
true ->
System.shell(command)
false ->
:os.cmd(to_charlist(command))
end
end
# Mix/Elixir lower than 1.11.0 use config/releases.exs instead of runtime.exs
case Version.match?(System.version, ">= 1.11.0") do
true ->
:ok
false ->
execute.("cp config/runtime.exs config/releases.exs")
end
execute.("sed -e 's|{{\\(\[_a-z\]*\\)}}|<%= @\\1 %>|g' ejabberdctl.template > ejabberdctl.example1")
Mix.Generator.copy_template("ejabberdctl.example1", "ejabberdctl.example2", assigns)
execute.("sed -e 's|{{\\(\[_a-z\]*\\)}}|<%= @\\1 %>|g' ejabberdctl.example2 > ejabberdctl.example3")
execute.("sed -e 's|ERLANG_NODE=ejabberd@localhost|ERLANG_NODE=ejabberd|g' ejabberdctl.example3 > ejabberdctl.example4")
execute.("sed -e 's|INSTALLUSER=|ERL_OPTIONS=\"-setcookie \\$\\(cat \"\\${SCRIPT_DIR%/*}/releases/COOKIE\")\"\\nINSTALLUSER=|g' ejabberdctl.example4 > ejabberdctl.example5")
Mix.Generator.copy_template("ejabberdctl.example5", "#{ro}/bin/ejabberdctl", assigns)
File.chmod("#{ro}/bin/ejabberdctl", 0o755)
File.rm("ejabberdctl.example1")
File.rm("ejabberdctl.example2")
File.rm("ejabberdctl.example3")
File.rm("ejabberdctl.example4")
File.rm("ejabberdctl.example5")
suffix = case Mix.env() do
:dev ->
Mix.Generator.copy_file("test/ejabberd_SUITE_data/ca.pem", "#{ro}/etc/ejabberd/ca.pem")
Mix.Generator.copy_file("test/ejabberd_SUITE_data/cert.pem", "#{ro}/etc/ejabberd/cert.pem")
".example"
_ -> ""
end
Mix.Generator.copy_file("ejabberd.yml.example", "#{ro}/etc/ejabberd/ejabberd.yml#{suffix}")
Mix.Generator.copy_file("ejabberdctl.cfg.example", "#{ro}/etc/ejabberd/ejabberdctl.cfg#{suffix}")
Mix.Generator.copy_file("inetrc", "#{ro}/etc/ejabberd/inetrc")
Mix.Generator.copy_template("rel/vm.args.mix", "#{ro}/etc/ejabberd/vm.args", assigns)
Enum.each(File.ls!("sql"),
fn x ->
Mix.Generator.copy_file("sql/#{x}", "#{ro}/lib/ejabberd-#{release.version}/priv/sql/#{x}")
end)
Mix.Generator.create_directory("#{ro}/var/lib/ejabberd")
case Mix.env() do
:dev -> execute.("REL_DIR_TEMP=$PWD/rel/overlays/ rel/setup-dev.sh")
_ -> :ok
end
release
end
end
defmodule Mix.Tasks.Compile.Asn1 do
+26 -30
View File
@@ -1,40 +1,36 @@
%{
"artificery": {:hex, :artificery, "0.4.3", "0bc4260f988dcb9dda4b23f9fc3c6c8b99a6220a331534fdf5bf2fd0d4333b02", [:mix], [], "hexpm", "12e95333a30e20884e937abdbefa3e7f5e05609c2ba8cf37b33f000b9ffc0504"},
"base64url": {:hex, :base64url, "0.0.1", "36a90125f5948e3afd7be97662a1504b934dd5dac78451ca6e9abf85a10286be", [:rebar], [], "hexpm", "fab09b20e3f5db886725544cbcf875b8e73ec93363954eb8a1a9ed834aa8c1f9"},
"cache_tab": {:hex, :cache_tab, "1.0.28", "551beb14325c34aa7e1e5d65e5fdaa1a87b0325393cfaf8641c0068364d84f69", [:rebar3], [{:p1_utils, "1.0.22", [hex: :p1_utils, repo: "hexpm", optional: false]}], "hexpm", "17451084f2cc0a4a6304e12ae5c9ceef13d70ad070c9c406317e80abb7677889"},
"base64url": {:hex, :base64url, "1.0.1", "f8c7f2da04ca9a5d0f5f50258f055e1d699f0e8bf4cfdb30b750865368403cf6", [:rebar3], [], "hexpm", "f9b3add4731a02a9b0410398b475b33e7566a695365237a6bdee1bb447719f5c"},
"cache_tab": {:hex, :cache_tab, "1.0.29", "6c161988620b788d8df28c8f6af557571609c8e4b671dbadab295a4722cd501b", [:rebar3], [{:p1_utils, "1.0.23", [hex: :p1_utils, repo: "hexpm", optional: false]}], "hexpm", "a02a638021cce91ed1a8628dcbb4795bf5c01c9d11db8c613065923142824ce9"},
"distillery": {:hex, :distillery, "2.1.1", "f9332afc2eec8a1a2b86f22429e068ef35f84a93ea1718265e740d90dd367814", [:mix], [{:artificery, "~> 0.2", [hex: :artificery, repo: "hexpm", optional: false]}], "hexpm", "bbc7008b0161a6f130d8d903b5b3232351fccc9c31a991f8fcbf2a12ace22995"},
"earmark": {:hex, :earmark, "1.4.3", "364ca2e9710f6bff494117dbbd53880d84bebb692dafc3a78eb50aa3183f2bfd", [:mix], [], "hexpm", "8cf8a291ebf1c7b9539e3cddb19e9cef066c2441b1640f13c34c1d3cfc825fec"},
"earmark_parser": {:hex, :earmark_parser, "1.4.12", "b245e875ec0a311a342320da0551da407d9d2b65d98f7a9597ae078615af3449", [:mix], [], "hexpm", "711e2cc4d64abb7d566d43f54b78f7dc129308a63bc103fbd88550d2174b3160"},
"eimp": {:hex, :eimp, "1.0.20", "4b46fa8623690ba602fc1c509dd5d38bdf7c2188b694064bf144f36be600cf02", [:rebar3], [{:p1_utils, "1.0.22", [hex: :p1_utils, repo: "hexpm", optional: false]}], "hexpm", "531a1d07e5df83f6adf29f9bae93faa227ebfdcd92d2408a28630709eac3e979"},
"epam": {:hex, :epam, "1.0.10", "feb9cf1169c8e30609b13bc5f77a0d8213b425997bec1d05dfbccab024fde856", [:rebar3], [], "hexpm", "429a43b876fbef5d1accaadf8177a74933b37e069d6bcc08d74745b8c8f76f71"},
"eredis": {:hex, :eredis, "1.2.0", "0b8e9cfc2c00fa1374cd107ea63b49be08d933df2cf175e6a89b73dd9c380de4", [:rebar3], [], "hexpm", "d9b5abef2c2c8aba8f32aa018203e0b3dc8b1157773b254ab1d4c2002317f1e1"},
"esip": {:hex, :esip, "1.0.42", "ccd1f3aa1e8d7b5ffe51fc5df238b0d36b5f6cde67cef1dab24931ff03a0a836", [:rebar3], [{:fast_tls, "1.1.12", [hex: :fast_tls, repo: "hexpm", optional: false]}, {:p1_utils, "1.0.22", [hex: :p1_utils, repo: "hexpm", optional: false]}, {:stun, "1.0.43", [hex: :stun, repo: "hexpm", optional: false]}], "hexpm", "87e28b1344543ef9c1b24a60097ae3ceeedba0ff6487f20cdc7be53f087b9a4e"},
"ex_doc": {:hex, :ex_doc, "0.24.2", "e4c26603830c1a2286dae45f4412a4d1980e1e89dc779fcd0181ed1d5a05c8d9", [:mix], [{:earmark_parser, "~> 1.4.0", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "e134e1d9e821b8d9e4244687fb2ace58d479b67b282de5158333b0d57c6fb7da"},
"ezlib": {:hex, :ezlib, "1.0.9", "b17136b48bcf73962446b06d4427b0b6f2be4550bb5190a18a2979640271e244", [:rebar3], [], "hexpm", "fafc60a0de6e982be38f793da7b220b87a0da2969eba8a878351442b35cc2fde"},
"fast_tls": {:hex, :fast_tls, "1.1.12", "b11997d96d4306abcd4cdb9ffa77ccfc0f826f64bed77ecaceb48b2dc46b9202", [:rebar3], [{:p1_utils, "1.0.22", [hex: :p1_utils, repo: "hexpm", optional: false]}], "hexpm", "c3d80828f5d985cba4c93660ffbf2c9b9cd831303382b97832dd66429fb16f8a"},
"fast_xml": {:hex, :fast_xml, "1.1.46", "bd563e1cdd8a397ed31a6e11f832ea9e4e90f84695104aa92b46224a887fc6ae", [:rebar3], [{:p1_utils, "1.0.22", [hex: :p1_utils, repo: "hexpm", optional: false]}], "hexpm", "2992a0b2fb649879936fd72498e8bf4202e4cc8356295e14ddf17d4220ac8c51"},
"fast_yaml": {:hex, :fast_yaml, "1.0.31", "a66d0e678341dc20680aece8e6fd566205a229981b5b3cfa698c66323b728da2", [:rebar3], [{:p1_utils, "1.0.22", [hex: :p1_utils, repo: "hexpm", optional: false]}], "hexpm", "8aa129e3384c5aa9f5f1597a1e3321a63a44860f3951f23eeed950bf0ee59643"},
"earmark_parser": {:hex, :earmark_parser, "1.4.17", "6f3c7e94170377ba45241d394389e800fb15adc5de51d0a3cd52ae766aafd63f", [:mix], [], "hexpm", "f93ac89c9feca61c165b264b5837bf82344d13bebc634cd575cb711e2e342023"},
"eimp": {:hex, :eimp, "1.0.21", "2e918a5dc9a1959ef8713a2360499e3baeee64cfd7881bd9d1f361ca9ddf07e8", [:rebar3], [{:p1_utils, "1.0.23", [hex: :p1_utils, repo: "hexpm", optional: false]}], "hexpm", "998f58538f58aa0cff103414994d7ce56dc253e6576cd6fb40c1ead64aa73a28"},
"epam": {:hex, :epam, "1.0.12", "2a5625d4133bca4b3943791a3f723ba764455a461ae9b6ba5debb262efcf4b40", [:rebar3], [], "hexpm", "54c166c4459cef72f2990a3d89a8f0be27180fe0ab0f24b28ddcc3b815f49f7f"},
"esip": {:hex, :esip, "1.0.45", "2f21fb9750f7a505e6bbd43f6d48b0e879b808aba6c2224686c83f2bcd7a34bf", [:rebar3], [{:fast_tls, "1.1.13", [hex: :fast_tls, repo: "hexpm", optional: false]}, {:p1_utils, "1.0.23", [hex: :p1_utils, repo: "hexpm", optional: false]}, {:stun, "1.0.47", [hex: :stun, repo: "hexpm", optional: false]}], "hexpm", "1f1eae69f2bd8d75f42c048409eabb4e3dc71ab6412fc5d998edbdade6ad5f75"},
"ex_doc": {:hex, :ex_doc, "0.26.0", "1922164bac0b18b02f84d6f69cab1b93bc3e870e2ad18d5dacb50a9e06b542a3", [:mix], [{:earmark_parser, "~> 1.4.0", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "2775d66e494a9a48355db7867478ffd997864c61c65a47d31c4949459281c78d"},
"ezlib": {:hex, :ezlib, "1.0.10", "c1c24eb18944cfde55f0574e9922d5b0392fa864282f769f82b2ea15e54f6003", [:rebar3], [], "hexpm", "1d317f1d85373686199eb3b4164d3477e95033ac68e45a95ba18e7b7a8c23241"},
"fast_tls": {:hex, :fast_tls, "1.1.13", "828cdc75e1e8fce8158846d2b971d8b4fe2b2ddcc75b759e88d751079bf78afd", [:rebar3], [{:p1_utils, "1.0.23", [hex: :p1_utils, repo: "hexpm", optional: false]}], "hexpm", "d1f422af40c7777fe534496f508ee86515cb929ad10f7d1d56aa94ce899b44a0"},
"fast_xml": {:hex, :fast_xml, "1.1.48", "d41d14015227999a2367264cc97ac1e6770285aab1dc69545ac4f822be01a2d2", [:rebar3], [{:p1_utils, "1.0.23", [hex: :p1_utils, repo: "hexpm", optional: false]}], "hexpm", "afcf9b808c77599395d4bd22ed4560b3d82aa1a24ff5b65f3930fe72a423b3cf"},
"fast_yaml": {:hex, :fast_yaml, "1.0.32", "43f53a2c8572f2e4d66cd4e787fc6761b1c65b9132e42c511d8b9540b0989d65", [:rebar3], [{:p1_utils, "1.0.23", [hex: :p1_utils, repo: "hexpm", optional: false]}], "hexpm", "7258e322739ff0824237ebe44cd158e0bf52cd27a15fe731cf92f4b4c70b913e"},
"goldrush": {:hex, :goldrush, "0.1.9", "f06e5d5f1277da5c413e84d5a2924174182fb108dabb39d5ec548b27424cd106", [:rebar3], [], "hexpm", "99cb4128cffcb3227581e5d4d803d5413fa643f4eb96523f77d9e6937d994ceb"},
"idna": {:hex, :idna, "6.0.0", "689c46cbcdf3524c44d5f3dde8001f364cd7608a99556d8fbd8239a5798d4c10", [:rebar3], [{:unicode_util_compat, "0.4.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "4bdd305eb64e18b0273864920695cb18d7a2021f31a11b9c5fbcd9a253f936e2"},
"jiffy": {:hex, :jiffy, "1.0.5", "a69b58faf7123534c20e1b0b7ae97ac52079ca02ed4b6989b4b380179cd63a54", [:rebar3], [], "hexpm", "b617a53f46ae84f20d0c38951367dc947a2cf8cff922aa5c6ac6b64b8b052289"},
"jose": {:hex, :jose, "1.9.0", "4167c5f6d06ffaebffd15cdb8da61a108445ef5e85ab8f5a7ad926fdf3ada154", [:mix, :rebar3], [{:base64url, "~> 0.0.1", [hex: :base64url, repo: "hexpm", optional: false]}], "hexpm", "6429c4fee52b2dda7861ee19a4f09c8c1ffa213bee3a1ec187828fde95d447ed"},
"lager": {:hex, :lager, "3.6.10", "6172b43ab720ac33914ccd0aeb21fdbdf88213847707d4b91e6af57b2ae5c4d2", [:rebar3], [{:goldrush, "0.1.9", [hex: :goldrush, repo: "hexpm", optional: false]}], "hexpm", "5d10499461826b79c5abee18bb594b3949cbdf76d9d9fd7e66d0a558137c21c9"},
"luerl": {:hex, :luerl, "0.3.1", "5412807630aac1aaf59ffe5a1bc09259c447b4faeb1d3fe2d4ef41b87676cb04", [:rebar3], [], "hexpm", "1bc011c7297e43aec762e53b17ecb15b0ff29f9546cd153110b343cf5b043f5f"},
"jose": {:hex, :jose, "1.11.1", "59da64010c69aad6cde2f5b9248b896b84472e99bd18f246085b7b9fe435dcdb", [:mix, :rebar3], [], "hexpm", "078f6c9fb3cd2f4cfafc972c814261a7d1e8d2b3685c0a76eb87e158efff1ac5"},
"lager": {:hex, :lager, "3.9.2", "4cab289120eb24964e3886bd22323cb5fefe4510c076992a23ad18cf85413d8c", [:rebar3], [{:goldrush, "0.1.9", [hex: :goldrush, repo: "hexpm", optional: false]}], "hexpm", "7f904d9e87a8cb7e66156ed31768d1c8e26eba1d54f4bc85b1aa4ac1f6340c28"},
"makeup": {:hex, :makeup, "1.0.5", "d5a830bc42c9800ce07dd97fa94669dfb93d3bf5fcf6ea7a0c67b2e0e4a7f26c", [:mix], [{:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cfa158c02d3f5c0c665d0af11512fed3fba0144cf1aadee0f2ce17747fba2ca9"},
"makeup_elixir": {:hex, :makeup_elixir, "0.15.1", "b5888c880d17d1cc3e598f05cdb5b5a91b7b17ac4eaf5f297cb697663a1094dd", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "db68c173234b07ab2a07f645a5acdc117b9f99d69ebf521821d89690ae6c6ec8"},
"makeup_elixir": {:hex, :makeup_elixir, "0.15.2", "dc72dfe17eb240552857465cc00cce390960d9a0c055c4ccd38b70629227e97c", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "fd23ae48d09b32eff49d4ced2b43c9f086d402ee4fd4fcb2d7fad97fa8823e75"},
"makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"},
"mqtree": {:hex, :mqtree, "1.0.13", "28c9eaa3a63624829c75f606588d584c3434aec3b615df452f5a539a97467f50", [:rebar3], [{:p1_utils, "1.0.22", [hex: :p1_utils, repo: "hexpm", optional: false]}], "hexpm", "2369ecb99b2ae3908e8c5c604ed4b96aab8f930ac1f1225e1c42ec25d6a65cc8"},
"nimble_parsec": {:hex, :nimble_parsec, "1.1.0", "3a6fca1550363552e54c216debb6a9e95bd8d32348938e13de5eda962c0d7f89", [:mix], [], "hexpm", "08eb32d66b706e913ff748f11694b17981c0b04a33ef470e33e11b3d3ac8f54b"},
"p1_acme": {:hex, :p1_acme, "1.0.12", "e51a9e178441669ac06fc5f335ed8ef3343fda67ec83bbbf9551c49967d5f401", [:rebar3], [{:idna, "~>6.0.0", [hex: :idna, repo: "hexpm", optional: false]}, {:jiffy, "~>1.0.5", [hex: :jiffy, repo: "hexpm", optional: false]}, {:jose, "~>1.9.0", [hex: :jose, repo: "hexpm", optional: false]}, {:yconf, "~>1.0.11", [hex: :yconf, repo: "hexpm", optional: false]}], "hexpm", "9a98f523c656b159be3222c9834a07a83cd5f9dc83f8dec9233a457fceef99a6"},
"p1_mysql": {:hex, :p1_mysql, "1.0.18", "c636842cc7b56785de383e4ffacc5b74318dae09d9d1447f6eac8b4aac8bd8f4", [:rebar3], [], "hexpm", "4b5e001c554b9a2b9e32885ad43c7cc97d53ef8412d9bbe9491c01997935fbb8"},
"p1_oauth2": {:hex, :p1_oauth2, "0.6.9", "07c4527e0af10aa93e4df033f971c64aec01aa0806d6467bb0632f944b3a2309", [:rebar3], [], "hexpm", "924360cd9883cb773ae8166773241e1a9b3a70cad3034e038ab493b40b56d987"},
"p1_pgsql": {:hex, :p1_pgsql, "1.1.11", "8769ec7a2c4f480d443b90fdaa02519fbb459aa06c5fa6a99a0fbee683be9f7a", [:rebar3], [], "hexpm", "e4ef71713293717e8ace5fe717ddd63c618179597a6af79156af9be8c3ea851d"},
"p1_utils": {:hex, :p1_utils, "1.0.22", "10a70faa665d1f8f6995fa100d068b4d910ee2a0111fa3567e9d6232cbb86f21", [:rebar3], [], "hexpm", "0e49ff5586515e3c44901d6fb06b1473bda492d749f0b1705cbf9d96d4cd5a38"},
"pkix": {:hex, :pkix, "1.0.7", "a0b8c9011edeba702d7cb73fecef1eabe3ae89b3dcf4b8f33775e4f17a7a1304", [:rebar3], [], "hexpm", "104a9e0ecd9cc0e579d148a028189a6efe6420b241f3d319d8a65d898a078295"},
"sqlite3": {:hex, :sqlite3, "1.1.9", "10090161893843c9839d884855cafbb33c8ee3a2d6597443d66e6f94144dfd79", [:rebar3], [], "hexpm", "148ef74ee796efc13ffc6bb0e7f5feeb050f425e7335ff02c7415ca86819c0d0"},
"stringprep": {:hex, :stringprep, "1.0.25", "15062f6020777a51a96488f29ce9a2d83e3195f92fdf27f25acc462dff7d8d82", [:rebar3], [{:p1_utils, "1.0.22", [hex: :p1_utils, repo: "hexpm", optional: false]}], "hexpm", "8e0807d94a6927d1c3f8e76d584a2e3cdd9b4bcb02823eaf96629edf2a65b104"},
"stun": {:hex, :stun, "1.0.43", "5c58af3b87fde5e85552dfc085d565a8d899ef7bc0c3e97dea0ea45e3daf0a30", [:rebar3], [{:fast_tls, "1.1.12", [hex: :fast_tls, repo: "hexpm", optional: false]}, {:p1_utils, "1.0.22", [hex: :p1_utils, repo: "hexpm", optional: false]}], "hexpm", "6db03005a5f9931dc5c331d923cbe1c06b04f92921b47093dff8e3f0a18d7b36"},
"mqtree": {:hex, :mqtree, "1.0.14", "d201a79b51a9232b80e764b4b77a866f7c30a90c7ac6205d71f391eb3ea7eb31", [:rebar3], [{:p1_utils, "1.0.23", [hex: :p1_utils, repo: "hexpm", optional: false]}], "hexpm", "8626dac5e862b575eaf4836f0fc1be5a7c8435c378c5a309e34ee012d48b6f6e"},
"nimble_parsec": {:hex, :nimble_parsec, "1.2.0", "b44d75e2a6542dcb6acf5d71c32c74ca88960421b6874777f79153bbbbd7dccc", [:mix], [], "hexpm", "52b2871a7515a5ac49b00f214e4165a40724cf99798d8e4a65e4fd64ebd002c1"},
"p1_acme": {:hex, :p1_acme, "1.0.16", "88b84cc24c9b6eb87204ea53969ccd9b524dcd4142de632441fdd2859ccab778", [:rebar3], [{:base64url, "1.0.1", [hex: :base64url, repo: "hexpm", optional: false]}, {:idna, "6.0.0", [hex: :idna, repo: "hexpm", optional: false]}, {:jiffy, "1.0.5", [hex: :jiffy, repo: "hexpm", optional: false]}, {:jose, "1.11.1", [hex: :jose, repo: "hexpm", optional: false]}, {:yconf, "1.0.12", [hex: :yconf, repo: "hexpm", optional: false]}], "hexpm", "ec0ef380a7345c38b57899733f6fece97c337a3d44fd02cc8898f6a2491a38a8"},
"p1_mysql": {:hex, :p1_mysql, "1.0.19", "22f1be58397780a7d580a954e7af66cde32a29dee1a24ab2aa196272fc654a4a", [:rebar3], [], "hexpm", "88f6cdb510e8959c14b6ae84ccda04967e3de239228f859d8341da67949622b1"},
"p1_oauth2": {:hex, :p1_oauth2, "0.6.10", "09ba1fbd447b1f480b223903e36d0415f21be592a1b00db964eea01285749028", [:rebar3], [], "hexpm", "c79cb61ababee4a8c85409b7f4932035797c093aeef1f9f53985e512b26f2a64"},
"p1_pgsql": {:hex, :p1_pgsql, "1.1.12", "10ae79eeb35ea98c0424a8b6420542fef9e4469eb12ccf41475d10840c291e68", [:rebar3], [], "hexpm", "32203f779e01cf0353270df24833a1d831ad7cb3e3e8e35a7556dfa1f40948d5"},
"p1_utils": {:hex, :p1_utils, "1.0.23", "7f94466ada69bd982ea7bb80fbca18e7053e7d0b82c9d9e37621fa508587069b", [:rebar3], [], "hexpm", "47f21618694eeee5006af1c88731ad86b757161e7823c29b6f73921b571c8502"},
"pkix": {:hex, :pkix, "1.0.8", "98ea05243847fd4504f7c7a0cd82cecd1010ac327a082e1c674c5384006eae75", [:rebar3], [], "hexpm", "399508819501fab9d2e586dfa601b5ee3ef22b5612d3db58204dd2d089ef45d7"},
"stringprep": {:hex, :stringprep, "1.0.27", "02808c7024bc6285ca6a8a67e7addfc16f35dda55551a582c5181d8ea960e890", [:rebar3], [{:p1_utils, "1.0.23", [hex: :p1_utils, repo: "hexpm", optional: false]}], "hexpm", "a5967b1144ca8002a58a03d16dd109fbd0bcdb82616cead2f983944314af6a00"},
"stun": {:hex, :stun, "1.0.47", "fae94c0dc7415263297e8f07f286f3355d327d8bf78b1b0743c9a5a492381f71", [:rebar3], [{:fast_tls, "1.1.13", [hex: :fast_tls, repo: "hexpm", optional: false]}, {:p1_utils, "1.0.23", [hex: :p1_utils, repo: "hexpm", optional: false]}], "hexpm", "377d8487f4add85f6bc6ecdebdb4dcbcbe890e9462f27d6d31f3db1cf9b2cc9b"},
"unicode_util_compat": {:hex, :unicode_util_compat, "0.4.1", "d869e4c68901dd9531385bb0c8c40444ebf624e60b6962d95952775cac5e90cd", [:rebar3], [], "hexpm", "1d1848c40487cdb0b30e8ed975e34e025860c02e419cb615d255849f3427439d"},
"xmpp": {:hex, :xmpp, "1.5.3", "d61d8c90ffacd99bea4915c55dcee1829a053d43e0dc33b8ea66bab845cca8ed", [:rebar3], [{:ezlib, "1.0.9", [hex: :ezlib, repo: "hexpm", optional: false]}, {:fast_tls, "1.1.12", [hex: :fast_tls, repo: "hexpm", optional: false]}, {:fast_xml, "1.1.46", [hex: :fast_xml, repo: "hexpm", optional: false]}, {:idna, "6.0.0", [hex: :idna, repo: "hexpm", optional: false]}, {:p1_utils, "1.0.22", [hex: :p1_utils, repo: "hexpm", optional: false]}, {:stringprep, "1.0.25", [hex: :stringprep, repo: "hexpm", optional: false]}], "hexpm", "dca72f926769ed512e524b4369c7812095205f39e00b7e8b11530174a10a9d35"},
"yconf": {:hex, :yconf, "1.0.11", "081fe70e5d73a74d0bbad91c3876a1be0e84bd8539bba4cefef2d61cd3c92f9e", [:rebar3], [{:fast_yaml, "1.0.31", [hex: :fast_yaml, repo: "hexpm", optional: false]}], "hexpm", "6df4253e2d55592ad56b5cc29edb0981778ddb6656034a8625f70ffe24290a98"},
"xmpp": {:hex, :xmpp, "1.5.6", "09259177a39c880d682817932f4da0537c471160fd43aa891ea9cb71cf827b52", [:rebar3], [{:ezlib, "1.0.10", [hex: :ezlib, repo: "hexpm", optional: false]}, {:fast_tls, "1.1.13", [hex: :fast_tls, repo: "hexpm", optional: false]}, {:fast_xml, "1.1.48", [hex: :fast_xml, repo: "hexpm", optional: false]}, {:idna, "6.0.0", [hex: :idna, repo: "hexpm", optional: false]}, {:p1_utils, "1.0.23", [hex: :p1_utils, repo: "hexpm", optional: false]}, {:stringprep, "1.0.27", [hex: :stringprep, repo: "hexpm", optional: false]}], "hexpm", "59b7317c4077d3384f9a891e0517a591cdbd44a323260b835eafbede4f4eb12e"},
"yconf": {:hex, :yconf, "1.0.12", "78c119d39bb805207fcb7671cb884805d75ee89c9ec98632b678f90a597dee2c", [:rebar3], [{:fast_yaml, "1.0.32", [hex: :fast_yaml, repo: "hexpm", optional: false]}], "hexpm", "12faa51c281e95bcb6abf185fd034a242209621a7bb04b6cc411c867b192e207"},
}
+49 -1
View File
@@ -5,11 +5,20 @@
{" (Add * to the end of field to match substring)"," (Ajouter * à la fin du champ pour correspondre à la sous-chaîne)"}.
{" has set the subject to: "," a défini le sujet sur : "}.
{"# participants","# participants"}.
{"A description of the node","Une description du nœud"}.
{"A friendly name for the node","Un nom convivial pour le nœud"}.
{"A password is required to enter this room","Un mot de passe est nécessaire pour accéder à ce salon"}.
{"A Web Page","Une page Web"}.
{"Accept","Accepter"}.
{"Access denied by service policy","L'accès au service est refusé"}.
{"Access model of authorize","Modèle daccès de « autoriser »"}.
{"Access model of open","Modèle daccès de « ouvrir »"}.
{"Access model of presence","Modèle daccès de « présence »"}.
{"Access model of roster","Modèle daccès de « liste »"}.
{"Access model of whitelist","Modèle daccès de « liste blanche »"}.
{"Access model","Modèle daccès"}.
{"Account doesn't exist","Le compte nexiste pas"}.
{"Action on user","Action sur l'utilisateur"}.
{"Add Jabber ID","Ajouter un Jabber ID"}.
{"Add New","Ajouter"}.
@@ -19,7 +28,9 @@
{"Administrator privileges required","Les droits d'administrateur sont nécessaires"}.
{"All activity","Toute activité"}.
{"All Users","Tous les utilisateurs"}.
{"Allow subscription","Autoriser labonnement"}.
{"Allow this Jabber ID to subscribe to this pubsub node?","Autoriser ce Jabber ID à s'abonner à ce nœud PubSub ?"}.
{"Allow this person to register with the room?","Autoriser cette personne à enregistrer ce salon?"}.
{"Allow users to change the subject","Autoriser les utilisateurs à changer le sujet"}.
{"Allow users to query other users","Autoriser les utilisateurs à envoyer des requêtes aux autres utilisateurs"}.
{"Allow users to send invites","Autoriser les utilisateurs à envoyer des invitations"}.
@@ -28,8 +39,25 @@
{"Allow visitors to send private messages to","Autoriser les visiteurs à envoyer des messages privés"}.
{"Allow visitors to send status text in presence updates","Autoriser les visiteurs à envoyer un message d'état avec leur présence"}.
{"Allow visitors to send voice requests","Permettre aux visiteurs d'envoyer des demandes de 'voice'"}.
{"An associated LDAP group that defines room membership; this should be an LDAP Distinguished Name according to an implementation-specific or deployment-specific definition of a group.","Un groupe LDAP associé qui définit ladhésion à un salon; cela devrait être un nom distingué LDAP selon la définition spécifique à limplémentation ou au déploiement dun groupe."}.
{"Announcements","Annonces"}.
{"Answer associated with a picture","Réponse associée à une image"}.
{"Answer associated with a video","Réponse associée à une vidéo"}.
{"Answer associated with speech","Réponse associée à un discours"}.
{"Answer to a question","Réponse à une question"}.
{"Anyone in the specified roster group(s) may subscribe and retrieve items","Nimporte qui dans le groupe de la liste spécifiée peut sabonner et récupérer les items"}.
{"Anyone may associate leaf nodes with the collection","Nimporte qui peut associer les feuilles avec la collection"}.
{"Anyone may publish","Nimporte qui peut publier"}.
{"Anyone may subscribe and retrieve items","Nimporte qui peut sabonner et récupérer les items"}.
{"Anyone with a presence subscription of both or from may subscribe and retrieve items","Nimporte qui avec un abonnement de présence peut sabonner et récupérer les items"}.
{"Anyone with Voice","Nimporte qui avec Voice"}.
{"Anyone","Nimporte qui"}.
{"April","Avril"}.
{"Attribute 'channel' is required for this request","Lattribut « channel » est requis pour la requête"}.
{"Attribute 'id' is mandatory for MIX messages","Lattribut « id » est obligatoire pour les messages MIX"}.
{"Attribute 'jid' is not allowed here","Lattribut « jid » nest pas autorisé ici"}.
{"Attribute 'node' is not allowed here","Lattribut « node » nest pas autorisé ici"}.
{"Attribute 'to' of stanza that triggered challenge","Lattribut « to » de la strophe qui a déclenché le défi"}.
{"August","Août"}.
{"Automatic node creation is not enabled","La creation implicite de nœud n'est pas disponible"}.
{"Backup Management","Gestion des sauvegardes"}.
@@ -43,10 +71,14 @@
{"Cannot remove active list","La liste active ne peut être supprimée"}.
{"Cannot remove default list","La liste par défaut ne peut être supprimée"}.
{"CAPTCHA web page","Page web de CAPTCHA"}.
{"Challenge ID","Identifiant du défi"}.
{"Change Password","Modifier le mot de passe"}.
{"Change User Password","Changer le mot de passe de l'utilisateur"}.
{"Changing password is not allowed","La modification du mot de passe n'est pas autorisée"}.
{"Changing role/affiliation is not allowed","La modification role/affiliation n'est pas autorisée"}.
{"Channel already exists","Ce canal existe déjà"}.
{"Channel does not exist","Le canal nexiste pas"}.
{"Channels","Canaux"}.
{"Characters not allowed:","Caractères non autorisés :"}.
{"Chatroom configuration modified","Configuration du salon modifiée"}.
{"Chatroom is created","Le salon de discussion est créé"}.
@@ -58,30 +90,39 @@
{"Choose storage type of tables","Choisissez un type de stockage pour les tables"}.
{"Choose whether to approve this entity's subscription.","Choisissez d'approuver ou non l'abonnement de cette entité."}.
{"City","Ville"}.
{"Client acknowledged more stanzas than sent by server","Le client accuse réception de plus de strophes que ce qui est envoyé par le serveur"}.
{"Commands","Commandes"}.
{"Conference room does not exist","Le salon de discussion n'existe pas"}.
{"Configuration of room ~s","Configuration pour le salon ~s"}.
{"Configuration","Configuration"}.
{"Connected Resources:","Ressources connectées :"}.
{"Contact Addresses (normally, room owner or owners)","Adresses de contact (normalement les administrateurs du salon)"}.
{"Country","Pays"}.
{"CPU Time:","Temps CPU :"}.
{"Current Discussion Topic","Sujet de discussion courant"}.
{"Database failure","Échec sur la base de données"}.
{"Database Tables at ~p","Tables de base de données sur ~p"}.
{"Database Tables Configuration at ","Configuration des tables de base de données sur "}.
{"Database","Base de données"}.
{"December","Décembre"}.
{"Default users as participants","Les utilisateurs sont participant par défaut"}.
{"Delete content","Supprimer le contenu"}.
{"Delete message of the day on all hosts","Supprimer le message du jour sur tous les domaines"}.
{"Delete message of the day","Supprimer le message du jour"}.
{"Delete Selected","Suppression des éléments sélectionnés"}.
{"Delete table","Supprimer la table"}.
{"Delete User","Supprimer l'utilisateur"}.
{"Deliver event notifications","Envoyer les notifications d'événement"}.
{"Deliver payloads with event notifications","Inclure le contenu du message avec la notification"}.
{"Description:","Description :"}.
{"Disc only copy","Copie sur disque uniquement"}.
{"'Displayed groups' not added (they do not exist!): ","« Groupes affichés » non ajoutés (ils nexistent pas!) : "}.
{"Displayed:","Affichés :"}.
{"Don't tell your password to anybody, not even the administrators of the XMPP server.","Ne révélez votre mot de passe à personne, pas même aux administrateurs du serveur XMPP."}.
{"Dump Backup to Text File at ","Enregistrer la sauvegarde dans un fichier texte sur "}.
{"Dump to Text File","Sauvegarder dans un fichier texte"}.
{"Duplicated groups are not allowed by RFC6121","Les groupes dupliqués ne sont pas autorisés par la RFC6121"}.
{"Dynamically specify a replyto of the item publisher","Spécifie dynamiquement un « réponse à » de litem de l’éditeur"}.
{"Edit Properties","Modifier les propriétés"}.
{"Either approve or decline the voice request.","Accepter ou refuser la demande de voix."}.
{"ejabberd MUC module","Module MUC ejabberd"}.
@@ -116,6 +157,7 @@
{"Failed to parse HTTP response","Échec de lecture de la réponse HTTP"}.
{"Failed to process option '~s'","Échec de traitement de l'option '~s'"}.
{"Family Name","Nom de famille"}.
{"FAQ Entry","Entrée FAQ"}.
{"February","Février"}.
{"File larger than ~w bytes","Taille de fichier suppérieur à ~w octets"}.
{"Fill in the form to search for any matching XMPP User","Complétez le formulaire pour rechercher un utilisateur XMPP correspondant"}.
@@ -176,6 +218,7 @@
{"July","Juillet"}.
{"June","Juin"}.
{"Just created","Vient d'être créé"}.
{"Label:","Étiquette :"}.
{"Last Activity","Dernière activité"}.
{"Last login","Dernière connexion"}.
{"Last month","Dernier mois"}.
@@ -192,7 +235,6 @@
{"Make room public searchable","Rendre le salon public"}.
{"Malformed username","Nom d'utilisateur invalide"}.
{"March","Mars"}.
{"Max # of items to persist","Nombre maximum d'éléments à stocker"}.
{"Max payload size in bytes","Taille maximum pour le contenu du message en octet"}.
{"Maximum file size","Taille maximale du fichier"}.
{"Maximum Number of History Messages Returned by Room","Nombre maximal de messages d'historique renvoyés par salle"}.
@@ -274,6 +316,7 @@
{"Online Users:","Utilisateurs connectés :"}.
{"Online Users","Utilisateurs en ligne"}.
{"Online","En ligne"}.
{"Only admins can see this","Seuls les administrateurs peuvent voir cela"}.
{"Only deliver notifications to available users","Envoyer les notifications uniquement aux utilisateurs disponibles"}.
{"Only <enable/> or <disable/> tags are allowed","Seul le tag <enable/> ou <disable/> est autorisé"}.
{"Only <list/> element is allowed in this query","Seul l'élément <list/> est autorisé dans cette requête"}.
@@ -283,6 +326,7 @@
{"Only moderators can approve voice requests","Seuls les modérateurs peuvent accépter les requêtes voix"}.
{"Only occupants are allowed to send messages to the conference","Seuls les occupants peuvent envoyer des messages à la conférence"}.
{"Only occupants are allowed to send queries to the conference","Seuls les occupants sont autorisés à envoyer des requêtes à la conférence"}.
{"Only publishers may publish","Seuls les éditeurs peuvent publier"}.
{"Only service administrators are allowed to send service messages","Seuls les administrateurs du service sont autoriser à envoyer des messages de service"}.
{"Organization Name","Nom de l'organisation"}.
{"Organization Unit","Unité de l'organisation"}.
@@ -290,6 +334,7 @@
{"Outgoing s2s Connections:","Connexions s2s sortantes :"}.
{"Owner privileges required","Les droits de propriétaire sont nécessaires"}.
{"Packet","Paquet"}.
{"Participant","Participant"}.
{"Password Verification","Vérification du mot de passe"}.
{"Password Verification:","Vérification du mot de passe :"}.
{"Password","Mot de passe"}.
@@ -323,6 +368,9 @@
{"Remove User","Supprimer l'utilisateur"}.
{"Remove","Supprimer"}.
{"Replaced by new connection","Remplacé par une nouvelle connexion"}.
{"Request has timed out","La demande a expiré"}.
{"Request is ignored","La demande est ignorée"}.
{"Requested role","Rôle demandé"}.
{"Resources","Ressources"}.
{"Restart Service","Redémarrer le service"}.
{"Restart","Redémarrer"}.
+90 -10
View File
@@ -13,8 +13,10 @@
{"Accept","Diterima"}.
{"Access denied by service policy","Akses ditolak oleh kebijakan layanan"}.
{"Access model of authorize","Model akses otorisasi"}.
{"Access model of open","Model akses terbuka"}.
{"Access model of presence","Model akses kehadiran"}.
{"Access model of roster","model akses daftar kontak"}.
{"Access model of whitelist","Model akses daftar putih"}.
{"Access model","Model akses"}.
{"Account doesn't exist","Akun tidak ada"}.
{"Action on user","Tindakan pada pengguna"}.
@@ -34,7 +36,9 @@
{"Allow users to send invites","Perbolehkan pengguna mengirimkan undangan"}.
{"Allow users to send private messages","perbolehkan pengguna mengirimkan pesan ke pengguna lain secara pribadi"}.
{"Allow visitors to change nickname","Perbolehkan visitor mengganti nama julukan"}.
{"Allow visitors to send private messages to","Izinkan pengunjung mengirimkan pesan privat ke"}.
{"Allow visitors to send status text in presence updates","Izinkan pengunjung untuk mengirim teks status terbaru"}.
{"Allow visitors to send voice requests","Izinkan pengunjung mengirim permintaan suara"}.
{"Announcements","Pengumuman"}.
{"Answer associated with a picture","Jawaban yang berhubungan dengan gambar"}.
{"Answer associated with a video","Jawaban yang berhubungan dengan video"}.
@@ -44,6 +48,7 @@
{"Anyone may publish","Siapapun dapat mempublikasi"}.
{"Anyone may subscribe and retrieve items","Siapapun dapat berlangganan dan mengambil item"}.
{"Anyone with Voice","Siapapun dengan fungsi suara"}.
{"Anyone","Siapapun"}.
{"April","April"}.
{"Attribute 'channel' is required for this request","Atribut 'channel' diperlukan untuk permintaan ini"}.
{"Attribute 'id' is mandatory for MIX messages","Atribut 'id' harus ada untuk pesan MIX"}.
@@ -112,8 +117,9 @@
{"Don't tell your password to anybody, not even the administrators of the XMPP server.","Jangan beritahukan kata sandi Anda ke siapapun, bahkan ke administrator layanan XMPP."}.
{"Dump Backup to Text File at ","Dump Backup menjadi File Teks di "}.
{"Dump to Text File","Dump menjadi File Teks"}.
{"Duplicated groups are not allowed by RFC6121","Grup duplikat tidak diperbolehkan oleh RFC6121"}.
{"Edit Properties","Ganti Properti"}.
{"Either approve or decline the voice request.","Antara terima atau tolak permintaan suara"}.
{"Either approve or decline the voice request.","Antara terima atau tolak permintaan suara."}.
{"ejabberd HTTP Upload service","Layanan HTTP Upload ejabberd"}.
{"ejabberd MUC module","Modul MUC ejabberd"}.
{"ejabberd Multicast service","Layanan Multicast ejabberd"}.
@@ -135,8 +141,10 @@
{"Enter path to jabberd14 spool file","Masukkan path ke file jabberd14 spool"}.
{"Enter path to text file","Masukkan path ke file teks"}.
{"Enter the text you see","Masukkan teks yang Anda lihat"}.
{"Erlang XMPP Server","Server Erlang XMPP"}.
{"Error","Kesalahan"}.
{"Exclude Jabber IDs from CAPTCHA challenge","Kecualikan Jabber IDs dari tantangan CAPTCHA"}.
{"Export all tables as SQL queries to a file:","Ekspor semua tabel sebagai kueri SQL ke file:"}.
{"Export data of all users in the server to PIEFXIS files (XEP-0227):","Ekspor data dari semua pengguna pada layanan ke berkas PIEFXIS (XEP-0227):"}.
{"Export data of users in a host to PIEFXIS files (XEP-0227):","Ekspor data pengguna pada sebuah host ke berkas PIEFXIS (XEP-0227):"}.
{"External component failure","Kegagalan komponen eksternal"}.
@@ -149,6 +157,7 @@
{"FAQ Entry","Entri FAQ"}.
{"February","Februari"}.
{"File larger than ~w bytes","File lebih besar dari ~w bytes"}.
{"Fill in the form to search for any matching XMPP User","Isi kolom untuk mencari pengguna XMPP"}.
{"Friday","Jumat"}.
{"From ~ts","Dari ~ts"}.
{"From","Dari"}.
@@ -161,8 +170,11 @@
{"Get User Last Login Time","Lihat Waktu Login Terakhir Pengguna"}.
{"Get User Password","Dapatkan User Password"}.
{"Get User Statistics","Dapatkan Statistik Pengguna"}.
{"Given Name","Nama"}.
{"Grant voice to this person?","Ijinkan akses suara kepadanya?"}.
{"Group","Grup"}.
{"Groups that will be displayed to the members","Grup yang akan ditampilkan kepada anggota"}.
{"Groups","Grup"}.
{"has been banned","telah dibanned"}.
{"has been kicked because of a system shutdown","telah dikick karena sistem shutdown"}.
{"has been kicked because of an affiliation change","telah dikick karena perubahan afiliasi"}.
@@ -170,17 +182,27 @@
{"has been kicked","telah dikick"}.
{"Host unknown","Host tidak dikenal"}.
{"Host","Host"}.
{"HTTP File Upload","Unggah Berkas HTTP"}.
{"Idle connection","Koneksi menganggur"}.
{"If you don't see the CAPTCHA image here, visit the web page.","Jika Anda tidak melihat gambar CAPTCHA disini, silahkan kunjungi halaman web."}.
{"Import Directory","Impor Direktori"}.
{"Import File","Impor File"}.
{"Import user data from jabberd14 spool file:","Impor data pengguna dari sekumpulan berkas jabberd14:"}.
{"Import User from File at ","Impor Pengguna dari File pada"}.
{"Import User from File at ","Impor Pengguna dari File pada "}.
{"Import users data from a PIEFXIS file (XEP-0227):","impor data-data pengguna dari sebuah PIEFXIS (XEP-0227):"}.
{"Import users data from jabberd14 spool directory:","Импорт пользовательских данных из буферной директории jabberd14:"}.
{"Import Users from Dir at ","Impor Pengguna dari Dir di"}.
{"Import Users from Dir at ","Impor Pengguna dari Dir di "}.
{"Import Users From jabberd14 Spool Files","Impor Pengguna Dari jabberd14 Spool File"}.
{"Improper message type","Jenis pesan yang tidak benar"}.
{"Incoming s2s Connections:","Koneksi s2s masuk:"}.
{"Incorrect CAPTCHA submit","Isian CAPTCHA salah"}.
{"Incorrect data form","Formulir data salah"}.
{"Incorrect password","Kata sandi salah"}.
{"Incorrect value of 'action' attribute","Nilai atribut 'aksi' salah"}.
{"Incorrect value of 'action' in data form","Nilai 'tindakan' yang salah dalam formulir data"}.
{"Insufficient privilege","Hak tidak mencukupi"}.
{"Internal server error","Galat server internal"}.
{"Invalid node name","Nama node tidak valid"}.
{"IP addresses","Alamat IP"}.
{"is now known as","sekarang dikenal sebagai"}.
{"It is not allowed to send private messages of type \"groupchat\"","Hal ini tidak diperbolehkan untuk mengirim pesan pribadi jenis \"groupchat \""}.
@@ -217,15 +239,17 @@
{"Moderator privileges required","Hak istimewa moderator dibutuhkan"}.
{"Modified modules","Modifikasi modul-modul"}.
{"Monday","Senin"}.
{"Multiple <item/> elements are not allowed by RFC6121","Beberapa elemen <item/> tidak diizinkan oleh RFC6121"}.
{"Name","Nama"}.
{"Name:","Nama:"}.
{"Never","Tidak Pernah"}.
{"New Password:","Password Baru:"}.
{"Nickname Registration at ","Pendaftaran Julukan pada"}.
{"Nickname Registration at ","Pendaftaran Julukan pada "}.
{"Nickname ~s does not exist in the room","Nama Julukan ~s tidak berada di dalam ruangan"}.
{"Nickname","Nama Julukan"}.
{"No body provided for announce message","Tidak ada isi pesan yang disediakan untuk mengirimkan pesan"}.
{"No Data","Tidak Ada Data"}.
{"No <forwarded/> element found","Tidak ada elemen <forwarded/> yang ditemukan"}.
{"No limit","Tidak terbatas"}.
{"Node ID","ID Node"}.
{"Node not found","Node tidak ditemukan"}.
@@ -259,28 +283,45 @@
{"Outgoing s2s Connections:","Koneksi s2s yang keluar:"}.
{"Owner privileges required","Hak istimewa owner dibutuhkan"}.
{"Packet","Paket"}.
{"Participant","Partisipan"}.
{"Password Verification:","Verifikasi Kata Sandi:"}.
{"Password Verification","Verifikasi Sandi"}.
{"Password:","Kata Sandi:"}.
{"Password","Sandi"}.
{"Path to Dir","Jalur ke Dir"}.
{"Path to File","Jalur ke File"}.
{"Payload type","Tipe payload"}.
{"Pending","Tertunda"}.
{"Period: ","Periode:"}.
{"Period: ","Periode: "}.
{"Persist items to storage","Pertahankan item ke penyimpanan"}.
{"Persistent","Persisten"}.
{"Ping query is incorrect","Kueri ping salah"}.
{"Ping","Ping"}.
{"Please note that these options will only backup the builtin Mnesia database. If you are using the ODBC module, you also need to backup your SQL database separately.","Harap dicatat bahwa pilihan ini hanya akan membuat cadangan builtin Mnesia database. Jika Anda menggunakan modul ODBC, anda juga perlu untuk membuat cadangan database SQL Anda secara terpisah."}.
{"Pong","Pong"}.
{"Present real Jabber IDs to","Tampilkan Jabber ID secara lengkap"}.
{"Previous session not found","Sesi sebelumnya tidak ditemukan"}.
{"Previous session PID has been killed","Sesi PID sebelumnya telah dimatikan"}.
{"Previous session PID has exited","Sesi PID sebelumnya telah keluar"}.
{"Previous session PID is dead","Sesi PID sebelumnya mati"}.
{"Previous session timed out","Sesi sebelumnya habis waktu"}.
{"private, ","pribadi, "}.
{"Public","Publik"}.
{"Publish model","Model penerbitan"}.
{"Publish-Subscribe","Setujui-Pertemanan"}.
{"PubSub subscriber request","Permintaan pertemanan PubSub"}.
{"Purge all items when the relevant publisher goes offline","Bersihkan semua item ketika penerbit yang relevan telah offline"}.
{"Queries to the conference members are not allowed in this room","Permintaan untuk para anggota konferensi tidak diperbolehkan di ruangan ini"}.
{"Query to another users is forbidden","Kueri ke pengguna lain dilarang"}.
{"RAM and disc copy","RAM dan disc salinan"}.
{"RAM copy","Salinan RAM"}.
{"Really delete message of the day?","Benar-benar ingin menghapus pesan harian?"}.
{"Receive notification from all descendent nodes","Terima notifikasi dari semua node turunan"}.
{"Receive notification from direct child nodes only","Terima notifikasi dari child node saja"}.
{"Receive notification of new items only","Terima notifikasi dari item baru saja"}.
{"Receive notification of new nodes only","Terima notifikasi dari node baru saja"}.
{"Recipient is not in the conference room","Penerima tidak berada di ruangan konferensi"}.
{"Register an XMPP account","Daftarkan sebuah akun XMPP"}.
{"Registered Users","Pengguna Terdaftar"}.
{"Registered Users:","Pengguna Terdaftar:"}.
{"Register","Mendaftar"}.
@@ -289,28 +330,39 @@
{"Remove User","Hapus Pengguna"}.
{"Remove","Menghapus"}.
{"Replaced by new connection","Diganti dengan koneksi baru"}.
{"Request has timed out","Waktu permintaan telah habis"}.
{"Request is ignored","Permintaan diabaikan"}.
{"Requested role","Peran yang diminta"}.
{"Resources","Sumber daya"}.
{"Restart Service","Restart Layanan"}.
{"Restart","Jalankan Ulang"}.
{"Restore Backup from File at ","Kembalikan Backup dari File pada"}.
{"Restore Backup from File at ","Kembalikan Backup dari File pada "}.
{"Restore binary backup after next ejabberd restart (requires less memory):","Mengembalikan cadangan yang berpasanagn setelah ejabberd berikutnya dijalankan ulang (memerlukan memori lebih sedikit):"}.
{"Restore binary backup immediately:","Segera mengembalikan cadangan yang berpasangan:"}.
{"Restore plain text backup immediately:","Segera mengembalikan cadangan teks biasa:"}.
{"Restore","Mengembalikan"}.
{"Roles that May Send Private Messages","Peran yang Dapat Mengirim Pesan Pribadi"}.
{"Room Configuration","Konfigurasi Ruangan"}.
{"Room creation is denied by service policy","Pembuatan Ruangan ditolak oleh kebijakan layanan"}.
{"Room description","Keterangan ruangan"}.
{"Room Occupants","Penghuni Ruangan"}.
{"Room terminates","Ruang dihentikan"}.
{"Room title","Nama Ruangan"}.
{"Roster groups allowed to subscribe","Kelompok kontak yang diizinkan untuk berlangganan"}.
{"Roster of ~ts","Daftar ~ts"}.
{"Roster size","Ukuran Daftar Kontak"}.
{"Roster:","Daftar:"}.
{"RPC Call Error","Panggilan Kesalahan RPC"}.
{"Running Nodes","Menjalankan Node"}.
{"~s invites you to the room ~s","~s mengundang anda masuk kamar ~s"}.
{"Saturday","Sabtu"}.
{"Script check","Periksa naskah"}.
{"Search Results for ","Hasil Pencarian untuk"}.
{"Search users in ","Pencarian pengguna dalam"}.
{"Search from the date","Cari dari tanggal"}.
{"Search Results for ","Hasil Pencarian untuk "}.
{"Search the text","Cari teks"}.
{"Search until the date","Cari sampai tanggal"}.
{"Search users in ","Pencarian pengguna dalam "}.
{"Select All","Pilih Semua"}.
{"Send announcement to all online users on all hosts","Kirim pengumuman untuk semua pengguna yang online pada semua host"}.
{"Send announcement to all online users","Kirim pengumuman untuk semua pengguna yang online"}.
{"Send announcement to all users on all hosts","Kirim pengumuman untuk semua pengguna pada semua host"}.
@@ -323,9 +375,11 @@
{"Show Integral Table","Tampilkan Tabel Terpisah"}.
{"Show Ordinary Table","Tampilkan Tabel Normal"}.
{"Shut Down Service","Shut Down Layanan"}.
{"SOCKS5 Bytestreams","SOCKS5 Bytestreams"}.
{"Specify the access model","Tentukan model akses"}.
{"Specify the event message type","Tentukan jenis acara pesan"}.
{"Specify the publisher model","Tentukan model penerbitan"}.
{"Stanza ID","ID Stanza"}.
{"Statistics of ~p","statistik dari ~p"}.
{"Statistics","Statistik"}.
{"Stop","Hentikan"}.
@@ -333,18 +387,35 @@
{"Storage Type","Jenis Penyimpanan"}.
{"Store binary backup:","Penyimpanan cadangan yang berpasangan:"}.
{"Store plain text backup:","Simpan cadangan teks biasa:"}.
{"Stream management is already enabled","Manajemen stream sudah diaktifkan"}.
{"Stream management is not enabled","Manajemen stream tidak diaktifkan"}.
{"Subject","Subyek"}.
{"Submit","Serahkan"}.
{"Submitted","Ulangi masukan"}.
{"Subscriber Address","Alamat Pertemanan"}.
{"Subscribers may publish","Pelanggan dapat mempublikasikan"}.
{"Subscription","Berlangganan"}.
{"Subscriptions are not allowed","Langganan tidak diperbolehkan"}.
{"Sunday","Minggu"}.
{"Text associated with a picture","Teks yang terkait dengan gambar"}.
{"Text associated with a sound","Teks yang terkait dengan suara"}.
{"Text associated with a video","Teks yang terkait dengan video"}.
{"Text associated with speech","Teks yang terkait dengan ucapan"}.
{"That nickname is already in use by another occupant","Julukan itu sudah digunakan oleh penghuni lain"}.
{"That nickname is registered by another person","Julukan tersebut telah didaftarkan oleh orang lain"}.
{"The account was not unregistered","Akun tidak terdaftar"}.
{"The CAPTCHA is valid.","Captcha ini benar."}.
{"The CAPTCHA verification has failed","Verifikasi CAPTCHA telah gagal"}.
{"The captcha you entered is wrong","Isian captcha yang anda masukkan salah"}.
{"The collections with which a node is affiliated","Koleksi dengan yang berafiliasi dengan sebuah node"}.
{"The JID of the node creator","JID dari pembuat node"}.
{"The JIDs of those to contact with questions","JID dari mereka untuk dihubungi dengan pertanyaan"}.
{"The JIDs of those with an affiliation of owner","JID dari mereka yang memiliki afiliasi pemilik"}.
{"The JIDs of those with an affiliation of publisher","JID dari mereka yang memiliki afiliasi penerbit"}.
{"The name of the node","Nama node"}.
{"The node is a collection node","Node adalah node koleksi"}.
{"The node is a leaf node (default)","Node adalah leaf node (default)"}.
{"The NodeID of the relevant node","NodeID dari node yang relevan"}.
{"The number of subscribers to the node","Jumlah pendaftar di node"}.
{"The number of unread or undelivered messages","Jumlah pesan yang belum dibaca atau tidak terkirim"}.
{"The password contains unacceptable characters","Kata sandi mengandung karakter yang tidak dapat diterima"}.
@@ -352,10 +423,12 @@
{"the password is","kata sandinya"}.
{"The password was not changed","Kata sandi belum berubah"}.
{"The passwords are different","Kata sandi berbeda"}.
{"The username is not valid","Nama pengguna tidak valid"}.
{"There was an error changing the password: ","Ada kesalahan saat merubah kata kunci: "}.
{"There was an error creating the account: ","Ada kesalahan saat membuat akun: "}.
{"There was an error deleting the account: ","Ada kesalahan saat menghapus akun:"}.
{"There was an error deleting the account: ","Ada kesalahan saat menghapus akun: "}.
{"This room is not anonymous","Ruangan ini tidak dikenal"}.
{"This service can not process the address: ~s","Layanan ini tidak dapat memproses alamat: ~s"}.
{"Thursday","Kamis"}.
{"Time delay","Waktu tunda"}.
{"Time","Waktu"}.
@@ -363,10 +436,13 @@
{"To ~ts","Kepada ~ts"}.
{"Token TTL","TTL Token"}.
{"To","Kepada"}.
{"Too many active bytestreams","Terlalu banyak bytestream aktif"}.
{"Too many CAPTCHA requests","Terlalu banyak permintaan CAPTCHA"}.
{"Too many child elements","Terlalu banyak elemen turunan"}.
{"Too many <item/> elements","Terlalu banyak <item/> elemen"}.
{"Too many <list/> elements","Terlalu banyak <list/> elemen"}.
{"Too many (~p) failed authentications from this IP address (~s). The address will be unblocked at ~s UTC","Terlalu banyak (~p) percobaan otentifikasi yang gagal dari alamat IP (~s). Alamat akan di unblok pada ~s UTC"}.
{"Too many receiver fields were specified","Terlalu banyak bidang penerima yang ditentukan"}.
{"Too many users in this conference","Terlalu banyak pengguna di grup ini"}.
{"Total rooms","Total kamar"}.
{"Traffic rate limit is exceeded","Batas tingkat lalu lintas terlampaui"}.
@@ -377,6 +453,7 @@
{"~ts's Offline Messages Queue","~ts's antrian Pesan Offline"}.
{"Tuesday","Selasa"}.
{"Unable to generate a CAPTCHA","Tidak dapat menghasilkan CAPTCHA"}.
{"Unable to register route on existing local domain","Tidak dapat mendaftarkan rute di domain lokal yang ada"}.
{"Unauthorized","Ditolak"}.
{"Unexpected action","Aksi yang tidak diharapkan"}.
{"Unexpected error condition: ~p","Kondisi kerusakan yang tidak diduga: ~p"}.
@@ -414,7 +491,7 @@
{"vCard User Search","vCard Pencarian Pengguna"}.
{"View Queue","Lihat antrian"}.
{"View Roster","Lihat daftar kontak"}.
{"Virtual Hosts","Virtual Hosts"}.
{"Virtual Hosts","Host Virtual"}.
{"Visitors are not allowed to change their nicknames in this room","Tamu tidak diperbolehkan untuk mengubah nama panggilan di ruangan ini"}.
{"Visitors are not allowed to send messages to all occupants","Tamu tidak diperbolehkan untuk mengirim pesan ke semua penghuni"}.
{"Visitor","Tamu"}.
@@ -428,11 +505,14 @@
{"Whether an entity wants to receive digests (aggregations) of notifications or all notifications individually","Apakah entitas ingin menerima ringkasan(agregasi) pemberitahuan atau semua pemberitahuan satu per satu"}.
{"Whether an entity wants to receive or disable notifications","Apakah entitas ingin menerima atau menonaktifkan pemberitahuan"}.
{"Whether owners or publisher should receive replies to items","Apakah pemilik atau penerbit harus menerima balasan dari item"}.
{"Whether the node is a leaf (default) or a collection","Apakah node adalah leaf (default) atau koleksi"}.
{"Whether to allow subscriptions","Apakah diperbolehkan untuk berlangganan"}.
{"Whether to make all subscriptions temporary, based on subscriber presence","Apakah akan menjadikan semua langganan sementara, berdasarkan keberadaan pelanggan"}.
{"Whether to notify owners about new subscribers and unsubscribes","Apakah akan memberi tahu pemilik tentang pelanggan baru dan berhenti berlangganan"}.
{"Who may associate leaf nodes with a collection","Siapa yang dapat mengaitkan leaf node dengan koleksi"}.
{"Wrong parameters in the web formulary","Parameter yang salah di formula web"}.
{"Wrong xmlns","xmlns salah"}.
{"XMPP Account Registration","Pendaftaran Akun XMPP"}.
{"XMPP Domains","Domain XMPP"}.
{"XMPP Show Value of Away","XMPP menunjukkan status Away"}.
{"XMPP Show Value of Chat","XMPP menunjukkan status Chat"}.
+1
View File
@@ -3,6 +3,7 @@
%% To improve translations please read:
%% https://docs.ejabberd.im/developer/extending-ejabberd/localization/
{" (Add * to the end of field to match substring)"," Riempire il modulo per la ricerca di utenti Jabber corrispondenti ai criteri (Aggiungere * alla fine del campo per la ricerca di una sottostringa"}.
{" has set the subject to: "," ha modificato l'oggetto in: "}.
{"A friendly name for the node","Un nome comodo per il nodo"}.
{"A password is required to enter this room","Per entrare in questa stanza è prevista una password"}.
+560 -1
View File
@@ -3,103 +3,662 @@
%% To improve translations please read:
%% https://docs.ejabberd.im/developer/extending-ejabberd/localization/
{" (Add * to the end of field to match substring)"," (Adicione * no final do campo para combinar com a substring)"}.
{" has set the subject to: "," colocou o tópico: "}.
{"# participants","# participantes"}.
{"A description of the node","Uma descrição do nó"}.
{"A friendly name for the node","Um nome familiar para o nó"}.
{"A password is required to enter this room","Se necessita palavra-passe para entrar nesta sala"}.
{"A Web Page","Uma página da web"}.
{"Accept","Aceito"}.
{"Access denied by service policy","Acesso negado pela política de serviço"}.
{"Access model of authorize","Modelo de acesso da autorização"}.
{"Access model of open","Modelo para acesso aberto"}.
{"Access model of presence","Modelo para acesso presença"}.
{"Access model of roster","Modelo para acesso lista"}.
{"Access model of whitelist","Modelo de acesso da lista branca"}.
{"Access model","Modelo de acesso"}.
{"Account doesn't exist","A conta não existe"}.
{"Action on user","Acção no utilizador"}.
{"Add Jabber ID","Adicionar ID jabber"}.
{"Add New","Adicionar novo"}.
{"Add User","Adicionar utilizador"}.
{"Administration of ","Administração de "}.
{"Administration","Administração"}.
{"Administrator privileges required","São necessários privilégios de administrador"}.
{"All activity","Todas atividades"}.
{"All Users","Todos os utilizadores"}.
{"Allow subscription","Permitir a assinatura"}.
{"Allow this Jabber ID to subscribe to this pubsub node?","Autorizar este Jabber ID para a inscrição neste tópico pubsub?"}.
{"Allow this person to register with the room?","Permita que esta pessoa se registe na sala?"}.
{"Allow users to change the subject","Permitir a utilizadores modificar o assunto"}.
{"Allow users to query other users","Permitir a utilizadores pesquisar informações sobre os demais"}.
{"Allow users to send invites","Permitir a utilizadores envio de convites"}.
{"Allow users to send private messages","Permitir a utilizadores enviarem mensagens privadas"}.
{"Allow visitors to change nickname","Permitir mudança de apelido aos visitantes"}.
{"Allow visitors to send private messages to","Permitir visitantes enviar mensagem privada para"}.
{"Allow visitors to send status text in presence updates","Permitir atualizações de estado aos visitantes"}.
{"Allow visitors to send voice requests","Permitir aos visitantes o envio de requisições de voz"}.
{"An associated LDAP group that defines room membership; this should be an LDAP Distinguished Name according to an implementation-specific or deployment-specific definition of a group.","Um grupo LDAP associado que define a adesão à sala; este deve ser um Nome Distinto LDAP de acordo com uma definição específica da implementação ou da implantação específica de um grupo."}.
{"Announcements","Anúncios"}.
{"Answer associated with a picture","Resposta associada com uma foto"}.
{"Answer associated with a video","Resposta associada com um vídeo"}.
{"Answer associated with speech","Resposta associada com a fala"}.
{"Answer to a question","Resposta para uma pergunta"}.
{"Anyone in the specified roster group(s) may subscribe and retrieve items","Qualquer pessoa do(s) grupo(s) informado(s) podem se inscrever e recuperar itens"}.
{"Anyone may associate leaf nodes with the collection","Qualquer pessoa pode associar nós das páginas à coleção"}.
{"Anyone may publish","Qualquer pessoa pode publicar"}.
{"Anyone may subscribe and retrieve items","Qualquer pessoa pode se inscrever e recuperar os itens"}.
{"Anyone with a presence subscription of both or from may subscribe and retrieve items","Qualquer pessoa com uma assinatura presente dos dois ou de ambos pode se inscrever e recuperar os itens"}.
{"Anyone with Voice","Qualquer pessoa com voz"}.
{"Anyone","Qualquer pessoa"}.
{"April","Abril"}.
{"Attribute 'channel' is required for this request","O atributo 'canal' é necessário para esta solicitação"}.
{"Attribute 'id' is mandatory for MIX messages","O atributo 'id' é obrigatório para mensagens MIX"}.
{"Attribute 'jid' is not allowed here","O atributo 'jid' não é permitido aqui"}.
{"Attribute 'node' is not allowed here","O Atributo 'nó' não é permitido aqui"}.
{"Attribute 'to' of stanza that triggered challenge","O atributo 'para' da estrofe que desencadeou o desafio"}.
{"August","Agosto"}.
{"Automatic node creation is not enabled","Criação automatizada de nós está desativada"}.
{"Backup Management","Gestão de cópias de segurança"}.
{"Backup of ~p","Backup de ~p"}.
{"Backup to File at ","Guardar cópia de segurança para ficheiro em "}.
{"Backup","Guardar cópia de segurança"}.
{"Bad format","Formato incorreto"}.
{"Birthday","Data de nascimento"}.
{"Both the username and the resource are required","Nome de utilizador e recurso são necessários"}.
{"Bytestream already activated","Bytestream já foi ativado"}.
{"Cannot remove active list","Não é possível remover uma lista ativa"}.
{"Cannot remove default list","Não é possível remover uma lista padrão"}.
{"CAPTCHA web page","CAPTCHA web page"}.
{"Challenge ID","ID do desafio"}.
{"Change Password","Mudar palavra-chave"}.
{"Change User Password","Alterar Palavra-passe do Utilizador"}.
{"Changing password is not allowed","Não é permitida a alteração da palavra-passe"}.
{"Changing role/affiliation is not allowed","Não é permitida a alteração da função/afiliação"}.
{"Channel already exists","O canal já existe"}.
{"Channel does not exist","O canal não existe"}.
{"Channels","Canais"}.
{"Characters not allowed:","Caracteres não aceitos:"}.
{"Chatroom configuration modified","Configuração da sala de bate-papo modificada"}.
{"Chatroom is created","A sala de chat está criada"}.
{"Chatroom is destroyed","A sala de chat está destruída"}.
{"Chatroom is started","A sala de chat está iniciada"}.
{"Chatroom is stopped","A sala de chat está parada"}.
{"Chatrooms","Salas de Chat"}.
{"Choose a username and password to register with this server","Escolha um nome de utilizador e palavra-chave para se registar neste servidor"}.
{"Choose storage type of tables","Seleccione o tipo de armazenagem das tabelas"}.
{"Choose whether to approve this entity's subscription.","Aprovar esta assinatura."}.
{"City","Cidade"}.
{"Client acknowledged more stanzas than sent by server","O cliente reconheceu mais estrofes do que as enviadas pelo servidor"}.
{"Commands","Comandos"}.
{"Conference room does not exist","A sala não existe"}.
{"Configuration of room ~s","Configuração para ~s"}.
{"Configuration","Configuração"}.
{"Connected Resources:","Recursos conectados:"}.
{"Contact Addresses (normally, room owner or owners)","Endereços de contato (normalmente, o proprietário ou os proprietários da sala)"}.
{"Country","País"}.
{"CPU Time:","Tempo da CPU:"}.
{"Current Discussion Topic","Assunto em discussão"}.
{"Database failure","Falha no banco de dados"}.
{"Database Tables at ~p","Tabelas da Base de dados em ~p"}.
{"Database Tables Configuration at ","Configuração de Tabelas de Base de dados em "}.
{"Database","Base de dados"}.
{"December","Dezembro"}.
{"Default users as participants","Utilizadores padrões como participantes"}.
{"Delete content","Apagar o conteúdo"}.
{"Delete message of the day on all hosts","Apagar a mensagem do dia em todos os hosts"}.
{"Delete message of the day","Apagar mensagem do dia"}.
{"Delete Selected","Eliminar os seleccionados"}.
{"Delete table","Apagar a tabela"}.
{"Delete User","Deletar Utilizador"}.
{"Deliver event notifications","Entregar as notificações de evento"}.
{"Deliver payloads with event notifications","Enviar payloads junto com as notificações de eventos"}.
{"Description:","Descrição:"}.
{"Disc only copy","Cópia apenas em disco"}.
{"'Displayed groups' not added (they do not exist!): ","Os 'Grupos exibidos' não foi adicionado (eles não existem!): "}.
{"Displayed:","Exibido:"}.
{"Don't tell your password to anybody, not even the administrators of the XMPP server.","Não revele a sua palavra-passe a ninguém, nem mesmo para o administrador deste servidor XMPP."}.
{"Dump Backup to Text File at ","Exporta cópia de segurança para ficheiro de texto em "}.
{"Dump to Text File","Exportar para ficheiro de texto"}.
{"Duplicated groups are not allowed by RFC6121","Os grupos duplicados não são permitidos pela RFC6121"}.
{"Dynamically specify a replyto of the item publisher","Definir de forma dinâmica uma resposta da editora do item"}.
{"Edit Properties","Editar propriedades"}.
{"Either approve or decline the voice request.","Deve aprovar/desaprovar a requisição de voz."}.
{"ejabberd HTTP Upload service","serviço HTTP de upload ejabberd"}.
{"ejabberd MUC module","Módulo MUC de ejabberd"}.
{"ejabberd Multicast service","Serviço multicast ejabberd"}.
{"ejabberd Publish-Subscribe module","Módulo para Publicar Tópicos do ejabberd"}.
{"ejabberd SOCKS5 Bytestreams module","Modulo ejabberd SOCKS5 Bytestreams"}.
{"ejabberd vCard module","Módulo vCard de ejabberd"}.
{"ejabberd Web Admin","ejabberd Web Admin"}.
{"ejabberd","ejabberd"}.
{"Elements","Elementos"}.
{"Email Address","Endereço de e-mail"}.
{"Email","Email"}.
{"Enable logging","Permitir criação de logs"}.
{"Enable message archiving","Ativar arquivamento de mensagens"}.
{"Enabling push without 'node' attribute is not supported","Abilitar push sem o atributo 'node' não é suportado"}.
{"End User Session","Terminar Sessão do Utilizador"}.
{"Enter nickname you want to register","Introduza a alcunha que quer registar"}.
{"Enter path to backup file","Introduza o caminho do ficheiro de cópia de segurança"}.
{"Enter path to jabberd14 spool dir","Introduza o caminho para o directório de spools do jabberd14"}.
{"Enter path to jabberd14 spool file","Introduza o caminho para o ficheiro de spool do jabberd14"}.
{"Enter path to text file","Introduza caminho para o ficheiro de texto"}.
{"Enter the text you see","Insira o texto que vê"}.
{"Erlang XMPP Server","Servidor XMPP Erlang"}.
{"Error","Erro"}.
{"Exclude Jabber IDs from CAPTCHA challenge","Excluir IDs Jabber de serem submetidos ao CAPTCHA"}.
{"Export all tables as SQL queries to a file:","Exportar todas as tabelas como SQL para um ficheiro:"}.
{"Export data of all users in the server to PIEFXIS files (XEP-0227):","Exportar todos os dados de todos os utilizadores no servidor, para ficheiros de formato PIEFXIS (XEP-0227):"}.
{"Export data of users in a host to PIEFXIS files (XEP-0227):","Exportar dados dos utilizadores num host, para ficheiros de PIEFXIS (XEP-0227):"}.
{"External component failure","Falha de componente externo"}.
{"External component timeout","Tempo esgotado à espera de componente externo"}.
{"Failed to activate bytestream","Falha ao ativar bytestream"}.
{"Failed to extract JID from your voice request approval","Não foi possível extrair o JID (Jabber ID) da requisição de voz"}.
{"Failed to map delegated namespace to external component","Falha ao mapear namespace delegado ao componente externo"}.
{"Failed to parse HTTP response","Falha ao analisar resposta HTTP"}.
{"Failed to process option '~s'","Falha ao processar opção '~s'"}.
{"Family Name","Apelido"}.
{"FAQ Entry","Registo das perguntas frequentes"}.
{"February","Fevereiro"}.
{"File larger than ~w bytes","Ficheiro é maior que ~w bytes"}.
{"Fill in the form to search for any matching XMPP User","Preencha campos para procurar por quaisquer utilizadores XMPP"}.
{"Friday","Sexta"}.
{"From ~ts","De ~s"}.
{"From","De"}.
{"Full List of Room Admins","Lista completa dos administradores das salas"}.
{"Full List of Room Owners","Lista completa dos proprietários das salas"}.
{"Full Name","Nome completo"}.
{"Get Number of Online Users","Obter quantidade de utilizadores online"}.
{"Get Number of Registered Users","Obter quantidade de utilizadores registados"}.
{"Get Pending","Obter os pendentes"}.
{"Get User Last Login Time","Obter a data do último login"}.
{"Get User Password","Obter palavra-passe do utilizador"}.
{"Get User Statistics","Obter estatísticas do utilizador"}.
{"Given Name","Sobrenome"}.
{"Grant voice to this person?","Dar voz a esta pessoa?"}.
{"Group","Grupo"}.
{"Groups that will be displayed to the members","Os grupos que serão exibidos para os membros"}.
{"Groups","Grupos"}.
{"has been banned","foi banido"}.
{"has been kicked because of a system shutdown","foi desconectado porque o sistema foi desligado"}.
{"has been kicked because of an affiliation change","foi desconectado porque por afiliação inválida"}.
{"has been kicked because the room has been changed to members-only","foi desconectado porque a política da sala mudou, só membros são permitidos"}.
{"has been kicked","foi removido"}.
{"Host unknown","Máquina desconhecida"}.
{"Host","Máquina"}.
{"HTTP File Upload","Upload de ficheiros por HTTP"}.
{"Idle connection","Conexão inativa"}.
{"If you don't see the CAPTCHA image here, visit the web page.","Se não conseguir ver o CAPTCHA aqui, visite a web page."}.
{"Import Directory","Importar directório"}.
{"Import File","Importar ficheiro"}.
{"Import user data from jabberd14 spool file:","Importar dados dos utilizadores de uma fila jabberd14:"}.
{"Import User from File at ","Importar utilizador a partir do ficheiro em "}.
{"Import users data from a PIEFXIS file (XEP-0227):","Importe os utilizadores de um ficheiro PIEFXIS (XEP-0227):"}.
{"Import users data from jabberd14 spool directory:","Importar dados dos utilizadores de um diretório-fila jabberd14:"}.
{"Import Users from Dir at ","Importar utilizadores a partir do directório em "}.
{"Import Users From jabberd14 Spool Files","Importar utilizadores de ficheiros de jabberd14 (spool files)"}.
{"Improper domain part of 'from' attribute","Atributo 'from' contém domínio incorreto"}.
{"Improper message type","Tipo de mensagem incorrecto"}.
{"Incoming s2s Connections:","Conexões s2s de Entrada:"}.
{"Incorrect CAPTCHA submit","CAPTCHA submetido incorretamente"}.
{"Incorrect data form","Formulário dos dados incorreto"}.
{"Incorrect password","Palavra-chave incorrecta"}.
{"Incorrect value of 'action' attribute","Valor incorreto do atributo 'action'"}.
{"Incorrect value of 'action' in data form","Valor incorreto de 'action' no formulário de dados"}.
{"Incorrect value of 'path' in data form","Valor incorreto de 'path' no formulário de dados"}.
{"Insufficient privilege","Privilégio insuficiente"}.
{"Internal server error","Erro interno do servidor"}.
{"Invalid 'from' attribute in forwarded message","Atributo 'from' inválido na mensagem reenviada"}.
{"Invalid node name","Nome do nó inválido"}.
{"Invalid 'previd' value","Valor 'previd' inválido"}.
{"Invitations are not allowed in this conference","Os convites não são permitidos nesta conferência"}.
{"IP addresses","Endereços IP"}.
{"is now known as","é agora conhecido como"}.
{"It is not allowed to send error messages to the room. The participant (~s) has sent an error message (~s) and got kicked from the room","Não é permitido o envio de mensagens de erro para a sala. O membro (~s) enviou uma mensagem de erro (~s) e foi expulso da sala"}.
{"It is not allowed to send private messages of type \"groupchat\"","Não é permitido enviar mensagens privadas do tipo \"groupchat\""}.
{"It is not allowed to send private messages to the conference","Impedir o envio de mensagens privadas para a sala"}.
{"It is not allowed to send private messages","Não é permitido enviar mensagens privadas"}.
{"Jabber ID","ID Jabber"}.
{"January","Janeiro"}.
{"JID normalization denied by service policy","Normalização JID negada por causa da política de serviços"}.
{"JID normalization failed","A normalização JID falhou"}.
{"joins the room","Entrar na sala"}.
{"July","Julho"}.
{"June","Junho"}.
{"Just created","Acabou de ser criado"}.
{"Label:","Rótulo:"}.
{"Last Activity","Última actividade"}.
{"Last login","Último login"}.
{"Last message","Última mensagem"}.
{"Last month","Último mês"}.
{"Last year","Último ano"}.
{"Least significant bits of SHA-256 hash of text should equal hexadecimal label","Bits menos significativos do hash sha-256 do texto devem ser iguais ao rótulo hexadecimal"}.
{"leaves the room","Sair da sala"}.
{"List of rooms","Lista de salas"}.
{"Logging","Registando no log"}.
{"Low level update script","Script de atualização low level"}.
{"Make participants list public","Tornar pública a lista de participantes"}.
{"Make room CAPTCHA protected","Tornar protegida a palavra-passe da sala"}.
{"Make room members-only","Tornar sala apenas para membros"}.
{"Make room moderated","Tornar a sala moderada"}.
{"Make room password protected","Tornar sala protegida à palavra-passe"}.
{"Make room persistent","Tornar sala persistente"}.
{"Make room public searchable","Tornar sala pública possível de ser encontrada"}.
{"Malformed username","Nome de utilizador inválido"}.
{"MAM preference modification denied by service policy","Modificação de preferência MAM negada por causa da política de serviços"}.
{"March","Março"}.
{"Max # of items to persist","Máximo # de elementos que persistem"}.
{"Max payload size in bytes","Máximo tamanho do payload em bytes"}.
{"Maximum file size","Tamanho máximo do ficheiro"}.
{"Maximum Number of History Messages Returned by Room","Quantidade máxima das mensagens do histórico que foram devolvidas por sala"}.
{"Maximum number of items to persist","Quantidade máxima dos itens para manter"}.
{"Maximum Number of Occupants","Quantidate máxima de participantes"}.
{"May","Maio"}.
{"Members not added (inexistent vhost!): ","Membros que não foram adicionados (o vhost não existe!): "}.
{"Membership is required to enter this room","É necessário ser membro desta sala para poder entrar"}.
{"Members:","Membros:"}.
{"Memorize your password, or write it in a paper placed in a safe place. In XMPP there isn't an automated way to recover your password if you forget it.","Memorize a sua palavra-passe ou anote-a num papel guardado num local seguro. No XMPP, não há uma maneira automatizada de recuperar a sua palavra-passe caso a esqueça."}.
{"Memory","Memória"}.
{"Mere Availability in XMPP (No Show Value)","Mera disponibilidade no XMPP (Sem valor para ser exibido)"}.
{"Message body","Corpo da mensagem"}.
{"Message not found in forwarded payload","Mensagem não encontrada em conteúdo encaminhado"}.
{"Messages from strangers are rejected","As mensagens vindas de estranhos são rejeitadas"}.
{"Messages of type headline","Mensagens do tipo do título"}.
{"Messages of type normal","Mensagens do tipo normal"}.
{"Middle Name","Segundo nome"}.
{"Minimum interval between voice requests (in seconds)","O intervalo mínimo entre requisições de voz (em segundos)"}.
{"Moderator privileges required","São necessários privilégios de moderador"}.
{"Moderator","Moderador"}.
{"Moderators Only","Somente moderadores"}.
{"Modified modules","Módulos atualizados"}.
{"Module failed to handle the query","Módulo falhou ao processar a consulta"}.
{"Monday","Segunda"}.
{"Multicast","Multicast"}.
{"Multiple <item/> elements are not allowed by RFC6121","Vários elementos <item/> não são permitidos pela RFC6121"}.
{"Multi-User Chat","Chat multi-utilizador"}.
{"Name in the rosters where this group will be displayed","O nome nas listas onde este grupo será exibido"}.
{"Name","Nome"}.
{"Name:","Nome:"}.
{"Natural Language for Room Discussions","Idioma nativo para as discussões na sala"}.
{"Natural-Language Room Name","Nome da sala no idioma nativo"}.
{"Neither 'jid' nor 'nick' attribute found","Nem o atributo 'jid' nem 'nick' foram encontrados"}.
{"Neither 'role' nor 'affiliation' attribute found","Nem o atributo 'role' nem 'affiliation' foram encontrados"}.
{"Never","Nunca"}.
{"New Password:","Nova Palavra-passe:"}.
{"Nickname can't be empty","O apelido não pode ser vazio"}.
{"Nickname Registration at ","Registo da alcunha em "}.
{"Nickname ~s does not exist in the room","A alcunha ~s não existe na sala"}.
{"Nickname","Alcunha"}.
{"No address elements found","Nenhum elemento endereço foi encontrado"}.
{"No addresses element found","Nenhum elemento endereços foi encontrado"}.
{"No 'affiliation' attribute found","Atributo 'affiliation' não foi encontrado"}.
{"No available resource found","Nenhum recurso disponível foi encontrado"}.
{"No body provided for announce message","Nenhum corpo de texto fornecido para anunciar mensagem"}.
{"No child elements found","Nenhum elemento filho foi encontrado"}.
{"No data form found","Nenhum formulário de dados foi encontrado"}.
{"No Data","Nenhum dado"}.
{"No features available","Nenhuma funcionalidade disponível"}.
{"No <forwarded/> element found","Nenhum elemento <forwarded/> foi encontrado"}.
{"No hook has processed this command","Nenhum hook processou este comando"}.
{"No info about last activity found","Não foi encontrada informação sobre última atividade"}.
{"No 'item' element found","O elemento 'item' não foi encontrado"}.
{"No items found in this query","Nenhum item encontrado nesta consulta"}.
{"No limit","Ilimitado"}.
{"No module is handling this query","Nenhum módulo está processando esta consulta"}.
{"No node specified","Nenhum nó especificado"}.
{"No 'password' found in data form","'password' não foi encontrado em formulário de dados"}.
{"No 'password' found in this query","Nenhuma 'palavra-passe' foi encontrado nesta consulta"}.
{"No 'path' found in data form","'path' não foi encontrado em formulário de dados"}.
{"No pending subscriptions found","Não foram encontradas subscrições"}.
{"No privacy list with this name found","Nenhuma lista de privacidade encontrada com este nome"}.
{"No private data found in this query","Nenhum dado privado encontrado nesta consulta"}.
{"No running node found","Nenhum nó em execução foi encontrado"}.
{"No services available","Não há serviços disponíveis"}.
{"No statistics found for this item","Não foram encontradas estatísticas para este item"}.
{"No 'to' attribute found in the invitation","Atributo 'to' não foi encontrado no convite"}.
{"Nobody","Ninguém"}.
{"Node already exists","Nó já existe"}.
{"Node ID","ID do Tópico"}.
{"Node index not found","O índice do nó não foi encontrado"}.
{"Node not found","Nodo não encontrado"}.
{"Node ~p","Nó ~p"}.
{"Node","Nó"}.
{"Nodeprep has failed","Processo de identificação de nó falhou (nodeprep)"}.
{"Nodes","Nodos"}.
{"None","Nenhum"}.
{"Not allowed","Não é permitido"}.
{"Not Found","Não encontrado"}.
{"Not subscribed","Não subscrito"}.
{"Notify subscribers when items are removed from the node","Notificar assinantes quando itens forem eliminados do nó"}.
{"Notify subscribers when the node configuration changes","Notificar assinantes a configuração do nó mudar"}.
{"Notify subscribers when the node is deleted","Notificar assinantes quando o nó for eliminado se elimine"}.
{"November","Novembro"}.
{"Number of answers required","Quantidade de respostas necessárias"}.
{"Number of occupants","Quantidade de participantes"}.
{"Number of Offline Messages","Quantidade das mensagens offline"}.
{"Number of online users","Quantidade de utilizadores online"}.
{"Number of registered users","Quantidade de utilizadores registados"}.
{"Number of seconds after which to automatically purge items","Quantidade de segundos para excluir os itens automaticamente"}.
{"Occupants are allowed to invite others","As pessoas estão autorizadas a convidar outras pessoas"}.
{"Occupants May Change the Subject","As pessoas talvez possam alterar o assunto"}.
{"October","Outubro"}.
{"Offline Messages","Mensagens offline"}.
{"Offline Messages:","Mensagens offline:"}.
{"OK","OK"}.
{"Old Password:","Palavra-passe Antiga:"}.
{"Online Users","Utilizadores ligados"}.
{"Online Users:","Utilizadores online:"}.
{"Online","Ligado"}.
{"Only admins can see this","Apenas administradores podem ver isso"}.
{"Only collection node owners may associate leaf nodes with the collection","Apenas um grupo dos proprietários dos nós podem associar as páginas na coleção"}.
{"Only deliver notifications to available users","Somente enviar notificações aos utilizadores disponíveis"}.
{"Only <enable/> or <disable/> tags are allowed","Apenas tags <enable/> ou <disable/> são permitidas"}.
{"Only <list/> element is allowed in this query","Apenas elemento <list/> é permitido nesta consulta"}.
{"Only members may query archives of this room","Somente os membros podem procurar nos arquivos desta sala"}.
{"Only moderators and participants are allowed to change the subject in this room","Somente os moderadores e os participamentes podem alterar o assunto desta sala"}.
{"Only moderators are allowed to change the subject in this room","Somente os moderadores podem alterar o assunto desta sala"}.
{"Only moderators can approve voice requests","Somente moderadores podem aprovar requisições de voz"}.
{"Only occupants are allowed to send messages to the conference","Só os ocupantes podem enviar mensagens para a sala"}.
{"Only occupants are allowed to send queries to the conference","Só os ocupantes podem enviar consultas para a sala"}.
{"Only publishers may publish","Apenas os editores podem publicar"}.
{"Only service administrators are allowed to send service messages","Só os administradores do serviço têm permissão para enviar mensagens de serviço"}.
{"Only those on a whitelist may associate leaf nodes with the collection","Apenas aqueles presentes numa lista branca podem associar páginas na coleção"}.
{"Only those on a whitelist may subscribe and retrieve items","Apenas aqueles presentes numa lista branca podem se inscrever e recuperar os itens"}.
{"Organization Name","Nome da organização"}.
{"Organization Unit","Unidade da organização"}.
{"Outgoing s2s Connections","Conexões s2s de Saída"}.
{"Outgoing s2s Connections:","Saída das conexões s2s:"}.
{"Owner privileges required","São necessários privilégios de dono"}.
{"Packet relay is denied by service policy","A retransmissão de pacote é negada por causa da política de serviço"}.
{"Packet","Pacote"}.
{"Participant","Participante"}.
{"Password Verification:","Verificação da Palavra-passe:"}.
{"Password Verification","Verificação de Palavra-passe"}.
{"Password","Palavra-chave"}.
{"Password:","Palavra-chave:"}.
{"Path to Dir","Caminho para o directório"}.
{"Path to File","Caminho do ficheiro"}.
{"Payload type","Tipo da carga útil"}.
{"Pending","Pendente"}.
{"private, ","privado"}.
{"Period: ","Período: "}.
{"Persist items to storage","Persistir elementos ao armazenar"}.
{"Persistent","Persistente"}.
{"Ping query is incorrect","A consulta ping está incorreta"}.
{"Ping","Ping"}.
{"Please note that these options will only backup the builtin Mnesia database. If you are using the ODBC module, you also need to backup your SQL database separately.","Observe que tais opções farão backup apenas da base de dados Mnesia. Caso esteja a utilizar o modulo ODBC, precisará fazer backup da sua base de dados SQL separadamente."}.
{"Please, wait for a while before sending new voice request","Por favor, espere antes de enviar uma nova requisição de voz"}.
{"Pong","Pong"}.
{"Possessing 'ask' attribute is not allowed by RFC6121","Possuir o atributo 'ask' não é permitido pela RFC6121"}.
{"Present real Jabber IDs to","Tornar o Jabber ID real visível por"}.
{"Previous session not found","A sessão anterior não foi encontrada"}.
{"Previous session PID has been killed","O PID da sessão anterior foi excluído"}.
{"Previous session PID has exited","O PID da sessão anterior foi encerrado"}.
{"Previous session PID is dead","O PID da sessão anterior está morto"}.
{"Previous session timed out","A sessão anterior expirou"}.
{"private, ","privado, "}.
{"Public","Público"}.
{"Publish model","Publicar o modelo"}.
{"Publish-Subscribe","Publicação de Tópico"}.
{"PubSub subscriber request","PubSub requisição de assinante"}.
{"Purge all items when the relevant publisher goes offline","Descartar todos os itens quando o publicante principal estiver offline"}.
{"Push record not found","O registo push não foi encontrado"}.
{"Queries to the conference members are not allowed in this room","Nesta sala não são permitidas consultas aos seus membros"}.
{"Query to another users is forbidden","Consultar a outro utilizador é proibido"}.
{"RAM and disc copy","Cópia em RAM e em disco"}.
{"RAM copy","Cópia em RAM"}.
{"Really delete message of the day?","Deletar realmente a mensagem do dia?"}.
{"Receive notification from all descendent nodes","Receba a notificação de todos os nós descendentes"}.
{"Receive notification from direct child nodes only","Receba apenas as notificações dos nós relacionados"}.
{"Receive notification of new items only","Receba apenas as notificações dos itens novos"}.
{"Receive notification of new nodes only","Receba apenas as notificações dos nós novos"}.
{"Recipient is not in the conference room","O destinatário não está na sala"}.
{"Register an XMPP account","Registe uma conta XMPP"}.
{"Registered Users","Utilizadores registados"}.
{"Registered Users:","Utilizadores registados:"}.
{"Register","Registar"}.
{"Remote copy","Cópia remota"}.
{"Remove All Offline Messages","Remover Todas as Mensagens Offline"}.
{"Remove User","Eliminar utilizador"}.
{"Remove","Remover"}.
{"Replaced by new connection","Substituído por nova conexão"}.
{"Request has timed out","O pedido expirou"}.
{"Request is ignored","O pedido foi ignorado"}.
{"Requested role","Função solicitada"}.
{"Resources","Recursos"}.
{"Restart Service","Reiniciar Serviço"}.
{"Restart","Reiniciar"}.
{"Restore Backup from File at ","Restaura cópia de segurança a partir do ficheiro em "}.
{"Restore binary backup after next ejabberd restart (requires less memory):","Restaurar backup binário após reinicialização do ejabberd (requer menos memória):"}.
{"Restore binary backup immediately:","Restaurar imediatamente o backup binário:"}.
{"Restore plain text backup immediately:","Restaurar backup formato texto imediatamente:"}.
{"Restore","Restaurar"}.
{"Roles and Affiliations that May Retrieve Member List","As funções e as afiliações que podem recuperar a lista dos membros"}.
{"Roles for which Presence is Broadcasted","Para quem a presença será notificada"}.
{"Roles that May Send Private Messages","Atribuições que talvez possam enviar mensagens privadas"}.
{"Room Configuration","Configuração de salas"}.
{"Room creation is denied by service policy","Sala não pode ser criada devido à política do serviço"}.
{"Room description","Descrição da Sala"}.
{"Room Occupants","Quantidade de participantes"}.
{"Room terminates","Terminação da sala"}.
{"Room title","Título da sala"}.
{"Roster groups allowed to subscribe","Listar grupos autorizados"}.
{"Roster of ~ts","Lista de ~ts"}.
{"Roster size","Tamanho da Lista"}.
{"Roster:","Lista:"}.
{"RPC Call Error","Erro de chamada RPC"}.
{"Running Nodes","Nodos a correr"}.
{"~s invites you to the room ~s","~s convidaram-o à sala ~s"}.
{"Saturday","Sábado"}.
{"Script check","Verificação de Script"}.
{"Search from the date","Pesquise a partir da data"}.
{"Search Results for ","Resultados de pesquisa para "}.
{"Search the text","Pesquise o texto"}.
{"Search until the date","Pesquise até a data"}.
{"Search users in ","Procurar utilizadores em "}.
{"Select All","Selecione tudo"}.
{"Send announcement to all online users on all hosts","Enviar anúncio a todos utilizadores online em todas as máquinas"}.
{"Send announcement to all online users","Enviar anúncio a todos os utilizadorns online"}.
{"Send announcement to all users on all hosts","Enviar aviso para todos os utilizadores em todos os hosts"}.
{"Send announcement to all users","Enviar anúncio a todos os utilizadores"}.
{"September","Setembro"}.
{"Server:","Servidor:"}.
{"Service list retrieval timed out","A recuperação da lista dos serviços expirou"}.
{"Session state copying timed out","A cópia do estado da sessão expirou"}.
{"Set message of the day and send to online users","Definir mensagem do dia e enviar a todos utilizadores online"}.
{"Set message of the day on all hosts and send to online users","Definir mensagem do dia em todos os hosts e enviar para os utilizadores online"}.
{"Shared Roster Groups","Grupos Shared Roster"}.
{"Show Integral Table","Mostrar Tabela Integral"}.
{"Show Ordinary Table","Mostrar Tabela Ordinária"}.
{"Shut Down Service","Parar Serviço"}.
{"SOCKS5 Bytestreams","Bytestreams SOCKS5"}.
{"Some XMPP clients can store your password in the computer, but you should do this only in your personal computer for safety reasons.","Alguns clientes XMPP podem armazenar a sua palavra-passe no seu computador, só faça isso no seu computador particular por questões de segurança."}.
{"Specify the access model","Especificar os modelos de acesso"}.
{"Specify the event message type","Especificar o tipo de mensagem para o evento"}.
{"Specify the publisher model","Especificar o modelo do publicante"}.
{"Stanza ID","ID da estrofe"}.
{"Statically specify a replyto of the node owner(s)","Defina uma resposta fixa do(s) proprietário(s) do nó"}.
{"Statistics of ~p","Estatísticas de ~p"}.
{"Statistics","Estatísticas"}.
{"Stop","Parar"}.
{"Stopped Nodes","Nodos parados"}.
{"Storage Type","Tipo de armazenagem"}.
{"Store binary backup:","Armazenar backup binário:"}.
{"Store plain text backup:","Armazenar backup em texto:"}.
{"Stream management is already enabled","A gestão do fluxo já está ativada"}.
{"Stream management is not enabled","A gestão do fluxo não está ativada"}.
{"Subject","Assunto"}.
{"Submit","Enviar"}.
{"Submitted","Submetido"}.
{"Subscriber Address","Endereço dos Assinantes"}.
{"Subscribers may publish","Os assinantes podem publicar"}.
{"Subscription requests must be approved and only subscribers may retrieve items","Os pedidos de assinatura devem ser aprovados e apenas os assinantes podem recuperar os itens"}.
{"Subscriptions are not allowed","Subscrições não estão permitidas"}.
{"Subscription","Subscrição"}.
{"Sunday","Domingo"}.
{"Text associated with a picture","Um texto associado a uma imagem"}.
{"Text associated with a sound","Um texto associado a um som"}.
{"Text associated with a video","Um texto associado a um vídeo"}.
{"Text associated with speech","Um texto associado à fala"}.
{"That nickname is already in use by another occupant","O apelido (nick) já está a ser utilizado"}.
{"That nickname is registered by another person","O apelido já está registado por outra pessoa"}.
{"The account already exists","A conta já existe"}.
{"The account was not unregistered","A conta não estava não registada"}.
{"The body text of the last received message","O corpo do texto da última mensagem que foi recebida"}.
{"The CAPTCHA is valid.","O CAPTCHA é inválido."}.
{"The CAPTCHA verification has failed","A verificação do CAPTCHA falhou"}.
{"The captcha you entered is wrong","O captcha que digitou está errado"}.
{"The child nodes (leaf or collection) associated with a collection","Os nós relacionados (página ou coleção) associados com uma coleção"}.
{"The collections with which a node is affiliated","As coleções com as quais o nó está relacionado"}.
{"The DateTime at which a leased subscription will end or has ended","A data e a hora que uma assinatura alugada terminará ou terá terminado"}.
{"The datetime when the node was created","A data em que o nó foi criado"}.
{"The default language of the node","O idioma padrão do nó"}.
{"The feature requested is not supported by the conference","A funcionalidade solicitada não é suportada pela sala de conferência"}.
{"The JID of the node creator","O JID do criador do nó"}.
{"The JIDs of those to contact with questions","Os JIDs daqueles para entrar em contato com perguntas"}.
{"The JIDs of those with an affiliation of owner","Os JIDs daqueles com uma afiliação de proprietário"}.
{"The JIDs of those with an affiliation of publisher","Os JIDs daqueles com uma afiliação de editor"}.
{"The list of JIDs that may associate leaf nodes with a collection","A lista dos JIDs que podem associar as páginas dos nós numa coleção"}.
{"The maximum number of child nodes that can be associated with a collection","A quantidade máxima dos nós relacionados que podem ser associados com uma coleção"}.
{"The minimum number of milliseconds between sending any two notification digests","A quantidade mínima de milissegundos entre o envio do resumo das duas notificações"}.
{"The name of the node","O nome do nó"}.
{"The node is a collection node","O nó é um nó da coleção"}.
{"The node is a leaf node (default)","O nó é uma página do nó (padrão)"}.
{"The NodeID of the relevant node","O NodeID do nó relevante"}.
{"The number of pending incoming presence subscription requests","A quantidade pendente dos pedidos da presença da assinatura"}.
{"The number of subscribers to the node","A quantidade dos assinantes para o nó"}.
{"The number of unread or undelivered messages","A quantidade das mensagens que não foram lidas ou não foram entregues"}.
{"The password contains unacceptable characters","A palavra-passe contém caracteres proibidos"}.
{"The password is too weak","Palavra-passe considerada muito fraca"}.
{"the password is","a palavra-passe é"}.
{"The password of your XMPP account was successfully changed.","A palavra-passe da sua conta XMPP foi alterada com sucesso."}.
{"The password was not changed","A palavra-passe não foi alterada"}.
{"The passwords are different","As palavras-passe não batem"}.
{"The presence states for which an entity wants to receive notifications","As condições da presença para os quais uma entidade queira receber as notificações"}.
{"The query is only allowed from local users","Esta consulta só é permitida a partir de utilizadores locais"}.
{"The query must not contain <item/> elements","A consulta não pode conter elementos <item/>"}.
{"The room subject can be modified by participants","O tema da sala pode ser alterada pelos próprios participantes"}.
{"The sender of the last received message","O remetente da última mensagem que foi recebida"}.
{"The stanza MUST contain only one <active/> element, one <default/> element, or one <list/> element","A instância DEVE conter apenas um elemento <active/>, um elemento <default/>, ou um elemento <list/>"}.
{"The subscription identifier associated with the subscription request","O identificador da assinatura associado à solicitação da assinatura"}.
{"The type of node data, usually specified by the namespace of the payload (if any)","O tipo dos dados do nó, normalmente definido pelo espaço dos nomes da carga útil (caso haja)"}.
{"The URL of an XSL transformation which can be applied to payloads in order to generate an appropriate message body element.","O URL da transformação XSL que pode ser aplicada nas cargas úteis para gerar um elemento apropriado no corpo da mensagem."}.
{"The URL of an XSL transformation which can be applied to the payload format in order to generate a valid Data Forms result that the client could display using a generic Data Forms rendering engine","A URL de uma transformação XSL que pode ser aplicada ao formato de carga útil para gerar um Formulário de Dados válido onde o cliente possa exibir usando um mecanismo genérico de renderização do Formulários de Dados"}.
{"The username is not valid","O nome do utilizador não é válido"}.
{"There was an error changing the password: ","Houve um erro ao alterar a palavra-passe: "}.
{"There was an error creating the account: ","Houve um erro ao criar esta conta: "}.
{"There was an error deleting the account: ","Houve um erro ao deletar esta conta: "}.
{"This is case insensitive: macbeth is the same that MacBeth and Macbeth.","O tamanho da caixa não importa: macbeth é o mesmo que MacBeth e Macbeth."}.
{"This page allows to register an XMPP account in this XMPP server. Your JID (Jabber ID) will be of the form: username@server. Please read carefully the instructions to fill correctly the fields.","Esta pagina permite a criação de novas contas XMPP neste servidor. O seu JID (Identificador Jabber) será da seguinte maneira: utilizador@servidor. Por favor, leia cuidadosamente as instruções para preencher todos os campos corretamente."}.
{"This page allows to unregister an XMPP account in this XMPP server.","Esta página permite a exclusão de uma conta XMPP neste servidor."}.
{"This room is not anonymous","Essa sala não é anônima"}.
{"This service can not process the address: ~s","Este serviço não pode processar o endereço: ~s"}.
{"Thursday","Quinta"}.
{"Time delay","Intervalo (Tempo)"}.
{"Timed out waiting for stream resumption","Tempo limite expirou durante à espera da retomada da transmissão"}.
{"Time","Data"}.
{"To register, visit ~s","Para registar, visite ~s"}.
{"To ~ts","Para ~s"}.
{"Token TTL","Token TTL"}.
{"Too many active bytestreams","Quantidade excessiva de bytestreams ativos"}.
{"Too many CAPTCHA requests","Quantidade excessiva de requisições para o CAPTCHA"}.
{"Too many child elements","Quantidade excessiva de elementos filho"}.
{"Too many <item/> elements","Quantidade excessiva de elementos <item/>"}.
{"Too many <list/> elements","Quantidade excessiva de elementos <list/>"}.
{"Too many (~p) failed authentications from this IP address (~s). The address will be unblocked at ~s UTC","Tentativas excessivas (~p) com falha de autenticação (~s). O endereço será desbloqueado às ~s UTC"}.
{"Too many receiver fields were specified","Foram definidos receptores demais nos campos"}.
{"Too many unacked stanzas","Quantidade excessiva de instâncias sem confirmação"}.
{"Too many users in this conference","Há uma quantidade excessiva de utilizadores nesta conferência"}.
{"To","Para"}.
{"Total rooms","Salas no total"}.
{"Traffic rate limit is exceeded","Limite de banda excedido"}.
{"Transactions Aborted:","Transações abortadas:"}.
{"Transactions Committed:","Transações salvas:"}.
{"Transactions Logged:","Transações de log:"}.
{"Transactions Restarted:","Transações reiniciadas:"}.
{"~ts's Offline Messages Queue","~s's Fila de Mensagens Offline"}.
{"Tuesday","Terça"}.
{"Unable to generate a CAPTCHA","Impossível gerar um CAPTCHA"}.
{"Unable to register route on existing local domain","Não foi possível registar rota no domínio local existente"}.
{"Unauthorized","Não Autorizado"}.
{"Unexpected action","Ação inesperada"}.
{"Unexpected error condition: ~p","Condição de erro inesperada: ~p"}.
{"Unregister an XMPP account","Excluir uma conta XMPP"}.
{"Unregister","Deletar registo"}.
{"Unselect All","Desmarcar todos"}.
{"Unsupported <index/> element","Elemento <index/> não suportado"}.
{"Unsupported version","Versão sem suporte"}.
{"Update message of the day (don't send)","Atualizar mensagem do dia (não enviar)"}.
{"Update message of the day on all hosts (don't send)","Atualizar a mensagem do dia em todos os host (não enviar)"}.
{"Update ~p","Atualizar ~p"}.
{"Update plan","Plano de atualização"}.
{"Update script","Script de atualização"}.
{"Update","Actualizar"}.
{"Uptime:","Tempo de atividade:"}.
{"URL for Archived Discussion Logs","A URL para o arquivamento dos registos da discussão"}.
{"User already exists","Utilizador já existe"}.
{"User (jid)","Utilizador (jid)"}.
{"User JID","Utilizador JID"}.
{"User Management","Gestão de utilizadores"}.
{"User removed","O utilizador foi removido"}.
{"User session not found","A sessão do utilizador não foi encontrada"}.
{"User session terminated","Sessão de utilizador terminada"}.
{"User ~ts","Utilizador ~s"}.
{"Username:","Utilizador:"}.
{"Users are not allowed to register accounts so quickly","Utilizadores não estão autorizados a registar contas imediatamente"}.
{"Users Last Activity","Últimas atividades dos utilizadores"}.
{"Users","Utilizadores"}.
{"User","Utilizador"}.
{"Validate","Validar"}.
{"Value 'get' of 'type' attribute is not allowed","Valor 'get' não permitido para atributo 'type'"}.
{"Value of '~s' should be boolean","Value de '~s' deveria ser um booleano"}.
{"Value of '~s' should be datetime string","Valor de '~s' deveria ser data e hora"}.
{"Value of '~s' should be integer","Valor de '~s' deveria ser um inteiro"}.
{"Value 'set' of 'type' attribute is not allowed","Valor 'set' não permitido para atributo 'type'"}.
{"vCard User Search","Busca de Utilizador vCard"}.
{"View Queue","Exibir a fila"}.
{"View Roster","Ver a lista"}.
{"Virtual Hosts","Hosts virtuais"}.
{"Visitors are not allowed to change their nicknames in this room","Nesta sala, os visitantes não podem mudar os apelidos deles"}.
{"Visitors are not allowed to send messages to all occupants","Os visitantes não podem enviar mensagens para todos os ocupantes"}.
{"Visitor","Visitante"}.
{"Voice request","Requisição de voz"}.
{"Voice requests are disabled in this conference","Requisições de voz estão desativadas nesta sala de conferência"}.
{"Wednesday","Quarta"}.
{"When a new subscription is processed and whenever a subscriber comes online","Quando uma nova assinatura é processada e sempre que um assinante fica online"}.
{"When a new subscription is processed","Quando uma nova assinatura é processada"}.
{"When to send the last published item","Quando enviar o último tópico publicado"}.
{"Whether an entity wants to receive an XMPP message body in addition to the payload format","Caso uma entidade queira receber o corpo de uma mensagem XMPP além do formato de carga útil"}.
{"Whether an entity wants to receive digests (aggregations) of notifications or all notifications individually","Caso uma entidade queira receber os resumos (as agregações) das notificações ou todas as notificações individualmente"}.
{"Whether an entity wants to receive or disable notifications","Caso uma entidade queira receber ou desativar as notificações"}.
{"Whether owners or publisher should receive replies to items","Caso os proprietários ou a editora devam receber as respostas nos itens"}.
{"Whether the node is a leaf (default) or a collection","Caso o nó seja uma folha (padrão) ou uma coleção"}.
{"Whether to allow subscriptions","Permitir subscrições"}.
{"Whether to make all subscriptions temporary, based on subscriber presence","Caso todas as assinaturas devam ser temporárias, com base na presença do assinante"}.
{"Whether to notify owners about new subscribers and unsubscribes","Caso deva notificar os proprietários sobre os novos assinantes e aqueles que cancelaram a assinatura"}.
{"Who may associate leaf nodes with a collection","Quem pode associar as folhas dos nós numa coleção"}.
{"Wrong parameters in the web formulary","O formulário web está com os parâmetros errados"}.
{"Wrong xmlns","Xmlns errado"}.
{"XMPP Account Registration","Registo da Conta XMPP"}.
{"XMPP Domains","Domínios XMPP"}.
{"XMPP Show Value of Away","XMPP Exiba o valor da ausência"}.
{"XMPP Show Value of Chat","XMPP Exiba o valor do chat"}.
{"XMPP Show Value of DND (Do Not Disturb)","XMPP Exiba o valor do DND (Não Perturbe)"}.
{"XMPP Show Value of XA (Extended Away)","XMPP Exiba o valor do XA (Ausência Estendida)"}.
{"XMPP URI of Associated Publish-Subscribe Node","XMPP URI da publicação do nó associado da assinatura"}.
{"You are being removed from the room because of a system shutdown","Está a ser removido da sala devido ao desligamento do sistema"}.
{"You are not joined to the channel","Não está inscrito no canal"}.
{"You can later change your password using an XMPP client.","Pode alterar a sua palavra-passe mais tarde usando um cliente XMPP."}.
{"You have been banned from this room","Foi banido desta sala"}.
{"You have joined too many conferences","Entrou em demais salas de conferência"}.
{"You must fill in field \"Nickname\" in the form","Deve completar o campo \"Apelido\" no formulário"}.
{"You need a client that supports x:data and CAPTCHA to register","Precisa de um cliente com suporte de x:data para poder registar o apelido"}.
{"You need a client that supports x:data to register the nickname","Precisa de um cliente com suporte a x:data para registar o seu apelido"}.
{"You need an x:data capable client to search","É necessário um cliente com suporte de x:data para poder procurar"}.
{"Your active privacy list has denied the routing of this stanza.","A sua lista de privacidade ativa negou o roteamento desta instância."}.
{"Your contact offline message queue is full. The message has been discarded.","A fila de contatos offline esta cheia. A sua mensagem foi descartada."}.
{"Your subscription request and/or messages to ~s have been blocked. To unblock your subscription request, visit ~s","As suas mensagens para ~s estão bloqueadas. Para desbloqueá-las, visite: ~s"}.
{"Your XMPP account was successfully registered.","A sua conta XMPP foi registada com sucesso."}.
{"Your XMPP account was successfully unregistered.","A sua conta XMPP foi excluída com sucesso."}.
{"You're not allowed to create nodes","Não tem autorização para criar nós"}.
+15 -18
View File
@@ -4,7 +4,7 @@
%% https://docs.ejabberd.im/developer/extending-ejabberd/localization/
{" (Add * to the end of field to match substring)"," (在字段末添加*来匹配子串)"}.
{" has set the subject to: ","已将标题设置为: "}.
{" has set the subject to: "," 已将标题设置为: "}.
{"# participants","# 个参与人"}.
{"A description of the node","该节点的描述"}.
{"A friendly name for the node","该节点的友好名称"}.
@@ -23,7 +23,7 @@
{"Add Jabber ID","添加Jabber ID"}.
{"Add New","添加新用户"}.
{"Add User","添加用户"}.
{"Administration of ","管理"}.
{"Administration of ","管理 "}.
{"Administration","管理"}.
{"Administrator privileges required","需要管理员权限"}.
{"All activity","所有活动"}.
@@ -62,7 +62,7 @@
{"Automatic node creation is not enabled","未启用自动节点创建"}.
{"Backup Management","备份管理"}.
{"Backup of ~p","~p的备份"}.
{"Backup to File at ","备份文件位于"}.
{"Backup to File at ","备份文件位于 "}.
{"Backup","备份"}.
{"Bad format","格式错误"}.
{"Birthday","出生日期"}.
@@ -102,7 +102,7 @@
{"Current Discussion Topic","当前讨论话题"}.
{"Database failure","数据库失败"}.
{"Database Tables at ~p","位于~p的数据库表"}.
{"Database Tables Configuration at ","数据库表格配置位于"}.
{"Database Tables Configuration at ","数据库表格配置位于 "}.
{"Database","数据库"}.
{"December","十二月"}.
{"Default users as participants","用户默认被视为参与人"}.
@@ -119,12 +119,12 @@
{"'Displayed groups' not added (they do not exist!): ","'显示的群组' 未被添加 (它们不存在!): "}.
{"Displayed:","已显示:"}.
{"Don't tell your password to anybody, not even the administrators of the XMPP server.","不要将密码告诉任何人, 就算是XMPP服务器的管理员也不可以."}.
{"Dump Backup to Text File at ","转储备份到文本文件"}.
{"Dump Backup to Text File at ","将备份转储到位于以下位置的文本文件 "}.
{"Dump to Text File","转储到文本文件"}.
{"Duplicated groups are not allowed by RFC6121","按照RFC6121的规则,不允许有重复的群组"}.
{"Dynamically specify a replyto of the item publisher","为项目发布者动态指定一个 replyto"}.
{"Edit Properties","编辑属性"}.
{"Either approve or decline the voice request.","接受或拒绝声音请求"}.
{"Either approve or decline the voice request.","接受或拒绝声音请求."}.
{"ejabberd HTTP Upload service","ejabberd HTTP 上传服务"}.
{"ejabberd MUC module","ejabberd MUC 模块"}.
{"ejabberd Multicast service","ejabberd多重映射服务"}.
@@ -194,10 +194,10 @@
{"Import Directory","导入目录"}.
{"Import File","导入文件"}.
{"Import user data from jabberd14 spool file:","从 jabberd14 Spool 文件导入用户数据:"}.
{"Import User from File at ","导入用户的文件位于"}.
{"Import User from File at ","从以下位置的文件导入用户 "}.
{"Import users data from a PIEFXIS file (XEP-0227):","从 PIEFXIS 文件 (XEP-0227) 导入用户数据:"}.
{"Import users data from jabberd14 spool directory:","从jabberd14 Spool目录导入用户数据:"}.
{"Import Users from Dir at ","导入用户的目录位于"}.
{"Import Users from Dir at ","从以下位置目录导入用户 "}.
{"Import Users From jabberd14 Spool Files","从 jabberd14 Spool 文件导入用户"}.
{"Improper domain part of 'from' attribute","不恰当的'from'属性域名部分"}.
{"Improper message type","不恰当的消息类型"}.
@@ -249,7 +249,6 @@
{"Malformed username","用户名无效"}.
{"MAM preference modification denied by service policy","MAM偏好被服务策略拒绝"}.
{"March","三月"}.
{"Max # of items to persist","允许持久化的最大内容条目数"}.
{"Max payload size in bytes","最大有效负载字节数"}.
{"Maximum file size","最大文件大小"}.
{"Maximum Number of History Messages Returned by Room","房间返回的历史消息最大值"}.
@@ -288,7 +287,7 @@
{"Never","从未"}.
{"New Password:","新密码:"}.
{"Nickname can't be empty","昵称不能为空"}.
{"Nickname Registration at ","昵称注册于"}.
{"Nickname Registration at ","昵称注册于 "}.
{"Nickname ~s does not exist in the room","昵称~s不在该房间"}.
{"Nickname","昵称"}.
{"No address elements found","没有找到地址的各元素"}.
@@ -326,6 +325,7 @@
{"Node ~p","节点~p"}.
{"Nodeprep has failed","Nodeprep 已失效"}.
{"Nodes","节点"}.
{"Node","节点"}.
{"None","无"}.
{"Not allowed","不允许"}.
{"Not Found","没有找到"}.
@@ -339,7 +339,6 @@
{"Number of Offline Messages","离线消息数量"}.
{"Number of online users","在线用户数"}.
{"Number of registered users","注册用户数"}.
{"Number of seconds after which to automatically purge items","自动清除项目要等待的秒数"}.
{"Occupants are allowed to invite others","允许成员邀请其他人"}.
{"Occupants May Change the Subject","成员可以修改主题"}.
{"October","十月"}.
@@ -428,7 +427,7 @@
{"Resources","资源"}.
{"Restart Service","重启服务"}.
{"Restart","重启"}.
{"Restore Backup from File at ","恢复备份文件位于"}.
{"Restore Backup from File at ","从以下位置的文件恢复备份 "}.
{"Restore binary backup after next ejabberd restart (requires less memory):","在下次 ejabberd 重启后恢复二进制备份(需要的内存更少):"}.
{"Restore binary backup immediately:","立即恢复二进制备份:"}.
{"Restore plain text backup immediately:","立即恢复普通文本备份:"}.
@@ -455,7 +454,7 @@
{"Search Results for ","搜索结果属于关键词 "}.
{"Search the text","搜索文本"}.
{"Search until the date","搜索截至日期"}.
{"Search users in ","搜索用户"}.
{"Search users in ","在以下位置搜索用户 "}.
{"Select All","全选"}.
{"Send announcement to all online users on all hosts","发送通知给所有主机的在线用户"}.
{"Send announcement to all online users","发送通知给所有在线用户"}.
@@ -519,7 +518,6 @@
{"The JIDs of those with an affiliation of owner","隶属所有人的JID"}.
{"The JIDs of those with an affiliation of publisher","隶属发布人的JID"}.
{"The list of JIDs that may associate leaf nodes with a collection","可以将叶节点与集合关联的JID列表"}.
{"The maximum number of child nodes that can be associated with a collection","可以与集合关联的最大子节点数"}.
{"The minimum number of milliseconds between sending any two notification digests","发送任何两个通知摘要之间的最小毫秒数"}.
{"The name of the node","该节点的名称"}.
{"The node is a collection node","该节点是集合节点"}.
@@ -544,13 +542,12 @@
{"The type of node data, usually specified by the namespace of the payload (if any)","节点数据的类型, 如果有, 通常由有效负载的名称空间指定"}.
{"The URL of an XSL transformation which can be applied to payloads in order to generate an appropriate message body element.","XSL转换的URL,可以将其应用于有效负载以生成适当的消息正文元素。"}.
{"The URL of an XSL transformation which can be applied to the payload format in order to generate a valid Data Forms result that the client could display using a generic Data Forms rendering engine","XSL转换的URL, 可以将其应用于有效负载格式, 以生成有效的数据表单结果, 客户端可以使用通用数据表单呈现引擎来显示该结果"}.
{"The username is not valid","用户名无效"}.
{"There was an error changing the password: ","修改密码出错: "}.
{"There was an error creating the account: ","帐户创建出错: "}.
{"There was an error deleting the account: ","帐户删除失败: "}.
{"This is case insensitive: macbeth is the same that MacBeth and Macbeth.","此处不区分大小写: macbeth 与 MacBeth 和 Macbeth 是一样的."}.
{"This page allows to register an XMPP account in this XMPP server. Your JID (Jabber ID) will be of the form: username@server. Please read carefully the instructions to fill correctly the fields.","本页面允许在此服务器上注册XMPP帐户. 你的JID (Jabber ID) 的形式如下: 用户名@服务器. 请仔细阅读说明并正确填写相应字段."}.
{"This page allows to unregister an XMPP account in this XMPP server.","此页面允许在此XMPP服务器上注销XMPP帐户"}.
{"This page allows to unregister an XMPP account in this XMPP server.","此页面允许在此 XMPP 服务器上注销 XMPP 帐户"}.
{"This room is not anonymous","此房间不是匿名房间"}.
{"This service can not process the address: ~s","此服务无法处理地址: ~s"}.
{"Thursday","星期四"}.
@@ -565,7 +562,7 @@
{"Too many child elements","太多子元素"}.
{"Too many <item/> elements","太多 <item/> 元素"}.
{"Too many <list/> elements","太多 <list/> 元素"}.
{"Too many (~p) failed authentications from this IP address (~s). The address will be unblocked at ~s UTC","来自IP地址(~p)的(~s)失败认证太多. 该地址将在UTC时间~s被禁用."}.
{"Too many (~p) failed authentications from this IP address (~s). The address will be unblocked at ~s UTC","来自IP地址(~p)的(~s)失败认证太多将在UTC时间 ~s 解除对该地址的封锁"}.
{"Too many receiver fields were specified","指定的接收者字段太多"}.
{"Too many unacked stanzas","未被确认的节太多"}.
{"Too many users in this conference","该会议的用户太多"}.
@@ -656,7 +653,7 @@
{"You need a client that supports x:data to register the nickname","您需要一个支持 x:data 的客户端来注册昵称"}.
{"You need an x:data capable client to search","您需要一个兼容 x:data 的客户端来搜索"}.
{"Your active privacy list has denied the routing of this stanza.","你的活跃私聊列表拒绝了在此房间进行路由分发."}.
{"Your contact offline message queue is full. The message has been discarded.","您的联系人离线消息队列已满. 消息已被丢弃"}.
{"Your contact offline message queue is full. The message has been discarded.","您的联系人离线消息队列已满消息已被丢弃"}.
{"Your subscription request and/or messages to ~s have been blocked. To unblock your subscription request, visit ~s","您发送给~s的消息已被阻止. 要解除阻止, 请访问 ~s"}.
{"Your XMPP account was successfully registered.","你的XMPP帐户注册成功."}.
{"Your XMPP account was successfully unregistered.","你的XMPP帐户注销成功."}.
+61 -23
View File
@@ -19,48 +19,48 @@
%%%----------------------------------------------------------------------
{deps, [{base64url, ".*", {git, "https://github.com/dvv/base64url", {tag, "1.0.1"}}},
{cache_tab, ".*", {git, "https://github.com/processone/cache_tab", {tag, "1.0.28"}}},
{eimp, ".*", {git, "https://github.com/processone/eimp", {tag, "1.0.20"}}},
{cache_tab, ".*", {git, "https://github.com/processone/cache_tab", {tag, "1.0.29"}}},
{eimp, ".*", {git, "https://github.com/processone/eimp", {tag, "1.0.21"}}},
{if_var_true, tools,
{ejabberd_po, ".*", {git, "https://github.com/processone/ejabberd-po", {branch, "main"}}}},
{if_var_true, elixir,
{elixir, ".*", {git, "https://github.com/elixir-lang/elixir", {tag, "v1.4.4"}}}},
{if_var_true, pam,
{epam, ".*", {git, "https://github.com/processone/epam", {tag, "1.0.10"}}}},
{epam, ".*", {git, "https://github.com/processone/epam", {tag, "1.0.12"}}}},
{if_var_true, redis,
{eredis, ".*", {git, "https://github.com/wooga/eredis", {tag, "v1.0.8"}}}},
{eredis, ".*", {git, "https://github.com/wooga/eredis", {tag, "v1.2.0"}}}},
{if_var_true, sip,
{esip, ".*", {git, "https://github.com/processone/esip", {tag, "1.0.42"}}}},
{esip, ".*", {git, "https://github.com/processone/esip", {tag, "1.0.45"}}}},
{if_var_true, zlib,
{ezlib, ".*", {git, "https://github.com/processone/ezlib", {tag, "1.0.9"}}}},
{fast_tls, ".*", {git, "https://github.com/processone/fast_tls", {tag, "1.1.12"}}},
{fast_xml, ".*", {git, "https://github.com/processone/fast_xml", {tag, "1.1.46"}}},
{fast_yaml, ".*", {git, "https://github.com/processone/fast_yaml", {tag, "1.0.31"}}},
{ezlib, ".*", {git, "https://github.com/processone/ezlib", {tag, "1.0.10"}}}},
{fast_tls, ".*", {git, "https://github.com/processone/fast_tls", {tag, "1.1.13"}}},
{fast_xml, ".*", {git, "https://github.com/processone/fast_xml", {tag, "1.1.48"}}},
{fast_yaml, ".*", {git, "https://github.com/processone/fast_yaml", {tag, "1.0.32"}}},
{idna, ".*", {git, "https://github.com/benoitc/erlang-idna", {tag, "6.0.0"}}},
{jiffy, ".*", {git, "https://github.com/davisp/jiffy", {tag, "1.0.5"}}},
{jose, ".*", {git, "https://github.com/potatosalad/erlang-jose", {tag, "1.9.0"}}},
{lager, ".*", {git, "https://github.com/erlang-lager/lager", {tag, "3.6.10"}}},
{jose, ".*", {git, "https://github.com/potatosalad/erlang-jose", {tag, "1.11.1"}}},
{lager, ".*", {git, "https://github.com/erlang-lager/lager", {tag, "3.9.1"}}},
{if_var_true, lua,
{luerl, ".*", {git, "https://github.com/rvirding/luerl", {tag, "v0.3"}}}},
{mqtree, ".*", {git, "https://github.com/processone/mqtree", {tag, "1.0.13"}}},
{p1_acme, ".*", {git, "https://github.com/processone/p1_acme", {tag, "1.0.12"}}},
{mqtree, ".*", {git, "https://github.com/processone/mqtree", {tag, "1.0.14"}}},
{p1_acme, ".*", {git, "https://github.com/processone/p1_acme", {tag, "1.0.16"}}},
{if_var_true, mysql,
{p1_mysql, ".*", {git, "https://github.com/processone/p1_mysql", {tag, "1.0.18"}}}},
{p1_oauth2, ".*", {git, "https://github.com/processone/p1_oauth2", {tag, "0.6.9"}}},
{p1_mysql, ".*", {git, "https://github.com/processone/p1_mysql", {tag, "1.0.19"}}}},
{p1_oauth2, ".*", {git, "https://github.com/processone/p1_oauth2", {tag, "0.6.10"}}},
{if_var_true, pgsql,
{p1_pgsql, ".*", {git, "https://github.com/processone/p1_pgsql", {tag, "1.1.11"}}}},
{p1_utils, ".*", {git, "https://github.com/processone/p1_utils", {tag, "1.0.22"}}},
{pkix, ".*", {git, "https://github.com/processone/pkix", {tag, "1.0.7"}}},
{p1_pgsql, ".*", {git, "https://github.com/processone/p1_pgsql", {tag, "1.1.16"}}}},
{p1_utils, ".*", {git, "https://github.com/processone/p1_utils", {tag, "1.0.23"}}},
{pkix, ".*", {git, "https://github.com/processone/pkix", {tag, "1.0.8"}}},
{if_not_rebar3, %% Needed because modules are not fully migrated to new structure and mix
{if_var_true, elixir,
{rebar_elixir_plugin, ".*", {git, "https://github.com/processone/rebar_elixir_plugin", "0.1.0"}}}},
{if_var_true, sqlite,
{sqlite3, ".*", {git, "https://github.com/processone/erlang-sqlite3", {tag, "1.1.12"}}}},
{stringprep, ".*", {git, "https://github.com/processone/stringprep", {tag, "1.0.25"}}},
{sqlite3, ".*", {git, "https://github.com/processone/erlang-sqlite3", {tag, "1.1.13"}}}},
{stringprep, ".*", {git, "https://github.com/processone/stringprep", {tag, "1.0.27"}}},
{if_var_true, stun,
{stun, ".*", {git, "https://github.com/processone/stun", {tag, "1.0.43"}}}},
{xmpp, ".*", {git, "https://github.com/processone/xmpp", {tag, "1.5.3"}}},
{yconf, ".*", {git, "https://github.com/processone/yconf", {tag, "1.0.11"}}}
{stun, ".*", {git, "https://github.com/processone/stun", {tag, "1.0.47"}}}},
{xmpp, ".*", {git, "https://github.com/processone/xmpp", {tag, "1.5.6"}}},
{yconf, ".*", {git, "https://github.com/processone/yconf", {tag, "1.0.12"}}}
]}.
{gitonly_deps, [elixir, luerl]}.
@@ -100,6 +100,7 @@
{if_version_below, "23", {d, 'USE_OLD_CRYPTO_HMAC'}},
{if_version_below, "23", {d, 'USE_OLD_PG2'}},
{if_version_below, "24", {d, 'COMPILER_REPORTS_ONLY_LINES'}},
{if_version_below, "24", {d, 'SYSTOOLS_APP_DEF_WITHOUT_OPTIONAL'}},
{if_var_match, db_type, mssql, {d, 'mssql'}},
{if_var_false, debug, no_debug_info},
{if_var_true, debug, debug_info},
@@ -109,6 +110,7 @@
{if_var_true, sip, {d, 'SIP'}},
{if_var_true, stun, {d, 'STUN'}},
{if_have_fun, {erl_error, format_exception, 6}, {d, 'HAVE_ERL_ERROR'}},
{if_have_fun, {uri_string, normalize, 1}, {d, 'HAVE_URI_STRING'}},
{src_dirs, [src,
{if_rebar3, sql},
{if_var_true, tools, tools},
@@ -155,6 +157,8 @@
{cover_enabled, true}.
{cover_export_enabled, true}.
{coveralls_coverdata, "_build/test/cover/ct.coverdata"}.
{coveralls_service_name, "github"}.
{recursive_cmds, ['configure-deps']}.
{overrides, [
@@ -169,6 +173,40 @@
{"fast_yaml", []},
{"stringprep", []}]}.
{relx, [{release, {ejabberd, {cmd, "grep {vsn, vars.config | sed 's|{vsn, \"||;s|\"}.||' | tr -d '\012'"}},
[ejabberd]},
{sys_config, "./rel/sys.config"},
{vm_args, "./rel/vm.args"},
{overlay_vars, "vars.config"},
{extended_start_script, true},
{overlay, [{mkdir, "var/log/ejabberd"},
{mkdir, "var/lib/ejabberd"},
{mkdir, "etc/ejabberd"},
{copy, "rel/files/erl", "\{\{erts_vsn\}\}/bin/erl"}, % in rebar2 this prepends erts-
{template, "ejabberdctl.template", "bin/ejabberdctl"},
{copy, "inetrc", "etc/ejabberd/inetrc"},
{copy, "tools/captcha*.sh", "lib/ejabberd-\{\{release_version\}\}/priv/bin/"},
{copy, "rel/files/install_upgrade.escript", "bin/install_upgrade.escript"}]}
]}.
{profiles, [{prod, [{relx, [{debug_info, strip},
{dev_mode, false},
{include_erts, true},
{include_src, true},
{overlay, [{copy, "sql/*", "lib/ejabberd-\{\{release_version\}\}/priv/sql/"},
{copy, "ejabberdctl.cfg.example", "etc/ejabberd/ejabberdctl.cfg"},
{copy, "ejabberd.yml.example", "etc/ejabberd/ejabberd.yml"}]}]}]},
{dev, [{post_hooks, [{release, "rel/setup-dev.sh"}]},
{relx, [{debug_info, keep},
{dev_mode, true},
{include_erts, true},
{include_src, false},
{overlay, [{copy, "ejabberdctl.cfg.example", "etc/ejabberd/ejabberdctl.cfg.example"},
{copy, "ejabberd.yml.example", "etc/ejabberd/ejabberd.yml.example"},
{copy, "test/ejabberd_SUITE_data/ca.pem", "etc/ejabberd/"},
{copy, "test/ejabberd_SUITE_data/cert.pem", "etc/ejabberd/"}]}]}]},
{test, [{erl_opts, [nowarn_export_all]}]}]}.
%% Local Variables:
%% mode: erlang
%% End:
+46 -16
View File
@@ -339,17 +339,44 @@ fun(Deps, FDeps) ->
end, Deps)
end,
TravisPostHooks =
fun(true) ->
[{ct, "echo '\n%%! -pa ebin/ deps/coveralls/ebin\n" ++
"main(_)->{ok,F}=file:open(\"erlang.json\",[write])," ++
"io:fwrite(F,\"~s\",[coveralls:convert_file(" ++
"\"logs/all.coverdata\", \"" ++
os:getenv("TRAVIS_JOB_ID") ++
"\", \"travis-ci\",\"\")]).' > getcover.erl"},
{ct, "escript ./getcover.erl"}];
(_) ->
[]
VarsApps = case file:consult(filename:join([filename:dirname(SCRIPT),"vars.config"])) of
{ok, TermsV} ->
case proplists:get_bool(odbc, TermsV) of
true -> [odbc];
false -> []
end;
_->
[]
end,
ProcessRelx = fun(Relx, Deps) ->
{value, {release, NameVersion, DefaultApps}, RelxTail} = lists:keytake(release, 1, Relx),
ProfileApps = case os:getenv("REBAR_PROFILE") of
"dev" -> [observer, runtime_tools, wx, debugger];
_ -> []
end,
DepApps = lists:map(fun({DepName, _, _}) -> DepName;
({DepName, _}) -> DepName
end, Deps),
[{release, NameVersion, DefaultApps ++ VarsApps ++ ProfileApps ++ DepApps} | RelxTail]
end,
GithubConfig = case {os:getenv("GITHUB_ACTIONS"), os:getenv("GITHUB_TOKEN")} of
{"true", Token} when is_list(Token) ->
CONFIG1 = [{coveralls_repo_token, Token},
{coveralls_service_job_id, os:getenv("GITHUB_RUN_ID")},
{coveralls_commit_sha, os:getenv("GITHUB_SHA")},
{coveralls_service_number, os:getenv("GITHUB_RUN_NUMBER")}],
case os:getenv("GITHUB_EVENT_NAME") =:= "pull_request"
andalso string:tokens(os:getenv("GITHUB_REF"), "/") of
[_, "pull", PRNO, _] ->
[{coveralls_service_pull_request, PRNO} | CONFIG1];
_ ->
CONFIG1
end;
_ ->
[]
end,
Rules = [
@@ -358,10 +385,10 @@ Rules = [
{compile, {asn, compile}},
{clean, {asn, clean}}
]}]), []},
{[deps], os:getenv("TRAVIS") == "true",
AppendList([{coveralls, ".*", {git, "https://github.com/markusn/coveralls-erl", {tag, "v2.0.1"}}}]), []},
{[post_hooks], [cover_enabled], os:getenv("TRAVIS") == "true",
AppendList2(TravisPostHooks), [], false},
{[plugins], IsRebar3 and (os:getenv("GITHUB_ACTIONS") == "true"),
AppendList([{coveralls, {git,
"https://github.com/processone/coveralls-erl.git",
{branch, "addjsonfile"}}} ]), []},
{[overrides], [post_hook_configure], SystemDeps == false,
AppendList2(GenDepsConfigure), [], []},
{[ct_extra_params], [eunit_compile_opts], true,
@@ -370,6 +397,8 @@ Rules = [
ProcessErlOpt, []},
{[xref_queries], [xref_exclusions], true,
AppendList2(ProcssXrefExclusions), [], []},
{[relx], [deps], IsRebar3,
ProcessRelx, [], []},
{[deps], [floating_deps], true,
ProcessFloatingDeps, [], []},
{[deps], [gitonly_deps], IsRebar3,
@@ -379,7 +408,8 @@ Rules = [
],
Config = [{plugin_dir, filename:join([filename:dirname(SCRIPT),"plugins"])}]++
FilterConfig(ProcessVars(CONFIG, []), Rules),
FilterConfig(ProcessVars(CONFIG, []), Rules)++
GithubConfig,
%io:format("ejabberd configuration:~n ~p~n", [Config]),
Executable
BIN
View File
Binary file not shown.
-1
View File
@@ -89,7 +89,6 @@ Sys = [{lib_dirs, []},
Overlay = [
{mkdir, "var/log/ejabberd"},
{mkdir, "var/lock"},
{mkdir, "var/lib/ejabberd"},
{mkdir, "etc/ejabberd"},
{mkdir, "doc"},
+28
View File
@@ -0,0 +1,28 @@
echo -n "===> Preparing dev configuration files: "
PWD_DIR=`pwd`
REL_DIR=$PWD_DIR/_build/dev/rel/ejabberd/
CON_DIR=$REL_DIR/etc/ejabberd/
[ -z "$REL_DIR_TEMP" ] && REL_DIR_TEMP=$REL_DIR
CON_DIR_TEMP=$REL_DIR_TEMP/etc/ejabberd/
BIN_DIR_TEMP=$REL_DIR_TEMP/bin/
cd $CON_DIR_TEMP
sed -i "s|# certfiles:|certfiles:\n - $CON_DIR/cert.pem|g" ejabberd.yml.example
sed -i "s|certfiles:|ca_file: $CON_DIR/ca.pem\ncertfiles:|g" ejabberd.yml.example
sed -i 's|^acl:$|acl:\n admin: [user: admin]|g' ejabberd.yml.example
[ ! -f "$CON_DIR/ejabberd.yml" ] \
&& echo -n "ejabberd.yml " \
&& mv ejabberd.yml.example ejabberd.yml
sed -i "s|#' POLL|EJABBERD_BYPASS_WARNINGS=true\n\n#' POLL|g" ejabberdctl.cfg.example
[ ! -f "$CON_DIR/ejabberdctl.cfg" ] \
&& echo -n "ejabberdctl.cfg " \
&& mv ejabberdctl.cfg.example ejabberdctl.cfg
echo ""
echo "===> Some example ways to start this ejabberd dev:"
echo " _build/dev/rel/ejabberd/bin/ejabberd console"
echo " _build/dev/rel/ejabberd/bin/ejabberdctl live"
+2
View File
@@ -0,0 +1,2 @@
[{ejabberd, [{config, "etc/ejabberd/ejabberd.yml"},
{log_path, "var/log/ejabberd/ejabberd.log"}]}].
+32
View File
@@ -0,0 +1,32 @@
## Name of the node
-sname ejabberd@localhost
## Cookie for distributed erlang
#-setcookie ejabberd
-mnesia dir \"var/lib/ejabberd\"
## Heartbeat management; auto-restarts VM if it dies or becomes unresponsive
## (Disabled by default..use with caution!)
##-heart
## Enable kernel poll and a few async threads
##+K true
##+A 5
## Increase number of concurrent ports/sockets
##-env ERL_MAX_PORTS 4096
## Tweak GC to run more often
##-env ERL_FULLSWEEP_AFTER 10
# +B [c | d | i]
# Option c makes Ctrl-C interrupt the current shell instead of invoking the emulator break
# handler. Option d (same as specifying +B without an extra option) disables the break handler. # Option i makes the emulator ignore any break signal.
# If option c is used with oldshell on Unix, Ctrl-C will restart the shell process rather than
# interrupt it.
# Disable the emulator break handler
# it easy to accidentally type ctrl-c when trying
# to reach for ctrl-d. ctrl-c on a live node can
# have very undesirable results
##+Bi
+14
View File
@@ -0,0 +1,14 @@
## Customize flags given to the VM: https://erlang.org/doc/man/erl.html
## -mode/-name/-sname/-setcookie are configured via env vars, do not set them here
-boot ../releases/<%= @version %>/start_clean
-boot_var RELEASE_LIB ../lib
## Number of dirty schedulers doing IO work (file, sockets, and others)
##+SDio 5
## Increase number of concurrent ports/sockets
##+Q 65536
## Tweak GC to run more often
##-env ERL_FULLSWEEP_AFTER 10
+3
View File
@@ -73,6 +73,8 @@ CREATE TABLE sr_group (
PRIMARY KEY (server_host, name)
);
CREATE UNIQUE INDEX i_sr_group_sh_name ON sr_group (server_host, name);
CREATE TABLE sr_user (
jid text NOT NULL,
server_host text NOT NULL,
@@ -81,6 +83,7 @@ CREATE TABLE sr_user (
PRIMARY KEY (server_host, jid, grp)
);
CREATE UNIQUE INDEX i_sr_user_sh_jid_grp ON sr_user (server_host, jid, grp);
CREATE INDEX i_sr_user_sh_jid ON sr_user (server_host, jid);
CREATE INDEX i_sr_user_sh_grp ON sr_user (server_host, grp);
+2
View File
@@ -65,6 +65,8 @@ CREATE TABLE sr_group (
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE UNIQUE INDEX i_sr_group_name ON sr_group (name);
CREATE TABLE sr_user (
jid text NOT NULL,
grp text NOT NULL,
+20
View File
@@ -544,3 +544,23 @@ WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW
CREATE UNIQUE INDEX [i_push_ut] ON [push_session] (username, timestamp)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON);
CREATE TABLE [dbo].[mqtt_pub](
[username] [varchar](191) NOT NULL,
[server_host] [varchar](191) NOT NULL,
[resource] [varchar](191) NOT NULL,
[topic] [varchar](191) NOT NULL,
[qos] [tinyint] NOT NULL,
[payload] [varbinary](max) NOT NULL,
[payload_format] [tinyint] NOT NULL,
[content_type] [text] NOT NULL,
[response_topic] [text] NOT NULL,
[correlation_data] [varbinary](max) NOT NULL,
[user_properties] [varbinary](max) NOT NULL,
[expiry] [int] NOT NULL,
CONSTRAINT [i_mqtt_topic_server] PRIMARY KEY CLUSTERED
(
[topic] ASC,
[server_host] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY];
+5 -2
View File
@@ -20,8 +20,8 @@ CREATE TABLE users (
username varchar(191) NOT NULL,
server_host varchar(191) NOT NULL,
password text NOT NULL,
serverkey varchar(64) NOT NULL DEFAULT '',
salt varchar(64) NOT NULL DEFAULT '',
serverkey varchar(128) NOT NULL DEFAULT '',
salt varchar(128) NOT NULL DEFAULT '',
iterationcount integer NOT NULL DEFAULT 0,
created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (server_host(191), username)
@@ -76,6 +76,8 @@ CREATE TABLE sr_group (
PRIMARY KEY (server_host(191), name)
) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE UNIQUE INDEX i_sr_group_sh_name ON sr_group(server_host(191), name);
CREATE TABLE sr_user (
jid varchar(191) NOT NULL,
server_host varchar(191) NOT NULL,
@@ -84,6 +86,7 @@ CREATE TABLE sr_user (
PRIMARY KEY (server_host(191), jid, grp)
) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE UNIQUE INDEX i_sr_user_sh_jid_group ON sr_user(server_host(191), jid, grp);
CREATE INDEX i_sr_user_sh_jid ON sr_user(server_host(191), jid);
CREATE INDEX i_sr_user_sh_grp ON sr_user(server_host(191), grp);
+2
View File
@@ -77,6 +77,7 @@ BEGIN
ALTER TABLE `last` ADD PRIMARY KEY (`server_host`, `username`);
ALTER TABLE `sr_group` ADD COLUMN `server_host` VARCHAR (191) COLLATE `utf8mb4_unicode_ci` NOT NULL DEFAULT @DEFAULT_HOST AFTER `name`;
ALTER TABLE `sr_group` ALTER COLUMN `server_host` DROP DEFAULT;
ALTER TABLE `sr_group` ADD UNIQUE INDEX `i_sr_group_sh_name` (`server_host`, `name`);
ALTER TABLE `sr_group` ADD PRIMARY KEY (`server_host`, `name`);
ALTER TABLE `muc_registered` ADD COLUMN `server_host` VARCHAR (191) COLLATE `utf8mb4_unicode_ci` NOT NULL DEFAULT @DEFAULT_HOST AFTER `host`;
ALTER TABLE `muc_registered` ALTER COLUMN `server_host` DROP DEFAULT;
@@ -99,6 +100,7 @@ BEGIN
ALTER TABLE `sr_user` DROP INDEX `i_sr_user_jid_group`;
ALTER TABLE `sr_user` ADD COLUMN `server_host` VARCHAR (191) COLLATE `utf8mb4_unicode_ci` NOT NULL DEFAULT @DEFAULT_HOST AFTER `jid`;
ALTER TABLE `sr_user` ALTER COLUMN `server_host` DROP DEFAULT;
ALTER TABLE `sr_user` ADD UNIQUE INDEX `i_sr_user_sh_jid_group` (`server_host`, `jid`, `grp`);
ALTER TABLE `sr_user` ADD INDEX `i_sr_user_sh_jid` (`server_host`, `jid`);
ALTER TABLE `sr_user` ADD INDEX `i_sr_user_sh_grp` (`server_host`, `grp`);
ALTER TABLE `sr_user` ADD PRIMARY KEY (`server_host`, `jid`, `grp`);
+4 -2
View File
@@ -19,8 +19,8 @@
CREATE TABLE users (
username varchar(191) PRIMARY KEY,
password text NOT NULL,
serverkey varchar(64) NOT NULL DEFAULT '',
salt varchar(64) NOT NULL DEFAULT '',
serverkey varchar(128) NOT NULL DEFAULT '',
salt varchar(128) NOT NULL DEFAULT '',
iterationcount integer NOT NULL DEFAULT 0,
created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
@@ -68,6 +68,8 @@ CREATE TABLE sr_group (
created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE UNIQUE INDEX i_sr_group_name ON sr_group(name);
CREATE TABLE sr_user (
jid varchar(191) NOT NULL,
grp varchar(191) NOT NULL,
+10 -1
View File
@@ -156,6 +156,12 @@
-- CREATE INDEX i_sm_sh_username ON sm USING btree (server_host, username);
-- ALTER TABLE sm ALTER COLUMN server_host DROP DEFAULT;
-- ALTER TABLE push_session ADD COLUMN server_host text NOT NULL DEFAULT '<HOST>';
-- DROP INDEX i_push_usn;
-- DROP INDEX i_push_ut;
-- ALTER TABLE push_session ADD PRIMARY KEY (server_host, username, timestamp);
-- CREATE UNIQUE INDEX i_push_session_susn ON push_session USING btree (server_host, username, service, node);
CREATE TABLE users (
username text NOT NULL,
@@ -218,6 +224,8 @@ CREATE TABLE sr_group (
PRIMARY KEY (server_host, name)
);
CREATE UNIQUE INDEX i_sr_group_sh_name ON sr_group USING btree (server_host, name);
CREATE TABLE sr_user (
jid text NOT NULL,
server_host text NOT NULL,
@@ -226,6 +234,7 @@ CREATE TABLE sr_user (
PRIMARY KEY (server_host, jid, grp)
);
CREATE UNIQUE INDEX i_sr_user_sh_jid_grp ON sr_user USING btree (server_host, jid, grp);
CREATE INDEX i_sr_user_sh_jid ON sr_user USING btree (server_host, jid);
CREATE INDEX i_sr_user_sh_grp ON sr_user USING btree (server_host, grp);
@@ -302,7 +311,7 @@ CREATE TABLE vcard_search (
lorgname text NOT NULL,
orgunit text NOT NULL,
lorgunit text NOT NULL,
PRIMARY KEY (server_host, username)
PRIMARY KEY (server_host, lusername)
);
CREATE INDEX i_vcard_search_sh_lfn ON vcard_search(server_host, lfn);
+2
View File
@@ -69,6 +69,8 @@ CREATE TABLE sr_group (
created_at TIMESTAMP NOT NULL DEFAULT now()
);
CREATE UNIQUE INDEX i_sr_group_name ON sr_group USING btree (name);
CREATE TABLE sr_user (
jid text NOT NULL,
grp text NOT NULL,
+1
View File
@@ -25,6 +25,7 @@
-export([match_rules/4, match_acls/3]).
-export([access_rules_validator/0, access_validator/0]).
-export([validator/1, validators/0]).
-export([loaded_shared_roster_module/1]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
+36 -31
View File
@@ -553,37 +553,42 @@ hosts() ->
-spec vcard_temp() -> yconf:validator().
vcard_temp() ->
vcard_validator(
vcard_temp, undefined,
[{version, undefined, binary()},
{fn, undefined, binary()},
{n, undefined, vcard_name()},
{nickname, undefined, binary()},
{photo, undefined, vcard_photo()},
{bday, undefined, binary()},
{adr, [], list(vcard_adr())},
{label, [], list(vcard_label())},
{tel, [], list(vcard_tel())},
{email, [], list(vcard_email())},
{jabberid, undefined, binary()},
{mailer, undefined, binary()},
{tz, undefined, binary()},
{geo, undefined, vcard_geo()},
{title, undefined, binary()},
{role, undefined, binary()},
{logo, undefined, vcard_logo()},
{org, undefined, vcard_org()},
{categories, [], list(binary())},
{note, undefined, binary()},
{prodid, undefined, binary()},
{rev, undefined, binary()},
{sort_string, undefined, binary()},
{sound, undefined, vcard_sound()},
{uid, undefined, binary()},
{url, undefined, binary()},
{class, undefined, enum([confidential, private, public])},
{key, undefined, vcard_key()},
{desc, undefined, binary()}]).
and_then(
vcard_validator(
vcard_temp, undefined,
[{version, undefined, binary()},
{fn, undefined, binary()},
{n, undefined, vcard_name()},
{nickname, undefined, binary()},
{photo, undefined, vcard_photo()},
{bday, undefined, binary()},
{adr, [], list(vcard_adr())},
{label, [], list(vcard_label())},
{tel, [], list(vcard_tel())},
{email, [], list(vcard_email())},
{jabberid, undefined, binary()},
{mailer, undefined, binary()},
{tz, undefined, binary()},
{geo, undefined, vcard_geo()},
{title, undefined, binary()},
{role, undefined, binary()},
{logo, undefined, vcard_logo()},
{org, undefined, vcard_org()},
{categories, [], list(binary())},
{note, undefined, binary()},
{prodid, undefined, binary()},
{rev, undefined, binary()},
{sort_string, undefined, binary()},
{sound, undefined, vcard_sound()},
{uid, undefined, binary()},
{url, undefined, binary()},
{class, undefined, enum([confidential, private, public])},
{key, undefined, vcard_key()},
{desc, undefined, binary()}]),
fun(Tuple) ->
list_to_tuple(tuple_to_list(Tuple) ++ [[]])
end).
-spec vcard_name() -> yconf:validator().
vcard_name() ->
+4
View File
@@ -20,10 +20,14 @@ Vars = case file:consult(filename:join([filename:dirname(SCRIPT), "..", "vars.co
cache_tab,
eimp,
fast_tls,
fast_xml,
fast_yaml,
lager,
p1_acme,
p1_utils,
pkix,
stringprep,
yconf,
xmpp]},
{mod, {ejabberd_app, []}}]}.
+35 -33
View File
@@ -46,6 +46,7 @@
code_change/3]).
-define(SERVER, ?MODULE).
-define(CACHE_TAB, access_permissions_cache).
-record(state,
{definitions = none :: none | [definition()]}).
@@ -71,17 +72,45 @@
%%%===================================================================
-spec can_access(atom(), caller_info()) -> allow | deny.
can_access(Cmd, CallerInfo) ->
gen_server:call(?MODULE, {can_access, Cmd, CallerInfo}).
Defs0 = show_current_definitions(),
CallerModule = maps:get(caller_module, CallerInfo, none),
Host = maps:get(caller_host, CallerInfo, global),
Tag = maps:get(tag, CallerInfo, none),
Defs = maps:get(extra_permissions, CallerInfo, []) ++ Defs0,
Res = lists:foldl(
fun({Name, _} = Def, none) ->
case matches_definition(Def, Cmd, CallerModule, Tag, Host, CallerInfo) of
true ->
?DEBUG("Command '~p' execution allowed by rule "
"'~ts' (CallerInfo=~p)", [Cmd, Name, CallerInfo]),
allow;
_ ->
none
end;
(_, Val) ->
Val
end, none, Defs),
case Res of
allow -> allow;
_ ->
?DEBUG("Command '~p' execution denied "
"(CallerInfo=~p)", [Cmd, CallerInfo]),
deny
end.
-spec invalidate() -> ok.
invalidate() ->
gen_server:cast(?MODULE, invalidate).
gen_server:cast(?MODULE, invalidate),
ets_cache:delete(?CACHE_TAB, definitions).
-spec show_current_definitions() -> [definition()].
show_current_definitions() ->
gen_server:call(?MODULE, show_current_definitions).
ets_cache:lookup(?CACHE_TAB, definitions,
fun() ->
{cache, gen_server:call(?MODULE, show_current_definitions)}
end).
start_link() ->
ets_cache:new(?CACHE_TAB, [{max_size, 2}]),
gen_server:start_link({local, ?SERVER}, ?MODULE, [], []).
%%%===================================================================
@@ -90,38 +119,11 @@ start_link() ->
-spec init([]) -> {ok, state()}.
init([]) ->
ejabberd_hooks:add(config_reloaded, ?MODULE, invalidate, 90),
ets_cache:new(access_permissions),
{ok, #state{}}.
-spec handle_call({can_access, atom(), caller_info()} |
show_current_definitions | term(),
-spec handle_call(show_current_definitions | term(),
term(), state()) -> {reply, term(), state()}.
handle_call({can_access, Cmd, CallerInfo}, _From, State) ->
CallerModule = maps:get(caller_module, CallerInfo, none),
Host = maps:get(caller_host, CallerInfo, global),
Tag = maps:get(tag, CallerInfo, none),
{State2, Defs0} = get_definitions(State),
Defs = maps:get(extra_permissions, CallerInfo, []) ++ Defs0,
Res = lists:foldl(
fun({Name, _} = Def, none) ->
case matches_definition(Def, Cmd, CallerModule, Tag, Host, CallerInfo) of
true ->
?DEBUG("Command '~p' execution allowed by rule "
"'~ts' (CallerInfo=~p)", [Cmd, Name, CallerInfo]),
allow;
_ ->
none
end;
(_, Val) ->
Val
end, none, Defs),
Res2 = case Res of
allow -> allow;
_ ->
?DEBUG("Command '~p' execution denied "
"(CallerInfo=~p)", [Cmd, CallerInfo]),
deny
end,
{reply, Res2, State2};
handle_call(show_current_definitions, _From, State) ->
{State2, Defs} = get_definitions(State),
{reply, Defs, State2};
+2 -1
View File
@@ -27,7 +27,8 @@
%% Hooks
-export([ejabberd_started/0, register_certfiles/0, cert_expired/2]).
%% ejabberd commands
-export([request_certificate/1, revoke_certificate/1, list_certificates/0]).
-export([get_commands_spec/0, request_certificate/1,
revoke_certificate/1, list_certificates/0]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3, format_status/2]).
+45 -20
View File
@@ -119,12 +119,15 @@ get_commands_spec() ->
desc = "Restart ejabberd gracefully",
module = init, function = restart,
args = [], result = {res, rescode}},
#ejabberd_commands{name = reopen_log, tags = [logs, server],
desc = "Reopen the log files",
#ejabberd_commands{name = reopen_log, tags = [logs],
desc = "Reopen the log files after being renamed",
longdesc = "This can be useful when an external tool is "
"used for log rotation. See "
"https://docs.ejabberd.im/admin/guide/troubleshooting/#log-files",
policy = admin,
module = ?MODULE, function = reopen_log,
args = [], result = {res, rescode}},
#ejabberd_commands{name = rotate_log, tags = [logs, server],
#ejabberd_commands{name = rotate_log, tags = [logs],
desc = "Rotate the log files",
module = ?MODULE, function = rotate_log,
args = [], result = {res, rescode}},
@@ -139,14 +142,14 @@ get_commands_spec() ->
args_example = [60, <<"Server will stop now.">>],
args = [{delay, integer}, {announcement, string}],
result = {res, rescode}},
#ejabberd_commands{name = get_loglevel, tags = [logs, server],
#ejabberd_commands{name = get_loglevel, tags = [logs],
desc = "Get the current loglevel",
module = ejabberd_logger, function = get,
result_desc = "Tuple with the log level number, its keyword and description",
result_example = warning,
args = [],
result = {levelatom, atom}},
#ejabberd_commands{name = set_loglevel, tags = [logs, server],
#ejabberd_commands{name = set_loglevel, tags = [logs],
desc = "Set the loglevel",
module = ?MODULE, function = set_loglevel,
args_desc = ["Desired logging level: none | emergency | alert | critical "
@@ -200,7 +203,7 @@ get_commands_spec() ->
result_example = [<<"example.com">>, <<"anon.example.com">>],
args = [],
result = {vhosts, {list, {vhost, string}}}},
#ejabberd_commands{name = reload_config, tags = [server, config],
#ejabberd_commands{name = reload_config, tags = [config],
desc = "Reload config file in memory",
module = ?MODULE, function = reload_config,
args = [],
@@ -254,21 +257,21 @@ get_commands_spec() ->
module = ejabberd_piefxis, function = import_file,
args_desc = ["Full path to the PIEFXIS file"],
args_example = ["/var/lib/ejabberd/example.com.xml"],
args = [{file, string}], result = {res, rescode}},
args = [{file, binary}], result = {res, rescode}},
#ejabberd_commands{name = export_piefxis, tags = [mnesia],
desc = "Export data of all users in the server to PIEFXIS files (XEP-0227)",
module = ejabberd_piefxis, function = export_server,
args_desc = ["Full path to a directory"],
args_example = ["/var/lib/ejabberd/"],
args = [{dir, string}], result = {res, rescode}},
args = [{dir, binary}], result = {res, rescode}},
#ejabberd_commands{name = export_piefxis_host, tags = [mnesia],
desc = "Export data of users in a host to PIEFXIS files (XEP-0227)",
module = ejabberd_piefxis, function = export_host,
args_desc = ["Full path to a directory", "Vhost to export"],
args_example = ["/var/lib/ejabberd/", "example.com"],
args = [{dir, string}, {host, string}], result = {res, rescode}},
args = [{dir, binary}, {host, binary}], result = {res, rescode}},
#ejabberd_commands{name = delete_mnesia, tags = [mnesia, sql],
#ejabberd_commands{name = delete_mnesia, tags = [mnesia],
desc = "Delete elements in Mnesia database for a given vhost",
module = ejd2sql, function = delete,
args_desc = ["Vhost which content will be deleted in Mnesia database"],
@@ -282,8 +285,8 @@ get_commands_spec() ->
args = [{host, binary}], result = {res, rescode}},
#ejabberd_commands{name = import_prosody, tags = [mnesia, sql],
desc = "Import data from Prosody",
longdesc = "Note: this method requires ejabberd compiled with optional tools support "
"and package must provide optional luerl dependency.",
longdesc = "Note: this requires ejabberd compiled with --enable-lua "
"and include the optional 'luerl' library.",
module = prosody2ejabberd, function = from_dir,
args_desc = ["Full path to the Prosody data directory"],
args_example = ["/var/lib/prosody/datadump/"],
@@ -317,13 +320,16 @@ get_commands_spec() ->
#ejabberd_commands{name = export2sql, tags = [mnesia],
desc = "Export virtual host information from Mnesia tables to SQL file",
longdesc = "Configure the modules to use SQL, then call this command.",
longdesc = "Configure the modules to use SQL, then call this command. "
"After correctly exported the database of a vhost, "
"you may want to delete from mnesia with "
"the http://./#delete-mnesia[delete_mnesia] command.",
module = ejd2sql, function = export,
args_desc = ["Vhost", "Full path to the destination SQL file"],
args_example = ["example.com", "/var/lib/ejabberd/example.com.sql"],
args = [{host, string}, {file, string}],
result = {res, rescode}},
#ejabberd_commands{name = set_master, tags = [mnesia],
#ejabberd_commands{name = set_master, tags = [cluster],
desc = "Set master node of the clustered Mnesia tables",
longdesc = "If you provide as nodename \"self\", this "
"node will be set as its own master.",
@@ -342,31 +348,41 @@ get_commands_spec() ->
{oldbackup, string}, {newbackup, string}],
result = {res, restuple}},
#ejabberd_commands{name = backup, tags = [mnesia],
desc = "Store the database to backup file",
desc = "Backup the Mnesia database to a binary file",
module = ?MODULE, function = backup_mnesia,
args_desc = ["Full path for the destination backup file"],
args_example = ["/var/lib/ejabberd/database.backup"],
args = [{file, string}], result = {res, restuple}},
#ejabberd_commands{name = restore, tags = [mnesia],
desc = "Restore the database from backup file",
desc = "Restore the Mnesia database from a binary backup file",
longdesc = "This restores immediately from a "
"binary backup file the internal Mnesia "
"database. This will consume a lot of memory if "
"you have a large database, you may prefer "
"'install_fallback'.",
module = ?MODULE, function = restore_mnesia,
args_desc = ["Full path to the backup file"],
args_example = ["/var/lib/ejabberd/database.backup"],
args = [{file, string}], result = {res, restuple}},
#ejabberd_commands{name = dump, tags = [mnesia],
desc = "Dump the database to a text file",
desc = "Dump the Mnesia database to a text file",
module = ?MODULE, function = dump_mnesia,
args_desc = ["Full path for the text file"],
args_example = ["/var/lib/ejabberd/database.txt"],
args = [{file, string}], result = {res, restuple}},
#ejabberd_commands{name = dump_table, tags = [mnesia],
desc = "Dump a table to a text file",
desc = "Dump a Mnesia table to a text file",
module = ?MODULE, function = dump_table,
args_desc = ["Full path for the text file", "Table name"],
args_example = ["/var/lib/ejabberd/table-muc-registered.txt", "muc_registered"],
args = [{file, string}, {table, string}], result = {res, restuple}},
#ejabberd_commands{name = load, tags = [mnesia],
desc = "Restore the database from a text file",
desc = "Restore Mnesia database from a text dump file",
longdesc = "Restore immediately. This is not "
"recommended for big databases, as it will "
"consume much time, memory and processor. In "
"that case it's preferable to use 'backup' and "
"'install_fallback'.",
module = ?MODULE, function = load_mnesia,
args_desc = ["Full path to the text file"],
args_example = ["/var/lib/ejabberd/database.txt"],
@@ -382,7 +398,14 @@ get_commands_spec() ->
args_example = ["roster"],
args = [{table, string}], result = {res, string}},
#ejabberd_commands{name = install_fallback, tags = [mnesia],
desc = "Install the database from a fallback file",
desc = "Install Mnesia database from a binary backup file",
longdesc = "The binary backup file is "
"installed as fallback: it will be used to "
"restore the database at the next ejabberd "
"start. This means that, after running this "
"command, you have to restart ejabberd. This "
"command requires less memory than
'restore'.",
module = ?MODULE, function = install_fallback_mnesia,
args_desc = ["Full path to the fallback file"],
args_example = ["/var/lib/ejabberd/database.fallback"],
@@ -393,10 +416,12 @@ get_commands_spec() ->
args = [], result = {res, rescode}},
#ejabberd_commands{name = gc, tags = [server],
desc = "Force full garbage collection",
note = "added in 20.01",
module = ?MODULE, function = gc,
args = [], result = {res, rescode}},
#ejabberd_commands{name = man, tags = [documentation],
desc = "Generate Unix manpage for current ejabberd version",
note = "added in 20.01",
module = ejabberd_doc, function = man,
args = [], result = {res, restuple}}
].
+14
View File
@@ -299,6 +299,20 @@ export(_Server) ->
["username=%(LUser)s",
"server_host=%(LServer)s",
"password=%(Password)s"])];
(Host, {passwd, {LUser, LServer},
{scram, StoredKey1, ServerKey, Salt, IterationCount}})
when LServer == Host ->
Hash = sha,
StoredKey = scram_hash_encode(Hash, StoredKey1),
[?SQL("delete from users where username=%(LUser)s and %(LServer)H;"),
?SQL_INSERT(
"users",
["username=%(LUser)s",
"server_host=%(LServer)s",
"password=%(StoredKey)s",
"serverkey=%(ServerKey)s",
"salt=%(Salt)s",
"iterationcount=%(IterationCount)d"])];
(Host, #passwd{us = {LUser, LServer}, password = #scram{} = Scram})
when LServer == Host ->
StoredKey = scram_hash_encode(Scram#scram.hash, Scram#scram.storedkey),
+1 -1
View File
@@ -880,7 +880,7 @@ get_priority_from_presence(#presence{priority = Prio}) ->
-spec route_multiple(state(), [jid()], stanza()) -> ok.
route_multiple(#{lserver := LServer}, JIDs, Pkt) ->
From = xmpp:get_from(Pkt),
ejabberd_router_multicast:route_multicast(From, LServer, JIDs, Pkt).
ejabberd_router_multicast:route_multicast(From, LServer, JIDs, Pkt, false).
get_subscription(#jid{luser = LUser, lserver = LServer}, JID) ->
{Subscription, _, _} = ejabberd_hooks:run_fold(
+16 -1
View File
@@ -41,6 +41,7 @@
get_tags_commands/0,
get_tags_commands/1,
register_commands/1,
register_commands/2,
unregister_commands/1,
get_commands_spec/0,
get_commands_definition/0,
@@ -90,6 +91,17 @@ get_commands_spec() ->
"that will have example invocation include in markdown document"],
result_desc = "0 if command failed, 1 when succeeded",
args_example = ["/home/me/docs/api.html", "mod_admin", "java,json"],
result_example = ok},
#ejabberd_commands{name = gen_markdown_doc_for_tags, tags = [documentation],
desc = "Generates markdown documentation for ejabberd_commands",
note = "added in 21.12",
module = ejabberd_commands_doc, function = generate_tags_md,
args = [{file, binary}],
result = {res, rescode},
args_desc = ["Path to file where generated "
"documentation should be stored"],
result_desc = "0 if command failed, 1 when succeeded",
args_example = ["/home/me/docs/tags.md"],
result_example = ok}].
start_link() ->
@@ -129,10 +141,13 @@ code_change(_OldVsn, State, _Extra) ->
-spec register_commands([ejabberd_commands()]) -> ok.
register_commands(Commands) ->
register_commands(unknown, Commands).
register_commands(Definer, Commands) ->
lists:foreach(
fun(Command) ->
%% XXX check if command exists
mnesia:dirty_write(Command)
mnesia:dirty_write(Command#ejabberd_commands{definer = Definer})
%% ?DEBUG("This command is already defined:~n~p", [Command])
end,
Commands),
+47 -7
View File
@@ -28,6 +28,7 @@
-export([generate_html_output/3]).
-export([generate_md_output/3]).
-export([generate_tags_md/1]).
-include("ejabberd_commands.hrl").
@@ -83,6 +84,8 @@ md_tag(h2, V) ->
[<<"\n__">>, V, <<"__\n\n">>];
md_tag(strong, V) ->
[<<"*">>, V, <<"*">>];
md_tag('div', V) ->
[<<"<div class='note-down'>">>, V, <<"</div>">>];
md_tag(_, V) ->
V.
@@ -358,8 +361,16 @@ gen_param(Name, Type, Desc, HTMLOutput) ->
[?TAG(dt, [?TAG_R(strong, atom_to_list(Name)), <<" :: ">>, ?RAW(format_type(Type))]),
?TAG(dd, ?RAW(Desc))].
gen_doc(#ejabberd_commands{name=Name, tags=_Tags, desc=Desc, longdesc=LongDesc,
args=Args, args_desc=ArgsDesc,
make_tags(HTMLOutput) ->
TagsList = ejabberd_commands:get_tags_commands(1000000),
lists:map(fun(T) -> gen_tags(T, HTMLOutput) end, TagsList).
-dialyzer({no_match, gen_tags/2}).
gen_tags({TagName, Commands}, HTMLOutput) ->
[?TAG(h1, TagName) | [?TAG(p, ?RAW("* *`"++C++"`*")) || C <- Commands]].
gen_doc(#ejabberd_commands{name=Name, tags=Tags, desc=Desc, longdesc=LongDesc,
args=Args, args_desc=ArgsDesc, note=Note, definer=Definer,
result=Result, result_desc=ResultDesc}=Cmd, HTMLOutput, Langs) ->
try
ArgsText = case ArgsDesc of
@@ -387,8 +398,24 @@ gen_doc(#ejabberd_commands{name=Name, tags=_Tags, desc=Desc, longdesc=LongDesc,
[?TAG(dl, [gen_param(RName, Type, ResultDesc, HTMLOutput)])]
end
end,
TagsText = [?RAW("*`"++atom_to_list(Tag)++"`* ") || Tag <- Tags],
IsDefinerMod = case Definer of
unknown -> true;
_ -> lists:member(gen_mod, proplists:get_value(behaviour, Definer:module_info(attributes)))
end,
ModuleText = case IsDefinerMod of
true ->
[?TAG(h2, <<"Module:">>), ?TAG(p, ?RAW("*`"++atom_to_list(Definer)++"`*"))];
false ->
[]
end,
NoteEl = case Note of
"" -> [];
_ -> ?TAG('div', "note-down", ?RAW(Note))
end,
[?TAG(h1, atom_to_list(Name)),
[NoteEl,
?TAG(h1, atom_to_list(Name)),
?TAG(p, ?RAW(Desc)),
case LongDesc of
"" -> [];
@@ -396,6 +423,8 @@ gen_doc(#ejabberd_commands{name=Name, tags=_Tags, desc=Desc, longdesc=LongDesc,
end,
?TAG(h2, <<"Arguments:">>), ArgsText,
?TAG(h2, <<"Result:">>), ResultText,
?TAG(h2, <<"Tags:">>), ?TAG(p, TagsText)]
++ ModuleText ++ [
?TAG(h2, <<"Examples:">>), gen_calls(Cmd, HTMLOutput, Langs)]
catch
_:Ex ->
@@ -414,12 +443,13 @@ find_commands_definitions() ->
lists:flatmap(fun(P) ->
Mod = list_to_atom(filename:rootname(P)),
code:ensure_loaded(Mod),
case erlang:function_exported(Mod, get_commands_spec, 0) of
Cs = case erlang:function_exported(Mod, get_commands_spec, 0) of
true ->
apply(Mod, get_commands_spec, []);
_ ->
[]
end
end,
[C#ejabberd_commands{definer = Mod} || C <- Cs]
end, filelib:wildcard("*.beam", Path))
end.
@@ -459,15 +489,25 @@ generate_md_output(File, RegExp, Languages) ->
end, Cmds2),
Cmds4 = [maybe_add_policy_arguments(Cmd) || Cmd <- Cmds3],
Langs = binary:split(Languages, <<",">>, [global]),
Header = <<"---\ntitle: Administration API reference\ntoc: true\nmenu: Administration API\norder: 40\n"
Header = <<"---\ntitle: Administration API reference\ntoc: true\nmenu: API Reference\norder: 1\n"
"// Autogenerated with 'ejabberdctl gen_markdown_doc_for_commands'\n---\n\n"
"This section describes API of ejabberd version ", (ejabberd_option:version())/binary>>,
"This section describes API of ejabberd.\n">>,
Out = lists:map(fun(C) -> gen_doc(C, false, Langs) end, Cmds4),
{ok, Fh} = file:open(File, [write]),
io:format(Fh, "~ts~ts", [Header, Out]),
file:close(Fh),
ok.
generate_tags_md(File) ->
Header = <<"---\ntitle: API Tags\ntoc: true\nmenu: API Tags\norder: 2\n"
"// Autogenerated with 'ejabberdctl gen_markdown_doc_for_tags'\n---\n\n"
"This section enumerates the tags and their associated API.\n">>,
Tags = make_tags(false),
{ok, Fh} = file:open(File, [write]),
io:format(Fh, "~ts~ts", [Header, Tags]),
file:close(Fh),
ok.
html_pre() ->
"<!DOCTYPE>
<html>
+167 -72
View File
@@ -174,27 +174,38 @@ process(["help" | Mode], Version) ->
{MaxC, ShCode} = get_shell_info(),
case Mode of
[] ->
print_usage(dual, MaxC, ShCode, Version),
?STATUS_USAGE;
print_usage_help(MaxC, ShCode),
?STATUS_SUCCESS;
["--dual"] ->
print_usage(dual, MaxC, ShCode, Version),
?STATUS_USAGE;
["--long"] ->
print_usage(long, MaxC, ShCode, Version),
?STATUS_USAGE;
["--tags"] ->
["tags"] ->
print_usage_tags(MaxC, ShCode, Version),
?STATUS_SUCCESS;
["--tags", Tag] ->
["--tags"] -> % deprecated in favor of "tags"
print_usage_tags(MaxC, ShCode, Version),
?STATUS_SUCCESS;
["commands"] ->
print_usage_tags_long(MaxC, ShCode, Version),
?STATUS_SUCCESS;
["--tags", Tag] -> % deprecated in favor of simply "Tag"
print_usage_tags(Tag, MaxC, ShCode, Version),
?STATUS_SUCCESS;
["help"] ->
print_usage_help(MaxC, ShCode),
?STATUS_SUCCESS;
[CmdString | _] ->
CmdStringU = ejabberd_regexp:greplace(
list_to_binary(CmdString), <<"-">>, <<"_">>),
print_usage_commands2(binary_to_list(CmdStringU), MaxC, ShCode, Version),
[String | _] ->
case determine_string_type(String, Version) of
no_idea ->
io:format("No tag or command matches '~ts'~n", [String]);
both ->
print_usage_tags(String, MaxC, ShCode, Version),
print_usage_commands2(String, MaxC, ShCode, Version);
tag ->
print_usage_tags(String, MaxC, ShCode, Version);
command ->
print_usage_commands2(String, MaxC, ShCode, Version)
end,
?STATUS_SUCCESS
end;
@@ -250,6 +261,21 @@ process2(Args, AccessCommands, Auth, Version) ->
{"Erroneous result: " ++ io_lib:format("~p", [Other]), ?STATUS_ERROR}
end.
determine_string_type(String, Version) ->
TagsCommands = ejabberd_commands:get_tags_commands(Version),
CommandsNames = case lists:keysearch(String, 1, TagsCommands) of
{value, {String, CNs}} -> CNs;
false -> []
end,
AllCommandsNames = [atom_to_list(Name) || {Name, _, _} <- ejabberd_commands:list_commands(Version)],
Cmds = filter_commands(AllCommandsNames, String),
case {CommandsNames, Cmds} of
{[], []} -> no_idea;
{[], _} -> command;
{_, []} -> tag;
{_, _} -> both
end.
%%-----------------------------
%% Command calling
%%-----------------------------
@@ -323,7 +349,8 @@ call_command([CmdString | Args], Auth, _AccessCommands, Version) ->
{L1, L2} when L1 < L2 -> {L2-L1, "less argument"};
{L1, L2} when L1 > L2 -> {L1-L2, "more argument"}
end,
{io_lib:format("Error: the command ~p requires ~p ~ts.",
process(["help" | [CmdString]]),
{io_lib:format("Error: the command '~ts' requires ~p ~ts.",
[CmdString, NumCompa, TextCompa]),
wrong_command_arguments}
end.
@@ -367,8 +394,8 @@ format_result({error, ErrorAtom}, _) ->
%% An error should always be allowed to return extended error to help with API.
%% Extended error is of the form:
%% {error, type :: atom(), code :: int(), Desc :: string()}
format_result({error, ErrorAtom, Code, _Msg}, _) ->
{io_lib:format("Error: ~p", [ErrorAtom]), make_status(Code)};
format_result({error, ErrorAtom, Code, Msg}, _) ->
{io_lib:format("Error: ~p: ~s", [ErrorAtom, Msg]), make_status(Code)};
format_result(Atom, {_Name, atom}) ->
io_lib:format("~p", [Atom]);
@@ -472,15 +499,25 @@ is_supported_args(Args) ->
%% Print help
%%-----------------------------
%% Bold
%% Commands are Bold
-define(B1, "\e[1m").
-define(B2, "\e[22m").
-define(B(S), case ShCode of true -> [?B1, S, ?B2]; false -> S end).
-define(B2, "\e[21m").
-define(C(S), case ShCode of true -> [?B1, S, ?B2]; false -> S end).
%% Underline
%% Arguments are Dim
-define(D1, "\e[2m").
-define(D2, "\e[22m").
-define(A(S), case ShCode of true -> [?D1, S, ?D2]; false -> S end).
%% Tags are Underline
-define(U1, "\e[4m").
-define(U2, "\e[24m").
-define(U(S), case ShCode of true -> [?U1, S, ?U2]; false -> S end).
-define(G(S), case ShCode of true -> [?U1, S, ?U2]; false -> S end).
%% B are Nothing
-define(N1, "\e[0m").
-define(N2, "\e[0m").
-define(B(S), case ShCode of true -> [?N1, S, ?N2]; false -> S end).
print_usage(Version) ->
{MaxC, ShCode} = get_shell_info(),
@@ -488,25 +525,19 @@ print_usage(Version) ->
print_usage(HelpMode, MaxC, ShCode, Version) ->
AllCommands =
[
{"help", ["[arguments]"], "Get help"},
{"status", [], "Get ejabberd status"},
{"stop", [], "Stop ejabberd"},
{"restart", [], "Restart ejabberd"},
{"help", ["[--tags [tag] | com?*]"], "Show help (try: ejabberdctl help help)"},
{"mnesia", ["[info]"], "show information of Mnesia system"}] ++
get_list_commands(Version),
print(
["Usage: ", ?B("ejabberdctl"), " [--no-timeout] [--node ", ?U("nodename"), "] [--version ", ?U("api_version"), "] ",
?U("command"), " [", ?U("options"), "]\n"
["Usage: ", "ejabberdctl", " [--no-timeout] [--node ", ?A("nodename"), "] [--version ", ?A("api_version"), "] ",
?C("command"), " [", ?A("arguments"), "]\n"
"\n"
"Available commands in this ejabberd node:\n"], []),
print_usage_commands(HelpMode, MaxC, ShCode, AllCommands),
print(
["\n"
"Examples:\n"
" ejabberdctl restart\n"
" ejabberdctl --node ejabberd@host restart\n"],
[]).
print_usage_commands(HelpMode, MaxC, ShCode, AllCommands).
print_usage_commands(HelpMode, MaxC, ShCode, Commands) ->
CmdDescsSorted = lists:keysort(1, Commands),
@@ -550,8 +581,24 @@ get_shell_info() ->
_:_ -> {78, false}
end.
%% Erlang/OTP 20.0 introduced string:find/2, but we must support old 19.3
string_find([], _SearchPattern) ->
nomatch;
string_find([A | String], [A]) ->
String;
string_find([_ | String], SearchPattern) ->
string_find(String, SearchPattern).
%% Split this command description in several lines of proper length
prepare_description(DescInit, MaxC, Desc) ->
case string_find(Desc, "\n") of
nomatch ->
prepare_description2(DescInit, MaxC, Desc);
_ ->
Desc
end.
prepare_description2(DescInit, MaxC, Desc) ->
Words = string:tokens(Desc, " "),
prepare_long_line(DescInit, MaxC, Words).
@@ -598,21 +645,27 @@ format_command_lines(CALD, MaxCmdLen, MaxC, ShCode, dual)
%% If the space available for descriptions is too narrow, enforce long help mode
format_command_lines(CALD, MaxCmdLen, MaxC, ShCode, long);
format_command_lines(CALD, _MaxCmdLen, _MaxC, ShCode, short) ->
lists:map(
fun({Cmd, Args, _CmdArgsL, _Desc}) ->
[" ", ?C(Cmd), [[" ", ?A(Arg)] || Arg <- Args], "\n"]
end, CALD);
format_command_lines(CALD, MaxCmdLen, MaxC, ShCode, dual) ->
lists:map(
fun({Cmd, Args, CmdArgsL, Desc}) ->
DescFmt = prepare_description(MaxCmdLen+4, MaxC, Desc),
[" ", ?B(Cmd), " ", [[?U(Arg), " "] || Arg <- Args],
string:chars($\s, MaxCmdLen - CmdArgsL + 1),
[" ", ?C(Cmd), [[" ", ?A(Arg)] || Arg <- Args],
lists:duplicate(MaxCmdLen - CmdArgsL + 1, $\s),
DescFmt, "\n"]
end, CALD);
format_command_lines(CALD, _MaxCmdLen, MaxC, ShCode, long) ->
lists:map(
fun({Cmd, Args, _CmdArgsL, Desc}) ->
DescFmt = prepare_description(8, MaxC, Desc),
["\n ", ?B(Cmd), " ", [[?U(Arg), " "] || Arg <- Args], "\n", " ",
DescFmt, "\n"]
DescFmt = prepare_description(13, MaxC, Desc),
[" ", ?C(Cmd), [[" ", ?A(Arg)] || Arg <- Args], "\n",
" ", DescFmt, "\n"]
end, CALD).
@@ -621,20 +674,42 @@ format_command_lines(CALD, _MaxCmdLen, MaxC, ShCode, long) ->
%%-----------------------------
print_usage_tags(MaxC, ShCode, Version) ->
print("Available tags and commands:", []),
print("Available tags and list of commands:", []),
TagsCommands = ejabberd_commands:get_tags_commands(Version),
lists:foreach(
fun({Tag, Commands} = _TagCommands) ->
print(["\n\n ", ?B(Tag), "\n "], []),
print(["\n\n ", ?G(Tag), "\n "], []),
Words = lists:sort(Commands),
Desc = prepare_long_line(5, MaxC, Words),
print(Desc, [])
print(?C(Desc), [])
end,
TagsCommands),
print("\n\n", []).
print_usage_tags_long(MaxC, ShCode, Version) ->
print("Available tags and commands details:", []),
TagsCommands = ejabberd_commands:get_tags_commands(Version),
print("\n", []),
lists:foreach(
fun({Tag, CommandsNames} = _TagCommands) ->
print(["\n ", ?G(Tag), "\n"], []),
CommandsList = lists:map(
fun(NameString) ->
C = ejabberd_commands:get_command_definition(
list_to_atom(NameString), Version),
#ejabberd_commands{name = Name,
args = Args,
desc = Desc} = C,
tuple_command_help({Name, Args, Desc})
end,
CommandsNames),
print_usage_commands(short, MaxC, ShCode, CommandsList)
end,
TagsCommands),
print("\n", []).
print_usage_tags(Tag, MaxC, ShCode, Version) ->
print(["Available commands with tag ", ?B(Tag), ":", "\n"], []),
print(["Available commands with tag ", ?G(Tag), ":", "\n", "\n"], []),
HelpMode = long,
TagsCommands = ejabberd_commands:get_tags_commands(Version),
CommandsNames = case lists:keysearch(Tag, 1, TagsCommands) of
@@ -661,26 +736,29 @@ print_usage_tags(Tag, MaxC, ShCode, Version) ->
print_usage_help(MaxC, ShCode) ->
LongDesc =
["The special 'help' ejabberdctl command provides help of ejabberd commands.\n\n"
"The format is:\n ", ?B("ejabberdctl"), " ", ?B("help"), " [", ?B("--tags"), " ", ?U("[tag]"), " | ", ?U("com?*"), "]\n\n"
["This special ", ?C("help"), " command provides help of ejabberd commands.\n\n"
"The format is:\n ", ?B("ejabberdctl"), " ", ?C("help"),
" [", ?A("tags"), " | ", ?A("commands"), " | ", ?G("tag"), " | ", ?C("command"), " | ", ?C("com?*"), "]\n\n"
"The optional arguments:\n"
" ",?B("--tags")," Show all tags and the names of commands in each tag\n"
" ",?B("--tags"), " ", ?U("tag")," Show description of commands in this tag\n"
" ",?U("command")," Show detailed description of the command\n"
" ",?U("com?*")," Show detailed description of commands that match this glob.\n"
" You can use ? to match a simple character,\n"
" and * to match several characters.\n"
" ",?A("tags")," Show all tags and commands names in each tag\n"
" ",?A("commands")," Show all tags and commands details in each tag\n"
" ",?G("tag")," Show commands related to this tag\n"
" ",?C("command")," Show detailed description of this command\n"
" ",?C("com?*")," Show commands that match this glob.\n"
" (? will match a simple character, and\n"
" * will match several characters)\n"
"\n",
"Some example usages:\n",
" ejabberdctl help\n",
" ejabberdctl help --tags\n",
" ejabberdctl help --tags accounts\n",
" ejabberdctl help register\n",
" ejabberdctl help regist*\n",
" ejabberdctl ", ?C("help"), "\n",
" ejabberdctl ", ?C("help"), " ", ?A("tags"), "\n",
" ejabberdctl ", ?C("help"), " ", ?A("commands"), "\n",
" ejabberdctl ", ?C("help"), " ", ?G("accounts"), "\n",
" ejabberdctl ", ?C("help"), " ", ?C("register"), "\n",
" ejabberdctl ", ?C("help"), " ", ?C("regist*"), "\n",
"\n",
"Please note that 'ejabberdctl help' shows all ejabberd commands,\n",
"Please note that 'ejabberdctl' shows all ejabberd commands,\n",
"even those that cannot be used in the shell with ejabberdctl.\n",
"Those commands can be identified because the description starts with: *"],
"Those commands can be identified because their description starts with: *"],
ArgsDef = [],
C = #ejabberd_commands{
name = help,
@@ -701,23 +779,26 @@ print_usage_commands2(CmdSubString, MaxC, ShCode, Version) ->
AllCommandsNames = [atom_to_list(Name) || {Name, _, _} <- ejabberd_commands:list_commands(Version)],
Cmds = filter_commands(AllCommandsNames, CmdSubString),
case Cmds of
[] -> io:format("Error: no command found that match: ~p~n", [CmdSubString]);
[] -> io:format("Error: no command found that match '~ts'~n", [CmdSubString]);
_ -> print_usage_commands3(lists:sort(Cmds), MaxC, ShCode, Version)
end.
print_usage_commands3([Cmd], MaxC, ShCode, Version) ->
print_usage_command(Cmd, MaxC, ShCode, Version);
print_usage_commands3(Cmds, MaxC, ShCode, Version) ->
%% Then for each one print it
lists:mapfoldl(
fun(Cmd, Remaining) ->
print_usage_command(Cmd, MaxC, ShCode, Version),
case Remaining > 1 of
true -> print([" ", lists:duplicate(MaxC, 126), " \n"], []);
false -> ok
end,
{ok, Remaining-1}
end,
length(Cmds),
Cmds).
CommandsList = lists:map(
fun(NameString) ->
C = ejabberd_commands:get_command_definition(
list_to_atom(NameString), Version),
#ejabberd_commands{name = Name,
args = Args,
desc = Desc} = C,
tuple_command_help({Name, Args, Desc})
end,
Cmds),
print_usage_commands(long, MaxC, ShCode, CommandsList), %% que aqui solo muestre un par de lineas
ok.
filter_commands(All, SubString) ->
case lists:member(SubString, All) of
@@ -747,15 +828,15 @@ print_usage_command(Cmd, MaxC, ShCode, Version) ->
print_usage_command2(Cmd, C, MaxC, ShCode) ->
#ejabberd_commands{
tags = TagsAtoms,
definer = Definer,
desc = Desc,
args = ArgsDef,
longdesc = LongDesc,
result = ResultDef} = C,
NameFmt = [" ", ?B("Command Name"), ": ", Cmd, "\n"],
NameFmt = [" ", ?B("Command Name"), ": ", ?C(Cmd), "\n"],
%% Initial indentation of result is 13 = length(" Arguments: ")
{ArgsDef, _, _} = ejabberd_commands:get_command_format(
C#ejabberd_commands.name, admin),
Args = [format_usage_ctype(ArgDef, 13) || ArgDef <- ArgsDef],
ArgsMargin = lists:duplicate(13, $\s),
ArgsListFmt = case Args of
@@ -770,9 +851,18 @@ print_usage_command2(Cmd, C, MaxC, ShCode) ->
XmlrpcFmt = "", %%+++ [" ",?B("XML-RPC"),": ", format_usage_xmlrpc(ArgsDef, ResultDef), "\n\n"],
TagsFmt = [" ",?B("Tags"),": ", prepare_long_line(8, MaxC, [atom_to_list(TagA) || TagA <- TagsAtoms])],
TagsFmt = [" ",?B("Tags"),":", prepare_long_line(8, MaxC, [?G(atom_to_list(TagA)) || TagA <- TagsAtoms])],
DescFmt = [" ",?B("Description"),": ", prepare_description(15, MaxC, Desc)],
IsDefinerMod = case Definer of
unknown -> true;
_ -> lists:member(gen_mod, proplists:get_value(behaviour, Definer:module_info(attributes)))
end,
ModuleFmt = case IsDefinerMod of
true -> [" ",?B("Module"),": ", atom_to_list(Definer), "\n\n"];
false -> []
end,
DescFmt = [" ",?B("Description"),":", prepare_description(15, MaxC, Desc)],
LongDescFmt = case LongDesc of
"" -> "";
@@ -784,7 +874,12 @@ print_usage_command2(Cmd, C, MaxC, ShCode) ->
false -> [" ", ?B("Note:"), " This command cannot be executed using ejabberdctl. Try ejabberd_xmlrpc.\n\n"]
end,
print(["\n", NameFmt, "\n", ArgsFmt, "\n", ReturnsFmt, "\n\n", XmlrpcFmt, TagsFmt, "\n\n", DescFmt, "\n\n", LongDescFmt, NoteEjabberdctl], []).
case Cmd of
"help" -> ok;
_ -> print([NameFmt, "\n", ArgsFmt, "\n", ReturnsFmt,
"\n\n", XmlrpcFmt, TagsFmt, "\n\n", ModuleFmt, DescFmt, "\n\n"], [])
end,
print([LongDescFmt, NoteEjabberdctl], []).
format_usage_ctype(Type, _Indentation)
when (Type==atom) or (Type==integer) or (Type==string) or (Type==binary) or (Type==rescode) or (Type==restuple)->
+4
View File
@@ -159,6 +159,10 @@ opt_to_man(Lang, {Option, Options, Children}, Level) ->
lists:keysort(1, Children))]) ++
[io_lib:nl()|format_example(Level, Lang, Options)].
format_option(Lang, Option, #{note := Note, value := Val}) ->
"\n\n_Note_ about the next option: " ++ Note ++ ":\n\n"++
"*" ++ atom_to_list(Option) ++ "*: 'pass:[" ++
tr(Lang, Val) ++ "]'::";
format_option(Lang, Option, #{value := Val}) ->
"*" ++ atom_to_list(Option) ++ "*: 'pass:[" ++
tr(Lang, Val) ++ "]'::";
+8 -8
View File
@@ -51,7 +51,7 @@
active = false :: boolean(),
c2s_pid :: pid(),
ws :: {#ws{}, pid()},
rfc_compilant = undefined :: boolean() | undefined}).
rfc_compliant = undefined :: boolean() | undefined}).
%-define(DBGFSM, true).
@@ -166,7 +166,7 @@ handle_event({new_shaper, Shaper}, StateName, #state{ws = {_, WsPid}} = StateDat
{next_state, StateName, StateData}.
handle_sync_event({send_xml, Packet}, _From, StateName,
#state{ws = {_, WsPid}, rfc_compilant = R} = StateData) ->
#state{ws = {_, WsPid}, rfc_compliant = R} = StateData) ->
Packet2 = case {case R of undefined -> true; V -> V end, Packet} of
{true, {xmlstreamstart, _, Attrs}} ->
Attrs2 = [{<<"xmlns">>, <<"urn:ietf:params:xml:ns:xmpp-framing">>} |
@@ -215,7 +215,7 @@ handle_sync_event({send_xml, Packet}, _From, StateName,
StateName
end,
{reply, ok, SN2, StateData};
handle_sync_event(close, _From, StateName, #state{ws = {_, WsPid}, rfc_compilant = true} = StateData)
handle_sync_event(close, _From, StateName, #state{ws = {_, WsPid}, rfc_compliant = true} = StateData)
when StateName /= stream_end_sent ->
Close = #xmlel{name = <<"close">>,
attrs = [{<<"xmlns">>, <<"urn:ietf:params:xml:ns:xmpp-framing">>}]},
@@ -313,7 +313,7 @@ get_human_html_xmlel() ->
"client that supports it.">>}]}]}]}.
parse(#state{rfc_compilant = C} = State, Data) ->
parse(#state{rfc_compliant = C} = State, Data) ->
case C of
undefined ->
P = fxml_stream:new(self()),
@@ -321,13 +321,13 @@ parse(#state{rfc_compilant = C} = State, Data) ->
fxml_stream:close(P2),
case parsed_items([]) of
error ->
{State#state{rfc_compilant = true}, <<"parse error">>};
{State#state{rfc_compliant = true}, <<"parse error">>};
[] ->
{State#state{rfc_compilant = true}, <<"parse error">>};
{State#state{rfc_compliant = true}, <<"parse error">>};
[{xmlstreamstart, <<"open">>, _} | _] ->
parse(State#state{rfc_compilant = true}, Data);
parse(State#state{rfc_compliant = true}, Data);
_ ->
parse(State#state{rfc_compilant = false}, Data)
parse(State#state{rfc_compliant = false}, Data)
end;
true ->
El = fxml_stream:parse_element(Data),
+5 -2
View File
@@ -113,10 +113,11 @@ init({Port, _, udp} = EndPoint, Module, Opts, SockOpts) ->
_ ->
{Port, SockOpts}
end,
ExtraOpts2 = lists:keydelete(send_timeout, 1, ExtraOpts),
case gen_udp:open(Port2, [binary,
{active, false},
{reuseaddr, true} |
ExtraOpts]) of
ExtraOpts2]) of
{ok, Socket} ->
case inet:sockname(Socket) of
{ok, {Addr, Port1}} ->
@@ -195,7 +196,6 @@ listen_tcp(Port, SockOpts) ->
{active, false},
{reuseaddr, true},
{nodelay, true},
{send_timeout, ?TCP_SEND_TIMEOUT},
{send_timeout_close, true},
{keepalive, true} | ExtraOpts]),
case Res of
@@ -682,6 +682,8 @@ listen_opt_type(max_stanza_size) ->
econf:pos_int(infinity);
listen_opt_type(max_fsm_queue) ->
econf:pos_int();
listen_opt_type(send_timeout) ->
econf:timeout(second, infinity);
listen_opt_type(shaper) ->
econf:shaper();
listen_opt_type(access) ->
@@ -694,6 +696,7 @@ listen_options() ->
{transport, tcp},
{ip, {0,0,0,0}},
{accept_interval, 0},
{send_timeout, 15000},
{backlog, 5},
{use_proxy_protocol, false},
{supervisor, true}].
+10 -2
View File
@@ -288,10 +288,11 @@ start(Level) ->
ConsoleFmtConfig = FmtConfig#{template => console_template()},
try
ok = logger:set_primary_config(level, Level),
ok = logger:update_formatter_config(default, ConsoleFmtConfig),
DefaultHandlerId = get_default_handlerid(),
ok = logger:update_formatter_config(DefaultHandlerId, ConsoleFmtConfig),
case quiet_mode() of
true ->
ok = logger:set_handler_config(default, level, critical);
ok = logger:set_handler_config(DefaultHandlerId, level, critical);
_ ->
ok
end,
@@ -319,6 +320,13 @@ start(Level) ->
Err
end.
get_default_handlerid() ->
Ids = logger:get_handler_ids(),
case lists:member(default, Ids) of
true -> default;
false -> hd(Ids)
end.
-spec restart() -> ok.
restart() ->
ok.
+105 -91
View File
@@ -61,11 +61,11 @@ doc() ->
desc =>
?T("The time of a cached item to keep in cache. "
"Once it's expired, the corresponding item is "
"erased from cache. The default value is 'one hour'. "
"erased from cache. The default value is '1 hour'. "
"Several modules have a similar option; and some core "
"ejabberd parts support similar options too, see "
"'auth_cache_life_time', 'oauth_cache_life_time', "
"'router_cache_life_time', and 'sm_cache_life_time'.")}},
"_`auth_cache_life_time`_, _`oauth_cache_life_time`_, "
"_`router_cache_life_time`_, and _`sm_cache_life_time`_.")}},
{cache_missed,
#{value => "true | false",
desc =>
@@ -73,12 +73,12 @@ doc() ->
"an attempt to lookup for a value in a database and "
"this value is not found and the option is set to 'true', "
"this attempt will be cached and no attempts will be "
"performed until the cache expires (see 'cache_life_time'). "
"performed until the cache expires (see _`cache_life_time`_). "
"Usually you don't want to change it. Default is 'true'. "
"Several modules have a similar option; and some core "
"ejabberd parts support similar options too, see "
"'auth_cache_missed', 'oauth_cache_missed', "
"'router_cache_missed', and 'sm_cache_missed'.")}},
"_`auth_cache_missed`_, _`oauth_cache_missed`_, "
"_`router_cache_missed`_, and _`sm_cache_missed`_.")}},
{cache_size,
#{value => "pos_integer() | infinity",
desc =>
@@ -93,16 +93,16 @@ doc() ->
"performance. The default value is '1000'. "
"Several modules have a similar option; and some core "
"ejabberd parts support similar options too, see "
"'auth_cache_size', 'oauth_cache_size', "
"'router_cache_size', and 'sm_cache_size'.")}},
"_`auth_cache_size`_, _`oauth_cache_size`_, "
"_`router_cache_size`_, and _`sm_cache_size`_.")}},
{use_cache,
#{value => "true | false",
desc =>
?T("Enable or disable cache. The default is 'true'. "
"Several modules have a similar option; and some core "
"ejabberd parts support similar options too, see "
"'auth_use_cache', 'oauth_use_cache', 'router_use_cache', "
"and 'sm_use_cache'.")}},
"_`auth_use_cache`_, _`oauth_use_cache`_, _`router_use_cache`_, "
"and _`sm_use_cache`_.")}},
{default_db,
#{value => "mnesia | sql",
desc =>
@@ -122,14 +122,14 @@ doc() ->
"Modules may have its own value of the option. "
"The value of 'ram' means that queues will be kept in memory. "
"If value 'file' is set, you may also specify directory "
"in 'queue_dir' option where file queues will be placed. "
"in _`queue_dir`_ option where file queues will be placed. "
"The default value is 'ram'.")}},
{version,
#{value => "string()",
desc =>
?T("The option can be used to set custom ejabberd version, "
"that will be used by different parts of ejabberd, for "
"example by 'mod_version' module. The default value is "
"example by _`mod_version`_ module. The default value is "
"obtained at compile time from the underlying version "
"control system.")}},
{acl,
@@ -141,7 +141,7 @@ doc() ->
"has name 'ACLName': it can be any string except 'all' or 'none' "
"(those are predefined names for the rules that match all or nothing "
"respectively). The name 'ACLName' can be referenced from other "
"parts of the configuration file, for example in 'access_rules' "
"parts of the configuration file, for example in _`access_rules`_ "
"option. The rules of 'ACLName' are represented by mapping "
"'pass:[{ACLType: ACLValue}]'. These can be one of the following:")},
[{user,
@@ -225,7 +225,7 @@ doc() ->
"of the configuration file (mostly from 'access' options of "
"ejabberd modules). Each rule definition may contain "
"arbitrary number of 'allow' or 'deny' sections, and each "
"section may contain any number of ACL rules (see 'acl' option). "
"section may contain any number of ACL rules (see _`acl`_ option). "
"There are no access rules defined by default."),
example =>
["access_rules:",
@@ -313,10 +313,12 @@ doc() ->
{anonymous_protocol,
#{value => "login_anon | sasl_anon | both",
desc =>
?T("'login_anon' means that the anonymous login method will be used. "
"'sasl_anon' means that the SASL Anonymous method will be used. "
"'both' means that SASL Anonymous and login anonymous are both "
"enabled. The default value is 'sasl_anon'.")}},
[?T("Define what anonymous protocol will be used: "), "",
?T("* 'login_anon' means that the anonymous login method will be used. "), "",
?T("* 'sasl_anon' means that the SASL Anonymous method will be used. "), "",
?T("* 'both' means that SASL Anonymous and login anonymous are both "
"enabled."), "",
?T("The default value is 'sasl_anon'."), ""]}},
{api_permissions,
#{value => "[Permission, ...]",
desc =>
@@ -334,18 +336,18 @@ doc() ->
{auth_cache_life_time,
#{value => "timeout()",
desc =>
?T("Same as 'cache_life_time', but applied to authentication cache "
"only. If not set, the value from 'cache_life_time' will be used.")}},
?T("Same as _`cache_life_time`_, but applied to authentication cache "
"only. If not set, the value from _`cache_life_time`_ will be used.")}},
{auth_cache_missed,
#{value => "true | false",
desc =>
?T("Same as 'cache_missed', but applied to authentication cache "
"only. If not set, the value from 'cache_missed' will be used.")}},
?T("Same as _`cache_missed`_, but applied to authentication cache "
"only. If not set, the value from _`cache_missed`_ will be used.")}},
{auth_cache_size,
#{value => "pos_integer() | infinity",
desc =>
?T("Same as 'cache_size', but applied to authentication cache "
"only. If not set, the value from 'cache_size' will be used.")}},
?T("Same as _`cache_size`_, but applied to authentication cache "
"only. If not set, the value from _`cache_size`_ will be used.")}},
{auth_method,
#{value => "[mnesia | sql | anonymous | external | jwt | ldap | pam, ...]",
desc =>
@@ -359,37 +361,41 @@ doc() ->
desc =>
?T("This is used by the contributed module "
"'ejabberd_auth_http' that can be installed from the "
"'ejabberd-contrib' Git repository. Please refer to that "
"https://github.com/processone/ejabberd-contrib[ejabberd-contrib] "
"Git repository. Please refer to that "
"module's README file for details.")}},
{auth_password_format,
#{value => "plain | scram",
note => "improved in 20.01",
desc =>
?T("The option defines in what format the users passwords "
"are stored. 'plain': The password is stored as plain text "
[?T("The option defines in what format the users passwords "
"are stored:"), "",
?T("* 'plain': The password is stored as plain text "
"in the database. This is risky because the passwords "
"can be read if your database gets compromised. "
"This is the default value. This format allows clients to "
"authenticate using: the old Jabber Non-SASL (XEP-0078), "
"SASL PLAIN, SASL DIGEST-MD5, and SASL SCRAM-SHA-1. "
"'scram': The password is not stored, only some information "
"SASL PLAIN, SASL DIGEST-MD5, and SASL SCRAM-SHA-1. "), "",
?T("* 'scram': The password is not stored, only some information "
"that allows to verify the hash provided by the client. "
"It is impossible to obtain the original plain password "
"from the stored information; for this reason, when this "
"value is configured it cannot be changed to plain anymore. "
"This format allows clients to authenticate using: "
"SASL PLAIN and SASL SCRAM-SHA-1.")}},
"SASL PLAIN and SASL SCRAM-SHA-1."),
?T("The default value is 'plain'.")]}},
{auth_scram_hash,
#{value => "sha | sha256 | sha512",
desc =>
?T("Hash algorith that should be used to store password in SCRAM format. "
"You shouldn't change this if you already have passwords generated with "
"a different algorithm - users that have such passwords will not be able "
"to authenticate.")}},
"to authenticate. The default value is 'sha'.")}},
{auth_use_cache,
#{value => "true | false",
desc =>
?T("Same as 'use_cache', but applied to authentication cache "
"only. If not set, the value from 'use_cache' will be used.")}},
?T("Same as _`use_cache`_, but applied to authentication cache "
"only. If not set, the value from _`use_cache`_ will be used.")}},
{c2s_cafile,
#{value => ?T("Path"),
desc =>
@@ -448,22 +454,22 @@ doc() ->
{captcha_cmd,
#{value => ?T("Path"),
desc =>
?T("Full path to a script that generates CAPTCHA images. "
?T("Full path to a script that generates http://../basic/#captcha[CAPTCHA] images. "
"There is no default value: when this option is not "
"set, CAPTCHA functionality is completely disabled.")}},
{captcha_limit,
#{value => "pos_integer() | infinity",
desc =>
?T("Maximum number of CAPTCHA generated images per minute for "
?T("Maximum number of http://../basic/#captcha[CAPTCHA] generated images per minute for "
"any given JID. The option is intended to protect the server "
"from CAPTCHA DoS. The default value is 'infinity'.")}},
{captcha_host,
#{value => "String",
desc => ?T("Deprecated. Use 'captcha_url' instead.")}},
desc => ?T("Deprecated. Use _`captcha_url`_ instead.")}},
{captcha_url,
#{value => ?T("URL"),
desc =>
?T("An URL where CAPTCHA requests should be sent. NOTE: you need "
?T("An URL where http://../basic/#captcha[CAPTCHA] requests should be sent. NOTE: you need "
"to configure 'request_handlers' for 'ejabberd_http' listener "
"as well. There is no default value.")}},
{certfiles,
@@ -673,7 +679,8 @@ doc() ->
desc =>
?T("The option defines the default language of server strings "
"that can be seen by XMPP clients. If an XMPP client does not "
"possess 'xml:lang' attribute, the specified language is used.")}},
"possess 'xml:lang' attribute, the specified language is used. "
"The default value is '\"en\"'.")}},
{ldap_servers,
#{value => "[Host, ...]",
desc =>
@@ -683,7 +690,7 @@ doc() ->
#{value => "[Host, ...]",
desc =>
?T("A list of IP addresses or DNS names of LDAP backup servers. "
"When no servers listed in 'ldap_servers' option are reachable, "
"When no servers listed in _`ldap_servers`_ option are reachable, "
"ejabberd will try to connect to these backup servers. "
"The default is an empty list, i.e. no backup servers specified. "
"WARNING: ejabberd doesn't try to reconnect back to the main "
@@ -790,7 +797,7 @@ doc() ->
"the result set. There is no default value, which means the "
"result is not filtered. WARNING: Since this filter makes "
"additional LDAP lookups, use it only as the last resort: "
"try to define all filter rules in 'ldap_filter' option if possible."),
"try to define all filter rules in _`ldap_filter`_ option if possible."),
example =>
["ldap_dn_filter:",
" \"(&(name=%s)(owner=%D)(user=%u@%d))\": [sn]"]}},
@@ -798,7 +805,8 @@ doc() ->
#{value => ?T("Number"),
desc =>
?T("The number of rotated log files to keep. "
"The default value is '1'.")}},
"The default value is '1', which means that only keeps "
"`ejabberd.log.0`, `error.log.0` and `crash.log.0`.")}},
{log_rotate_size,
#{value => "pos_integer() | infinity",
desc =>
@@ -834,7 +842,7 @@ doc() ->
"must have identical value on all nodes, or it will lead to subtle "
"bugs. Usually leaving default value of this is option is best, "
"tweak it only if you know what you are doing. "
"The default value is '1' minute.")}},
"The default value is '1 minute'.")}},
{new_sql_schema,
#{value => "true | false",
desc =>
@@ -860,23 +868,24 @@ doc() ->
{oauth_cache_life_time,
#{value => "timeout()",
desc =>
?T("Same as 'cache_life_time', but applied to OAuth cache "
"only. If not set, the value from 'cache_life_time' will be used.")}},
?T("Same as _`cache_life_time`_, but applied to OAuth cache "
"only. If not set, the value from _`cache_life_time`_ will be used.")}},
{oauth_cache_missed,
#{value => "true | false",
desc =>
?T("Same as 'cache_missed', but applied to OAuth cache "
"only. If not set, the value from 'cache_missed' will be used.")}},
?T("Same as _`cache_missed`_, but applied to OAuth cache "
"only. If not set, the value from _`cache_missed`_ will be used.")}},
{oauth_cache_rest_failure_life_time,
#{value => "timeout()",
note => "added in 21.01",
desc =>
?T("The time that a failure in OAuth ReST is cached. "
"The default value is 'infinity'.")}},
{oauth_cache_size,
#{value => "pos_integer() | infinity",
desc =>
?T("Same as 'cache_size', but applied to OAuth cache "
"only. If not set, the value from 'cache_size' will be used.")}},
?T("Same as _`cache_size`_, but applied to OAuth cache "
"only. If not set, the value from _`cache_size`_ will be used.")}},
{oauth_client_id_check,
#{value => "allow | db | deny",
desc =>
@@ -886,13 +895,13 @@ doc() ->
{oauth_use_cache,
#{value => "true | false",
desc =>
?T("Same as 'use_cache', but applied to OAuth cache "
"only. If not set, the value from 'use_cache' will be used.")}},
?T("Same as _`use_cache`_, but applied to OAuth cache "
"only. If not set, the value from _`use_cache`_ will be used.")}},
{oauth_db_type,
#{value => "mnesia | sql",
desc =>
?T("Database backend to use for OAuth authentication. "
"The default value is picked from 'default_db' option, or "
"The default value is picked from _`default_db`_ option, or "
"if it's not set, 'mnesia' will be used.")}},
{oauth_expire,
#{value => "timeout()",
@@ -906,7 +915,7 @@ doc() ->
desc =>
?T("Enable or disable OOM (out-of-memory) killer. "
"When system memory raises above the limit defined in "
"'oom_watermark' option, ejabberd triggers OOM killer "
"_`oom_watermark`_ option, ejabberd triggers OOM killer "
"to terminate most memory consuming Erlang processes. "
"Note that in order to maintain functionality, ejabberd only "
"attempts to kill transient processes, such as those managing "
@@ -917,14 +926,14 @@ doc() ->
desc =>
?T("Trigger OOM killer when some of the running Erlang processes "
"have messages queue above this 'Size'. Note that "
"such processes won't be killed if 'oom_killer' option is set "
"such processes won't be killed if _`oom_killer`_ option is set "
"to 'false' or if 'oom_watermark' is not reached yet.")}},
{oom_watermark,
#{value => ?T("Percent"),
desc =>
?T("A percent of total system memory consumed at which "
"OOM killer should be activated with some of the processes "
"possibly be killed (see 'oom_killer' option). Later, when "
"possibly be killed (see _`oom_killer`_ option). Later, when "
"memory drops below this 'Percent', OOM killer is deactivated. "
"The default value is '80' percents.")}},
{outgoing_s2s_families,
@@ -935,12 +944,14 @@ doc() ->
"connecting with IPv4, if that fails it tries using IPv6.")}},
{outgoing_s2s_ipv4_address,
#{value => "Address",
note => "added in 20.12",
desc =>
?T("Specify the IPv4 address that will be used when establishing "
"an outgoing S2S IPv4 connection, for example \"127.0.0.1\". "
"The default value is 'undefined'.")}},
{outgoing_s2s_ipv6_address,
#{value => "Address",
note => "added in 20.12",
desc =>
?T("Specify the IPv6 address that will be used when establishing "
"an outgoing S2S IPv6 connection, for example "
@@ -975,7 +986,7 @@ doc() ->
{queue_dir,
#{value => ?T("Directory"),
desc =>
?T("If 'queue_type' option is set to 'file', use this 'Directory' "
?T("If _`queue_type`_ option is set to 'file', use this 'Directory' "
"to store file queues. The default is to keep queues inside "
"Mnesia directory.")}},
{redis_connect_timeout,
@@ -1005,8 +1016,8 @@ doc() ->
#{value => "ram | file",
desc =>
?T("The type of request queue for the Redis server. "
"See description of 'queue_type' option for the explanation. "
"The default value is the value defined in 'queue_type' "
"See description of _`queue_type`_ option for the explanation. "
"The default value is the value defined in _`queue_type`_ "
"or 'ram' if the latter is not set.")}},
{redis_server,
#{value => ?T("Hostname"),
@@ -1016,7 +1027,7 @@ doc() ->
{registration_timeout,
#{value => "timeout()",
desc =>
?T("This is a global option for module 'mod_register'. "
?T("This is a global option for module _`mod_register`_. "
"It limits the frequency of registrations from a given "
"IP or username. So, a user that tries to register a "
"new account from the same IP address or JID during "
@@ -1039,29 +1050,29 @@ doc() ->
{router_cache_life_time,
#{value => "timeout()",
desc =>
?T("Same as 'cache_life_time', but applied to routing table cache "
"only. If not set, the value from 'cache_life_time' will be used.")}},
?T("Same as _`cache_life_time`_, but applied to routing table cache "
"only. If not set, the value from _`cache_life_time`_ will be used.")}},
{router_cache_missed,
#{value => "true | false",
desc =>
?T("Same as 'cache_missed', but applied to routing table cache "
"only. If not set, the value from 'cache_missed' will be used.")}},
?T("Same as _`cache_missed`_, but applied to routing table cache "
"only. If not set, the value from _`cache_missed`_ will be used.")}},
{router_cache_size,
#{value => "pos_integer() | infinity",
desc =>
?T("Same as 'cache_size', but applied to routing table cache "
"only. If not set, the value from 'cache_size' will be used.")}},
?T("Same as _`cache_size`_, but applied to routing table cache "
"only. If not set, the value from _`cache_size`_ will be used.")}},
{router_db_type,
#{value => "mnesia | redis | sql",
desc =>
?T("Database backend to use for routing information. "
"The default value is picked from 'default_ram_db' option, or "
"The default value is picked from _`default_ram_db`_ option, or "
"if it's not set, 'mnesia' will be used.")}},
{router_use_cache,
#{value => "true | false",
desc =>
?T("Same as 'use_cache', but applied to routing table cache "
"only. If not set, the value from 'use_cache' will be used.")}},
?T("Same as _`use_cache`_, but applied to routing table cache "
"only. If not set, the value from _`use_cache`_ will be used.")}},
{rpc_timeout,
#{value => "timeout()",
desc =>
@@ -1138,14 +1149,14 @@ doc() ->
#{value => "ram | file",
desc =>
?T("The type of a queue for s2s packets. "
"See description of 'queue_type' option for the explanation. "
"The default value is the value defined in 'queue_type' "
"See description of _`queue_type`_ option for the explanation. "
"The default value is the value defined in _`queue_type`_ "
"or 'ram' if the latter is not set.")}},
{s2s_timeout,
#{value => "timeout()",
desc =>
?T("A time to wait before closing an idle s2s connection. "
"The default value is '10' minutes.")}},
"The default value is '10 minutes'.")}},
{s2s_use_starttls,
#{value => "true | false | optional | required",
desc =>
@@ -1167,7 +1178,7 @@ doc() ->
desc =>
?T("The option defines a set of shapers. Every shaper is assigned "
"a name 'ShaperName' that can be used in other parts of the "
"configuration file, such as 'shaper_rules' option. The shaper "
"configuration file, such as _`shaper_rules`_ option. The shaper "
"itself is defined by its 'Rate', where 'Rate' stands for the "
"maximum allowed incoming rate in **bytes** per second. "
"When a connection exceeds this limit, ejabberd stops reading "
@@ -1183,9 +1194,9 @@ doc() ->
#{value => "{ShaperRuleName: {Number|ShaperName: ACLRule|ACLName}}",
desc =>
?T("An entry allowing to declaring shaper to use for matching user/hosts. "
"Semantics is similar to 'access_rules' option, the only difference is "
"Semantics is similar to _`access_rules`_ option, the only difference is "
"that instead using 'allow' or 'deny', a name of a shaper (defined in "
"'shaper' option) or a positive number should be used."),
"_`shaper`_ option) or a positive number should be used."),
example =>
["shaper_rules:",
" connections_limit:",
@@ -1201,29 +1212,29 @@ doc() ->
{sm_cache_life_time,
#{value => "timeout()",
desc =>
?T("Same as 'cache_life_time', but applied to client sessions table cache "
"only. If not set, the value from 'cache_life_time' will be used.")}},
?T("Same as _`cache_life_time`_, but applied to client sessions table cache "
"only. If not set, the value from _`cache_life_time`_ will be used.")}},
{sm_cache_missed,
#{value => "true | false",
desc =>
?T("Same as 'cache_missed', but applied to client sessions table cache "
"only. If not set, the value from 'cache_missed' will be used.")}},
?T("Same as _`cache_missed`_, but applied to client sessions table cache "
"only. If not set, the value from _`cache_missed`_ will be used.")}},
{sm_cache_size,
#{value => "pos_integer() | infinity",
desc =>
?T("Same as 'cache_size', but applied to client sessions table cache "
"only. If not set, the value from 'cache_size' will be used.")}},
?T("Same as _`cache_size`_, but applied to client sessions table cache "
"only. If not set, the value from _`cache_size`_ will be used.")}},
{sm_db_type,
#{value => "mnesia | redis | sql",
desc =>
?T("Database backend to use for client sessions information. "
"The default value is picked from 'default_ram_db' option, or "
"The default value is picked from _`default_ram_db`_ option, or "
"if it's not set, 'mnesia' will be used.")}},
{sm_use_cache,
#{value => "true | false",
desc =>
?T("Same as 'use_cache', but applied to client sessions table cache "
"only. If not set, the value from 'use_cache' will be used.")}},
?T("Same as _`use_cache`_, but applied to client sessions table cache "
"only. If not set, the value from _`use_cache`_ will be used.")}},
{sql_type,
#{value => "mssql | mysql | odbc | pgsql | sqlite",
desc =>
@@ -1246,9 +1257,10 @@ doc() ->
"keepalive requests are made.")}},
{sql_odbc_driver,
#{value => "Path",
note => "added in 20.12",
desc =>
?T("Path to the ODBC driver to use to connect to a Microsoft SQL "
"Server database. This option is only valid if the 'sql_type' "
"Server database. This option is only valid if the _`sql_type`_ "
"option is set to 'mssql'. "
"The default value is: 'libtdsodbc.so'")}},
{sql_password,
@@ -1270,6 +1282,7 @@ doc() ->
"'1433' for MS SQL. The option has no effect for SQLite.")}},
{sql_prepared_statements,
#{value => "true | false",
note => "added in 20.01",
desc =>
?T("This option is 'true' by default, and is useful to disable "
"prepared statements. The option is valid for PostgreSQL.")}},
@@ -1282,8 +1295,8 @@ doc() ->
#{value => "ram | file",
desc =>
?T("The type of a request queue for the SQL server. "
"See description of 'queue_type' option for the explanation. "
"The default value is the value defined in 'queue_type' "
"See description of _`queue_type`_ option for the explanation. "
"The default value is the value defined in _`queue_type`_ "
"or 'ram' if the latter is not set.")}},
{sql_server,
#{value => ?T("Host"),
@@ -1292,23 +1305,24 @@ doc() ->
"The default value is 'localhost'.")}},
{sql_ssl,
#{value => "true | false",
note => "improved in 20.03",
desc =>
?T("Whether to use SSL encrypted connections to the "
"SQL server. The option is only available for "
"SQL server. The option is only available for MySQL and "
"PostgreSQL. The default value is 'false'.")}},
{sql_ssl_cafile,
#{value => ?T("Path"),
desc =>
?T("A path to a file with CA root certificates that will "
"be used to verify SQL connections. Implies 'sql_ssl' "
"and 'sql_ssl_verify' options are set to 'true'. "
"be used to verify SQL connections. Implies _`sql_ssl`_ "
"and _`sql_ssl_verify`_ options are set to 'true'. "
"There is no default which means "
"certificate verification is disabled.")}},
{sql_ssl_certfile,
#{value => ?T("Path"),
desc =>
?T("A path to a certificate file that will be used "
"for SSL connections to the SQL server. Implies 'sql_ssl' "
"for SSL connections to the SQL server. Implies _`sql_ssl`_ "
"option is set to 'true'. There is no default which means "
"ejabberd won't provide a client certificate to the SQL "
"server.")}},
@@ -1316,8 +1330,8 @@ doc() ->
#{value => "true | false",
desc =>
?T("Whether to verify SSL connection to the SQL server against "
"CA root certificates defined in 'sql_ssl_cafile' option. "
"Implies 'sql_ssl' option is set to 'true'. "
"CA root certificates defined in _`sql_ssl_cafile`_ option. "
"Implies _`sql_ssl`_ option is set to 'true'. "
"The default value is 'false'.")}},
{sql_start_interval,
#{value => "timeout()",
+86 -40
View File
@@ -24,17 +24,15 @@
%%%----------------------------------------------------------------------
%%% Not implemented:
%%% - PEP nodes export/import
%%% - message archives export/import
%%% - write mod_piefxis with ejabberdctl commands
%%% - Export from mod_offline_sql.erl
%%% - Export from mod_private_sql.erl
%%% - XEP-227: 6. Security Considerations
%%% - Other schemas of XInclude are not tested, and may not be imported correctly.
%%% - If a host has many users, split that host in XML files with 50 users each.
%%%% Headers
-module(ejabberd_piefxis).
-protocol({xep, 227, '1.0'}).
-protocol({xep, 227, '1.1'}).
-export([import_file/1, export_server/1, export_host/2]).
@@ -166,33 +164,66 @@ export_users([], _Server, _Fd) ->
export_user(User, Server, Fd) ->
Password = ejabberd_auth:get_password_s(User, Server),
LServer = jid:nameprep(Server),
Pass = case ejabberd_auth:password_format(LServer) of
scram -> format_scram_password(Password);
_ -> Password
{PassPlain, PassScram} = case ejabberd_auth:password_format(LServer) of
scram -> {[], [format_scram_password(Password)]};
_ -> {[{<<"password">>, Password}], []}
end,
Els = get_offline(User, Server) ++
Els =
PassScram ++
get_offline(User, Server) ++
get_vcard(User, Server) ++
get_privacy(User, Server) ++
get_roster(User, Server) ++
get_private(User, Server),
print(Fd, fxml:element_to_binary(
#xmlel{name = <<"user">>,
attrs = [{<<"name">>, User},
{<<"password">>, Pass}],
attrs = [{<<"name">>, User} | PassPlain],
children = Els})).
format_scram_password(#scram{hash = Hash, storedkey = StoredKey, serverkey = ServerKey,
salt = Salt, iterationcount = IterationCount}) ->
StoredKeyB64 = base64:encode(StoredKey),
ServerKeyB64 = base64:encode(ServerKey),
SaltB64 = base64:encode(Salt),
IterationCountBin = (integer_to_binary(IterationCount)),
Hash2 = case Hash of
sha -> <<>>;
sha256 -> <<"sha256,">>;
sha512 -> <<"sha512,">>
end,
<<"scram:", Hash2/binary, StoredKeyB64/binary, ",", ServerKeyB64/binary, ",", SaltB64/binary, ",", IterationCountBin/binary>>.
StoredKeyB64 = base64:encode(StoredKey),
ServerKeyB64 = base64:encode(ServerKey),
SaltB64 = base64:encode(Salt),
IterationCountBin = (integer_to_binary(IterationCount)),
MechanismB = case Hash of
sha -> <<"SCRAM-SHA-1">>;
sha256 -> <<"SCRAM-SHA-256">>;
sha512 -> <<"SCRAM-SHA-512">>
end,
Children =
[
#xmlel{name = <<"iter-count">>,
children = [{xmlcdata, IterationCountBin}]},
#xmlel{name = <<"salt">>,
children = [{xmlcdata, SaltB64}]},
#xmlel{name = <<"server-key">>,
children = [{xmlcdata, ServerKeyB64}]},
#xmlel{name = <<"stored-key">>,
children = [{xmlcdata, StoredKeyB64}]}
],
#xmlel{name = <<"scram-credentials">>,
attrs = [{<<"xmlns">>, <<?NS_PIE/binary, "#scram">>},
{<<"mechanism">>, MechanismB}],
children = Children}.
parse_scram_password(#xmlel{attrs = Attrs} = El) ->
Hash = case fxml:get_attr_s(<<"mechanism">>, Attrs) of
<<"SCRAM-SHA-1">> -> sha;
<<"SCRAM-SHA-256">> -> sha256;
<<"SCRAM-SHA-512">> -> sha512
end,
StoredKeyB64 = fxml:get_path_s(El, [{elem, <<"stored-key">>}, cdata]),
ServerKeyB64 = fxml:get_path_s(El, [{elem, <<"server-key">>}, cdata]),
IterationCountBin = fxml:get_path_s(El, [{elem, <<"iter-count">>}, cdata]),
SaltB64 = fxml:get_path_s(El, [{elem, <<"salt">>}, cdata]),
#scram{
storedkey = base64:decode(StoredKeyB64),
serverkey = base64:decode(ServerKeyB64),
salt = base64:decode(SaltB64),
hash = Hash,
iterationcount = (binary_to_integer(IterationCountBin))
};
parse_scram_password(PassData) ->
Split = binary:split(PassData, <<",">>, [global]),
@@ -214,26 +245,30 @@ parse_scram_password(PassData) ->
get_vcard(User, Server) ->
LUser = jid:nodeprep(User),
LServer = jid:nameprep(Server),
case mod_vcard:get_vcard(LUser, LServer) of
try mod_vcard:get_vcard(LUser, LServer) of
error -> [];
Els -> Els
catch
error:{module_not_loaded, _, _} -> []
end.
-spec get_offline(binary(), binary()) -> [xmlel()].
get_offline(User, Server) ->
LUser = jid:nodeprep(User),
LServer = jid:nameprep(Server),
case mod_offline:get_offline_els(LUser, LServer) of
try mod_offline:get_offline_els(LUser, LServer) of
[] ->
[];
Els ->
NewEls = lists:map(fun xmpp:encode/1, Els),
[#xmlel{name = <<"offline-messages">>, children = NewEls}]
catch
error:{module_not_loaded, _, _} -> []
end.
-spec get_privacy(binary(), binary()) -> [xmlel()].
get_privacy(User, Server) ->
case mod_privacy:get_user_lists(User, Server) of
try mod_privacy:get_user_lists(User, Server) of
{ok, #privacy{default = Default,
lists = [_|_] = Lists}} ->
XLists = lists:map(
@@ -246,12 +281,14 @@ get_privacy(User, Server) ->
[xmpp:encode(#privacy_query{default = Default, lists = XLists})];
_ ->
[]
catch
error:{module_not_loaded, _, _} -> []
end.
-spec get_roster(binary(), binary()) -> [xmlel()].
get_roster(User, Server) ->
JID = jid:make(User, Server),
case mod_roster:get_roster(User, Server) of
try mod_roster:get_roster(User, Server) of
[_|_] = Items ->
Subs =
lists:flatmap(
@@ -278,15 +315,19 @@ get_roster(User, Server) ->
[xmpp:encode(#roster_query{items = Rs}) | Subs];
_ ->
[]
catch
error:{module_not_loaded, _, _} -> []
end.
-spec get_private(binary(), binary()) -> [xmlel()].
get_private(User, Server) ->
case mod_private:get_data(User, Server) of
try mod_private:get_data(User, Server) of
[_|_] = Els ->
[xmpp:encode(#private{sub_els = Els})];
_ ->
[]
catch
error:{module_not_loaded, _, _} -> []
end.
process(#state{xml_stream_state = XMLStreamState, fd = Fd} = State) ->
@@ -398,21 +439,10 @@ process_users([_|Els], State) ->
process_users([], State) ->
{ok, State}.
process_user(#xmlel{name = <<"user">>, attrs = Attrs, children = Els},
process_user(#xmlel{name = <<"user">>, attrs = Attrs, children = Els} = El,
#state{server = LServer} = State) ->
Name = fxml:get_attr_s(<<"name">>, Attrs),
Password = fxml:get_attr_s(<<"password">>, Attrs),
PasswordFormat = ejabberd_auth:password_format(LServer),
Pass = case PasswordFormat of
scram ->
case Password of
<<"scram:", PassData/binary>> ->
parse_scram_password(PassData);
P -> P
end;
_ -> Password
end,
Pass = process_password(El, LServer),
case jid:nodeprep(Name) of
error ->
stop("Invalid 'user': ~ts", [Name]);
@@ -420,13 +450,29 @@ process_user(#xmlel{name = <<"user">>, attrs = Attrs, children = Els},
case ejabberd_auth:try_register(LUser, LServer, Pass) of
ok ->
process_user_els(Els, State#state{user = LUser});
{error, invalid_password} when (Password == <<>>) ->
{error, invalid_password} when (Pass == <<>>) ->
process_user_els(Els, State#state{user = LUser});
{error, Err} ->
stop("Failed to create user '~ts': ~p", [Name, Err])
end
end.
process_password(#xmlel{name = <<"user">>, attrs = Attrs} = El, LServer) ->
{PassPlain, PassOldScram} = case fxml:get_attr_s(<<"password">>, Attrs) of
<<"scram:", PassData/binary>> -> {<<"">>, PassData};
P -> {P, false}
end,
ScramCred = fxml:get_subtag(El, <<"scram-credentials">>),
PasswordFormat = ejabberd_auth:password_format(LServer),
case {PassPlain, PassOldScram, ScramCred, PasswordFormat} of
{PassPlain, false, false, plain} -> PassPlain;
{<<"">>, false, ScramCred, plain} -> parse_scram_password(ScramCred);
{<<"">>, PassOldScram, false, plain} -> parse_scram_password(PassOldScram);
{PassPlain, false, false, scram} -> PassPlain;
{<<"">>, false, ScramCred, scram} -> parse_scram_password(ScramCred);
{<<"">>, PassOldScram, false, scram} -> parse_scram_password(PassOldScram)
end.
process_user_els([#xmlel{} = El|Els], State) ->
case process_user_el(El, State) of
{ok, NewState} ->
+3 -3
View File
@@ -424,15 +424,15 @@ balancing_route(From, To, Packet, Rs) ->
Value = erlang:system_time(),
case [R || R <- Rs, node(R#route.pid) == node()] of
[] ->
R = lists:nth(erlang:phash(Value, length(Rs)), Rs),
R = lists:nth(erlang:phash2(Value, length(Rs))+1, Rs),
do_route(Packet, R);
LRs ->
R = lists:nth(erlang:phash(Value, length(LRs)), LRs),
R = lists:nth(erlang:phash2(Value, length(LRs))+1, LRs),
do_route(Packet, R)
end;
Value ->
SRs = lists:ukeysort(#route.local_hint, Rs),
R = lists:nth(erlang:phash(Value, length(SRs)), SRs),
R = lists:nth(erlang:phash2(Value, length(SRs))+1, SRs),
do_route(Packet, R)
end.
+42 -9
View File
@@ -30,7 +30,7 @@
-behaviour(gen_server).
%% API
-export([route_multicast/4,
-export([route_multicast/5,
register_route/1,
unregister_route/1
]).
@@ -39,7 +39,7 @@
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
terminate/2, code_change/3, update_to_in_wrapped/2]).
-include("logger.hrl").
-include_lib("xmpp/include/xmpp.hrl").
@@ -58,9 +58,11 @@
start_link() ->
gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).
-spec route_multicast(jid(), binary(), [jid()], stanza()) -> ok.
route_multicast(From, Domain, Destinations, Packet) ->
case catch do_route(Domain, Destinations, xmpp:set_from(Packet, From)) of
-spec route_multicast(jid(), binary(), [jid()], stanza(), boolean()) -> ok.
route_multicast(From0, Domain0, Destinations0, Packet0, Wrapped0) ->
{From, Domain, Destinations, Packet, Wrapped} =
ejabberd_hooks:run_fold(multicast_route, Domain0, {From0, Domain0, Destinations0, Packet0, Wrapped0}, []),
case catch do_route(Domain, Destinations, xmpp:set_from(Packet, From), Wrapped) of
{'EXIT', Reason} ->
?ERROR_MSG("~p~nwhen processing: ~p",
[Reason, {From, Domain, Destinations, Packet}]);
@@ -157,7 +159,7 @@ handle_cast(Msg, State) ->
%% Description: Handling all non call/cast messages
%%--------------------------------------------------------------------
handle_info({route_multicast, Domain, Destinations, Packet}, State) ->
case catch do_route(Domain, Destinations, Packet) of
case catch do_route(Domain, Destinations, Packet, false) of
{'EXIT', Reason} ->
?ERROR_MSG("~p~nwhen processing: ~p",
[Reason, {Domain, Destinations, Packet}]);
@@ -204,13 +206,41 @@ terminate(_Reason, _State) ->
code_change(_OldVsn, State, _Extra) ->
{ok, State}.
-spec update_to_in_wrapped(stanza(), jid()) -> stanza().
update_to_in_wrapped(Packet, To) ->
case Packet of
#message{sub_els = [#ps_event{
items = #ps_items{
items = [#ps_item{
sub_els = [Internal]
} = PSItem]
} = PSItems
} = PSEvent]} ->
Internal2 = xmpp:set_to(Internal, To),
PSItem2 = PSItem#ps_item{sub_els = [Internal2]},
PSItems2 = PSItems#ps_items{items = [PSItem2]},
PSEvent2 = PSEvent#ps_event{items = PSItems2},
xmpp:set_to(Packet#message{sub_els = [PSEvent2]}, To);
_ ->
xmpp:set_to(Packet, To)
end.
%%--------------------------------------------------------------------
%%% Internal functions
%%--------------------------------------------------------------------
%% From = #jid
%% Destinations = [#jid]
-spec do_route(binary(), [jid()], stanza()) -> any().
do_route(Domain, Destinations, Packet) ->
-spec do_route(binary(), [jid()], stanza(), boolean()) -> any().
do_route(Domain, Destinations, Packet, true) ->
?DEBUG("Route multicast:~n~ts~nDomain: ~ts~nDestinations: ~ts~n",
[xmpp:pp(Packet), Domain,
str:join([jid:encode(To) || To <- Destinations], <<", ">>)]),
lists:foreach(
fun(To) ->
Packet2 = update_to_in_wrapped(Packet, To),
ejabberd_router:route(Packet2)
end, Destinations);
do_route(Domain, Destinations, Packet, false) ->
?DEBUG("Route multicast:~n~ts~nDomain: ~ts~nDestinations: ~ts~n",
[xmpp:pp(Packet), Domain,
str:join([jid:encode(To) || To <- Destinations], <<", ">>)]),
@@ -236,4 +266,7 @@ pick_multicast_pid(Rs) ->
-spec do_route_normal([jid()], stanza()) -> any().
do_route_normal(Destinations, Packet) ->
[ejabberd_router:route(xmpp:set_to(Packet, To)) || To <- Destinations].
lists:foreach(
fun(To) ->
ejabberd_router:route(xmpp:set_to(Packet, To))
end, Destinations).
+37 -50
View File
@@ -33,8 +33,8 @@
%% API
-export([start_link/0, stop/0, route/1, have_connection/1,
get_connections_pids/1, try_register/1,
remove_connection/2, start_connection/2, start_connection/3,
get_connections_pids/1,
start_connection/2, start_connection/3,
dirty_get_connections/0, allow_host/2,
incoming_s2s_number/0, outgoing_s2s_number/0,
stop_s2s_connections/0,
@@ -64,7 +64,7 @@
%% once a server is temporary blocked, it stay blocked for 60 seconds
-record(s2s, {fromto :: {binary(), binary()},
-record(s2s, {fromto :: {binary(), binary()} | '_',
pid :: pid()}).
-record(state, {}).
@@ -112,24 +112,6 @@ is_temporarly_blocked(Host) ->
end
end.
-spec remove_connection({binary(), binary()}, pid()) -> ok.
remove_connection({From, To} = FromTo, Pid) ->
case mnesia:dirty_match_object(s2s, #s2s{fromto = FromTo, pid = Pid}) of
[#s2s{pid = Pid}] ->
F = fun() ->
mnesia:delete_object(#s2s{fromto = FromTo, pid = Pid})
end,
case mnesia:transaction(F) of
{atomic, _} -> ok;
{aborted, Reason} ->
?ERROR_MSG("Failed to unregister s2s connection ~ts -> ~ts: "
"Mnesia failure: ~p",
[From, To, Reason])
end;
_ ->
ok
end.
-spec have_connection({binary(), binary()}) -> boolean().
have_connection(FromTo) ->
case catch mnesia:dirty_read(s2s, FromTo) of
@@ -148,31 +130,6 @@ get_connections_pids(FromTo) ->
[]
end.
-spec try_register({binary(), binary()}) -> boolean().
try_register({From, To} = FromTo) ->
MaxS2SConnectionsNumber = max_s2s_connections_number(FromTo),
MaxS2SConnectionsNumberPerNode =
max_s2s_connections_number_per_node(FromTo),
F = fun () ->
L = mnesia:read({s2s, FromTo}),
NeededConnections = needed_connections_number(L,
MaxS2SConnectionsNumber,
MaxS2SConnectionsNumberPerNode),
if NeededConnections > 0 ->
mnesia:write(#s2s{fromto = FromTo, pid = self()}),
true;
true -> false
end
end,
case mnesia:transaction(F) of
{atomic, Res} -> Res;
{aborted, Reason} ->
?ERROR_MSG("Failed to register s2s connection ~ts -> ~ts: "
"Mnesia failure: ~p",
[From, To, Reason]),
false
end.
-spec dirty_get_connections() -> [{binary(), binary()}].
dirty_get_connections() ->
mnesia:dirty_all_keys(s2s).
@@ -269,6 +226,8 @@ init([]) ->
{stop, Reason}
end.
handle_call({new_connection, Args}, _From, State) ->
{reply, erlang:apply(fun new_connection_int/7, Args), State};
handle_call(Request, From, State) ->
?WARNING_MSG("Unexpected call from ~p: ~p", [From, Request]),
{noreply, State}.
@@ -289,6 +248,21 @@ handle_info({route, Packet}, State) ->
misc:format_exception(2, Class, Reason, StackTrace)])
end,
{noreply, State};
handle_info({'DOWN', _Ref, process, Pid, _Reason}, State) ->
case mnesia:dirty_match_object(s2s, #s2s{fromto = '_', pid = Pid}) of
[#s2s{pid = Pid, fromto = {From, To}} = Obj] ->
F = fun() -> mnesia:delete_object(Obj) end,
case mnesia:transaction(F) of
{atomic, _} -> ok;
{aborted, Reason} ->
?ERROR_MSG("Failed to unregister s2s connection for pid ~p (~ts -> ~ts):"
"Mnesia failure: ~p",
[Pid, From, To, Reason])
end,
{noreply, State};
_ ->
{noreply, State}
end;
handle_info(Info, State) ->
?WARNING_MSG("Unexpected info: ~p", [Info]),
{noreply, State}.
@@ -429,8 +403,8 @@ choose_pid(From, Pids) ->
Ps -> Ps
end,
Pid =
lists:nth(erlang:phash(jid:remove_resource(From),
length(Pids1)),
lists:nth(erlang:phash2(jid:remove_resource(From),
length(Pids1))+1,
Pids1),
?DEBUG("Using ejabberd_s2s_out ~p~n", [Pid]),
Pid.
@@ -458,6 +432,18 @@ open_several_connections(N, MyServer, Server, From,
integer(), integer(), [proplists:property()]) -> [pid()].
new_connection(MyServer, Server, From, FromTo,
MaxS2SConnectionsNumber, MaxS2SConnectionsNumberPerNode, Opts) ->
case whereis(ejabberd_s2s) == self() of
true ->
new_connection_int(MyServer, Server, From, FromTo,
MaxS2SConnectionsNumber, MaxS2SConnectionsNumberPerNode, Opts);
false ->
gen_server:call(ejabberd_s2s, {new_connection, [MyServer, Server, From, FromTo,
MaxS2SConnectionsNumber,
MaxS2SConnectionsNumberPerNode, Opts]})
end.
new_connection_int(MyServer, Server, From, FromTo,
MaxS2SConnectionsNumber, MaxS2SConnectionsNumberPerNode, Opts) ->
{ok, Pid} = ejabberd_s2s_out:start(MyServer, Server, Opts),
F = fun() ->
L = mnesia:read({s2s, FromTo}),
@@ -474,6 +460,7 @@ new_connection(MyServer, Server, From, FromTo,
case TRes of
{atomic, Pid1} ->
if Pid1 == Pid ->
erlang:monitor(process, Pid),
ejabberd_s2s_out:connect(Pid);
true ->
ejabberd_s2s_out:stop_async(Pid)
@@ -513,13 +500,13 @@ needed_connections_number(Ls, MaxS2SConnectionsNumber,
get_commands_spec() ->
[#ejabberd_commands{
name = incoming_s2s_number, tags = [stats, s2s],
name = incoming_s2s_number, tags = [statistics, s2s],
desc = "Number of incoming s2s connections on the node",
policy = admin,
module = ?MODULE, function = incoming_s2s_number,
args = [], result = {s2s_incoming, integer}},
#ejabberd_commands{
name = outgoing_s2s_number, tags = [stats, s2s],
name = outgoing_s2s_number, tags = [statistics, s2s],
desc = "Number of outgoing s2s connections on the node",
policy = admin,
module = ?MODULE, function = outgoing_s2s_number,
+6 -16
View File
@@ -318,7 +318,6 @@ handle_info(Info, #{server_host := ServerHost} = State) ->
terminate(Reason, #{server := LServer,
remote_server := RServer} = State) ->
ejabberd_s2s:remove_connection({LServer, RServer}, self()),
State1 = case Reason of
normal -> State;
_ -> State#{stop_reason => internal_failure}
@@ -351,21 +350,12 @@ bounce_queue(State) ->
end, State).
-spec bounce_message_queue({binary(), binary()}, state()) -> state().
bounce_message_queue({LServer, RServer} = FromTo, State) ->
Pids = ejabberd_s2s:get_connections_pids(FromTo),
case lists:member(self(), Pids) of
true ->
?WARNING_MSG("Outgoing s2s connection ~ts -> ~ts is supposed "
"to be unregistered, but pid ~p still presents "
"in 's2s' table", [LServer, RServer, self()]),
State;
false ->
receive {route, Pkt} ->
State1 = bounce_packet(Pkt, State),
bounce_message_queue(FromTo, State1)
after 0 ->
State
end
bounce_message_queue(FromTo, State) ->
receive {route, Pkt} ->
State1 = bounce_packet(Pkt, State),
bounce_message_queue(FromTo, State1)
after 0 ->
State
end.
-spec bounce_packet(xmpp_element(), state()) -> state().
+1 -1
View File
@@ -985,7 +985,7 @@ get_commands_spec() ->
result_desc = "List of users sessions",
result_example = [<<"user1@example.com">>, <<"user2@example.com">>],
result = {connected_users, {list, {sessions, string}}}},
#ejabberd_commands{name = connected_users_number, tags = [session, stats],
#ejabberd_commands{name = connected_users_number, tags = [session, statistics],
desc = "Get the number of established sessions",
policy = admin,
module = ?MODULE, function = connected_users_number,
+6
View File
@@ -39,6 +39,7 @@
restart/1,
use_new_schema/0,
sql_query_to_iolist/1,
sql_query_to_iolist/2,
escape/1,
standard_escape/1,
escape_like/1,
@@ -832,6 +833,11 @@ sql_query_format_res(Res, _SQLQuery) ->
sql_query_to_iolist(SQLQuery) ->
generic_sql_query_format(SQLQuery).
sql_query_to_iolist(sqlite, SQLQuery) ->
sqlite_sql_query_format(SQLQuery);
sql_query_to_iolist(_DbType, SQLQuery) ->
generic_sql_query_format(SQLQuery).
sql_begin() ->
sql_query_internal(
[{mssql, [<<"begin transaction;">>]},
+68 -9
View File
@@ -564,15 +564,23 @@ make_sql_upsert(Table, ParseRes, Pos) ->
[]
end,
erl_syntax:fun_expr(
[erl_syntax:clause(
[erl_syntax:atom(pgsql), erl_syntax:variable("__Version")],
[erl_syntax:infix_expr(
erl_syntax:variable("__Version"),
erl_syntax:operator('>='),
erl_syntax:integer(90100))],
[make_sql_upsert_pgsql901(Table, ParseRes),
erl_syntax:atom(ok)])] ++
MySqlReplace ++
[erl_syntax:clause(
[erl_syntax:atom(pgsql), erl_syntax:variable("__Version")],
[erl_syntax:infix_expr(
erl_syntax:variable("__Version"),
erl_syntax:operator('>='),
erl_syntax:integer(90500))],
[make_sql_upsert_pgsql905(Table, ParseRes),
erl_syntax:atom(ok)]),
erl_syntax:clause(
[erl_syntax:atom(pgsql), erl_syntax:variable("__Version")],
[erl_syntax:infix_expr(
erl_syntax:variable("__Version"),
erl_syntax:operator('>='),
erl_syntax:integer(90100))],
[make_sql_upsert_pgsql901(Table, ParseRes),
erl_syntax:atom(ok)])] ++
MySqlReplace ++
[erl_syntax:clause(
[erl_syntax:underscore(), erl_syntax:underscore()],
none,
@@ -713,6 +721,57 @@ make_sql_upsert_pgsql901(Table, ParseRes0) ->
erl_syntax:atom(sql_query_t),
[Upsert]).
make_sql_upsert_pgsql905(Table, ParseRes0) ->
ParseRes = lists:map(
fun({"family", A2, A3}) -> {"\"family\"", A2, A3};
(Other) -> Other
end, ParseRes0),
Vals =
lists:map(
fun({_Field, _, ST}) ->
ST
end, ParseRes),
Fields =
lists:map(
fun({Field, _, _ST}) ->
#state{'query' = [{str, Field}]}
end, ParseRes),
SPairs =
lists:flatmap(
fun({_Field, key, _ST}) ->
[];
({_Field, {false}, _ST}) ->
[];
({Field, {true}, ST}) ->
[ST#state{
'query' = [{str, Field}, {str, "="}] ++ ST#state.'query'
}]
end, ParseRes),
Set = join_states(SPairs, ", "),
KeyFields =
lists:flatmap(
fun({Field, key, _ST}) ->
[#state{'query' = [{str, Field}]}];
({_Field, _, _ST}) ->
[]
end, ParseRes),
State =
concat_states(
[#state{'query' = [{str, "INSERT INTO "}, {str, Table}, {str, "("}]},
join_states(Fields, ", "),
#state{'query' = [{str, ") VALUES ("}]},
join_states(Vals, ", "),
#state{'query' = [{str, ") ON CONFLICT ("}]},
join_states(KeyFields, ", "),
#state{'query' = [{str, ") DO UPDATE SET "}]},
Set
]),
Upsert = make_sql_query(State),
erl_syntax:application(
erl_syntax:atom(ejabberd_sql),
erl_syntax:atom(sql_query_t),
[Upsert]).
check_upsert(ParseRes, Pos) ->
Set =
+5 -1
View File
@@ -188,7 +188,11 @@ check_sqlite_db(Host) ->
create_sqlite_tables(DB) ->
SqlDir = misc:sql_dir(),
File = filename:join(SqlDir, "lite.sql"),
Filename = case ejabberd_sql:use_new_schema() of
true -> "lite.new.sql";
false -> "lite.sql"
end,
File = filename:join(SqlDir, Filename),
case file:open(File, [read, binary]) of
{ok, Fd} ->
Qs = read_lines(Fd, File, []),
+37 -1
View File
@@ -148,6 +148,7 @@ build_script(Dir, UpdatedBeams) ->
{Script, LowLevelScript, Check1}.
%% Copied from Erlang/OTP file: lib/sasl/src/systools.hrl
-ifdef(SYSTOOLS_APP_DEF_WITHOUT_OPTIONAL).
-record(application,
{name, %% Name of the application, atom().
type = permanent, %% Application start type, atom().
@@ -172,11 +173,46 @@ build_script(Dir, UpdatedBeams) ->
%% integer() | infinity.
mod = [], %% [] | {Mod, StartArgs}, Mod= atom(),
%% StartArgs = list().
start_phases = [], %% [] | {Phase, PhaseArgs}, Phase = atom(),
start_phases, %% [{Phase, PhaseArgs}] | undefined,
%% Phase = atom(),
%% PhaseArgs = list().
dir = "" %% The directory where the .app file was
%% found (internal use).
}).
-else.
-record(application,
{name, %% Name of the application, atom().
type = permanent, %% Application start type, atom().
vsn = "", %% Version of the application, string().
id = "", %% Id of the application, string().
description = "", %% Description of application, string().
modules = [], %% [Module | {Module,Vsn}] of modules
%% incorporated in the application,
%% Module = atom(), Vsn = string().
uses = [], %% [Application] list of applications required
%% by the application, Application = atom().
optional = [], %% [Application] list of applications in uses
%% that are optional, Application = atom().
includes = [], %% [Application] list of applications included
%% by the application, Application = atom().
regs = [], %% [RegNames] a list of registered process
%% names used by the application, RegNames =
%% atom().
env = [], %% [{Key,Value}] environment variable of
%% application, Key = Value = term().
maxT = infinity, %% Max time an application may exist,
%% integer() | infinity.
maxP = infinity, %% Max number of processes in an application,
%% integer() | infinity.
mod = [], %% [] | {Mod, StartArgs}, Mod= atom(),
%% StartArgs = list().
start_phases, %% [{Phase, PhaseArgs}] | undefined,
%% Phase = atom(),
%% PhaseArgs = list().
dir = "" %% The directory where the .app file was
%% found (internal use).
}).
-endif.
make_script(UpdatedBeams) ->
+163 -21
View File
@@ -585,8 +585,12 @@ list_vhosts2(Lang, Hosts) ->
[?XE(<<"thead">>,
[?XE(<<"tr">>,
[?XCT(<<"td">>, ?T("Host")),
?XCT(<<"td">>, ?T("Registered Users")),
?XCT(<<"td">>, ?T("Online Users"))])]),
?XACT(<<"td">>,
[{<<"class">>, <<"alignright">>}],
?T("Registered Users")),
?XACT(<<"td">>,
[{<<"class">>, <<"alignright">>}],
?T("Online Users"))])]),
?XE(<<"tbody">>,
(lists:map(fun (Host) ->
OnlineUsers =
@@ -598,10 +602,14 @@ list_vhosts2(Lang, Hosts) ->
[?AC(<<"../server/", Host/binary,
"/">>,
Host)]),
?XC(<<"td">>,
(pretty_string_int(RegisteredUsers))),
?XC(<<"td">>,
(pretty_string_int(OnlineUsers)))])
?XAE(<<"td">>,
[{<<"class">>, <<"alignright">>}],
[?AC(<<"../server/", Host/binary, "/users/">>,
pretty_string_int(RegisteredUsers))]),
?XAE(<<"td">>,
[{<<"class">>, <<"alignright">>}],
[?AC(<<"../server/", Host/binary, "/online-users/">>,
pretty_string_int(OnlineUsers))])])
end,
SHosts)))])].
@@ -706,7 +714,9 @@ list_given_users(Host, Users, Prefix, Lang, URLFunc) ->
[?XE(<<"thead">>,
[?XE(<<"tr">>,
[?XCT(<<"td">>, ?T("User")),
?XCT(<<"td">>, ?T("Offline Messages")),
?XACT(<<"td">>,
[{<<"class">>, <<"alignright">>}],
?T("Offline Messages")),
?XCT(<<"td">>, ?T("Last Activity"))])]),
?XE(<<"tbody">>,
(lists:map(fun (_SU = {Server, User}) ->
@@ -749,7 +759,9 @@ list_given_users(Host, Users, Prefix, Lang, URLFunc) ->
misc:url_encode(User),
Server})),
(us_to_list(US)))]),
?XE(<<"td">>, FQueueLen),
?XAE(<<"td">>,
[{<<"class">>, <<"alignright">>}],
FQueueLen),
?XC(<<"td">>, FLast)])
end,
Users)))]).
@@ -808,16 +820,24 @@ get_stats(global, Lang) ->
[?XE(<<"tbody">>,
[?XE(<<"tr">>,
[?XCT(<<"td">>, ?T("Registered Users:")),
?XC(<<"td">>, (pretty_string_int(RegisteredUsers)))]),
?XAC(<<"td">>,
[{<<"class">>, <<"alignright">>}],
(pretty_string_int(RegisteredUsers)))]),
?XE(<<"tr">>,
[?XCT(<<"td">>, ?T("Online Users:")),
?XC(<<"td">>, (pretty_string_int(OnlineUsers)))]),
?XAC(<<"td">>,
[{<<"class">>, <<"alignright">>}],
(pretty_string_int(OnlineUsers)))]),
?XE(<<"tr">>,
[?XCT(<<"td">>, ?T("Outgoing s2s Connections:")),
?XC(<<"td">>, (pretty_string_int(OutS2SNumber)))]),
?XAC(<<"td">>,
[{<<"class">>, <<"alignright">>}],
(pretty_string_int(OutS2SNumber)))]),
?XE(<<"tr">>,
[?XCT(<<"td">>, ?T("Incoming s2s Connections:")),
?XC(<<"td">>, (pretty_string_int(InS2SNumber)))])])])];
?XAC(<<"td">>,
[{<<"class">>, <<"alignright">>}],
(pretty_string_int(InS2SNumber)))])])])];
get_stats(Host, Lang) ->
OnlineUsers =
length(ejabberd_sm:get_vh_session_list(Host)),
@@ -827,10 +847,14 @@ get_stats(Host, Lang) ->
[?XE(<<"tbody">>,
[?XE(<<"tr">>,
[?XCT(<<"td">>, ?T("Registered Users:")),
?XC(<<"td">>, (pretty_string_int(RegisteredUsers)))]),
?XAC(<<"td">>,
[{<<"class">>, <<"alignright">>}],
(pretty_string_int(RegisteredUsers)))]),
?XE(<<"tr">>,
[?XCT(<<"td">>, ?T("Online Users:")),
?XC(<<"td">>, (pretty_string_int(OnlineUsers)))])])])].
?XAC(<<"td">>,
[{<<"class">>, <<"alignright">>}],
(pretty_string_int(OnlineUsers)))])])])].
list_online_users(Host, _Lang) ->
Users = [{S, U}
@@ -1151,17 +1175,23 @@ get_node(global, Node, [<<"db">>], Query, Lang) ->
{T, S, M};
_ -> {unknown, 0, 0}
end,
MemoryB = Memory*erlang:system_info(wordsize),
?XE(<<"tr">>,
[?XC(<<"td">>, STable),
[?XE(<<"td">>,
[?AC(<<"./", STable/binary,
"/">>,
STable)]),
?XE(<<"td">>,
[db_storage_select(STable, Type,
Lang)]),
?XAE(<<"td">>,
[{<<"class">>, <<"alignright">>}],
[?AC(<<"./", STable/binary,
"/1/">>,
(pretty_string_int(Size)))]),
?XAC(<<"td">>,
[{<<"class">>, <<"alignright">>}],
(pretty_string_int(Size))),
?XAC(<<"td">>,
[{<<"class">>, <<"alignright">>}],
(pretty_string_int(Memory)))])
(pretty_string_int(MemoryB)))])
end,
STables),
[?XC(<<"h1">>,
@@ -1177,8 +1207,12 @@ get_node(global, Node, [<<"db">>], Query, Lang) ->
[?XE(<<"tr">>,
[?XCT(<<"td">>, ?T("Name")),
?XCT(<<"td">>, ?T("Storage Type")),
?XCT(<<"td">>, ?T("Elements")),
?XCT(<<"td">>, ?T("Memory"))])]),
?XACT(<<"td">>,
[{<<"class">>, <<"alignright">>}],
?T("Elements")),
?XACT(<<"td">>,
[{<<"class">>, <<"alignright">>}],
?T("Memory"))])]),
?XE(<<"tbody">>,
(Rows ++
[?XE(<<"tr">>,
@@ -1189,6 +1223,10 @@ get_node(global, Node, [<<"db">>], Query, Lang) ->
<<"submit">>,
?T("Submit"))])])]))])])]
end;
get_node(global, Node, [<<"db">>, TableName], _Query, Lang) ->
make_table_view(Node, TableName, Lang);
get_node(global, Node, [<<"db">>, TableName, PageNumber], _Query, Lang) ->
make_table_elements_view(Node, TableName, Lang, binary_to_integer(PageNumber));
get_node(global, Node, [<<"backup">>], Query, Lang) ->
HomeDirRaw = case {os:getenv("HOME"), os:type()} of
{EnvHome, _} when is_list(EnvHome) -> list_to_binary(EnvHome);
@@ -1344,6 +1382,7 @@ get_node(global, Node, [<<"stats">>], _Query, Lang) ->
[wall_clock]),
UpTimeS = (str:format("~.3f",
[element(1, UpTime) / 1000])),
UpTimeDate = uptime_date(Node),
CPUTime = ejabberd_cluster:call(Node, erlang, statistics, [runtime]),
CPUTimeS = (str:format("~.3f",
[element(1, CPUTime) / 1000])),
@@ -1364,6 +1403,10 @@ get_node(global, Node, [<<"stats">>], _Query, Lang) ->
[?XCT(<<"td">>, ?T("Uptime:")),
?XAC(<<"td">>, [{<<"class">>, <<"alignright">>}],
UpTimeS)]),
?XE(<<"tr">>,
[?X(<<"td">>),
?XAC(<<"td">>, [{<<"class">>, <<"alignright">>}],
UpTimeDate)]),
?XE(<<"tr">>,
[?XCT(<<"td">>, ?T("CPU Time:")),
?XAC(<<"td">>, [{<<"class">>, <<"alignright">>}],
@@ -1458,6 +1501,16 @@ get_node(Host, Node, NPath, Query, Lang) ->
_ -> Res
end.
uptime_date(Node) ->
Localtime = ejabberd_cluster:call(Node, erlang, localtime, []),
Now = calendar:datetime_to_gregorian_seconds(Localtime),
{Wall, _} = ejabberd_cluster:call(Node, erlang, statistics, [wall_clock]),
LastRestart = Now - (Wall div 1000),
{{Year, Month, Day}, {Hour, Minute, Second}} =
calendar:gregorian_seconds_to_datetime(LastRestart),
str:format("~w-~.2.0w-~.2.0w ~.2.0w:~.2.0w:~.2.0w",
[Year, Month, Day, Hour, Minute, Second]).
%%%==================================
%%%% node parse
@@ -1732,6 +1785,95 @@ pretty_string_int(String) when is_binary(String) ->
{0, <<"">>}, lists:reverse(binary_to_list(String))),
Result.
%%%==================================
%%%% mnesia table view
make_table_view(Node, STable, Lang) ->
Table = misc:binary_to_atom(STable),
TInfo = ejabberd_cluster:call(Node, mnesia, table_info, [Table, all]),
{value, {storage_type, Type}} = lists:keysearch(storage_type, 1, TInfo),
{value, {size, Size}} = lists:keysearch(size, 1, TInfo),
{value, {memory, Memory}} = lists:keysearch(memory, 1, TInfo),
MemoryB = Memory*erlang:system_info(wordsize),
TableInfo = str:format("~p", [TInfo]),
[?XC(<<"h1">>, (str:translate_and_format(Lang, ?T("Database Tables at ~p"),
[Node]))),
?XAE(<<"table">>, [],
[?XE(<<"tbody">>,
[?XE(<<"tr">>,
[?XCT(<<"td">>, ?T("Name")),
?XAC(<<"td">>, [{<<"class">>, <<"alignright">>}],
STable
)]),
?XE(<<"tr">>,
[?XCT(<<"td">>, ?T("Node")),
?XAC(<<"td">>, [{<<"class">>, <<"alignright">>}],
misc:atom_to_binary(Node)
)]),
?XE(<<"tr">>,
[?XCT(<<"td">>, ?T("Storage Type")),
?XAC(<<"td">>, [{<<"class">>, <<"alignright">>}],
misc:atom_to_binary(Type)
)]),
?XE(<<"tr">>,
[?XCT(<<"td">>, ?T("Elements")),
?XAE(<<"td">>,
[{<<"class">>, <<"alignright">>}],
[?AC(<<"1/">>,
(pretty_string_int(Size)))])
]),
?XE(<<"tr">>,
[?XCT(<<"td">>, ?T("Memory")),
?XAC(<<"td">>, [{<<"class">>, <<"alignright">>}],
(pretty_string_int(MemoryB))
)])
])]),
?XC(<<"pre">>, TableInfo)].
make_table_elements_view(Node, STable, Lang, PageNumber) ->
Table = misc:binary_to_atom(STable),
TInfo = ejabberd_cluster:call(Node, mnesia, table_info, [Table, all]),
{value, {storage_type, Type}} = lists:keysearch(storage_type, 1, TInfo),
{value, {size, Size}} = lists:keysearch(size, 1, TInfo),
PageSize = 500,
TableContentErl = get_table_content(Node, Table, Type, PageNumber, PageSize),
TableContent = str:format("~p", [TableContentErl]),
PagesLinks = build_elements_pages_list(Size, PageNumber, PageSize),
[?XC(<<"h1">>, (str:translate_and_format(Lang, ?T("Database Tables at ~p"),
[Node]))),
?P, ?AC(<<"../">>, STable), ?P
] ++ PagesLinks ++ [?XC(<<"pre">>, TableContent)].
build_elements_pages_list(Size, PageNumber, PageSize) ->
PagesNumber = calculate_pages_number(Size, PageSize),
PagesSeq = lists:seq(1, PagesNumber),
PagesList = [?AC(<<"../", (integer_to_binary(N))/binary, "/">>,
<<(integer_to_binary(N))/binary, " ">>)
|| N <- PagesSeq],
lists:keyreplace(
[?C(<<(integer_to_binary(PageNumber))/binary, " ">>)],
4,
PagesList,
?C(<<" [", (integer_to_binary(PageNumber))/binary, "] ">>)).
calculate_pages_number(Size, PageSize) ->
Remainer = case Size rem PageSize of
0 -> 0;
_ -> 1
end,
case (Size div PageSize) + Remainer of
1 -> 0;
Res -> Res
end.
get_table_content(Node, Table, _Type, PageNumber, PageSize) ->
Keys1 = lists:sort(ejabberd_cluster:call(Node, mnesia, dirty_all_keys, [Table])),
FirstKeyPos = 1 - PageSize + PageNumber*PageSize,
Keys = lists:sublist(Keys1, FirstKeyPos, PageSize),
Res = [ejabberd_cluster:call(Node, mnesia, dirty_read, [Table, Key])
|| Key <- Keys],
lists:flatten(Res).
%%%==================================
%%%% navigation menu
+32 -32
View File
@@ -187,32 +187,32 @@ find_subprotocol(Headers) ->
end.
ws_loop(FrameInfo, Socket, WsHandleLoopPid, SocketMode, Shaper) ->
ws_loop(FrameInfo, Socket, WsHandleLoopPid, SockMod, Shaper) ->
receive
{DataType, _Socket, Data} when DataType =:= tcp orelse DataType =:= raw ->
case handle_data(DataType, FrameInfo, Data, Socket, WsHandleLoopPid, SocketMode, Shaper) of
case handle_data(DataType, FrameInfo, Data, Socket, WsHandleLoopPid, SockMod, Shaper) of
{error, Error} ->
?DEBUG("TLS decode error ~p", [Error]),
websocket_close(Socket, WsHandleLoopPid, SocketMode, 1002); % protocol error
websocket_close(Socket, WsHandleLoopPid, SockMod, 1002); % protocol error
{NewFrameInfo, ToSend, NewShaper} ->
lists:foreach(fun(Pkt) -> SocketMode:send(Socket, Pkt)
lists:foreach(fun(Pkt) -> SockMod:send(Socket, Pkt)
end, ToSend),
ws_loop(NewFrameInfo, Socket, WsHandleLoopPid, SocketMode, NewShaper)
ws_loop(NewFrameInfo, Socket, WsHandleLoopPid, SockMod, NewShaper)
end;
{new_shaper, NewShaper} ->
NewShaper = case NewShaper of
none when Shaper /= none ->
activate(Socket, SocketMode, true), none;
activate(Socket, SockMod, true), none;
_ ->
NewShaper
end,
ws_loop(FrameInfo, Socket, WsHandleLoopPid, SocketMode, NewShaper);
ws_loop(FrameInfo, Socket, WsHandleLoopPid, SockMod, NewShaper);
{tcp_closed, _Socket} ->
?DEBUG("TCP connection was closed, exit", []),
websocket_close(Socket, WsHandleLoopPid, SocketMode, 0);
websocket_close(Socket, WsHandleLoopPid, SockMod, 0);
{tcp_error, Socket, Reason} ->
?DEBUG("TCP connection error: ~ts", [inet:format_error(Reason)]),
websocket_close(Socket, WsHandleLoopPid, SocketMode, 0);
websocket_close(Socket, WsHandleLoopPid, SockMod, 0);
{'DOWN', Ref, process, WsHandleLoopPid, Reason} ->
Code = case Reason of
normal ->
@@ -224,39 +224,39 @@ ws_loop(FrameInfo, Socket, WsHandleLoopPid, SocketMode, Shaper) ->
1011 % internal error
end,
erlang:demonitor(Ref),
websocket_close(Socket, WsHandleLoopPid, SocketMode, Code);
websocket_close(Socket, WsHandleLoopPid, SockMod, Code);
{text_with_reply, Data, Sender} ->
SocketMode:send(Socket, encode_frame(Data, 1)),
SockMod:send(Socket, encode_frame(Data, 1)),
Sender ! {text_reply, self()},
ws_loop(FrameInfo, Socket, WsHandleLoopPid,
SocketMode, Shaper);
SockMod, Shaper);
{data_with_reply, Data, Sender} ->
SocketMode:send(Socket, encode_frame(Data, 2)),
SockMod:send(Socket, encode_frame(Data, 2)),
Sender ! {data_reply, self()},
ws_loop(FrameInfo, Socket, WsHandleLoopPid,
SocketMode, Shaper);
SockMod, Shaper);
{text, Data} ->
SocketMode:send(Socket, encode_frame(Data, 1)),
SockMod:send(Socket, encode_frame(Data, 1)),
ws_loop(FrameInfo, Socket, WsHandleLoopPid,
SocketMode, Shaper);
SockMod, Shaper);
{data, Data} ->
SocketMode:send(Socket, encode_frame(Data, 2)),
SockMod:send(Socket, encode_frame(Data, 2)),
ws_loop(FrameInfo, Socket, WsHandleLoopPid,
SocketMode, Shaper);
SockMod, Shaper);
{ping, Data} ->
SocketMode:send(Socket, encode_frame(Data, 9)),
SockMod:send(Socket, encode_frame(Data, 9)),
ws_loop(FrameInfo, Socket, WsHandleLoopPid,
SocketMode, Shaper);
SockMod, Shaper);
shutdown ->
?DEBUG("Shutdown request received, closing websocket "
"with pid ~p",
[self()]),
websocket_close(Socket, WsHandleLoopPid, SocketMode, 1001); % going away
websocket_close(Socket, WsHandleLoopPid, SockMod, 1001); % going away
_Ignored ->
?WARNING_MSG("Received unexpected message, ignoring: ~p",
[_Ignored]),
ws_loop(FrameInfo, Socket, WsHandleLoopPid,
SocketMode, Shaper)
SockMod, Shaper)
end.
encode_frame(Data, Opcode) ->
@@ -421,7 +421,7 @@ handle_data(tcp, FrameInfo, Data, Socket, WsHandleLoopPid, fast_tls, Shaper) ->
handle_data(_, FrameInfo, Data, Socket, WsHandleLoopPid, SockMod, Shaper) ->
handle_data_int(FrameInfo, Data, Socket, WsHandleLoopPid, SockMod, Shaper).
handle_data_int(FrameInfo, Data, Socket, WsHandleLoopPid, SocketMode, Shaper) ->
handle_data_int(FrameInfo, Data, Socket, WsHandleLoopPid, SockMod, Shaper) ->
{NewFrameInfo, Recv, Send} = process_frame(FrameInfo, Data),
lists:foreach(fun (El) ->
case El of
@@ -434,27 +434,27 @@ handle_data_int(FrameInfo, Data, Socket, WsHandleLoopPid, SocketMode, Shaper) ->
end
end,
Recv),
{NewFrameInfo, Send, handle_shaping(Data, Socket, SocketMode, Shaper)}.
{NewFrameInfo, Send, handle_shaping(Data, Socket, SockMod, Shaper)}.
websocket_close(Socket, WsHandleLoopPid,
SocketMode, CloseCode) when CloseCode > 0 ->
SockMod, CloseCode) when CloseCode > 0 ->
Frame = encode_frame(<<CloseCode:16/integer-big>>, 8),
SocketMode:send(Socket, Frame),
websocket_close(Socket, WsHandleLoopPid, SocketMode, 0);
websocket_close(Socket, WsHandleLoopPid, SocketMode, _CloseCode) ->
SockMod:send(Socket, Frame),
websocket_close(Socket, WsHandleLoopPid, SockMod, 0);
websocket_close(Socket, WsHandleLoopPid, SockMod, _CloseCode) ->
WsHandleLoopPid ! closed,
SocketMode:close(Socket).
SockMod:close(Socket).
get_origin() ->
ejabberd_option:websocket_origin().
handle_shaping(_Data, _Socket, _SocketMode, none) ->
handle_shaping(_Data, _Socket, _SockMod, none) ->
none;
handle_shaping(Data, Socket, SocketMode, Shaper) ->
handle_shaping(Data, Socket, SockMod, Shaper) ->
{NewShaper, Pause} = ejabberd_shaper:update(Shaper, byte_size(Data)),
if Pause > 0 ->
activate_after(Socket, self(), Pause);
true -> activate(Socket, SocketMode, once)
true -> activate(Socket, SockMod, once)
end,
NewShaper.
+23 -13
View File
@@ -73,11 +73,16 @@ export(Server, Output) ->
end, Modules),
close_output(Output, IO).
export(Server, Output, Module1) ->
Module = case Module1 of
mod_pubsub -> pubsub_db;
_ -> Module1
end,
export(Server, Output, mod_mam = M1) ->
MucServices = gen_mod:get_module_opt_hosts(Server, mod_muc),
[export2(MucService, Output, M1, M1) || MucService <- MucServices],
export2(Server, Output, M1, M1);
export(Server, Output, mod_pubsub = M1) ->
export2(Server, Output, M1, pubsub_db);
export(Server, Output, M1) ->
export2(Server, Output, M1, M1).
export2(Server, Output, Module1, Module) ->
SQLMod = gen_mod:db_mod(sql, Module),
LServer = jid:nameprep(iolist_to_binary(Server)),
IO = prepare_output(Output),
@@ -104,12 +109,17 @@ delete(Server) ->
delete(Server, Module)
end, Modules).
delete(Server, Module) ->
delete(Server, Module1) ->
LServer = jid:nameprep(iolist_to_binary(Server)),
Module = case Module1 of
mod_pubsub -> pubsub_db;
_ -> Module1
end,
SQLMod = gen_mod:db_mod(sql, Module),
lists:foreach(
fun({Table, ConvertFun}) ->
delete(LServer, Table, ConvertFun)
end, Module:export(Server)).
end, SQLMod:export(Server)).
import(Server, Dir, ToType) ->
lists:foreach(
@@ -154,6 +164,7 @@ import_info(Mod) ->
%%% Internal functions
%%%----------------------------------------------------------------------
export(LServer, Table, IO, ConvertFun) ->
DbType = ejabberd_option:sql_type(LServer),
F = fun () ->
mnesia:read_lock_table(Table),
{_N, SQLs} =
@@ -163,7 +174,7 @@ export(LServer, Table, IO, ConvertFun) ->
[] ->
Acc;
SQL1 ->
SQL = format_queries(SQL1),
SQL = format_queries(DbType, SQL1),
if N < (?MAX_RECORDS_PER_TRANSACTION) - 1 ->
{N + 1, [SQL | SQLs]};
true ->
@@ -191,7 +202,7 @@ output(_LServer, Table, Fd, SQLs) ->
delete(LServer, Table, ConvertFun) ->
F = fun () ->
mnesia:write_lock_table(Table),
{_N, SQLs} =
{_N, _SQLs} =
mnesia:foldl(
fun(R, Acc) ->
case ConvertFun(LServer, R) of
@@ -202,8 +213,7 @@ delete(LServer, Table, ConvertFun) ->
Acc
end
end,
{0, []}, Table),
delete(LServer, Table, SQLs)
{0, []}, Table)
end,
mnesia:transaction(F).
@@ -368,10 +378,10 @@ format_error({error, eof}) ->
format_error({error, Posix}) ->
file:format_error(Posix).
format_queries(SQLs) ->
format_queries(DbType, SQLs) ->
lists:map(
fun(#sql_query{} = SQL) ->
ejabberd_sql:sql_query_to_iolist(SQL);
ejabberd_sql:sql_query_to_iolist(DbType, SQL);
(SQL) ->
SQL
end, SQLs).
+26 -7
View File
@@ -84,14 +84,14 @@ code_change(_OldVsn, State, _Extra) ->
%% -- ejabberd commands
get_commands_spec() ->
[#ejabberd_commands{name = modules_update_specs,
tags = [admin,modules],
tags = [modules],
desc = "Update the module source code from Git",
longdesc = "A connection to Internet is required",
module = ?MODULE, function = update,
args = [],
result = {res, rescode}},
#ejabberd_commands{name = modules_available,
tags = [admin,modules],
tags = [modules],
desc = "List the contributed modules available to install",
module = ?MODULE, function = available_command,
result_desc = "List of tuples with module name and description",
@@ -103,7 +103,7 @@ get_commands_spec() ->
[{name, atom},
{summary, string}]}}}}},
#ejabberd_commands{name = modules_installed,
tags = [admin,modules],
tags = [modules],
desc = "List the contributed modules already installed",
module = ?MODULE, function = installed_command,
result_desc = "List of tuples with module name and description",
@@ -115,7 +115,7 @@ get_commands_spec() ->
[{name, atom},
{summary, string}]}}}}},
#ejabberd_commands{name = module_install,
tags = [admin,modules],
tags = [modules],
desc = "Compile, install and start an available contributed module",
module = ?MODULE, function = install,
args_desc = ["Module name"],
@@ -123,7 +123,7 @@ get_commands_spec() ->
args = [{module, binary}],
result = {res, rescode}},
#ejabberd_commands{name = module_uninstall,
tags = [admin,modules],
tags = [modules],
desc = "Uninstall a contributed module",
module = ?MODULE, function = uninstall,
args_desc = ["Module name"],
@@ -131,7 +131,7 @@ get_commands_spec() ->
args = [{module, binary}],
result = {res, rescode}},
#ejabberd_commands{name = module_upgrade,
tags = [admin,modules],
tags = [modules],
desc = "Upgrade the running code of an installed module",
longdesc = "In practice, this uninstalls and installs the module",
module = ?MODULE, function = upgrade,
@@ -140,7 +140,7 @@ get_commands_spec() ->
args = [{module, binary}],
result = {res, rescode}},
#ejabberd_commands{name = module_check,
tags = [admin,modules],
tags = [modules],
desc = "Check the contributed module repository compliance",
module = ?MODULE, function = check,
args_desc = ["Module name"],
@@ -638,6 +638,7 @@ install(Module, Spec, SrcDir, LibDir) ->
Errors = lists:dropwhile(fun({_, ok}) -> true;
(_) -> false
end, Files1++Files2),
inform_module_configuration(Module, LibDir, Files1),
Result = case Errors of
[{F, {error, E}}|_] ->
{error, {F, E}};
@@ -649,6 +650,24 @@ install(Module, Spec, SrcDir, LibDir) ->
file:set_cwd(CurDir),
Result.
inform_module_configuration(Module, LibDir, Files1) ->
Res = lists:filter(fun({[$c, $o, $n, $f |_], ok}) -> true;
(_) -> false
end, Files1),
case Res of
[{ConfigPath, ok}] ->
FullConfigPath = filename:join(LibDir, ConfigPath),
io:format("Module ~p has been installed and started.~n"
"It's configured in the file:~n ~s~n"
"Configure the module in that file, or remove it~n"
"and configure in your main ejabberd.yml~n",
[Module, FullConfigPath]);
[] ->
io:format("Module ~p has been installed.~n"
"Now you can configure it in your ejabberd.yml~n",
[Module])
end.
%% -- minimalist rebar spec parser, only support git
fetch_rebar_deps(SrcDir) ->
+9
View File
@@ -122,12 +122,21 @@
{result, {default, broadcast}} |
{error, stanza_error()}.
-callback remove_extra_items(NodeIdx :: nodeIdx(),
Max_Items :: unlimited | non_neg_integer()) ->
{result, {[itemId()], [itemId()]}
}.
-callback remove_extra_items(NodeIdx :: nodeIdx(),
Max_Items :: unlimited | non_neg_integer(),
ItemIds :: [itemId()]) ->
{result, {[itemId()], [itemId()]}
}.
-callback remove_expired_items(NodeIdx :: nodeIdx(),
Seconds :: infinity | non_neg_integer()) ->
{result, [itemId()]}.
-callback get_node_affiliations(NodeIdx :: nodeIdx()) ->
{result, [{ljid(), affiliation()}]}.
+3
View File
@@ -67,6 +67,9 @@
-callback get_nodes(Host :: host())->
[pubsubNode()].
-callback get_all_nodes(Host :: host()) ->
[pubsubNode()].
-callback get_parentnodes(Host :: host(),
NodeId :: nodeId(),
From :: jid:jid()) ->
+1 -1
View File
@@ -262,7 +262,7 @@ expr_to_term(Expr) ->
Term.
term_to_expr(Term) ->
list_to_binary(io_lib:print(Term)).
list_to_binary(io_lib:print(Term, 1, 999999, -1)).
-spec now_to_usec(erlang:timestamp()) -> non_neg_integer().
now_to_usec({MSec, Sec, USec}) ->
+11 -18
View File
@@ -92,7 +92,7 @@
%%%
start(_Host, _Opts) ->
ejabberd_commands:register_commands(get_commands_spec()).
ejabberd_commands:register_commands(?MODULE, get_commands_spec()).
stop(Host) ->
case gen_mod:is_loaded_elsewhere(Host, ?MODULE) of
@@ -275,7 +275,7 @@ get_commands_spec() ->
result = {res, rescode},
result_example = ok,
result_desc = "Status code: 0 on success, 1 otherwise"},
#ejabberd_commands{name = status_num_host, tags = [session, stats],
#ejabberd_commands{name = status_num_host, tags = [session, statistics],
desc = "Number of logged users with this status in host",
policy = admin,
module = ?MODULE, function = status_num,
@@ -285,7 +285,7 @@ get_commands_spec() ->
result = {users, integer},
result_example = 23,
result_desc = "Number of connected sessions with given status type"},
#ejabberd_commands{name = status_num, tags = [session, stats],
#ejabberd_commands{name = status_num, tags = [session, statistics],
desc = "Number of logged users with this status",
policy = admin,
module = ?MODULE, function = status_num,
@@ -662,9 +662,11 @@ get_commands_spec() ->
"For example:\n"
" ejabberdctl srg_create group3 myserver.com "
"name desc \\\"group1\\\\ngroup2\\\"",
note = "changed in 21.07",
module = ?MODULE, function = srg_create,
args = [{group, binary}, {host, binary},
{name, binary}, {description, binary}, {display, binary}],
{label, binary}, {description, binary}, {display, binary}],
args_rename = [{name, label}],
args_example = [<<"group3">>, <<"myserver.com">>, <<"Group3">>,
<<"Third group">>, <<"group1\\\\ngroup2">>],
args_desc = ["Group identifier", "Group server name", "Group name",
@@ -770,7 +772,7 @@ get_commands_spec() ->
args_desc = ["Username", "Server name", "Query XML element"],
result = {res, rescode}},
#ejabberd_commands{name = stats, tags = [stats],
#ejabberd_commands{name = stats, tags = [statistics],
desc = "Get statistical value: registeredusers onlineusers onlineusersnode uptimeseconds processes",
policy = admin,
module = ?MODULE, function = stats,
@@ -780,7 +782,7 @@ get_commands_spec() ->
result_example = 6,
result_desc = "Integer statistic value",
result = {stat, integer}},
#ejabberd_commands{name = stats_host, tags = [stats],
#ejabberd_commands{name = stats_host, tags = [statistics],
desc = "Get statistical value for this host: registeredusers onlineusers",
policy = admin,
module = ?MODULE, function = stats,
@@ -1456,12 +1458,12 @@ private_set2(Username, Host, Xml) ->
%%% Shared Roster Groups
%%%
srg_create(Group, Host, Name, Description, Display) ->
srg_create(Group, Host, Label, Description, Display) ->
DisplayList = case Display of
<<>> -> [];
_ -> ejabberd_regexp:split(Display, <<"\\\\n">>)
end,
Opts = [{name, Name},
Opts = [{label, Label},
{displayed_groups, DisplayList},
{description, Description}],
{atomic, _} = mod_shared_roster:create_group(Host, Group, Opts),
@@ -1650,14 +1652,6 @@ mod_doc() ->
?T("If you want to put a group Name with blankspaces, use the "
"characters \"\' and \'\" to define when the Name starts and "
"ends. See an example below.")],
opts =>
[{module_resource,
#{value => ?T("Resource"),
desc =>
?T("Indicate the resource that the XMPP stanzas must use "
"in the FROM or TO JIDs. This is only useful in the "
"'get_vcard*' and 'set_vcard*' commands. The default "
"value is 'mod_admin_extra'.")}}],
example =>
[{?T("With this configuration, vCards can only be modified with "
"mod_admin_extra commands:"),
@@ -1668,8 +1662,7 @@ mod_doc() ->
" vcard_set:",
" - allow: adminextraresource",
"modules:",
" mod_admin_extra:",
" module_resource: \"modadminextraf8x,31ad\"",
" mod_admin_extra: {}",
" mod_vcard:",
" access_set: vcard_set"]},
{?T("Content of roster file for 'pushroster' command:"),
+7 -4
View File
@@ -46,7 +46,7 @@
%%%
start(_Host, _Opts) ->
ejabberd_commands:register_commands(get_commands_spec()).
ejabberd_commands:register_commands(?MODULE, get_commands_spec()).
stop(_Host) ->
ejabberd_commands:unregister_commands(get_commands_spec()).
@@ -63,7 +63,7 @@ depends(_Host, _Opts) ->
get_commands_spec() ->
[#ejabberd_commands{name = update_sql, tags = [sql],
desc = "Convert SQL DB to the new format",
desc = "Convert PostgreSQL DB to the new format",
module = ?MODULE, function = update_sql,
args = [],
args_example = [],
@@ -140,6 +140,7 @@ update_tables(State) ->
add_sh_column(State, "sr_group"),
add_pkey(State, "sr_group", ["server_host", "name"]),
create_unique_index(State, "sr_group", "i_sr_group_sh_name", ["server_host", "name"]),
drop_sh_default(State, "sr_group"),
add_sh_column(State, "sr_user"),
@@ -147,6 +148,7 @@ update_tables(State) ->
drop_index(State, "i_sr_user_jid"),
drop_index(State, "i_sr_user_grp"),
add_pkey(State, "sr_user", ["server_host", "jid", "grp"]),
create_unique_index(State, "sr_user", "i_sr_user_sh_jid_grp", ["server_host", "jid", "grp"]),
create_index(State, "sr_user", "i_sr_user_sh_jid", ["server_host", "jid"]),
create_index(State, "sr_user", "i_sr_user_sh_grp", ["server_host", "grp"]),
drop_sh_default(State, "sr_user"),
@@ -364,5 +366,6 @@ mod_doc() ->
#{desc =>
?T("This module can be used to update existing SQL database "
"from the default to the new schema. Check the section "
"http://../database-ldap/#default-and-new-schemas[Default and New Schemas] for details. "
"When the module is loaded use 'update_sql' ejabberdctl command.")}.
"http://../database/#default-and-new-schemas[Default and New Schemas] for details. "
"Please note that only PostgreSQL is supported. "
"When the module is loaded use _`update_sql`_ API.")}.
+7 -7
View File
@@ -930,7 +930,7 @@ mod_doc() ->
"should be disabled for instances of ejabberd with hundreds of "
"thousands users."), "",
?T("The Ad-hoc Commands are listed in the Server Discovery. "
"For this feature to work, 'mod_adhoc' must be enabled."), "",
"For this feature to work, _`mod_adhoc`_ must be enabled."), "",
?T("The specific JIDs where messages can be sent are listed below. "
"The first JID in each entry will apply only to the specified "
"virtual host example.org, while the JID between brackets "
@@ -940,7 +940,7 @@ mod_doc() ->
"online and connected to several resources, only the resource "
"with the highest priority will receive the message. "
"If the registered user is not connected, the message will be "
"stored offline in assumption that offline storage (see 'mod_offline') "
"stored offline in assumption that offline storage (see _`mod_offline`_) "
"is enabled."),
"- example.org/announce/online (example.org/announce/all-hosts/online)::",
?T("The message is sent to all connected users. If the user is "
@@ -965,20 +965,20 @@ mod_doc() ->
{db_type,
#{value => "mnesia | sql",
desc =>
?T("Same as top-level 'default_db' option, but applied to this module only.")}},
?T("Same as top-level _`default_db`_ option, but applied to this module only.")}},
{use_cache,
#{value => "true | false",
desc =>
?T("Same as top-level 'use_cache' option, but applied to this module only.")}},
?T("Same as top-level _`use_cache`_ option, but applied to this module only.")}},
{cache_size,
#{value => "pos_integer() | infinity",
desc =>
?T("Same as top-level 'cache_size' option, but applied to this module only.")}},
?T("Same as top-level _`cache_size`_ option, but applied to this module only.")}},
{cache_missed,
#{value => "true | false",
desc =>
?T("Same as top-level 'cache_missed' option, but applied to this module only.")}},
?T("Same as top-level _`cache_missed`_ option, but applied to this module only.")}},
{cache_life_time,
#{value => "timeout()",
desc =>
?T("Same as top-level 'cache_life_time' option, but applied to this module only.")}}]}.
?T("Same as top-level _`cache_life_time`_ option, but applied to this module only.")}}]}.
+2 -2
View File
@@ -469,8 +469,8 @@ mod_doc() ->
"[XEP-0398: User Avatar to vCard-Based Avatars Conversion]."), "",
?T("Also, the module supports conversion between avatar "
"image formats on the fly."), "",
?T("The module depends on 'mod_vcard', 'mod_vcard_xupdate' and "
"'mod_pubsub'.")],
?T("The module depends on _`mod_vcard`_, _`mod_vcard_xupdate`_ and "
"_`mod_pubsub`_.")],
opts =>
[{convert,
#{value => "{From: To}",
+6 -6
View File
@@ -240,27 +240,27 @@ mod_doc() ->
{queue_type,
#{value => "ram | file",
desc =>
?T("Same as top-level 'queue_type' option, but applied to this module only.")}},
?T("Same as top-level _`queue_type`_ option, but applied to this module only.")}},
{ram_db_type,
#{value => "mnesia | sql | redis",
desc =>
?T("Same as 'default_ram_db' but applied to this module only.")}},
?T("Same as _`default_ram_db`_ but applied to this module only.")}},
{use_cache,
#{value => "true | false",
desc =>
?T("Same as top-level 'use_cache' option, but applied to this module only.")}},
?T("Same as top-level _`use_cache`_ option, but applied to this module only.")}},
{cache_size,
#{value => "pos_integer() | infinity",
desc =>
?T("Same as top-level 'cache_size' option, but applied to this module only.")}},
?T("Same as top-level _`cache_size`_ option, but applied to this module only.")}},
{cache_missed,
#{value => "true | false",
desc =>
?T("Same as top-level 'cache_missed' option, but applied to this module only.")}},
?T("Same as top-level _`cache_missed`_ option, but applied to this module only.")}},
{cache_life_time,
#{value => "timeout()",
desc =>
?T("Same as top-level 'cache_life_time' option, but applied to this module only.")}}],
?T("Same as top-level _`cache_life_time`_ option, but applied to this module only.")}}],
example =>
["listen:",
" -",
+19 -7
View File
@@ -49,7 +49,8 @@
handle_cast/2, terminate/2, code_change/3]).
-export([user_send_packet/1, user_receive_packet/1,
c2s_presence_in/2, mod_opt_type/1, mod_options/1, mod_doc/0]).
c2s_presence_in/2, c2s_copy_session/2,
mod_opt_type/1, mod_options/1, mod_doc/0]).
-include("logger.hrl").
@@ -274,6 +275,13 @@ c2s_presence_in(C2SState,
C2SState#{caps_resources => NewRs}
end.
-spec c2s_copy_session(ejabberd_c2s:state(), ejabberd_c2s:state())
-> ejabberd_c2s:state().
c2s_copy_session(C2SState, #{caps_resources := Rs}) ->
C2SState#{caps_resources => Rs};
c2s_copy_session(C2SState, _) ->
C2SState.
-spec depends(binary(), gen_mod:opts()) -> [{module(), hard | soft}].
depends(_Host, _Opts) ->
[].
@@ -304,6 +312,8 @@ init([Host|_]) ->
caps_stream_features, 75),
ejabberd_hooks:add(s2s_in_post_auth_features, Host, ?MODULE,
caps_stream_features, 75),
ejabberd_hooks:add(c2s_copy_session, Host, ?MODULE,
c2s_copy_session, 75),
ejabberd_hooks:add(disco_local_features, Host, ?MODULE,
disco_features, 75),
ejabberd_hooks:add(disco_local_identity, Host, ?MODULE,
@@ -341,6 +351,8 @@ terminate(_Reason, State) ->
?MODULE, caps_stream_features, 75),
ejabberd_hooks:delete(s2s_in_post_auth_features, Host,
?MODULE, caps_stream_features, 75),
ejabberd_hooks:delete(c2s_copy_session, Host, ?MODULE,
c2s_copy_session, 75),
ejabberd_hooks:delete(disco_local_features, Host,
?MODULE, disco_features, 75),
ejabberd_hooks:delete(disco_local_identity, Host,
@@ -595,25 +607,25 @@ mod_doc() ->
"https://xmpp.org/extensions/xep-0115.html"
"[XEP-0115: Entity Capabilities]."),
?T("The main purpose of the module is to provide "
"PEP functionality (see 'mod_pubsub').")],
"PEP functionality (see _`mod_pubsub`_).")],
opts =>
[{db_type,
#{value => "mnesia | sql",
desc =>
?T("Same as top-level 'default_db' option, but applied to this module only.")}},
?T("Same as top-level _`default_db`_ option, but applied to this module only.")}},
{use_cache,
#{value => "true | false",
desc =>
?T("Same as top-level 'use_cache' option, but applied to this module only.")}},
?T("Same as top-level _`use_cache`_ option, but applied to this module only.")}},
{cache_size,
#{value => "pos_integer() | infinity",
desc =>
?T("Same as top-level 'cache_size' option, but applied to this module only.")}},
?T("Same as top-level _`cache_size`_ option, but applied to this module only.")}},
{cache_missed,
#{value => "true | false",
desc =>
?T("Same as top-level 'cache_missed' option, but applied to this module only.")}},
?T("Same as top-level _`cache_missed`_ option, but applied to this module only.")}},
{cache_life_time,
#{value => "timeout()",
desc =>
?T("Same as top-level 'cache_life_time' option, but applied to this module only.")}}]}.
?T("Same as top-level _`cache_life_time`_ option, but applied to this module only.")}}]}.
+1 -1
View File
@@ -1564,4 +1564,4 @@ mod_doc() ->
?T("The module provides server configuration functionality via "
"https://xmpp.org/extensions/xep-0050.html"
"[XEP-0050: Ad-Hoc Commands]. This module requires "
"'mod_adhoc' to be loaded.")}.
"_`mod_adhoc`_ to be loaded.")}.
+157
View File
@@ -0,0 +1,157 @@
%%%----------------------------------------------------------------------
%%% File : mod_conversejs.erl
%%% Author : Alexey Shchepin <alexey@process-one.net>
%%% Purpose : Serve simple page for Converse.js XMPP web browser client
%%% Created : 8 Nov 2021 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2021 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
%%% published by the Free Software Foundation; either version 2 of the
%%% License, or (at your option) any later version.
%%%
%%% This program is distributed in the hope that it will be useful,
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
%%% General Public License for more details.
%%%
%%% You should have received a copy of the GNU General Public License along
%%% with this program; if not, write to the Free Software Foundation, Inc.,
%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
%%%
%%%----------------------------------------------------------------------
-module(mod_conversejs).
-author('alexey@process-one.net').
-behaviour(gen_mod).
-export([start/2, stop/1, reload/3, process/2, depends/2,
mod_opt_type/1, mod_options/1, mod_doc/0]).
-include_lib("xmpp/include/xmpp.hrl").
-include("logger.hrl").
-include("ejabberd_http.hrl").
-include("translate.hrl").
-include("ejabberd_web_admin.hrl").
start(_Host, _Opts) ->
ok.
stop(_Host) ->
ok.
reload(_Host, _NewOpts, _OldOpts) ->
ok.
depends(_Host, _Opts) ->
[].
process([], #request{method = 'GET'}) ->
Host = ejabberd_config:get_myname(),
Domain = gen_mod:get_module_opt(Host, ?MODULE, default_domain),
Script = gen_mod:get_module_opt(Host, ?MODULE, conversejs_script),
CSS = gen_mod:get_module_opt(Host, ?MODULE, conversejs_css),
Init = [{<<"discover_connection_methods">>, false},
{<<"jid">>, Domain},
{<<"default_domain">>, Domain},
{<<"domain_placeholder">>, Domain},
{<<"view_mode">>, <<"fullscreen">>}],
Init2 =
case gen_mod:get_module_opt(Host, ?MODULE, websocket_url) of
undefined -> Init;
WSURL -> [{<<"websocket_url">>, WSURL} | Init]
end,
Init3 =
case gen_mod:get_module_opt(Host, ?MODULE, bosh_service_url) of
undefined -> Init2;
BoshURL -> [{<<"bosh_service_url">>, BoshURL} | Init2]
end,
{200, [html],
[<<"<!DOCTYPE html>">>,
<<"<html>">>,
<<"<head>">>,
<<"<meta charset='utf-8'>">>,
<<"<link rel='stylesheet' type='text/css' media='screen' href='">>,
fxml:crypt(CSS), <<"'>">>,
<<"<script src='">>, fxml:crypt(Script), <<"' charset='utf-8'></script>">>,
<<"</head>">>,
<<"<body>">>,
<<"<script>">>,
<<"converse.initialize(">>, jiffy:encode({Init3}), <<");">>,
<<"</script>">>,
<<"</body>">>,
<<"</html>">>]};
process(_, _) ->
ejabberd_web:error(not_found).
mod_opt_type(bosh_service_url) ->
econf:either(undefined, econf:binary());
mod_opt_type(websocket_url) ->
econf:either(undefined, econf:binary());
mod_opt_type(conversejs_script) ->
econf:binary();
mod_opt_type(conversejs_css) ->
econf:binary();
mod_opt_type(default_domain) ->
econf:binary().
mod_options(_) ->
[{bosh_service_url, undefined},
{websocket_url, undefined},
{default_domain, ejabberd_config:get_myname()},
{conversejs_script, <<"https://cdn.conversejs.org/dist/converse.min.js">>},
{conversejs_css, <<"https://cdn.conversejs.org/dist/converse.min.css">>}].
mod_doc() ->
#{desc =>
[?T("This module serves a simple page for the "
"https://conversejs.org/[Converse] XMPP web browser client."), "",
?T("This module is available since ejabberd 21.12."), "",
?T("To use this module, in addition to adding it to the 'modules' "
"section, you must also enable it in 'listen' -> 'ejabberd_http' -> "
"http://../listen-options/#request-handlers[request_handlers]."), "",
?T("You must also setup either the option 'websocket_url' or 'bosh_service_url'."), "",
?T("By default, the options 'conversejs_css' and 'conversejs_script'"
" point to the public Converse.js client. Alternatively, you can"
" host the client locally using _`mod_http_fileserver`_.")
],
example =>
["listen:",
" -",
" port: 5280",
" module: ejabberd_http",
" request_handlers:",
" /websocket: ejabberd_http_ws",
" /conversejs: mod_conversejs",
"",
"modules:",
" mod_conversejs:",
" websocket_url: \"ws://example.org:5280/websocket\""],
opts =>
[{websocket_url,
#{value => ?T("WebsocketURL"),
desc =>
?T("A websocket URL to which Converse.js can connect to.")}},
{bosh_service_url,
#{value => ?T("BoshURL"),
desc =>
?T("BOSH service URL to which Converse.js can connect to.")}},
{default_domain,
#{value => ?T("Domain"),
desc =>
?T("Specify a domain to act as the default for user JIDs. "
"The default value is the first domain defined in the "
"ejabberd configuration file.")}},
{conversejs_script,
#{value => ?T("URL"),
desc =>
?T("Converse.js main script URL.")}},
{conversejs_css,
#{value => ?T("URL"),
desc =>
?T("Converse.js CSS URL.")}}]
}.
+41
View File
@@ -0,0 +1,41 @@
%% Generated automatically
%% DO NOT EDIT: run `make options` instead
-module(mod_conversejs_opt).
-export([bosh_service_url/1]).
-export([conversejs_css/1]).
-export([conversejs_script/1]).
-export([default_domain/1]).
-export([websocket_url/1]).
-spec bosh_service_url(gen_mod:opts() | global | binary()) -> 'undefined' | binary().
bosh_service_url(Opts) when is_map(Opts) ->
gen_mod:get_opt(bosh_service_url, Opts);
bosh_service_url(Host) ->
gen_mod:get_module_opt(Host, mod_conversejs, bosh_service_url).
-spec conversejs_css(gen_mod:opts() | global | binary()) -> binary().
conversejs_css(Opts) when is_map(Opts) ->
gen_mod:get_opt(conversejs_css, Opts);
conversejs_css(Host) ->
gen_mod:get_module_opt(Host, mod_conversejs, conversejs_css).
-spec conversejs_script(gen_mod:opts() | global | binary()) -> binary().
conversejs_script(Opts) when is_map(Opts) ->
gen_mod:get_opt(conversejs_script, Opts);
conversejs_script(Host) ->
gen_mod:get_module_opt(Host, mod_conversejs, conversejs_script).
-spec default_domain(gen_mod:opts() | global | binary()) -> binary().
default_domain(Opts) when is_map(Opts) ->
gen_mod:get_opt(default_domain, Opts);
default_domain(Host) ->
gen_mod:get_module_opt(Host, mod_conversejs, default_domain).
-spec websocket_url(gen_mod:opts() | global | binary()) -> 'undefined' | binary().
websocket_url(Opts) when is_map(Opts) ->
gen_mod:get_opt(websocket_url, Opts);
websocket_url(Host) ->
gen_mod:get_module_opt(Host, mod_conversejs, websocket_url).
+1 -1
View File
@@ -95,7 +95,7 @@ mod_doc() ->
?T("WARNING: Security issue: Namespace delegation gives components "
"access to sensitive data, so permission should be granted "
"carefully, only if you trust the component."), "",
?T("NOTE: This module is complementary to 'mod_privilege' but can "
?T("NOTE: This module is complementary to _`mod_privilege`_ but can "
"also be used separately.")],
opts =>
[{namespaces,
+2 -2
View File
@@ -464,11 +464,11 @@ mod_doc() ->
" -",
" modules: all",
" name: abuse-addresses",
" urls: [mailto:abuse@shakespeare.lit]",
" urls: [\"mailto:abuse@shakespeare.lit\"]",
" -",
" modules: [mod_muc]",
" name: \"Web chatroom logs\"",
" urls: [http://www.example.org/muc-logs]",
" urls: [\"http://www.example.org/muc-logs\"]",
" -",
" modules: [mod_disco]",
" name: feedback-addresses",
+1 -1
View File
@@ -107,7 +107,7 @@ c2s_stream_started(#{ip := {Addr, _}} = State, _) ->
start(Host, Opts) ->
catch ets:new(failed_auth, [named_table, public,
{heir, erlang:group_leader(), none}]),
ejabberd_commands:register_commands(get_commands_spec()),
ejabberd_commands:register_commands(?MODULE, get_commands_spec()),
gen_mod:start_child(?MODULE, Host, Opts).
stop(Host) ->
+13 -3
View File
@@ -527,10 +527,20 @@ mod_doc() ->
[?T("This module provides a ReST API to call ejabberd commands "
"using JSON data."), "",
?T("To use this module, in addition to adding it to the 'modules' "
"section, you must also add it to 'request_handlers' of some "
"listener."), "",
"section, you must also enable it in 'listen' -> 'ejabberd_http' -> "
"http://../listen-options/#request-handlers[request_handlers]."), "",
?T("To use a specific API version N, when defining the URL path "
"in the request_handlers, add a 'vN'. "
"For example: '/api/v2: mod_http_api'"), "",
?T("To run a command, send a POST request to the corresponding "
"URL: 'http://localhost:5280/api/<command_name>'")]}.
"URL: 'http://localhost:5280/api/<command_name>'")],
example =>
["listen:",
" -",
" port: 5280",
" module: ejabberd_http",
" request_handlers:",
" /api: mod_http_api",
"",
"modules:",
" mod_http_api: {}"]}.
+7 -5
View File
@@ -232,8 +232,9 @@ mod_doc() ->
"[XEP-0363: HTTP File Upload]. If the request is accepted, "
"the client receives a URL for uploading the file and "
"another URL from which that file can later be downloaded."), "",
?T("In order to use this module, it must be configured as "
"a 'request_handler' for 'ejabberd_http' listener.")],
?T("In order to use this module, it must be enabled "
"in 'listen' -> 'ejabberd_http' -> "
"http://../listen-options/#request-handlers[request_handlers].")],
opts =>
[{host,
#{desc => ?T("Deprecated. Use 'hosts' instead.")}},
@@ -320,17 +321,18 @@ mod_doc() ->
"used for file uploads. The keyword @HOST@ is replaced "
"with the virtual host name. NOTE: different virtual "
"hosts cannot use the same PUT URL. "
"The default value is \"https://@HOST@:5443\".")}},
"The default value is \"https://@HOST@:5443/upload\".")}},
{get_url,
#{value => ?T("URL"),
desc =>
?T("This option specifies the initial part of the GET URLs "
"used for downloading the files. By default, it is set "
"used for downloading the files. The default value is 'undefined'. "
"When this option is 'undefined', this option is set "
"to the same value as 'put_url'. The keyword @HOST@ is "
"replaced with the virtual host name. NOTE: if GET requests "
"are handled by 'mod_http_upload', the 'get_url' must match the "
"'put_url'. Setting it to a different value only makes "
"sense if an external web server or 'mod_http_fileserver' "
"sense if an external web server or _`mod_http_fileserver`_ "
"is used to serve the uploaded files.")}},
{service_url,
#{desc => ?T("Deprecated.")}},
+11 -12
View File
@@ -27,7 +27,6 @@
-author('holger@zedat.fu-berlin.de').
-define(TIMEOUT, timer:hours(24)).
-define(INITIAL_TIMEOUT, timer:minutes(10)).
-define(FORMAT(Error), file:format_error(Error)).
-behaviour(gen_server).
@@ -64,7 +63,7 @@
max_days :: pos_integer() | infinity,
docroot :: binary(),
disk_usage = #{} :: disk_usage(),
timers :: [timer:tref()]}).
timer :: reference() | undefined}).
-type disk_usage() :: #{{binary(), binary()} => non_neg_integer()}.
-type state() :: #state{}.
@@ -166,12 +165,11 @@ init([ServerHost|_]) ->
DocRoot1 = mod_http_upload_opt:docroot(ServerHost),
DocRoot2 = mod_http_upload:expand_home(str:strip(DocRoot1, right, $/)),
DocRoot3 = mod_http_upload:expand_host(DocRoot2, ServerHost),
Timers = if MaxDays == infinity -> [];
true ->
{ok, T1} = timer:send_after(?INITIAL_TIMEOUT, sweep),
{ok, T2} = timer:send_interval(?TIMEOUT, sweep),
[T1, T2]
end,
Timer = if MaxDays == infinity -> undefined;
true ->
Timeout = p1_rand:uniform(?TIMEOUT div 2),
erlang:send_after(Timeout, self(), sweep)
end,
ejabberd_hooks:add(http_upload_slot_request, ServerHost, ?MODULE,
handle_slot_request, 50),
{ok, #state{server_host = ServerHost,
@@ -179,7 +177,7 @@ init([ServerHost|_]) ->
access_hard_quota = AccessHardQuota,
max_days = MaxDays,
docroot = DocRoot3,
timers = Timers}}.
timer = Timer}}.
-spec handle_call(_, {pid(), _}, state()) -> {noreply, state()}.
handle_call(Request, From, State) ->
@@ -249,6 +247,7 @@ handle_info(sweep, #state{server_host = ServerHost,
max_days = MaxDays} = State)
when is_integer(MaxDays), MaxDays > 0 ->
?DEBUG("Got 'sweep' message for ~ts", [ServerHost]),
Timer = erlang:send_after(?TIMEOUT, self(), sweep),
case file:list_dir(DocRoot) of
{ok, Entries} ->
BackThen = secs_since_epoch() - (MaxDays * 86400),
@@ -264,17 +263,17 @@ handle_info(sweep, #state{server_host = ServerHost,
?ERROR_MSG("Cannot open document root ~ts: ~ts",
[DocRoot, ?FORMAT(Error)])
end,
{noreply, State};
{noreply, State#state{timer = Timer}};
handle_info(Info, State) ->
?ERROR_MSG("Unexpected info: ~p", [Info]),
{noreply, State}.
-spec terminate(normal | shutdown | {shutdown, _} | _, state()) -> ok.
terminate(Reason, #state{server_host = ServerHost, timers = Timers}) ->
terminate(Reason, #state{server_host = ServerHost, timer = Timer}) ->
?DEBUG("Stopping upload quota process for ~ts: ~p", [ServerHost, Reason]),
ejabberd_hooks:delete(http_upload_slot_request, ServerHost, ?MODULE,
handle_slot_request, 50),
lists:foreach(fun timer:cancel/1, Timers).
misc:cancel_timer(Timer).
-spec code_change({down, _} | _, state(), _) -> {ok, state()}.
code_change(_OldVsn, #state{server_host = ServerHost} = State, _Extra) ->
+5 -5
View File
@@ -344,20 +344,20 @@ mod_doc() ->
[{db_type,
#{value => "mnesia | sql",
desc =>
?T("Same as top-level 'default_db' option, but applied to this module only.")}},
?T("Same as top-level _`default_db`_ option, but applied to this module only.")}},
{use_cache,
#{value => "true | false",
desc =>
?T("Same as top-level 'use_cache' option, but applied to this module only.")}},
?T("Same as top-level _`use_cache`_ option, but applied to this module only.")}},
{cache_size,
#{value => "pos_integer() | infinity",
desc =>
?T("Same as top-level 'cache_size' option, but applied to this module only.")}},
?T("Same as top-level _`cache_size`_ option, but applied to this module only.")}},
{cache_missed,
#{value => "true | false",
desc =>
?T("Same as top-level 'cache_missed' option, but applied to this module only.")}},
?T("Same as top-level _`cache_missed`_ option, but applied to this module only.")}},
{cache_life_time,
#{value => "timeout()",
desc =>
?T("Same as top-level 'cache_life_time' option, but applied to this module only.")}}]}.
?T("Same as top-level _`cache_life_time`_ option, but applied to this module only.")}}]}.
+9 -8
View File
@@ -28,6 +28,7 @@
-protocol({xep, 313, '0.6.1'}).
-protocol({xep, 334, '0.2'}).
-protocol({xep, 359, '0.5.0'}).
-protocol({xep, 441, '0.2.0'}).
-behaviour(gen_mod).
@@ -148,7 +149,7 @@ start(Host, Opts) ->
ejabberd_hooks:add(check_create_room, Host, ?MODULE,
check_create_room, 50)
end,
ejabberd_commands:register_commands(get_commands_spec()),
ejabberd_commands:register_commands(?MODULE, get_commands_spec()),
ok;
Err ->
Err
@@ -1456,7 +1457,7 @@ mod_doc() ->
#{value => "true | false",
desc =>
?T("This option determines how ejabberd's "
"stream management code (see 'mod_stream_mgmt') "
"stream management code (see _`mod_stream_mgmt`_) "
"handles unacknowledged messages when the "
"connection is lost. Usually, such messages are "
"either bounced or resent. However, neither is "
@@ -1495,28 +1496,28 @@ mod_doc() ->
#{value => "true | false",
desc =>
?T("Whether to destroy message archive of a room "
"(see 'mod_muc') when it gets destroyed. "
"(see _`mod_muc`_) when it gets destroyed. "
"The default value is 'true'.")}},
{db_type,
#{value => "mnesia | sql",
desc =>
?T("Same as top-level 'default_db' option, but applied to this module only.")}},
?T("Same as top-level _`default_db`_ option, but applied to this module only.")}},
{use_cache,
#{value => "true | false",
desc =>
?T("Same as top-level 'use_cache' option, but applied to this module only.")}},
?T("Same as top-level _`use_cache`_ option, but applied to this module only.")}},
{cache_size,
#{value => "pos_integer() | infinity",
desc =>
?T("Same as top-level 'cache_size' option, but applied to this module only.")}},
?T("Same as top-level _`cache_size`_ option, but applied to this module only.")}},
{cache_missed,
#{value => "true | false",
desc =>
?T("Same as top-level 'cache_missed' option, but applied to this module only.")}},
?T("Same as top-level _`cache_missed`_ option, but applied to this module only.")}},
{cache_life_time,
#{value => "timeout()",
desc =>
?T("Same as top-level 'cache_life_time' option, but applied to this module only.")}},
?T("Same as top-level _`cache_life_time`_ option, but applied to this module only.")}},
{user_mucsub_from_muc_archive,
#{value => "true | false",
desc =>
+5 -15
View File
@@ -72,7 +72,7 @@ remove_from_archive(LUser, LServer, WithJid) ->
end.
delete_old_messages(ServerHost, TimeStamp, Type) ->
TS = now_to_usec(TimeStamp),
TS = misc:now_to_usec(TimeStamp),
case Type of
all ->
ejabberd_sql:sql_query(
@@ -315,7 +315,7 @@ export(_Server) ->
id = _ID, timestamp = TS, peer = Peer,
type = Type, nick = Nick, packet = Pkt})
when LServer == Host ->
TStmp = now_to_usec(TS),
TStmp = misc:now_to_usec(TS),
SUser = case Type of
chat -> LUser;
groupchat -> jid:encode({LUser, LServer, <<>>})
@@ -372,16 +372,6 @@ is_empty_for_room(LServer, LName, LHost) ->
%%%===================================================================
%%% Internal functions
%%%===================================================================
now_to_usec({MSec, Sec, USec}) ->
(MSec*1000000 + Sec)*1000000 + USec.
usec_to_now(Int) ->
Secs = Int div 1000000,
USec = Int rem 1000000,
MSec = Secs div 1000000,
Sec = Secs rem 1000000,
{MSec, Sec, USec}.
make_sql_query(User, LServer, MAMQuery, RSM, ExtraUsernames) ->
Start = proplists:get_value(start, MAMQuery),
End = proplists:get_value('end', MAMQuery),
@@ -432,14 +422,14 @@ make_sql_query(User, LServer, MAMQuery, RSM, ExtraUsernames) ->
StartClause = case Start of
{_, _, _} ->
[<<" and timestamp >= ">>,
integer_to_binary(now_to_usec(Start))];
integer_to_binary(misc:now_to_usec(Start))];
_ ->
[]
end,
EndClause = case End of
{_, _, _} ->
[<<" and timestamp <= ">>,
integer_to_binary(now_to_usec(End))];
integer_to_binary(misc:now_to_usec(End))];
_ ->
[]
end,
@@ -526,7 +516,7 @@ make_archive_el(User, TS, XML, Peer, Kind, Nick, MsgType, JidRequestor, JidArchi
TSInt ->
try jid:decode(Peer) of
PeerJID ->
Now = usec_to_now(TSInt),
Now = misc:usec_to_now(TSInt),
PeerLJID = jid:tolower(PeerJID),
T = case Kind of
<<"">> -> chat;
+5 -5
View File
@@ -24,7 +24,7 @@
-module(mod_mix).
-behaviour(gen_mod).
-behaviour(gen_server).
-protocol({xep, 369, '0.13.0'}).
-protocol({xep, 369, '0.14.1'}).
%% API
-export([route/1]).
@@ -106,12 +106,12 @@ mod_doc() ->
"experimental feature, updated in 19.02, and is not "
"yet ready to use in production. It's asserted that "
"the MIX protocol is going to replace the MUC protocol "
"in the future (see 'mod_muc')."), "",
"in the future (see _`mod_muc`_)."), "",
?T("To learn more about how to use that feature, you can refer to "
"our tutorial: https://docs.ejabberd.im/tutorials/mix-010/"
"[Getting started with XEP-0369: Mediated Information "
"eXchange (MIX) v0.1]."), "",
?T("The module depends on 'mod_mam'.")],
?T("The module depends on _`mod_mam`_.")],
opts =>
[{access_create,
#{value => ?T("AccessName"),
@@ -136,7 +136,7 @@ mod_doc() ->
{db_type,
#{value => "mnesia | sql",
desc =>
?T("Same as top-level 'default_db' option, but applied to this module only.")}}]}.
?T("Same as top-level _`default_db`_ option, but applied to this module only.")}}]}.
-spec route(stanza()) -> ok.
route(#iq{} = IQ) ->
@@ -166,7 +166,7 @@ process_disco_info(#iq{type = get, to = #jid{luser = <<>>} = To,
[ServerHost, ?MODULE, <<"">>, Lang]),
Name = mod_mix_opt:name(ServerHost),
Identity = #identity{category = <<"conference">>,
type = <<"text">>,
type = <<"mix">>,
name = translate:translate(Lang, Name)},
Features = [?NS_DISCO_INFO, ?NS_DISCO_ITEMS,
?NS_MIX_CORE_0, ?NS_MIX_CORE_SEARCHABLE_0,
+5 -5
View File
@@ -120,23 +120,23 @@ mod_doc() ->
[{db_type,
#{value => "mnesia | sql",
desc =>
?T("Same as top-level 'default_db' option, but applied to this module only.")}},
?T("Same as top-level _`default_db`_ option, but applied to this module only.")}},
{use_cache,
#{value => "true | false",
desc =>
?T("Same as top-level 'use_cache' option, but applied to this module only.")}},
?T("Same as top-level _`use_cache`_ option, but applied to this module only.")}},
{cache_size,
#{value => "pos_integer() | infinity",
desc =>
?T("Same as top-level 'cache_size' option, but applied to this module only.")}},
?T("Same as top-level _`cache_size`_ option, but applied to this module only.")}},
{cache_missed,
#{value => "true | false",
desc =>
?T("Same as top-level 'cache_missed' option, but applied to this module only.")}},
?T("Same as top-level _`cache_missed`_ option, but applied to this module only.")}},
{cache_life_time,
#{value => "timeout()",
desc =>
?T("Same as top-level 'cache_life_time' option, but applied to this module only.")}}]}.
?T("Same as top-level _`cache_life_time`_ option, but applied to this module only.")}}]}.
-spec bounce_sm_packet({term(), stanza()}) -> {term(), stanza()}.
bounce_sm_packet({_, #message{to = #jid{lresource = <<>>} = To,
+27 -9
View File
@@ -278,8 +278,9 @@ listen_options() ->
%%%===================================================================
mod_doc() ->
#{desc =>
?T("This module adds support for the MQTT protocol "
"version '3.1.1' and '5.0'. Remember to configure "
?T("This module adds "
"https://docs.ejabberd.im/admin/guide/mqtt/[support for the MQTT] "
"protocol version '3.1.1' and '5.0'. Remember to configure "
"'mod_mqtt' in 'modules' and 'listen' sections."),
opts =>
[{access_subscribe,
@@ -326,37 +327,37 @@ mod_doc() ->
{queue_type,
#{value => "ram | file",
desc =>
?T("Same as top-level 'queue_type' option, "
?T("Same as top-level _`queue_type`_ option, "
"but applied to this module only.")}},
{ram_db_type,
#{value => "mnesia",
desc =>
?T("Same as top-level 'default_ram_db' option, "
?T("Same as top-level _`default_ram_db`_ option, "
"but applied to this module only.")}},
{db_type,
#{value => "mnesia | sql",
desc =>
?T("Same as top-level 'default_db' option, "
?T("Same as top-level _`default_db`_ option, "
"but applied to this module only.")}},
{use_cache,
#{value => "true | false",
desc =>
?T("Same as top-level 'use_cache' option, "
?T("Same as top-level _`use_cache`_ option, "
"but applied to this module only.")}},
{cache_size,
#{value => "pos_integer() | infinity",
desc =>
?T("Same as top-level 'cache_size' option, "
?T("Same as top-level _`cache_size`_ option, "
"but applied to this module only.")}},
{cache_missed,
#{value => "true | false",
desc =>
?T("Same as top-level 'cache_missed' option, "
?T("Same as top-level _`cache_missed`_ option, "
"but applied to this module only.")}},
{cache_life_time,
#{value => "timeout()",
desc =>
?T("Same as top-level 'cache_life_time' option, "
?T("Same as top-level _`cache_life_time`_ option, "
"but applied to this module only.")}}]}.
%%%===================================================================
@@ -600,6 +601,23 @@ match([H|T1], [<<"%c">>|T2], U, S, R) ->
R -> match(T1, T2, U, S, R);
_ -> false
end;
match([H|T1], [<<"%g">>|T2], U, S, R) ->
case jid:resourceprep(H) of
H ->
case acl:loaded_shared_roster_module(S) of
undefined -> false;
Mod ->
case Mod:get_group_opts(S, H) of
error -> false;
_ ->
case Mod:is_user_in_group({U, S}, H, S) of
true -> match(T1, T2, U, S, R);
_ -> false
end
end
end;
_ -> false
end;
match([H|T1], [H|T2], U, S, R) ->
match(T1, T2, U, S, R);
match([], [], _, _, _) ->

Some files were not shown because too many files have changed in this diff Show More