0

After starting up ejabberd 20.12 in Docker, the logs tell me I should run ejabberdctl dump-config to get the current running configuration.

2021-01-15 01:32:21.039034+00:00 [warning] Listening option 'certfile' of module ejabberd_c2s is deprecated and was automatically appended to global 'certfiles' option. Please adjust your configuration file accordingly. Hint: run `ejabberdctl dump-config` command to view current configuration as it is seen by ejabberd.

When I run it docker exec -it ejabberd bin/ejabberdctl dump-config it tells me I need 1 more argument...

Error: the command "dump-config" requires 1 more argument.

Time to check the documentation... Wait a minute, it's impossible to find any information online that mentions ejabberdctl dump-config. There is some API info about dump_config but I'm not sure how that translates to the CLI.

I tried to guess what the extra argument was by specifying an output file, but nothing gets written to the file. Is it just me or is the ejabberd documentation lacking?

1 Answers1

0

You can get details in https://docs.ejabberd.im/developer/ejabberd-api/admin-api/#dump-config and in

$ ejabberdctl help dump-config

  Command Name: dump_config

  Arguments: out::string
             
  Returns: res::rescode

  Tags:  config

  Description:  Dump configuration in YAML format as seen by ejabberd

So, for example:

$ ejabberdctl dump-config $HOME/eja.yml
$ head $HOME/eja.yml
hosts: 
  - "localhost"
  - "192.168.1.23"
loglevel: info
certfiles: 
  - "/etc/ejabberd/pem-5.pem"
...

I tried to guess what the extra argument was by specifying an output file, but nothing gets written to the file.

When specifying path in arguments to ejabberdctl or other ejabberd API commands, remember to specify always full path like /etc/ejabberd/something.txt.

If you specify only relative path like something.txt, it will be generated in ejabberd's working directory, which probably is not where you are running that ejabberdctl script

Badlop
  • 580
  • 3
  • 5
  • Thanks, that was the problem, I was not specifying the full path. It works as you described, and makes sense about the API documentation as well now that I read it again. – linucksrox Jan 15 '21 at 21:59