git ssb

2+

cel / scuttlebot.io



Commit 45711f7e951055faa40829bc23bb3c396e6067a1

Merge branch 'ssb-server'

cel committed on 4/21/2019, 12:44:05 AM
Parent: 69c5ed428a0c5ac7ea980ad8220130d5ddcd024f
Parent: 804cc11aa68f312b4037911ddbc45a3526fde434

Files changed

tmpl/apis/modules/secret-stack.mdchanged
tmpl/apis/modules/ssb-config.mdchanged
tmpl/apis/modules/ssb-feed.mdchanged
tmpl/apis/modules/ssb-party.mdchanged
tmpl/apis/scuttlebot/invite.mdchanged
tmpl/docs/basics/install-the-database.html.jschanged
tmpl/docs/basics/open-a-client.mdchanged
tmpl/docs/config/configure-scuttlebot.mdchanged
tmpl/docs/config/create-a-pub.html.jschanged
tmpl/docs/config/creating-test-databases.mdchanged
tmpl/footer.part.jschanged
tmpl/apis/modules/secret-stack.mdView
@@ -4,9 +4,9 @@
44
55 SecretStack is built on [secret-handshake](https://github.com/dominictarr/secret-handshake)
66 and [muxrpc](https://github.com/ssbc/muxrpc). This provides a framework
77 to make building secure, decentralized systems easier.
8-(such as [scuttlebot](https://github.com/ssbc/scuttlebot) which this was refactored out of ;)
8 +(such as [scuttlebot](https://github.com/ssbc/ssb-server) which this was refactored out of ;)
99
1010 ## Example
1111
1212 ``` js
tmpl/apis/modules/ssb-config.mdView
@@ -1,7 +1,7 @@
11 # ssb-config
22
3-Configuration module used by [`scuttlebot`](https://github.com/ssbc/scuttlebot).
3 +Configuration module used by [`ssb-server`](https://github.com/ssbc/ssb-server).
44
55 ## example
66
77 ``` js
@@ -24,9 +24,9 @@
2424 * `friends.dunbar` *(number)* [`Dunbar's number`](https://en.wikipedia.org/wiki/Dunbar%27s_number). Number of nodes your instance will replicate. Defaults to `150`.
2525 * `friends.hops` *(number)* How many friend of friend hops to replicate. Defaults to `3`.
2626 * `gossip.connections` *(number)* How many other nodes to connect with at one time. Defaults to `2`.
2727 * `path` *(string)* Path to the application data folder, which contains the private key, message attachment data (blobs) and the leveldb backend. Defaults to `$HOME/.ssb`.
28-* `master` *(array)* Pubkeys of users who, if they connect to the Scuttlebot instance, are allowed to command the primary user with full rights. Useful for remotely operating a pub. Defaults to `[]`.
28 +* `master` *(array)* Pubkeys of users who, if they connect to the server instance, are allowed to command the primary user with full rights. Useful for remotely operating a pub. Defaults to `[]`.
2929 * `logging.level` *(string)* How verbose should the logging be. Possible values are error, warning, notice, and info. Defaults to `notice`.
3030
3131 There are some configuration options for the sysadmins out there. All configuration is loaded via [`rc`](https://github.com/dominictarr/rc). You can pass any configuration value in as cli arg, env var, or in a file.
3232
tmpl/apis/modules/ssb-feed.mdView
@@ -27,8 +27,8 @@
2727 console.log(feed.keys)
2828 })
2929 ```
3030
31-This example uses `ssb-client`, but, if you're embedding `scuttlebot` or the `secure-scuttlebutt` library into your process, you can use them locally.
31 +This example uses `ssb-client`, but, if you're embedding `ssb-server` or the `secure-scuttlebutt` library into your process, you can use them locally.
3232
3333 [View on Github](https://github.com/ssbc/ssb-feed)
3434
tmpl/apis/modules/ssb-party.mdView
@@ -19,9 +19,9 @@
1919 overrides, but if the server is already running, these will not affect the existing server's config.
2020
2121 ### Example
2222
23-simplest case: connect to or start a local sbot:
23 +simplest case: connect to or start a local ssb-server:
2424 ```
2525 var party = require('ssb-party')
2626
2727 party(function (err, sbot) {
@@ -34,9 +34,9 @@
3434 - `config.timers.keepalive`: minimum time (ms) to keep the server online after the last client disconnects. default: 30s
3535 - `config.party.out`: where to put standard output of sbot. may be a path (absolute, or relative to ssb's directory), or `false` to discard, or `true` to pass through to the controlling terminal. default: `"debug.log"`
3636 - `config.party.err`: where to put standard error of sbot. default: same as `config.party.out`
3737
38-[scuttlebot]: https://github.com/ssbc/scuttlebot
38 +[scuttlebot]: https://github.com/ssbc/ssb-server
3939 [ssb-keys]: https://github.com/ssbc/ssb-keys
4040 [ssb-config]: https://github.com/ssbc/ssb-config
4141 [secret-stack]: https://github.com/ssbc/secret-stack
4242
tmpl/apis/scuttlebot/invite.mdView
@@ -7,13 +7,13 @@
77
88 Create a new invite code.
99
1010 ```bash
11-create {n}
11 +sbot create {n}
1212 ```
1313
1414 ```js
15-create(n, cb)
15 +sbot.create(n, cb)
1616 ```
1717
1818 This produces an invite-code which encodes the sbot server's address, and a keypair seed.
1919 The keypair seed is used to generate a keypair, which is then used to authenticate a connection with the sbot server.
@@ -27,13 +27,13 @@
2727
2828 Use an invite code.
2929
3030 ```bash
31-accept {invitecode}
31 +sbot accept {invitecode}
3232 ```
3333
3434 ```js
35-accept(invitecode, cb)
35 +sbot.accept(invitecode, cb)
3636 ```
3737
3838 This connects to the server address encoded in the invite-code, then calls `use()` on the server.
3939 It will cause the server to follow the local user.
@@ -45,13 +45,13 @@
4545
4646 Use an invite code created by this sbot instance (advanced function).
4747
4848 ```bash
49-use --feed {feedid}
49 +sbot use --feed {feedid}
5050 ```
5151
5252 ```js
53-use({ feed: }, cb)
53 +sbot.use({ feed: }, cb)
5454 ```
5555
5656 This commands the receiving server to follow the given feed.
5757
tmpl/docs/basics/install-the-database.html.jsView
@@ -10,15 +10,15 @@
1010
1111 // put content in a separate function so that index.html can reuse it
1212 module.exports.content = () => `
1313 <h2>Install the database</h2>
14- ${ com.code({ bash: `npm install -g scuttlebot` }) }
14 + ${ com.code({ bash: `npm install -g ssb-server` }) }
1515 <p>
1616 Install the database to your device, not to a host.
1717 Each user runs their own Scuttlebot.
1818 </p>
1919 <h2>Start the server</h2>
20- ${ com.code({ bash: `sbot server` }) }
20 + ${ com.code({ bash: `ssb-server start` }) }
2121 <blockquote>
2222 Scuttlebot server must be running for any of its other commands, or apps, to work.
2323 </blockquote>
2424 <h2>Next:</h2>
tmpl/docs/basics/open-a-client.mdView
@@ -1,7 +1,7 @@
11 ## Open an API client
22
3-If youre using Scuttlebot from a JS application, you will need to open a client connection.
3 +If you're using Scuttlebot from a JS application, you will need to open a client connection.
44
55 > If you're using the command-line, you can <a href="./publish-a-message.html">skip this step.</a>
66
77 ```js
tmpl/docs/config/configure-scuttlebot.mdView
@@ -24,13 +24,13 @@
2424 }
2525 }
2626 ```
2727
28-You can also specify config flags in the `sbot server` call.
28 +You can also specify config flags in the `ssb-server start` call.
2929 For example:
3030
3131 ```bash
32-sbot server --port 1234 --timeout 500
32 +ssb-server start --port 1234 --timeout 500
3333 ```
3434
3535 The options:
3636
@@ -42,5 +42,7 @@
4242 - `friends.dunbar` *(number)* [`Dunbar's number`](https://en.wikipedia.org/wiki/Dunbar%27s_number). Number of nodes your instance will replicate. Defaults to `150`.
4343 - `friends.hops` *(number)* How many friend of friend hops to replicate. Defaults to `3`.
4444 - `gossip.connections` *(number)* How many other nodes to connect with at one time. Defaults to `2`.
4545 * `master` *(array)* Pubkeys of users who, if they connect to the Scuttlebot instance, are allowed to command the primary user with full rights. Useful for remotely operating a pub. Defaults to `[]`.
46-* `logging.level` *(string)* How verbose should the logging be. Possible values are error, warning, notice, and info. Defaults to `notice`.
46 +* `logging.level` *(string)* How verbose should the logging be. Possible values are error, warning, notice, and info. Defaults to `notice`.
47 +
48 +See [ssb-config](https://github.com/ssbc/ssb-config) for more info about the config.
tmpl/docs/config/create-a-pub.html.jsView
@@ -20,50 +20,80 @@
2020 <h2>2. Install Scuttlebot</h2>
2121 <p>
2222 Install Scuttlebot using NPM.
2323 </p>
24- ${ com.code({ bash: `npm install -g scuttlebot` }) }
24 + ${ com.code({ bash: `npm install -g ssb-server` }) }
2525 <p>
2626 To update scuttlebot in the future, simply run the global install again.
2727 </p>
2828
29- <h2>3. Create a run-sbot.sh script</h2>
29 + <h2>3. Configure Scuttlebot</h2>
30 + ${ com.code({ bash: `
31 +EXTERNAL=&lt;hostname.yourdomain.tld&gt;
32 +
33 +mkdir -p ~/.ssb
34 +cat &gt; ~/.ssb/config &lt;&lt;EOF
35 +{
36 + "connections": {
37 + "incoming": {
38 + "net": [
39 + {
40 + "scope": "public",
41 + "host": "0.0.0.0",
42 + "external": ["$EXTERNAL"],
43 + "transform": "shs",
44 + "port": 8008
45 + }
46 + ]
47 + },
48 + "outgoing": {
49 + "net": [
50 + {
51 + "transform": "shs"
52 + }
53 + ]
54 + }
55 + }
56 +}
57 + ` }) }
58 +
59 + <h2>4. Create a run-sbotserver.sh script</h2>
3060 <p>
31- Save the following script somewhere easy to find, such as <code>~/run-sbot.sh</code>.
61 + Save the following script somewhere easy to find, such as <code>~/run-sbotserver.sh</code>.
3262 This script will help ensure uptime, even if scuttlebot experiences a crash:
3363 </p>
3464 ${ com.code({ bash: `
3565 #!/bin/bash
3666 while true; do
37- sbot server --host {your-hostname}
67 + ssb-server start --host {your-hostname}
3868 done
3969 ` }) }
4070 <p>
4171 Be sure to replace <code>{your-hostname}</code> with the actual hostname of your server
42- For instance, if your server is <code>foobar.com</code>, then you should enter <code>sbot server --host foobar.com</code>.
72 + For instance, if your server is <code>foobar.com</code>, then you should enter <code>ssb-server start --host foobar.com</code>.
4373 </p>
4474
45- <h2>4. Run the server script</h2>
75 + <h2>5. Run the server script</h2>
4676 <p>
4777 Use a session-manager such as <a href="https://www.rackaid.com/blog/linux-screen-tutorial-and-how-to/">screen</a> or <a href="https://wiki.archlinux.org/index.php/Tmux">tmux</a> to create a detachable session.
4878 Start the session and run the script:
4979 </p>
50- ${ com.code({ bash: `sh ~/run-sbot.sh` }) }
80 + ${ com.code({ bash: `sh ~/run-sbotserver.sh` }) }
5181 <p>
5282 Then, detach the session.
5383 </p>
5484
55- <h2>5. Confirm Scuttlebot server is running</h2>
85 + <h2>6. Confirm Scuttlebot server is running</h2>
5686 <p>
57- To check if sbot is running, use the following command:
87 + To check if the server is running, use the following command:
5888 </p>
5989 ${ com.code({ bash: `sbot whoami` }) }
6090 <p>
6191 If all is well, your Pub&#39;s ID will be logged to the console.
6292 If this fails, check that the server-script is still active, and isn&#39;t failing during startup.
6393 </p>
6494
65- <h2>6. Create the Pub&#39;s profile</h2>
95 + <h2>7. Create the Pub&#39;s profile</h2>
6696 <p>
6797 It&#39;s a good idea to give your Pub a name, by publishing one on its feed.
6898 To do this, first get the Pub&#39;s ID, with <code>sbot whoami</code>.
6999 Then, publish a name with the following command:
@@ -77,9 +107,9 @@
77107 ${ com.code({ bash: `sbot publish --type about \\
78108 --about "@2mIg4e/GO...GEHoQp3U=.ed25519" \\
79109 --name "foobar.com"` }) }
80110
81- <h2>7. Create invites</h2>
111 + <h2>8. Create invites</h2>
82112 <p>
83113 For a last step, you should create invite codes, which you can send to other users to let them join the pub.
84114 The command to create an invite code is:
85115 </p>
@@ -88,9 +118,9 @@
88118 This may now be given out to friends, to command your pub to follow them.
89119 If you want to let a single code be used more than once, you can provide a number larger than 1.
90120 </p>
91121
92- <h2>8. Backup your data directory (optional)</h2>
122 + <h2>9. Backup your data directory (optional)</h2>
93123 <p>
94124 It&#39;s a good idea to regularly backup the Pub&#39;s data directory, in case of failures.
95125 The data-directory will include the Pub&#39;s keypair, messages, and files.
96126 It can be found at <code>~/.ssb</code>, where <code>~</code> points to the home directory of the user running Scuttlebot.
tmpl/docs/config/creating-test-databases.mdView
@@ -5,8 +5,8 @@
55 To create databases for testing, you can specify a different data-directory using the `ssb_appname` environment variable.
66 For instance:
77
88 ```bash
9-ssb_appname=test sbot server
9 +ssb_appname=test ssb-server start
1010 ```
1111
1212 This will spawn the server with the `~/.test` data-directory.
tmpl/footer.part.jsView
@@ -9,7 +9,7 @@
99 <ul class="footer-section">
1010 <li>Community</li>
1111 <li><p>#scuttlebutt on freenode</p></li>
1212 <li><a href="https://github.com/ssbc">GitHub Org</a></li>
13- <li><a href="https://github.com/ssbc/scuttlebot">GitHub Repo</a></li>
13 + <li><a href="https://github.com/ssbc/ssb-server">GitHub Repo</a></li>
1414 </ul>
1515 </div>`

Built with git-ssb-web