diff options
author | Kim Alvefur <zash@zash.se> | 2021-02-03 23:28:02 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-02-03 23:28:02 +0100 |
commit | a64ae4e8d58b739951a741cd5ac1a5b194604667 (patch) | |
tree | 6f14aac5ecb2c5fd8315bf3b3487eeeed8f7e943 /plugins/mod_admin_shell.lua | |
parent | d4986121acfb36e42668d77359ed68b5171781d4 (diff) | |
download | prosody-a64ae4e8d58b739951a741cd5ac1a5b194604667.tar.gz prosody-a64ae4e8d58b739951a741cd5ac1a5b194604667.zip |
mod_admin_shell: List global HTTP endpoints by default
Trick copied from the module commands
Diffstat (limited to 'plugins/mod_admin_shell.lua')
-rw-r--r-- | plugins/mod_admin_shell.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/mod_admin_shell.lua b/plugins/mod_admin_shell.lua index 5b4c2a61..1c026b8b 100644 --- a/plugins/mod_admin_shell.lua +++ b/plugins/mod_admin_shell.lua @@ -1224,12 +1224,17 @@ def_env.http = {}; function def_env.http:list(hosts) local print = self.session.print; + hosts = array.collect(set.new({ not hosts and "*" or nil }) + get_hosts_set(hosts)):sort(_sort_hosts); - for host in get_hosts_set(hosts) do + for _, host in ipairs(hosts) do local http_apps = modulemanager.get_items("http-provider", host); if #http_apps > 0 then local http_host = module:context(host):get_option_string("http_host"); - print("HTTP endpoints on "..host..(http_host and (" (using "..http_host.."):") or ":")); + if host == "*" then + print("Global HTTP endpoints available on all hosts:"); + else + print("HTTP endpoints on "..host..(http_host and (" (using "..http_host.."):") or ":")); + end for _, provider in ipairs(http_apps) do local url = module:context(host):http_url(provider.name, provider.default_path); print("", url); |