README.mdView |
---|
14 | 14 … | ln -rs . ~/.ssb/node_modules/ssb-publishguard |
15 | 15 … | sbot plugins.enable ssb-publishguard |
16 | 16 … | # restart sbot server |
17 | 17 … | ``` |
| 18 … | + |
| 19 … | +## Config |
| 20 … | + |
| 21 … | +``` |
| 22 … | +{ |
| 23 … | + "publishguard": { |
| 24 … | + "browser": "dillo", // command to spawn confirm page |
| 25 … | + } |
| 26 … | +} |
| 27 … | +``` |
| 28 … | + |
| 29 … | +## Usage |
| 30 … | + |
| 31 … | +It wraps the `publish` and `private.publish` sbot calls, so you can continue |
| 32 … | +using those. |
| 33 … | + |
| 34 … | +Additional methods allow integration via HTTP redirects instead of spawning a |
| 35 … | +browser: |
| 36 … | + |
| 37 … | +### `publishguard.publishGetUrl(opts, cb(err, url))` : async |
| 38 … | + |
| 39 … | +- `opts.content`: content value to publish |
| 40 … | +- `redirectBase`: base url for redirect on message publish success |
| 41 … | +- `url`: url for a web page for the user to confirm publishing the message |
| 42 … | + |
| 43 … | +### `publishguard.privatePublishGetUrl(opts, cb(err, url))` : async |
| 44 … | + |
| 45 … | +- `opts.content`: content value to publish, encrypted to recipient keys |
| 46 … | +- `opts.recps`: recipient keys to encrypt the content value to with `private-box` |
| 47 … | +- `redirectBase`: base url for redirect on message publish success |
| 48 … | +- `url`: url for a web page for the user to confirm publishing the message |
| 49 … | + |
| 50 … | +If `redirectBase` is specified, if the user allows a message to be publish |
| 51 … | +through `publishguard`, their browser will redirect to the `redirectBase` |
| 52 … | +concatenated with the URL-encoded message id. This is so if you are building an |
| 53 … | +SSB web app, you can seamlessly integrate with `publishguard` by redirecting to |
| 54 … | +it and then getting a redirect back. |
| 55 … | + |
| 56 … | +If `redirectBase` is not specified, after approving publish, the user will |
| 57 … | +receive a simple page showing the resulting message JSON. |
| 58 … | + |
| 59 … | +## License |
| 60 … | + |
| 61 … | +© 2018 cel @f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519 |
| 62 … | + |
| 63 … | +Copying and distribution of this file, with or without modification, are |
| 64 … | +permitted in any medium without royalty provided the copyright notice and this |
| 65 … | +notice are preserved. This file is offered as-is, without any warranty. |