mirror of
https://github.com/h44z/wg-portal.git
synced 2025-09-15 07:11:15 +00:00
docs: add reverse-proxy example, improve docker examples, fix slow_query_threshold documentation; feat: allow config.yml and config.yaml as configuration files
This commit is contained in:
@@ -174,9 +174,16 @@ func GetConfig() (*Config, error) {
|
||||
|
||||
// override config values from YAML file
|
||||
|
||||
cfgFileName := "config/config.yml"
|
||||
cfgFileName := "config/config.yaml"
|
||||
cfgFileNameFallback := "config/config.yml"
|
||||
if envCfgFileName := os.Getenv("WG_PORTAL_CONFIG"); envCfgFileName != "" {
|
||||
cfgFileName = envCfgFileName
|
||||
cfgFileNameFallback = envCfgFileName
|
||||
}
|
||||
|
||||
// check if the config file exists, otherwise use the fallback file name
|
||||
if _, err := os.Stat(cfgFileName); os.IsNotExist(err) {
|
||||
cfgFileName = cfgFileNameFallback
|
||||
}
|
||||
|
||||
if err := loadConfigFile(cfg, cfgFileName); err != nil {
|
||||
|
Reference in New Issue
Block a user