如何成功運行 ejabberdctl dump-config 或查找更新的文檔?

如何成功運行 ejabberdctl dump-config 或查找更新的文檔?

在 Docker 中啟動 ejabberd 20.12 後,日誌告訴我應該執行 ejabberdctl dump-config 來取得目前執行設定。

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.

當我運行它時,docker exec -it ejabberd bin/ejabberdctl dump-config它告訴我我還需要 1 個參數...

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

是時候檢查一下文件了…等一下,在網路上找不到任何提到 ejabberdctl dump-config 的資訊。有一些關於 dump_config 的 API 信息,但我不確定如何將其轉換為 CLI。

我試圖透過指定輸出檔案來猜測額外的參數是什麼,但沒有任何內容被寫入該檔案。是我一個人的問題還是缺少 ejabberd 文件?

答案1

您可以在以下位置獲取詳細信息https://docs.ejabberd.im/developer/ejabberd-api/admin-api/#dump-config 並在

$ 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

因此,例如:

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

我試圖透過指定輸出檔案來猜測額外的參數是什麼,但沒有任何內容被寫入該檔案。

在 ejabberdctl 或其他 ejabberd API 命令的參數中指定路徑時,請記住始終指定完整路徑,例如/etc/ejabberd/something.txt.

如果您只指定相對路徑,例如something.txt,它將在 ejabberd 的工作目錄中生成,該目錄可能不是您執行 ejabberdctl 腳本的位置

相關內容