main: allow loading arbitrary config

master
q3k 2022-07-05 19:41:37 +02:00
parent 8bc76da4b8
commit 6c14716222
1 changed files with 11 additions and 1 deletions

View File

@ -6,7 +6,17 @@ Node = require('core.node')
ThreadNode = require('core.thread-node')
NodeManager = require('core.node-manager')
local config = require('config')
local config = nil
if os.getenv("SIGNAGE_CONFIG") ~= nil then
local f = loadfile(os.getenv("SIGNAGE_CONFIG"))
if f ~= nil then
config = f()
else
error("SIGNAGE_CONFIG given but could not be loaded")
end
else
config = require('config')
end
local push = require('vendor.push')