Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit 28ce126

Browse files
Redact private key from startup output
Previously we did this output *before* adding the keys to the config, but recently there were changes made that required the keys to be added to the config before the config was finished. This meant that the config being output contained private keys, which seems like a major security hazard for debugging. This commit changes the code so that we make a copy of the full config, set `redactedConfig.keys.private = null`, and then output the redacted configuration safely without any secrets exposed.
1 parent c88fd1b commit 28ce126

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@ function setupContext (appName, opts, cb) {
196196
ssbConfig.remote = `unix:${socketPath}:~noauth:${pubkey}`
197197
}
198198

199-
console.log(ssbConfig)
199+
const redactedConfig = Object.assign({}, ssbConfig);
200+
redactedConfig.keys.private = null
201+
console.log(redactedConfig)
200202

201203
if (opts.server === false) {
202204
cb && cb()

0 commit comments

Comments
 (0)