secure-scuttlebot classic
at main 197 lines 5.2 kB view raw view rendered
1# Secure-Scuttlebot Classic 2 3sbotc is an open source **peer-to-peer log store** used as a database, identity provider, and messaging system. 4It has: 5 6 - Global replication 7 - File-synchronization 8 - End-to-end encryption 9 10`ssb-server` behaves just like a [Kappa Architecture DB](http://milinda.pathirage.org/kappa-architecture.com/). 11In the background, it syncs with known peers. 12Peers do not have to be trusted, and can share logs and files on behalf of other peers, as each log is an unforgeable append-only message feed. 13This means ssb-servers comprise a [global gossip-protocol mesh](https://en.wikipedia.org/wiki/Gossip_protocol) without any host dependencies. 14 15### Classic rational 16 17ssb was abandoned in 2024, this is an attempt to restore the original "classic" functionality. You can find the original project documentation at [scuttlebot.io](https://scuttlebot.io). This repo is maintained by Everett Bogue. please reach out if you have any questions to the contact information present at https://evbogue.com/ 18 19--- 20 21## Installation 22 23### Prerequisites 24 25- You must have [Node.js](https://nodejs.org/) (version 14 or higher) and `npm` installed. 26 27### Install from NPM 28 29From the repo root: 30 31- `npm install` 32 33This will download the server, all dependencies, and make the `sbot` command available within the project. 34 35--- 36 37## Getting Started 38 39Follow these steps to get your server running and connected to the network. 40 41### 1. Start the Server 42 43First, start your secure scuttlebutt server. This process will run in your terminal, and you should leave it running. It will generate your unique ssb identity and store data in `~/.ssb`. 44 45From the repo root: 46```bash 47npm start 48``` 49 50This is equivalent to `node bin start`. You should see output like: 51``` 52ssb-server <version> <path> logging.level:<level> 53my key ID: <@yourPublicKey> 54``` 55**Leave this terminal window open!** It is your local sbot node. All other commands will be run in a **new, separate terminal window.** 56 57### 2. Use the Command-Line Interface (CLI) 58 59With the server running, you can open a **new terminal window** to run commands and interact with your sbot. 60 61All commands follow the format: `node bin <command> [...args]` 62 63**Example: Find Your Identity** 64 65This command shows your public key (your ID on the network). 66```bash 67node bin whoami 68``` 69 70**Example: See Connected Peers** 71 72This command shows who your server is currently connected to. Initially, it will be empty. 73```bash 74node bin gossip.peers 75``` 76 77### 3. Connect to the Network (Join a Pub) 78 79To see messages from other people, you need to connect to a "pub." Pubs are ssb-servers that are run on public servers so that they are always available. 80 81**Step A: Get an Invite Code** 82 83First, you need an invite code from a pub. These are often shared on websites or in chat rooms for ssb communities. An invite code looks like a long string of text. 84 85**Step B: Accept the Invite** 86 87Once you have an invite code, use the `invite.accept` command to connect to the pub. This tells your sbot to follow the pub and begin downloading messages from it. 88 89```bash 90node bin invite.accept "PASTE_THE_INVITE_CODE_HERE" 91``` 92 93After a few moments, your sbot will connect to the pub. You can verify this by running `node bin gossip.peers` again. You should now see the pub in your peer list. 94 95### 4. Create Your Own Invites 96 97You can also create your own invite codes to invite friends or connect your own devices. 98 99```bash 100# Create an invite that can be used 1 time 101node bin invite.create 1 102``` 103 104This will print an invite string you can pass to another person so they can connect to and follow your sbot. 105 106--- 107 108## (Optional) Web Clients (Patchbay + Decent) 109 110This repository includes two browser UIs: 111 112- `patchbay/` served through `ssb-ws` (default `:8989`) 113- `decent/` served by `plugins/decent-ui.js` (default `:8888`) 114 115Build both from repo root: 116 117```bash 118npm run build:web 119``` 120 121### 1. Build Patchbay 122 123From the repo root: 124 125```bash 126npm --prefix patchbay install --ignore-scripts 127npm --prefix patchbay run lite 128``` 129 130Build output: 131 132- `patchbay/build/index.html` 133 134Optional alternative build: 135 136```bash 137npm --prefix patchbay run bundle 138``` 139 140### 2. Build Decent 141 142From the repo root: 143 144```bash 145npm --prefix decent install --ignore-scripts 146npm --prefix decent run lite 147``` 148 149Build output: 150 151- `decent/build/index.html` 152- `decent/build/style.css` 153 154Optional alternative build: 155 156```bash 157npm --prefix decent run bundle 158``` 159 160### 3. Run Patchbay 161 162With your sbot running (`npm start`), open: 163 164- **http://localhost:8989/** 165 166If you need a different host/port for `ssb-ws`, add this to `~/.ssb/config`: 167 168```json 169{ 170 "ws": { 171 "host": "127.0.0.1", 172 "port": 8989 173 } 174} 175``` 176 177### 4. Run Decent 178 179The Decent bundle is served on its own port so it does not conflict with `ssb-ws` (default `8989`). Start your sbot (`npm start`) and visit: 180 181- **http://127.0.0.1:8888/** 182 183The view is served by `plugins/decent-ui.js` and reads assets from `decent/build/`. You can override the host/port in `~/.ssb/config`: 184 185```json 186{ 187 "decent": { 188 "host": "127.0.0.1", 189 "port": 8888 190 } 191} 192``` 193 194Picking another `port` keeps the Decent bundle running alongside Patchbay or other services. 195 196--- 197MIT