git ssb

2+

cel / scuttlebot.io



Commit 254c89b83aef67583e5b1b6f6cd5fdba4fb0b493

add config docs section

Paul Frazee committed on 3/16/2016, 11:11:07 PM
Parent: 6c0bb65f7ab11d7be0f9946113aa77ca000e6b74

Files changed

tmpl/docs/config/configure-scuttlebot.html.jschanged
tmpl/docs/config/creating-test-databases.html.jschanged
tmpl/docs/config/creating-test-users.html.jschanged
tmpl/docs/config/configure-scuttlebot.mdadded
tmpl/docs/config/creating-test-databases.mdadded
tmpl/docs/config/creating-test-users.mdadded
tmpl/docs/social/view-a-profile.html.jschanged
tmpl/docs/social/create-new-users.html.jsadded
tmpl/docs/social/create-new-users.mdadded
tmpl/leftnav.part.jschanged
tmpl/docs/config/configure-scuttlebot.html.jsView
@@ -1,10 +1,9 @@
1+var md = require('../../../markdown')
12 var page = require('../../page.part')
23 module.exports = () => page({
34 section: 'docs',
45 tab: 'docs-config',
5- path :'/docs/config/configure-scuttlebot.html',
6- content: `
7- <h2>Configure Scuttlebot</h2>
8- <p>todo</p>
9- `
10-})
6+ path: '/docs/config/configure-scuttlebot.html',
7+ content: md.doc(__dirname+'/configure-scuttlebot.md'),
8+ next: ['/docs/config/creating-test-databases.html', 'Creating test databases']
9+})
tmpl/docs/config/creating-test-databases.html.jsView
@@ -1,10 +1,9 @@
1+var md = require('../../../markdown')
12 var page = require('../../page.part')
23 module.exports = () => page({
34 section: 'docs',
45 tab: 'docs-config',
5- path :'/docs/config/creating-test-databases.html',
6- content: `
7- <h2>Creating test databases</h2>
8- <p>todo</p>
9- `
10-})
6+ path: '/docs/config/creating-test-databases.html',
7+ content: md.doc(__dirname+'/creating-test-databases.md'),
8+ next: ['/docs/config/creating-test-users.html', 'Creating test users']
9+})
tmpl/docs/config/creating-test-users.html.jsView
@@ -1,10 +1,8 @@
1+var md = require('../../../markdown')
12 var page = require('../../page.part')
23 module.exports = () => page({
34 section: 'docs',
45 tab: 'docs-config',
5- path :'/docs/config/creating-test-users.html',
6- content: `
7- <h2>Creating test users</h2>
8- <p>todo</p>
9- `
10-})
6+ path: '/docs/config/creating-test-users.html',
7+ content: md.doc(__dirname+'/creating-test-users.md')
8+})
tmpl/docs/config/configure-scuttlebot.mdView
@@ -1,0 +1,40 @@
1+## Configure Scuttlebot
2+
3+Scuttlebot keeps all data and configuration in the `~/.ssb` directory.
4+
5+Configuration is stored in `~/.ssb/config`, which is a JSON file:
6+
7+```
8+{
9+ "host": "",
10+ "port": 8008,
11+ "timeout": 30000,
12+ "pub": true,
13+ "local": true,
14+ friends: {
15+ "dunbar": 150,
16+ "hops": 3
17+ },
18+ "gossip": {
19+ "connections": 2
20+ }
21+}
22+```
23+
24+You can also specify config flags in the `sbot server` call.
25+For example:
26+
27+```bash
28+sbot server --port 1234 --timeout 500
29+```
30+
31+The options:
32+
33+- `host` *(string)* The domain or ip address for `sbot`. Defaults to your public ip address.
34+- `port` *(string|number)* The port for `sbot`. Defaults to `8008`.
35+- `timeout`: *(number)* Number of milliseconds a replication stream can idle before it's automatically disconnected. Defaults to `30000`.
36+- `pub` *(boolean)* Replicate with pub servers. Defaults to `true`.
37+- `local` *(boolean)* Replicate with local servers found on the same network via `udp`. Defaults to `true`.
38+- `friends.dunbar` *(number)* [`Dunbar's number`](https://en.wikipedia.org/wiki/Dunbar%27s_number). Number of nodes your instance will replicate. Defaults to `150`.
39+- `friends.hops` *(number)* How many friend of friend hops to replicate. Defaults to `3`.
40+- `gossip.connections` *(number)* How many other nodes to connect with at one time. Defaults to `2`.
tmpl/docs/config/creating-test-databases.mdView
@@ -1,0 +1,12 @@
1+## Creating test databases
2+
3+Scuttlebot keeps all data and configuration in the `~/.ssb` directory.
4+
5+To create databases for testing, you can specify a different data-directory using the `ssb_appname` environment variable.
6+For instance:
7+
8+```bash
9+ssb_appname=test sbot server
10+```
11+
12+This will spawn the server with the `~/.test` data-directory.
tmpl/docs/config/creating-test-users.mdView
@@ -1,0 +1,10 @@
1+## Creating test users
2+
3+Scuttlebot keeps all data and configuration in the `~/.ssb` directory.
4+
5+The primary user's private key is kept in the `~/.ssb/secret` file.
6+
7+If you want to set a new primary user, while still using the same database, you can move `private` to some other location (eg `~/ssb/secret.backup`).
8+Scuttlebot will automatically create a new user and secret, when started next.
9+
10+Alternatively, you can [create secondary users](/docs/social/create-new-users.html).
tmpl/docs/social/view-a-profile.html.jsView
@@ -7,6 +7,6 @@
77 content: md.doc(__dirname+'/view-a-profile.md'),
88 seeAlso: [
99 ['/docs/message-types/about.html', 'About messages']
1010 ],
11- next: ['/docs/social/join-a-pub.html', 'Join a pub']
11+ next: ['/docs/social/create-new-users.html', 'Create new users']
1212 })
tmpl/docs/social/create-new-users.html.jsView
@@ -1,0 +1,13 @@
1+var md = require('../../../markdown')
2+var page = require('../../page.part')
3+module.exports = () => page({
4+ section: 'docs',
5+ tab: 'docs-social',
6+ path :'/docs/social/create-new-users.html',
7+ content: md.doc(__dirname+'/create-new-users.md'),
8+ seeAlso: [
9+ ['/apis/modules/ssb-feed.html', 'SSB-Feed API'],
10+ ['/apis/modules/ssb-keys.html', 'SSB-Keys API']
11+ ],
12+ next: ['/docs/social/join-a-pub.html', 'Join a pub']
13+})
tmpl/docs/social/create-new-users.mdView
@@ -1,0 +1,18 @@
1+## Create new users
2+
3+By default, Scuttlebot uses a "master" identity/feed, which `sbot.publish()` will append new messages to.
4+If you want to manipulate additional feeds, you can load the keypair and then use this library to do so.
5+
6+``` js
7+var ssbFeed = require('ssb-feed')
8+var ssbKeys = require('ssb-keys')
9+
10+// create the new feed
11+var alice = ssbFeed(sbot, ssbKeys.generate())
12+
13+// Post to alice's feed
14+alice.publish({
15+ type: 'post',
16+ text: 'hello world, I am alice.'
17+}, function (err) { ... })
18+```
tmpl/leftnav.part.jsView
@@ -19,8 +19,9 @@
1919 ${item(c, '/docs/social/follow-users.html', 'Follow users')}
2020 ${item(c, '/docs/social/query-the-social-graph.html', 'Query the social graph')}
2121 ${item(c, '/docs/social/update-your-profile.html', 'Update your profile')}
2222 ${item(c, '/docs/social/view-a-profile.html', 'View a profile')}
23+ ${item(c, '/docs/social/create-new-users.html', 'Create new users')}
2324 ${item(c, '/docs/social/join-a-pub.html', 'Join a Pub')}
2425 ${item(c, '/docs/social/create-a-pub.html', 'Create a Pub')}
2526 </ul>`
2627
@@ -47,10 +48,10 @@
4748 </ul>`
4849
4950 module.exports['docs-config'] = (c) => `<ul class="nav">
5051 ${item(c, '/docs/config/configure-scuttlebot.html', 'Configure Scuttlebot')}
52+ ${item(c, '/docs/config/creating-test-databases.html', 'Creating test databases')}
5153 ${item(c, '/docs/config/creating-test-users.html', 'Creating test users')}
52- ${item(c, '/docs/config/creating-test-databases.html', 'Creating test databases')}
5354 </ul>`
5455
5556 module.exports['apis-scuttlebot'] = (c) => `<ul class="nav">
5657 ${item(c, '/apis/scuttlebot/ssb.html', 'SSB')}

Built with git-ssb-web