Use econf:directory to validate the path option

This commit is contained in:
Badlop 2021-09-15 15:50:15 +02:00
parent 0da3afbeeb
commit a41df9c914
2 changed files with 4 additions and 4 deletions

View File

@ -3,7 +3,7 @@
# log all vhosts chats in /var/log/ejabberd/chat directory in html
#modules:
# mod_log_chat:
# path: "/var/log/ejabberd/chat"
# path: /var/log/ejabberd/chat
# format: html
@ -13,8 +13,8 @@
# mod_log_chat:
# host_config:
# - "vh1.myjabberserver.net":
# - path: "/var/log/ejabberd/vh1.myjabberserver.net"
# - path: /var/log/ejabberd/vh1.myjabberserver.net
# - format: html
# - "vh2.myjabberserver.net":
# - path: "/var/log/ejabberd/vh2.myjabberserver.net"
# - path: /var/log/ejabberd/vh2.myjabberserver.net
# - format: text

View File

@ -280,7 +280,7 @@ depends(_Host, _Opts) ->
[].
mod_opt_type(host_config) -> econf:list(econf:any());
mod_opt_type(path) -> fun iolist_to_binary/1;
mod_opt_type(path) -> econf:directory(write);
mod_opt_type(format) ->
fun (A) when is_atom(A) -> A end.