Skip to content

Commit

Permalink
Configure basic auth correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
kegsay committed Aug 23, 2023
1 parent 4fd1c3b commit 2730e8f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
28 changes: 15 additions & 13 deletions cmd/syncv3/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,21 @@ func main() {
}

args := map[string]string{
EnvServer: os.Getenv(EnvServer),
EnvDB: os.Getenv(EnvDB),
EnvSecret: os.Getenv(EnvSecret),
EnvBindAddr: defaulting(os.Getenv(EnvBindAddr), "0.0.0.0:8008"),
EnvTLSCert: os.Getenv(EnvTLSCert),
EnvTLSKey: os.Getenv(EnvTLSKey),
EnvPPROF: os.Getenv(EnvPPROF),
EnvPrometheus: os.Getenv(EnvPrometheus),
EnvDebug: os.Getenv(EnvDebug),
EnvOTLP: os.Getenv(EnvOTLP),
EnvSentryDsn: os.Getenv(EnvSentryDsn),
EnvLogLevel: os.Getenv(EnvLogLevel),
EnvMaxConns: defaulting(os.Getenv(EnvMaxConns), "0"),
EnvServer: os.Getenv(EnvServer),
EnvDB: os.Getenv(EnvDB),
EnvSecret: os.Getenv(EnvSecret),
EnvBindAddr: defaulting(os.Getenv(EnvBindAddr), "0.0.0.0:8008"),
EnvTLSCert: os.Getenv(EnvTLSCert),
EnvTLSKey: os.Getenv(EnvTLSKey),
EnvPPROF: os.Getenv(EnvPPROF),
EnvPrometheus: os.Getenv(EnvPrometheus),
EnvDebug: os.Getenv(EnvDebug),
EnvOTLP: os.Getenv(EnvOTLP),
EnvOTLPUsername: os.Getenv(EnvOTLPUsername),
EnvOTLPPassword: os.Getenv(EnvOTLPPassword),
EnvSentryDsn: os.Getenv(EnvSentryDsn),
EnvLogLevel: os.Getenv(EnvLogLevel),
EnvMaxConns: defaulting(os.Getenv(EnvMaxConns), "0"),
}
requiredEnvVars := []string{EnvServer, EnvDB, EnvSecret, EnvBindAddr}
for _, requiredEnvVar := range requiredEnvVars {
Expand Down
2 changes: 1 addition & 1 deletion internal/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func ConfigureOTLP(otlpURL, otlpUser, otlpPass, version string) error {
if isInsecure {
opts = append(opts, otlptracehttp.WithInsecure())
}
fmt.Println("ConfigureOTLP: host=", parsedOTLPURL.Host, "insecure=", isInsecure)
fmt.Println("ConfigureOTLP: host=", parsedOTLPURL.Host, "insecure=", isInsecure, "basic auth=", otlpPass != "" && otlpUser != "")
if otlpPass != "" && otlpUser != "" {
opts = append(opts, otlptracehttp.WithHeaders(
map[string]string{
Expand Down

0 comments on commit 2730e8f

Please sign in to comment.