Skip to content

Commit

Permalink
(NOBIDS) make github api host configurable (#2898)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbitfly authored Jun 20, 2024
1 parent 93a7930 commit d6a1bd0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ethClients/ethClients.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,12 @@ func Init() {

func fetchClientData(repo string) *gitAPIResponse {
var gitAPI = new(gitAPIResponse)
resp, err := httpClient.Get("https://api.github.com/repos" + repo + "/releases/latest")
// resp, err := http.Get("http://localhost:5000/repos" + repo)

githubAPIHost := utils.Config.GithubApiHost
if githubAPIHost == "" {
githubAPIHost = "api.github.com"
}
resp, err := httpClient.Get(fmt.Sprintf("https://%s/repos%s/releases/latest", githubAPIHost, repo))

if err != nil {
logger.Errorf("error retrieving ETH Client Data: %v", err)
Expand Down
1 change: 1 addition & 0 deletions types/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ type Config struct {
ApiKey string `yaml:"apiKey" envconfig:"MONITORING_API_KEY"`
ServiceMonitoringConfigurations []ServiceMonitoringConfiguration `yaml:"serviceMonitoringConfigurations" envconfig:"SERVICE_MONITORING_CONFIGURATIONS"`
} `yaml:"monitoring"`
GithubApiHost string `yaml:"githubApiHost" envconfig:"GITHUB_API_HOST"`
}

type DatabaseConfig struct {
Expand Down

0 comments on commit d6a1bd0

Please sign in to comment.