fix fetch http config file not parse env

This commit is contained in:
zu1k
2020-08-21 13:01:00 +08:00
parent e6d0f19c0a
commit 45275bc2d3

View File

@@ -4,6 +4,7 @@ import (
"fmt"
"io/ioutil"
"log"
"os"
"sync"
"github.com/zu1k/proxypool/config"
@@ -70,5 +71,14 @@ func FetchNewConfigFileThenInit() {
if err != nil {
return
}
if domain := os.Getenv("DOMAIN"); domain != "" {
config.SourceConfig.Domain = domain
}
if cfEmail := os.Getenv("CF_API_EMAIL"); cfEmail != "" {
config.SourceConfig.CFEmail = cfEmail
}
if cfKey := os.Getenv("CF_API_KEY"); cfKey != "" {
config.SourceConfig.CFKey = cfKey
}
InitGetters(config.SourceConfig.Sources)
}