Skip to content

Commit

Permalink
feat: print gateway domains when set
Browse files Browse the repository at this point in the history
this ensures configured domains are logged suring startup
  • Loading branch information
lidel committed Feb 14, 2024
1 parent 82eadcb commit eea1209
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,16 @@ share the same seed as long as the indexes are different.
var wg sync.WaitGroup
wg.Add(2)

fmt.Printf("Gateway listening at %s\n", gatewayListen)
fmt.Printf("Legacy RPC at /api/v0 (%s): %s\n", EnvKuboRPC, strings.Join(gnd.kuboRPCs, " "))
fmt.Printf("IPFS Gateway listening at %s\n\n", gatewayListen)

printIfListConfigured(" RAINBOW_GATEWAY_DOMAINS = ", cfg.GatewayDomains)
printIfListConfigured(" RAINBOW_SUBDOMAIN_GATEWAY_DOMAINS = ", cfg.SubdomainGatewayDomains)
printIfListConfigured(" RAINBOW_TRUSTLESS_GATEWAY_DOMAINS = ", cfg.TrustlessGatewayDomains)
printIfListConfigured(" Legacy RPC at /api/v0 will redirect to KUBO_RPC_URL = ", cfg.KuboRPCURLs)

fmt.Printf("\n")

Check warning on line 349 in main.go

View check run for this annotation

Codecov / codecov/patch

main.go#L342-L349

Added lines #L342 - L349 were not covered by tests
fmt.Printf("CTL endpoint listening at http://%s\n", ctlListen)
fmt.Printf("Metrics: http://%s/debug/metrics/prometheus\n\n", ctlListen)
fmt.Printf(" Metrics: http://%s/debug/metrics/prometheus\n\n", ctlListen)

Check warning on line 351 in main.go

View check run for this annotation

Codecov / codecov/patch

main.go#L351

Added line #L351 was not covered by tests

go func() {
defer wg.Done()
Expand Down Expand Up @@ -429,3 +435,9 @@ func getCommaSeparatedList(val string) []string {
}
return items
}

func printIfListConfigured(message string, list []string) {
if len(list) > 0 {
fmt.Printf(message+"%v\n", strings.Join(list, ", "))
}

Check warning on line 442 in main.go

View check run for this annotation

Codecov / codecov/patch

main.go#L439-L442

Added lines #L439 - L442 were not covered by tests
}

0 comments on commit eea1209

Please sign in to comment.