diff mod_firewall/mod_firewall.lua @ 5834:866a49f5aa61

mod_firewall: Fix to find scripts when installed with plugin installer Extra resources are stored in a different path by luarocks, not alongside the code as this code assumed. Thanks eTaurus
author Kim Alvefur <zash@zash.se>
date Sun, 11 Feb 2024 12:50:53 +0100
parents e304e19536f2
children 1d1eadff331d
line wrap: on
line diff
--- a/mod_firewall/mod_firewall.lua	Wed Feb 07 11:57:30 2024 +0000
+++ b/mod_firewall/mod_firewall.lua	Sun Feb 11 12:50:53 2024 +0100
@@ -612,7 +612,7 @@
 local function resolve_script_path(script_path)
 	local relative_to = prosody.paths.config;
 	if script_path:match("^module:") then
-		relative_to = module.path:sub(1, -#("/mod_"..module.name..".lua"));
+		relative_to = module:get_directory();
 		script_path = script_path:match("^module:(.+)$");
 	end
 	return resolve_relative_path(relative_to, script_path);