dweb-secret-storage
Store secret keys for dwebfs archives in the user's home directory.
Install
npm install dweb-secret-storage
Usage
Return for the secret_key
storage in dwebfs/ddatabase. To avoid local ownership conflicts, pass the local directory as the first argument. dweb-secret-storage
will check for a non-empty ownership file in the source directory storage.
var secretStore = var storage = { if name === 'secret_key' return path opts return // other storage } { return // other storage } // store secret key in ~/.dweb/secret_keysvar archive =
API
secretStorage([dir])(ownershipFile, opts)
dir
: directory to store keys underdir/.dweb/secret_keys
. Defaults to users home directory.ownershipFile
: non-empty file that denotes ownership. This helps avoid local ownership conflicts of the same dweb.