Commit 254c89b83aef67583e5b1b6f6cd5fdba4fb0b493
add config docs section
Paul Frazee committed on 3/16/2016, 11:11:07 PMParent: 6c0bb65f7ab11d7be0f9946113aa77ca000e6b74
Files changed
tmpl/docs/config/configure-scuttlebot.html.js | ||
---|---|---|
@@ -1,10 +1,9 @@ | ||
1 | +var md = require('../../../markdown') | |
1 | 2 | var page = require('../../page.part') |
2 | 3 | module.exports = () => page({ |
3 | 4 | section: 'docs', |
4 | 5 | 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.js | ||
---|---|---|
@@ -1,10 +1,9 @@ | ||
1 | +var md = require('../../../markdown') | |
1 | 2 | var page = require('../../page.part') |
2 | 3 | module.exports = () => page({ |
3 | 4 | section: 'docs', |
4 | 5 | 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.js | ||
---|---|---|
@@ -1,10 +1,8 @@ | ||
1 | +var md = require('../../../markdown') | |
1 | 2 | var page = require('../../page.part') |
2 | 3 | module.exports = () => page({ |
3 | 4 | section: 'docs', |
4 | 5 | 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.md | ||
---|---|---|
@@ -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.md | ||
---|---|---|
@@ -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.md | ||
---|---|---|
@@ -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.js | ||
---|---|---|
@@ -7,6 +7,6 @@ | ||
7 | 7 | content: md.doc(__dirname+'/view-a-profile.md'), |
8 | 8 | seeAlso: [ |
9 | 9 | ['/docs/message-types/about.html', 'About messages'] |
10 | 10 | ], |
11 | - next: ['/docs/social/join-a-pub.html', 'Join a pub'] | |
11 | + next: ['/docs/social/create-new-users.html', 'Create new users'] | |
12 | 12 | }) |
tmpl/docs/social/create-new-users.html.js | ||
---|---|---|
@@ -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.md | ||
---|---|---|
@@ -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.js | ||
---|---|---|
@@ -19,8 +19,9 @@ | ||
19 | 19 | ${item(c, '/docs/social/follow-users.html', 'Follow users')} |
20 | 20 | ${item(c, '/docs/social/query-the-social-graph.html', 'Query the social graph')} |
21 | 21 | ${item(c, '/docs/social/update-your-profile.html', 'Update your profile')} |
22 | 22 | ${item(c, '/docs/social/view-a-profile.html', 'View a profile')} |
23 | + ${item(c, '/docs/social/create-new-users.html', 'Create new users')} | |
23 | 24 | ${item(c, '/docs/social/join-a-pub.html', 'Join a Pub')} |
24 | 25 | ${item(c, '/docs/social/create-a-pub.html', 'Create a Pub')} |
25 | 26 | </ul>` |
26 | 27 | |
@@ -47,10 +48,10 @@ | ||
47 | 48 | </ul>` |
48 | 49 | |
49 | 50 | module.exports['docs-config'] = (c) => `<ul class="nav"> |
50 | 51 | ${item(c, '/docs/config/configure-scuttlebot.html', 'Configure Scuttlebot')} |
52 | + ${item(c, '/docs/config/creating-test-databases.html', 'Creating test databases')} | |
51 | 53 | ${item(c, '/docs/config/creating-test-users.html', 'Creating test users')} |
52 | - ${item(c, '/docs/config/creating-test-databases.html', 'Creating test databases')} | |
53 | 54 | </ul>` |
54 | 55 | |
55 | 56 | module.exports['apis-scuttlebot'] = (c) => `<ul class="nav"> |
56 | 57 | ${item(c, '/apis/scuttlebot/ssb.html', 'SSB')} |
Built with git-ssb-web