1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-19 05:09:42 +02:00

Look for implicit documize.conf

@harveykandola

Now looks for implicit documize.conf, then specified .conf, then fallback to flags and envars.
This commit is contained in:
sauls8t 2019-04-28 14:54:48 +01:00
parent 1fefdaec9f
commit 34d1639899
5 changed files with 1173 additions and 1153 deletions

View file

@ -28,16 +28,16 @@ import (
)
func main() {
// runtime stores server/application level information
// Runtime stores server/application information.
rt := env.Runtime{}
// wire up logging implementation
// Wire up logging implementation.
rt.Log = logging.NewLogger(false)
// wire up embedded web assets handler
// Wire up embedded web assets handler.
web.Embed = embed.NewEmbedder()
// product details
// Specify the product edition.
rt.Product = domain.Product{}
rt.Product.Major = "2"
rt.Product.Minor = "4"
@ -50,21 +50,24 @@ func main() {
// Setup data store.
s := store.Store{}
// Parse flags/envars.
// Parse configuration information.
flagsOK := false
rt.Flags, flagsOK = env.ParseFlags()
rt.Flags, flagsOK = env.LoadConfig()
if !flagsOK {
os.Exit(0)
}
rt.Log.Info("Configuration source: " + rt.Flags.ConfigSource)
// Start database init.
bootOK := boot.InitRuntime(&rt, &s)
if bootOK {
// runtime.Log = runtime.Log.SetDB(runtime.Db)
}
// Register smart sections
// Register document sections.
section.Register(&rt, &s)
// Start web server.
ready := make(chan struct{}, 1) // channel signals router ready
server.Start(&rt, &s, ready)
}