Store secret keys for ddrive archives in the user's home directory.
npm install dwebx-secret-storage
Return for the secret_key
storage in ddrive/ddatabase.
var secretStore = require('dwebx-secret-storage')
var storage = {
metadata: function (name, opts) {
if (name === 'secret_key') return secretStore()(name, opts)
return // other storage
},
content: function (name, opts) {
return // other storage
}
}
// store secret key in ~/.dwebx/secret_keys
var archive = ddrive(storage)
dir
: directory to store keys underdir/.dwebx/secret_keys
. Defaults to users home directory.