Files: f8a4d655813f38ff344818cb42ca6e52403e92e9 / tmpl / docs / config / create-a-pub.html.js
4799 bytesRaw
1 | var page = require('../../page.part') |
2 | var com = require('../../com.part') |
3 | |
4 | module.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: ` |
31 | EXTERNAL=<hostname.yourdomain.tld> |
32 | |
33 | mkdir -p ~/.ssb |
34 | cat > ~/.ssb/config <<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 | EOF |
58 | ` }) } |
59 | |
60 | <h2>4. Create a run-sbotserver.sh script</h2> |
61 | <p> |
62 | Save the following script somewhere easy to find, such as <code>~/run-sbotserver.sh</code>. |
63 | This script will help ensure uptime, even if scuttlebot experiences a crash: |
64 | </p> |
65 | ${ com.code({ bash: ` |
66 | #!/bin/bash |
67 | while true; do |
68 | ssb-server start --host {your-hostname} |
69 | done |
70 | ` }) } |
71 | <p> |
72 | Be sure to replace <code>{your-hostname}</code> with the actual hostname of your server |
73 | For instance, if your server is <code>foobar.com</code>, then you should enter <code>ssb-server start --host foobar.com</code>. |
74 | </p> |
75 | |
76 | <h2>5. Run the server script</h2> |
77 | <p> |
78 | 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. |
79 | Start the session and run the script: |
80 | </p> |
81 | ${ com.code({ bash: `sh ~/run-sbotserver.sh` }) } |
82 | <p> |
83 | Then, detach the session. |
84 | </p> |
85 | |
86 | <h2>6. Confirm Scuttlebot server is running</h2> |
87 | <p> |
88 | To check if the server is running, use the following command: |
89 | </p> |
90 | ${ com.code({ bash: `sbot whoami` }) } |
91 | <p> |
92 | If all is well, your Pub's ID will be logged to the console. |
93 | If this fails, check that the server-script is still active, and isn't failing during startup. |
94 | </p> |
95 | |
96 | <h2>7. Create the Pub's profile</h2> |
97 | <p> |
98 | It's a good idea to give your Pub a name, by publishing one on its feed. |
99 | To do this, first get the Pub's ID, with <code>sbot whoami</code>. |
100 | Then, publish a name with the following command: |
101 | </p> |
102 | ${ com.code({ bash: `sbot publish --type about --about {pub-id} --name {name}` }) } |
103 | <p> |
104 | It's a good idea to use your Pub's hostname. |
105 | Also, don't use spaces, or include the <code>@</code> symbol. |
106 | Here's an example usage (dont copy this!): |
107 | </p> |
108 | ${ com.code({ bash: `sbot publish --type about \\ |
109 | --about "@2mIg4e/GO...GEHoQp3U=.ed25519" \\ |
110 | --name "foobar.com"` }) } |
111 | |
112 | <h2>8. Create invites</h2> |
113 | <p> |
114 | For a last step, you should create invite codes, which you can send to other users to let them join the pub. |
115 | The command to create an invite code is: |
116 | </p> |
117 | ${ com.code({ bash: `sbot invite.create 1` }) } |
118 | <p> |
119 | This may now be given out to friends, to command your pub to follow them. |
120 | If you want to let a single code be used more than once, you can provide a number larger than 1. |
121 | </p> |
122 | |
123 | <h2>9. Backup your data directory (optional)</h2> |
124 | <p> |
125 | It's a good idea to regularly backup the Pub's data directory, in case of failures. |
126 | The data-directory will include the Pub's keypair, messages, and files. |
127 | It can be found at <code>~/.ssb</code>, where <code>~</code> points to the home directory of the user running Scuttlebot. |
128 | </p> |
129 | |
130 | <p class="next"><a href="/docs/message-types/post.html">Message types: Post</a></p> |
131 | <ul class="see-also"> |
132 | <li><a href="/apis/scuttlebot/invite.html">Scuttlebot.Invite API</a></li> |
133 | <li><a href="/more/protocols/secure-scuttlebutt.html">Secure Scuttlebutt</a></li> |
134 | </ul> |
135 | ` |
136 | }) |
Built with git-ssb-web