diff options
author | Kim Alvefur <zash@zash.se> | 2023-05-24 14:49:29 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2023-05-24 14:49:29 +0200 |
commit | ba878e723028af75e0f93c611f6f4cd9d2d17bf9 (patch) | |
tree | 36986f5935afe4b61d1bd7291acd9fbca42e0f9d /plugins | |
parent | 0b87371f786155ba7efd66489dc0aea0ae556e27 (diff) | |
download | prosody-ba878e723028af75e0f93c611f6f4cd9d2d17bf9.tar.gz prosody-ba878e723028af75e0f93c611f6f4cd9d2d17bf9.zip |
mod_admin_shell: Show internal URL in addition to external in http:list
To help with configuring reverse proxies.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_admin_shell.lua | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/plugins/mod_admin_shell.lua b/plugins/mod_admin_shell.lua index 199bdef0..aa50b882 100644 --- a/plugins/mod_admin_shell.lua +++ b/plugins/mod_admin_shell.lua @@ -1837,9 +1837,10 @@ 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); local output = format_table({ - { title = "Module", width = "20%" }, - { title = "URL", width = "80%" }, - }, self.session.width); + { title = "Module"; width = "1p" }; + { title = "URL"; width = "3p" }; + { title = "Internal URL"; width = "3p" }; + }, self.session.width); for _, host in ipairs(hosts) do local http_apps = modulemanager.get_items("http-provider", host); @@ -1853,9 +1854,11 @@ function def_env.http:list(hosts) print(output()); for _, provider in ipairs(http_apps) do local mod = provider._provided_by; - local url = module:context(host):http_url(provider.name, provider.default_path); + local external = module:context(host):http_url(provider.name, provider.default_path); + local internal = module:context(host):http_url(provider.name, provider.default_path, "internal"); + if external==internal then internal="" end mod = mod and "mod_"..mod or "" - print(output{mod, url}); + print(output{mod, external, internal}); end print(""); end |