Skip to content

Commit

Permalink
Merge pull request ElementsProject#190 from nepet/202306-redact-passw…
Browse files Browse the repository at this point in the history
…ords

Remove passwords from logs
  • Loading branch information
nepet committed Jun 9, 2023
2 parents 3b64ef2 + ee92efd commit c03961d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 7 additions & 1 deletion clightning/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ type Config struct {
Liquid *LiquidConf
}

func (c *Config) String() string {
func (c Config) String() string {
bcopy := *c.Bitcoin
lcopy := *c.Liquid
bcopy.RpcPassword = "*****"
lcopy.RpcPassword = "*****"
c.Bitcoin = &bcopy
c.Liquid = &lcopy
b, _ := json.Marshal(c)
return string(b)
}
Expand Down
6 changes: 2 additions & 4 deletions cmd/peerswap-plugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,8 @@ func run(ctx context.Context, lightningPlugin *clightning.ClightningClient) erro

if !config.Liquid.Disabled && liquidWanted(config) {
liquidEnabled = true
log.Infof("Starting elements client with rpcuser: %s, rpcpassword: %s, rpccookie: %s, rpcport: %d, rpchost: %s",
log.Infof("Starting elements client with rpcuser: %s, rpcpassword:******, rpccookie: %s, rpcport: %d, rpchost: %s",
config.Liquid.RpcUser,
config.Liquid.RpcPassword,
config.Liquid.RpcPasswordFile,
config.Liquid.RpcPort,
config.Liquid.RpcHost,
Expand Down Expand Up @@ -208,10 +207,9 @@ func run(ctx context.Context, lightningPlugin *clightning.ClightningClient) erro
return err
}
log.Infof(
"Starting bitcoin client with chain:%s, rpcuser:%s, rpcpassword:%s, rpchost:%s, rpcport:%d",
"Starting bitcoin client with chain:%s, rpcuser:%s, rpcpassword:******,, rpchost:%s, rpcport:%d",
chain.Name,
config.Bitcoin.RpcUser,
config.Bitcoin.RpcPassword,
config.Bitcoin.RpcHost,
config.Bitcoin.RpcPort,
)
Expand Down

0 comments on commit c03961d

Please sign in to comment.