core.*: Complete removal of all traces of the "core" section and section-related code.

This commit is contained in:
Kim Alvefur 2013-03-23 02:33:15 +01:00
parent 974917a5a2
commit 1acfdf5914
7 changed files with 20 additions and 23 deletions

View file

@ -27,7 +27,7 @@ end
module "certmanager"
-- Global SSL options if not overridden per-host
local default_ssl_config = configmanager.get("*", "core", "ssl");
local default_ssl_config = configmanager.get("*", "ssl");
local default_capath = "/etc/ssl/certs";
local default_verify = (ssl and ssl.x509 and { "peer", "client_once", }) or "none";
local default_options = { "no_sslv2", luasec_has_noticket and "no_ticket" or nil };
@ -100,7 +100,7 @@ function create_context(host, mode, user_ssl_config)
end
function reload_ssl_config()
default_ssl_config = configmanager.get("*", "core", "ssl");
default_ssl_config = configmanager.get("*", "ssl");
end
prosody.events.add_handler("config-reloaded", reload_ssl_config);

View file

@ -74,7 +74,7 @@ function activate(host, host_config)
host = host;
s2sout = {};
events = events_new();
dialback_secret = configmanager.get(host, "core", "dialback_secret") or uuid_gen();
dialback_secret = configmanager.get(host, "dialback_secret") or uuid_gen();
send = host_send;
modules = {};
};

View file

@ -146,7 +146,7 @@ function reload_logging()
logger.reset();
local debug_mode = config.get("*", "core", "debug");
local debug_mode = config.get("*", "debug");
default_logging = { { to = "console" , levels = { min = (debug_mode and "debug") or "info" } } };
default_file_logging = {
@ -154,7 +154,7 @@ function reload_logging()
};
default_timestamp = "%b %d %H:%M:%S";
logging_config = config.get("*", "core", "log") or default_logging;
logging_config = config.get("*", "log") or default_logging;
for name, sink_maker in pairs(old_sink_types) do

View file

@ -167,12 +167,9 @@ function api:shared(...)
end
function api:get_option(name, default_value)
local value = config.get(self.host, self.name, name);
local value = config.get(self.host, name);
if value == nil then
value = config.get(self.host, "core", name);
if value == nil then
value = default_value;
end
value = default_value;
end
return value;
end

View file

@ -44,12 +44,12 @@ local modulemap = { ["*"] = {} };
-- Load modules when a host is activated
function load_modules_for_host(host)
local component = config.get(host, "core", "component_module");
local component = config.get(host, "component_module");
local global_modules_enabled = config.get("*", "core", "modules_enabled");
local global_modules_disabled = config.get("*", "core", "modules_disabled");
local host_modules_enabled = config.get(host, "core", "modules_enabled");
local host_modules_disabled = config.get(host, "core", "modules_disabled");
local global_modules_enabled = config.get("*", "modules_enabled");
local global_modules_disabled = config.get("*", "modules_disabled");
local host_modules_enabled = config.get(host, "modules_enabled");
local host_modules_disabled = config.get(host, "modules_disabled");
if host_modules_enabled == global_modules_enabled then host_modules_enabled = nil; end
if host_modules_disabled == global_modules_disabled then host_modules_disabled = nil; end
@ -218,7 +218,7 @@ local function do_reload_module(host, name)
saved = ret;
else
log("warn", "Error saving module '%s:%s' state: %s", host, name, ret);
if not config.get(host, "core", "force_module_reload") then
if not config.get(host, "force_module_reload") then
log("warn", "Aborting reload due to error, set force_module_reload to ignore this");
return nil, "save-state-failed";
else

View file

@ -140,7 +140,7 @@ function bind_resource(session, resource)
local sessions = hosts[session.host].sessions[session.username].sessions;
if sessions[resource] then
-- Resource conflict
local policy = config_get(session.host, "core", "conflict_resolve");
local policy = config_get(session.host, "conflict_resolve");
local increment;
if policy == "random" then
resource = uuid_generate();

View file

@ -42,8 +42,8 @@ function initialize_host(host)
host_session.events.add_handler("item-added/auth-provider", function (event)
local provider = event.item;
local auth_provider = config.get(host, "core", "authentication") or default_provider;
if config.get(host, "core", "anonymous_login") then
local auth_provider = config.get(host, "authentication") or default_provider;
if config.get(host, "anonymous_login") then
log("error", "Deprecated config option 'anonymous_login'. Use authentication = 'anonymous' instead.");
auth_provider = "anonymous";
end -- COMPAT 0.7
@ -61,8 +61,8 @@ function initialize_host(host)
end
end);
host_session.users = new_null_provider(); -- Start with the default usermanager provider
local auth_provider = config.get(host, "core", "authentication") or default_provider;
if config.get(host, "core", "anonymous_login") then auth_provider = "anonymous"; end -- COMPAT 0.7
local auth_provider = config.get(host, "authentication") or default_provider;
if config.get(host, "anonymous_login") then auth_provider = "anonymous"; end -- COMPAT 0.7
if auth_provider ~= "null" then
modulemanager.load(host, "auth_"..auth_provider);
end
@ -116,8 +116,8 @@ function is_admin(jid, host)
jid = jid_bare(jid);
host = host or "*";
local host_admins = config.get(host, "core", "admins");
local global_admins = config.get("*", "core", "admins");
local host_admins = config.get(host, "admins");
local global_admins = config.get("*", "admins");
if host_admins and host_admins ~= global_admins then
if type(host_admins) == "table" then