core/configmanager.lua
changeset 13392 de6c1a170871
parent 12976 ead41e25ebc0
child 13393 47d0d80da208
--- a/core/configmanager.lua	Thu Dec 07 12:08:01 2023 +0000
+++ b/core/configmanager.lua	Fri Dec 08 13:36:51 2023 +0000
@@ -62,6 +62,16 @@
 	return false;
 end
 
+local function rawget_option(config_table, host, key)
+	if host and key then
+		local hostconfig = rawget(config_table, host);
+		if not hostconfig then
+			return nil;
+		end
+		return rawget(hostconfig, key);
+	end
+end
+
 function _M.set(host, key, value)
 	return set(config, host, key, value);
 end
@@ -119,6 +129,10 @@
 					if k:match("^ENV_") then
 						return os.getenv(k:sub(5));
 					end
+					local val = rawget_option(config_table, env.__currenthost or "*", k);
+					if val ~= nil then
+						return val;
+					end
 					return rawget(_G, k);
 				end,
 				__newindex = function (_, k, v)