aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-02-04 19:03:02 +0100
committerKim Alvefur <zash@zash.se>2022-02-04 19:03:02 +0100
commit3e66b4e0911f227d7ff044b73d32d623b24ec130 (patch)
tree505e551b5c3c41fa2ad876844da67bd6f2522f8a
parentd57bd7a33c2e828b7e8d94923df3f0dcb258e8e7 (diff)
downloadprosody-3e66b4e0911f227d7ff044b73d32d623b24ec130.tar.gz
prosody-3e66b4e0911f227d7ff044b73d32d623b24ec130.zip
prosodyctl: Allow install plugin via explicit path or URL
This way you don't need to set the server URL in the config to use this, you could just ^C^V an install line from a web page that says prosodyctl install https://modules.example.com/mod_example.src.rock Drop the help message in this case since it'll be all messed up by being given an URL or rock filename.
-rwxr-xr-xprosodyctl4
1 files changed, 2 insertions, 2 deletions
diff --git a/prosodyctl b/prosodyctl
index e4a0cc00..c6e31be5 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -84,7 +84,7 @@ function commands.install(arg)
end
-- TODO finalize config option name
local server = configmanager.get("*", "plugin_server");
- if not server then
+ if not (arg[1]:match("^https://") or lfs.attributes(arg[1]) or server) then
show_warning("There is no 'plugin_server' option in the configuration file");
-- see https://prosody.im/doc/TODO documentation
-- #1602
@@ -92,7 +92,7 @@ function commands.install(arg)
end
show_message("Installing %s in %s", arg[1], prosody.paths.installer);
local ret = call_luarocks("install", arg[1], server);
- if ret == 0 then
+ if ret == 0 and arg[1]:match("^mod_") then
prosodyctl.show_module_configuration_help(arg[1]);
end
return ret;