Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func printHeap() {

// main.
func main() {
log.Info("Started", "settings", Settings)
log.Info("Started:\n" + Settings.String())
var err error
defer func() {
if err != nil {
Expand Down
18 changes: 18 additions & 0 deletions settings/all.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package settings
import (
"os"
"strconv"

"gopkg.in/yaml.v2"
)

var Settings TackleSettings
Expand Down Expand Up @@ -34,6 +36,22 @@ func (r *TackleSettings) Load() (err error) {
return
}

// String returns a YAML representation.
// Redacted as needed.
func (r TackleSettings) String() (s string) {
redacted := "********"
r.Encryption.Passphrase = redacted
r.Auth.Keycloak.ClientSecret = redacted
r.Auth.Keycloak.Admin.Pass = redacted
r.Auth.Keycloak.Admin.User = redacted
b, err := yaml.Marshal(r)
if err != nil {
panic(err)
}
s = string(b)
return
}

// Get boolean.
func getEnvBool(name string, def bool) bool {
boolean := def
Expand Down
Loading