git ssb

3+

cel / ssb-publishguard



Commit a6ffb4b6caa73da7f7a2df6300a63f7ab02452cf

Document & license

cel committed on 11/30/2018, 1:16:30 AM
Parent: 7a12b04dcc95dffc8ba47862c696d759fea0db9e

Files changed

README.mdchanged
package.jsonchanged
README.mdView
@@ -14,4 +14,52 @@
1414 ln -rs . ~/.ssb/node_modules/ssb-publishguard
1515 sbot plugins.enable ssb-publishguard
1616 # restart sbot server
1717 ```
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.
package.jsonView
@@ -1,2 +1,11 @@
11 {
2 + "name": "ssb-publishguard",
3 + "version": "1.1.0",
4 + "author": "cel",
5 + "license": "FSFAP",
6 + "repository": {
7 + "type": "git",
8 + "url": "ssb://%vsYlrAJt1oBwOpddWIMHC7NPGFbYAiJTqeUxedfSLJY=.sha256"
9 + },
10 + "homepage": "https://git-ssb.celehner.com/%25vsYlrAJt1oBwOpddWIMHC7NPGFbYAiJTqeUxedfSLJY%3D.sha256"
211 }

Built with git-ssb-web