- hosts[host] = {type = "local", connected = true, sessions = {}, host = host, s2sout = {} };
- log("info", "Activated host: %s", host);
+ hosts[host] = {type = "local", connected = true, sessions = {},
+ host = host, s2sout = {}, events = events_new(),
+ disallow_s2s = configmanager.get(host, "core", "disallow_s2s")
+ or (configmanager.get(host, "core", "anonymous_login")
+ and (configmanager.get(host, "core", "disallow_s2s") ~= false));
+ dialback_secret = configmanager.get(host, "core", "dialback_secret") or uuid_gen();
+ };
+ for option_name in pairs(host_config.core) do
+ if option_name:match("_ports$") then
+ log("warn", "%s: Option '%s' has no effect for virtual hosts - put it in global Host \"*\" instead", host, option_name);
+ end
+ end
+
+ if ssl then
+ local ssl_config = host_config.core.ssl or configmanager.get("*", "core", "ssl");
+ if ssl_config then
+ hosts[host].ssl_ctx = ssl.newcontext(setmetatable(ssl_config, { __index = default_ssl_ctx }));
+ hosts[host].ssl_ctx_in = ssl.newcontext(setmetatable(ssl_config, { __index = default_ssl_ctx_in }));
+ end
+ end
+
+ log((hosts_loaded_once and "info") or "debug", "Activated host: %s", host);