diff --git a/.env.example b/.env.example index 110c9da..a7a0de8 100644 --- a/.env.example +++ b/.env.example @@ -5,9 +5,4 @@ LISTEN_ADDR= JWKS_URL=https://auth.leaflow.cn/realms/Ecosystem/protocol/openid-connect/certs DEBUG=false -DATASCOPE_API_KEY= -MEILISEARCH_HOST= -MEILISEARCH_API_KEY= - -ONEAPI_API_BASE= -ONEAPI_API_KEY= \ No newline at end of file +HTTP_LISTEN_ADDR=127.0.0.1:8080 \ No newline at end of file diff --git a/internal/providers/config.go b/internal/providers/config.go index ff33d6b..3ae5daf 100644 --- a/internal/providers/config.go +++ b/internal/providers/config.go @@ -26,6 +26,10 @@ type defaultConfig struct { GrpcListenAddr string } + HTTP struct { + ListenAddr string + } + JWKS struct { Url string } @@ -33,20 +37,6 @@ type defaultConfig struct { DebugMode struct { Enable bool } - - DataScope struct { - ApiKey string - } - - MeiliSearch struct { - Host string - ApiKey string - } - - OneApi struct { - ApiBase string - ApiKey string - } } var Config = defaultConfig{} @@ -60,14 +50,9 @@ func InitConfig() { Config.Redis.Addr = GetEnv("REDIS_ADDR") Config.Redis.Pass = GetEnv("REDIS_PASS") Config.GRPC.GrpcListenAddr = GetEnv("LISTEN_ADDR") + Config.HTTP.ListenAddr = GetEnv("HTTP_LISTEN_ADDR") Config.JWKS.Url = GetEnv("JWKS_URL") Config.DebugMode.Enable = GetEnv("DEBUG", "false") == "true" - Config.DataScope.ApiKey = GetEnv("DATASCOPE_API_KEY") - Config.MeiliSearch.Host = GetEnv("MEILISEARCH_HOST") - Config.MeiliSearch.ApiKey = GetEnv("MEILISEARCH_API_KEY") - - Config.OneApi.ApiBase = GetEnv("OPENAI_API_BASE") - Config.OneApi.ApiKey = GetEnv("OPENAI_API_KEY") dsn := dsnparser.Parse(Config.DB.DSN) var dsn2 = ""