git ssb

2+

cel / scuttlebot.io



Tree: 45711f7e951055faa40829bc23bb3c396e6067a1

Files: 45711f7e951055faa40829bc23bb3c396e6067a1 / tmpl / docs / config / create-a-pub.html.js

4795 bytesRaw
1var page = require('../../page.part')
2var com = require('../../com.part')
3
4module.exports = () => page({
5 title: 'Create a Pub',
6 section: 'docs',
7 tab: 'docs-config',
8 path :'/docs/config/create-a-pub.html',
9 content: `
10 <h2>1. Get a public server</h2>
11 <p>
12 Pub servers need a static, publicly-reachable IP address.
13 The easiest way to get a public server is by renting a virtual server from businesses such as <a href="https://aws.amazon.com/">Amazon</a>, <a href="https://www.linode.com/">Linode</a>, or <a href="https://www.digitalocean.com/">Digital Ocean</a>.
14 </p>
15 <p>
16 After renting the server, follow the guides provided by your host to configure the software and install nodejs.
17 We recommend using a common Linux distribution, such as Ubuntu.
18 </p>
19
20 <h2>2. Install Scuttlebot</h2>
21 <p>
22 Install Scuttlebot using NPM.
23 </p>
24 ${ com.code({ bash: `npm install -g ssb-server` }) }
25 <p>
26 To update scuttlebot in the future, simply run the global install again.
27 </p>
28
29 <h2>3. Configure Scuttlebot</h2>
30 ${ com.code({ bash: `
31EXTERNAL=&lt;hostname.yourdomain.tld&gt;
32
33mkdir -p ~/.ssb
34cat &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>
60 <p>
61 Save the following script somewhere easy to find, such as <code>~/run-sbotserver.sh</code>.
62 This script will help ensure uptime, even if scuttlebot experiences a crash:
63 </p>
64 ${ com.code({ bash: `
65#!/bin/bash
66while true; do
67 ssb-server start --host {your-hostname}
68done
69 ` }) }
70 <p>
71 Be sure to replace <code>{your-hostname}</code> with the actual hostname of your server
72 For instance, if your server is <code>foobar.com</code>, then you should enter <code>ssb-server start --host foobar.com</code>.
73 </p>
74
75 <h2>5. Run the server script</h2>
76 <p>
77 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.
78 Start the session and run the script:
79 </p>
80 ${ com.code({ bash: `sh ~/run-sbotserver.sh` }) }
81 <p>
82 Then, detach the session.
83 </p>
84
85 <h2>6. Confirm Scuttlebot server is running</h2>
86 <p>
87 To check if the server is running, use the following command:
88 </p>
89 ${ com.code({ bash: `sbot whoami` }) }
90 <p>
91 If all is well, your Pub&#39;s ID will be logged to the console.
92 If this fails, check that the server-script is still active, and isn&#39;t failing during startup.
93 </p>
94
95 <h2>7. Create the Pub&#39;s profile</h2>
96 <p>
97 It&#39;s a good idea to give your Pub a name, by publishing one on its feed.
98 To do this, first get the Pub&#39;s ID, with <code>sbot whoami</code>.
99 Then, publish a name with the following command:
100 </p>
101 ${ com.code({ bash: `sbot publish --type about --about {pub-id} --name {name}` }) }
102 <p>
103 It&#39;s a good idea to use your Pub&#39;s hostname.
104 Also, don&#39;t use spaces, or include the <code>@</code> symbol.
105 Here&#39;s an example usage (dont copy this!):
106 </p>
107 ${ com.code({ bash: `sbot publish --type about \\
108 --about "@2mIg4e/GO...GEHoQp3U=.ed25519" \\
109 --name "foobar.com"` }) }
110
111 <h2>8. Create invites</h2>
112 <p>
113 For a last step, you should create invite codes, which you can send to other users to let them join the pub.
114 The command to create an invite code is:
115 </p>
116 ${ com.code({ bash: `sbot invite.create 1` }) }
117 <p>
118 This may now be given out to friends, to command your pub to follow them.
119 If you want to let a single code be used more than once, you can provide a number larger than 1.
120 </p>
121
122 <h2>9. Backup your data directory (optional)</h2>
123 <p>
124 It&#39;s a good idea to regularly backup the Pub&#39;s data directory, in case of failures.
125 The data-directory will include the Pub&#39;s keypair, messages, and files.
126 It can be found at <code>~/.ssb</code>, where <code>~</code> points to the home directory of the user running Scuttlebot.
127 </p>
128
129 <p class="next"><a href="/docs/message-types/post.html">Message types: Post</a></p>
130 <ul class="see-also">
131 <li><a href="/apis/scuttlebot/invite.html">Scuttlebot.Invite API</a></li>
132 <li><a href="/more/protocols/secure-scuttlebutt.html">Secure Scuttlebutt</a></li>
133 </ul>
134 `
135})

Built with git-ssb-web