From a5e7f1686652334f4149132fa449f23132bb99e1 Mon Sep 17 00:00:00 2001 From: toxuin Date: Fri, 20 May 2022 19:39:18 -0600 Subject: [PATCH] Added extra config location - /config/ --- Readme.md | 2 ++ config/config.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Readme.md b/Readme.md index 8396cae..a30aa4a 100644 --- a/Readme.md +++ b/Readme.md @@ -86,6 +86,8 @@ _A_: Some IP cameras have ONVIF, and sometimes that even includes motion alarms, - Misecu 5MP Wifi AI Cam (Hisilicon server) +- HomeViz OB10, K4W10, OW10 (Hisilicon server, tested by [acburnett](https://github.com/acburnett)) + If your camera works with Alarm Server - create an issue with some details about it and a picture, and we'll post it here. ## Docker diff --git a/config/config.go b/config/config.go index 43de162..cb4e086 100644 --- a/config/config.go +++ b/config/config.go @@ -51,6 +51,7 @@ func (c *Config) SetDefaults() { viper.SetConfigName("config") viper.SetConfigType("yaml") viper.AddConfigPath(".") + viper.AddConfigPath("./config/") viper.SetDefault("debug", false) viper.SetDefault("mqtt.port", 1883) @@ -86,6 +87,7 @@ func (c *Config) SetDefaults() { err := viper.ReadInConfig() if err != nil { if _, ok := err.(viper.ConfigFileNotFoundError); ok { + fmt.Println("Config file not found, writing default config...") err := viper.SafeWriteConfig() if err != nil { panic(fmt.Errorf("error saving default config file: %s \n", err))