ssbc / ssb-config

standard configuration for ssb
MIT License
23 stars 18 forks source link

{ keys } being ignored #44

Closed christianbundy closed 5 years ago

christianbundy commented 5 years ago

I'm thinking that this change may have been introduced here?

const ssbConfig = require('ssb-config/inject')
const ssbKeys = require('ssb-keys')

const keys = ssbKeys.generate()
const config = ssbConfig(Math.random().toString(16), { keys })

console.log(keys.public)
console.log('vs')
console.log(config.keys.public)
$ node example.js
cjso793P3FmXfHFE6h+Ji4qRWEhLUFoQrrcodLWLJow=.ed25519
vs
aZmUau7MXDQJFKRUswLvVZ/I0C5t0NdL9nLADQkakC4=.ed25519

cc: @mixmix

dominictarr commented 5 years ago

ssb-config never used to do that, but @mixmix moved it in because you'd always load keys anyway. I guess it should just check wether keys is already set.

christianbundy commented 5 years ago

Never used to do what?

I've pushed a PR to resolves this and add a test as well, see: #45.

dominictarr commented 5 years ago

I mean, before that change, ssb-config never used to touch the keys at all, the keys were loaded separately

https://github.com/ssbc/ssb-server/commit/da3d0b31e2c44ceb92a6292f1653605ee64215be