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

137 Commits

Author SHA1 Message Date
Badlop
9f934abd48 ejabberdctl: Fix crash running defined commands in container and installers 2024-02-09 14:12:06 +01:00
Badlop
c6878f9c9d ejabberdctl: Print argument description, examples and note in help 2024-02-06 17:52:25 +01:00
Badlop
1d65f4471b ejabberdctl: Document exclusive ejabberdctl commands like all the others 2024-02-06 17:52:24 +01:00
Badlop
e9de3748bd ejabberdctl: Reorganize commands related to mnesia info
- ejabberdctl mnesia: already implemented in ejabberd_admin.erl
- ejabberdctl mnesia info: renamed to mnesia_info_ctl
- ejabberdctl mnesia Arg: command removed, use mnesia_info_ctl instead
2024-02-06 17:52:22 +01:00
Alexey Shchepin
66d701e788 Add print_sql_schema ejabberdctl command 2024-01-24 22:52:20 +03:00
Badlop
589521bfd8 Update copyright year to 2024 (#4139) 2024-01-22 17:29:13 +01:00
Badlop
90766685ae ejabberd_ctl: When API version>0, update syntax of list results 2024-01-04 21:53:14 +01:00
Badlop
d65638efe1 ejabberd_ctl: Pass API version to format_result 2024-01-04 21:53:14 +01:00
Badlop
b34572e7ce ejabberd_ctl: Show proper command help when version is explicitly set 2024-01-04 21:53:14 +01:00
Badlop
c4c0cd1b77 ejabberd_ctl: Add support for list and tuple arguments
Tuple elements are separated with :
List elements are separated with ,

For example:
  ejabberdctl add_rosteritem user1 localhost testuser7 localhost NickUser77l gr1,gr2,gr3 both
  ejabberdctl create_room_with_opts room1 conference.localhost localhost public:false,persistent:true
  ejabberdctl subscribe_room_many user1@localhost:User1,admin@localhost:Admin room1@conference.localhost urn:xmpp:mucsub:nodes:messages,urn:xmpp:mucsub:nodes:affiliations

Affected commands:
- add_rosteritem
- create_room_with_opts
- oauth_issue_token
- send_direct_invitation
- set_vcard2_multi
- srg_create
- subscribe_room
- subscribe_room_many
2024-01-04 21:53:14 +01:00
Badlop
245c9ae446 ejabberd_ctl: Support policy=user in the help and return proper arguments 2023-09-21 13:47:07 +02:00
Badlop
8d39431d68 ejabberd_ctl: Improve printing lists in results
When formatting the results of a command:
- If the top of the result is a list, split elements with newline as usual
- If it's a list in one of the resulting lines, split elements with ;
2023-09-21 13:47:05 +02:00
Badlop
d2c54fd5fe Fix calling ejabberdctl command with wrong number of arguments with Erlang 26
In Erlang up to 25.3, the lists:zip arguments were [A1, A2]
Since Erlang 26.0, the arguments are: [A1, A2, fail]

93748a8d84
2023-06-13 12:25:27 +02:00
Stu Tomlinson
648c83ea03
Fix ejabberdctl output formatting (#3979)
ECMA-48 SGR sequence ESC [21m is actually 'set double underline' but was
incorrectly implemented as 'set normal intensity' in Linux prior to
4.17.

The correct sequence for 'set normal intensity' is ESC [22m, which fixes
output formatting of 'ejabberdctl' and 'ejabberdctl help' on macos.
2023-01-19 11:18:59 +01:00
Badlop
243697e25a Update copyright year to 2023 (#3967) 2023-01-10 13:52:04 +01:00
Badlop
4f8e6fe844 Fix errors and warnings for "rebar3 edoc" 2022-05-17 10:42:02 +02:00
Badlop
0f73d3f4d1 Don't define restart and stop in ejabberd_ctl, use the corresponding commands 2022-03-25 12:51:27 +01:00
Badlop
b3211b1f71 Update copyright year to 2022 2022-02-11 09:39:25 +01:00
Alexey Shchepin
536beedeb6 Accept more types of ejabberdctl commands arguments as JSON-encoded 2021-12-20 09:42:02 +03:00
Badlop
b6a2eeebeb Mention "help" as an available ejabberdctl command 2021-11-05 15:57:57 +01:00
Badlop
41808a63a0 Show definer module in "ejabberdctl help" when it's a gen_mod 2021-07-30 01:14:31 +02:00
Badlop
57202d958a Use G macro name for tag, as T overlapped T from translation 2021-05-17 16:14:39 +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
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
f8a02f5d9d Get the arguments definition from the record (#3569)
This fixes "ejabberdctl help help"
2021-04-15 20:25:47 +02:00
Badlop
6e0161470e Update newest copyright year to 2021 (#3464) 2021-01-27 17:02:06 +01:00
Badlop
d7d8085d3b Fix most EDoc errors, even if that's not used nowadays apparently 2020-05-11 19:53:13 +02:00
Badlop
055fe744d3 Clean some unused functions in ejabberd_ctl, this makes "make hooks" happy 2020-04-24 20:36:24 +02:00
Badlop
4aa85c538c When rescode is some unexpected, probably error message, print it 2020-04-17 16:19:55 +02:00
Badlop
2d32c66fd7 Update copyright to 2020 (#3149) 2020-01-28 15:49:23 +01:00
Evgeny Khramtsov
f1a35cc9ac Avoid calling to logger module on OTP<22 2019-10-25 15:27:47 +03:00
Evgeny Khramtsov
e4a8afb15d Replace lager with built-in new logging API
This change requires Erlang/OTP-21.0 or higher.
The commit also deprecates the following options:
  - log_rotate_date
  - log_rate_limit

Furthermore, these options have no effect. The logger now fully
relies on log_rotate_size, that cannot be 0 anymore.

The loglevel option now accepts levels in literal formats.
Those are: none, emergency, alert, critical, error, warning, notice, info, debug.
Old integer values (0-5) are still supported and automatically converted
into literal format.
2019-10-18 19:12:32 +03:00
Evgeny Khramtsov
5770946f03 Correctly handle unicode in log messages 2019-09-23 15:17:20 +03:00
Evgeny Khramtsov
53dacb3825 Use ejabberd_cluster:call() instead of rpc:call() 2019-07-12 12:30:38 +03:00
Evgeny Khramtsov
6f5d99275b Process unexpected messages uniformly 2019-07-12 11:55:36 +03:00
Evgeny Khramtsov
cbe84eb50c Check virtual host before running the command 2019-07-08 23:14:31 +03:00
Badlop
fb77e2e8c0 Add support for backwards compatibility in command argument names (#2908) 2019-06-19 09:30:53 +02:00
Evgeny Khramtsov
a02cff0e78 Use new configuration validator 2019-06-14 12:33:26 +03:00
Mickael Remond
7a8de9cfcf
Make some standard admin command to get Mnesia info 2019-05-03 14:59:24 +02:00
Evgeny Khramtsov
11e963aa78 Provide a suggestion when unknown command is detected 2019-04-30 10:05:06 +03:00
Badlop
55417dfb37 Update copyright to 2019 (#2756) 2019-01-08 22:53:27 +01:00
Paweł Chmielowski
c88a2d0569 Add code for handling deprecations of get_stacktrace() 2018-12-13 11:46:53 +01:00
Evgeny Khramtsov
2d246f61dd Fix some dialyzer warnings 2018-09-09 09:59:08 +03:00
Holger Weiss
12e537c43f Avoid "ejabberdctl status" crash 2018-07-14 20:27:30 +02:00
Paweł Chmielowski
dc6861eb73 Use ejabberd_config:get_version in ejabberdctl status 2018-07-09 17:11:40 +02:00
Evgeniy Khramtsov
fd8e07af47 Get rid of ejabberd.hrl header
The header consisted of too many unrelated stuff and macros misuse.
Some stuff is moved into scram.hrl and type_compat.hrl.
All macros have been replaced with the corresponding function calls.

TODO: probably type_compat.hrl is not even needed anymore since
we support only Erlang >= OTP 17.5
2018-06-14 14:00:47 +03:00
Evgeniy Khramtsov
6e5439db5c Find and fix typos using 'codespell' 2018-01-27 19:35:38 +03:00
Evgeniy Khramtsov
cdc7c1d1ed Update copyright dates 2018-01-05 23:18:58 +03:00
Evgeniy Khramtsov
01a2c9fe12 Add type specs for Module:opt_type/1 2017-05-08 12:59:28 +03:00
Evgeniy Khramtsov
b82b93f8f0 Don't validate an option in ejabberd_config:get_option() functions
The commit introduces the following changes:
* Now there is no need to pass validating function in
  ejabberd_config:get_option() functions, because the configuration
  keeps already validated values.
* New function ejabberd_config:get_option/1 is introduced
* Function ejabberd_config:get_option/3 is deprecated. If the function
  is still called, the second argument (validating function) is simply
  ignored.
* The second argument for ejabberd_config:get_option/2 is now
  a default value, not a validating function.
2017-04-29 11:39:40 +03:00