local file, rcode, errmsg
file, errmsg = io.open(fname, 'w')
if not file then
- error(string.format("[prefill] unable to open file %s (%s)",
+ error(string.format("[prefil] unable to open file %s (%s)",
fname, errmsg))
end
log_info(ffi.C.LOG_GRP_PREFILL, "downloading root zone to file %s ...", fname)
rcode, errmsg = kluautil.kr_https_fetch(url, file, rz_ca_file)
if rcode == nil then
- error(string.format("[prefill] fetch of `%s` failed: %s", url, errmsg))
+ error(string.format("[prefil] fetch of `%s` failed: %s", url, errmsg))
end
file:close()
log_info(ffi.C.LOG_GRP_PREFILL, "zone successfully parsed, import started")
else
error(string.format(
- "[prefill] zone import failed: %s", ffi.C.knot_strerror(ret)
+ "[prefil] zone import failed: %s", ffi.C.knot_strerror(ret)
))
end
end
if zone_cfg.interval then
zone_cfg.interval = tonumber(zone_cfg.interval)
if zone_cfg.interval < rz_interval_min then
- error(string.format('[prefill] refresh interval %d s is too short, '
+ error(string.format('[prefil] refresh interval %d s is too short, '
.. 'minimal interval is %d s',
zone_cfg.interval, rz_interval_min))
end
rz_ca_file = zone_cfg.ca_file
if not zone_cfg.url or not string.match(zone_cfg.url, '^https://') then
- error('[prefill] option url must contain a '
+ error('[prefil] option url must contain a '
.. 'https:// URL of a zone file')
else
rz_url = zone_cfg.url
if config == nil then return end -- e.g. just modules = { 'prefill' }
local root_configured = false
if type(config) ~= 'table' then
- error('[prefill] configuration must be in table '
+ error('[prefil] configuration must be in table '
.. '{owner name = {per-zone config}}')
end
for owner, zone_cfg in pairs(config) do
if owner ~= '.' then
- error('[prefill] only root zone can be imported '
+ error('[prefil] only root zone can be imported '
.. 'at the moment')
else
config_zone(zone_cfg)
end
end
if not root_configured then
- error('[prefill] this module version requires configuration '
+ error('[prefil] this module version requires configuration '
.. 'for root zone')
end