git ssb

3+

cel / ssb-publishguard



Tree: a6ffb4b6caa73da7f7a2df6300a63f7ab02452cf

Files: a6ffb4b6caa73da7f7a2df6300a63f7ab02452cf / README.md

2335 bytesRaw

ssb-publishguard

Intercept publishing messages with a prompt in a local web browser.

With this scuttlebot plugin installed, any call to sbot.publish or sbot.private.publish will trigger opening a web browser with a form to confirm or cancel publishing the proposed message.

The purpose of this to give the user a final review of any message that their scuttlebot client is going to publish. This may help reduce the likelihood of publishing accidental, malformed, duplicate, or poorly-thought-out messages.

Install

ln -rs . ~/.ssb/node_modules/ssb-publishguard
sbot plugins.enable ssb-publishguard
# restart sbot server

Config

{
  "publishguard": {
    "browser": "dillo", // command to spawn confirm page
  }
}

Usage

It wraps the publish and private.publish sbot calls, so you can continue using those.

Additional methods allow integration via HTTP redirects instead of spawning a browser:

publishguard.publishGetUrl(opts, cb(err, url)) : async

publishguard.privatePublishGetUrl(opts, cb(err, url)) : async

If redirectBase is specified, if the user allows a message to be publish through publishguard, their browser will redirect to the redirectBase
concatenated with the URL-encoded message id. This is so if you are building an SSB web app, you can seamlessly integrate with publishguard by redirecting to it and then getting a redirect back.

If redirectBase is not specified, after approving publish, the user will receive a simple page showing the resulting message JSON.

License

© 2018 cel @f/6sQ6d...

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.

Built with git-ssb-web