Mercurial > prosody-hg
changeset 14097:70b08435e47b
Merge 13.0->trunk
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Sun, 01 Mar 2026 22:51:12 +0000 |
| parents | 89743a9dc3a7 (current diff) 48ea7a15957e (diff) |
| children | 151babd0853b |
| files | util/prosodyctl/check.lua |
| diffstat | 1 files changed, 27 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/util/prosodyctl/check.lua Thu Feb 26 15:10:15 2026 +0000 +++ b/util/prosodyctl/check.lua Sun Mar 01 22:51:12 2026 +0000 @@ -1569,6 +1569,14 @@ print(""); end if not feature.ok then + if feature.problems then + table.sort(feature.problems); + print("", "", "Problems found:"); + for _, problem in ipairs(feature.problems) do + print("", "", (" - %s"):format(problem)); + end + print(""); + end if feature.lacking_modules then table.sort(feature.lacking_modules); print("", "", "Suggested modules: "); @@ -1681,6 +1689,11 @@ local current_feature; + local function problem(message) + current_feature.problems = current_feature.problems or {}; + table.insert(current_feature.problems, message); + end + local function check_module(suggested, alternate, ...) if set.intersection(modules_enabled, set.new({suggested, alternate, ...})):empty() then current_feature.lacking_modules = current_feature.lacking_modules or {}; @@ -1688,6 +1701,14 @@ end end + local function soft_check_for_modules(...) + for _, mod in ipairs({...}) do + if modules_enabled:contains(mod) then + return mod; + end + end + end + local function check_component(suggested, alternate, ...) local found; for _, component_module in ipairs({ suggested, alternate, ... }) do @@ -1797,6 +1818,8 @@ name = "File sharing"; desc = "Sharing of files to groups and offline users"; check = function (self) + local host_has_it = soft_check_for_modules("http_file_share", "http_upload", "http_upload_external"); + local service = check_component("http_file_share", "http_upload", "http_upload_external"); if service then local size_limit; @@ -1808,6 +1831,9 @@ ["Size limit"] = human_units.format(size_limit, "b", "b"); }; end + if host_has_it then + problem(("%s is present in modules_enabled, but you already have a component. Remove it from modules_enabled."):format(host_has_it)); + end end end; }; @@ -1828,6 +1854,7 @@ current_feature = feature; feature:check(); feature.ok = ( + not feature.problems and not feature.lacking_modules and not feature.lacking_components and not feature.lacking_component_modules
