diff --git a/README.md b/README.md index cf14aaa..6745d33 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # XrayR [![](https://img.shields.io/badge/TgChat-@XrayR讨论-blue.svg)](https://t.me/XrayR_project) [![](https://img.shields.io/badge/Channel-@XrayR通知-blue.svg)](https://t.me/XrayR_channel) +![](https://github.com/XrayR-project/XrayR/actions/workflows/release.yml/badge.svg) +![](https://github.com/XrayR-project/XrayR/actions/workflows/docker.yml/badge.svg) +[![Github All Releases](https://img.shields.io/github/downloads/XrayR-project/XrayR/total.svg)]() A Xray backend framework that can easily support many panels. diff --git a/main/main.go b/main/main.go index 4347cc4..a6b3c34 100644 --- a/main/main.go +++ b/main/main.go @@ -56,7 +56,7 @@ func getConfig() *viper.Viper { } if err := config.ReadInConfig(); err != nil { - log.Panicf("Fatal error config file: %s \n", err) + log.Panicf("Config file error: %s \n", err) } config.WatchConfig() // Watch the config @@ -73,7 +73,9 @@ func main() { config := getConfig() panelConfig := &panel.Config{} - config.Unmarshal(panelConfig) + if err := config.Unmarshal(panelConfig); err != nil { + log.Panicf("Parse config file %s failed: %s \n", configFile, err) + } p := panel.New(panelConfig) lastTime := time.Now() config.OnConfigChange(func(e fsnotify.Event) { @@ -84,7 +86,9 @@ func main() { p.Close() // Delete old instance and trigger GC runtime.GC() - config.Unmarshal(panelConfig) + if err := config.Unmarshal(panelConfig); err != nil { + log.Panicf("Parse config file %s failed: %s \n", configFile, err) + } p.Start() lastTime = time.Now() }