gluon-site: add default domain and check for it
This does not do anything yet, as this_domain() is not implemented yet. Based-on-patch-by: lemoer <git@irrelefant.net>
This commit is contained in:
parent
07dbfea617
commit
24a085a542
@ -1,5 +1,20 @@
|
|||||||
need_string(in_site({'site_code'}))
|
need_string(in_site({'site_code'}))
|
||||||
need_string(in_site({'site_name'}))
|
need_string(in_site({'site_name'}))
|
||||||
|
|
||||||
|
-- this_domain() returns nil when multidomain support is disabled
|
||||||
|
if this_domain() then
|
||||||
|
function need_domain_name(path)
|
||||||
|
need_string(path)
|
||||||
|
need(path, function(default_domain)
|
||||||
|
local f = io.open(os.getenv('IPKG_INSTROOT') .. '/lib/gluon/domains/' .. default_domain .. '.json')
|
||||||
|
if not f then return false end
|
||||||
|
f:close()
|
||||||
|
return true
|
||||||
|
end, nil, 'be a valid domain name')
|
||||||
|
end
|
||||||
|
need_domain_name(in_site({'default_domain'}))
|
||||||
|
end
|
||||||
|
|
||||||
need_string_match(in_domain({'domain_seed'}), '^' .. ('%x'):rep(64) .. '$')
|
need_string_match(in_domain({'domain_seed'}), '^' .. ('%x'):rep(64) .. '$')
|
||||||
|
|
||||||
need_string({'opkg', 'lede'}, false)
|
need_string({'opkg', 'lede'}, false)
|
||||||
|
@ -18,6 +18,10 @@ function in_domain(var)
|
|||||||
return var
|
return var
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function this_domain()
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
local function path_to_string(path)
|
local function path_to_string(path)
|
||||||
return table.concat(path, '/')
|
return table.concat(path, '/')
|
||||||
|
Loading…
Reference in New Issue
Block a user