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