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