Skip to content

Commit

Permalink
do da doo
Browse files Browse the repository at this point in the history
  • Loading branch information
ahdinosaur committed Jan 9, 2022
1 parent 4b41ece commit 318592f
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 7 deletions.
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ easily host your own [Secure ScuttleButt (SSB)](https://www.scuttlebutt.nz) pub!
- [install .deb package](#install-deb-package)
- [configure ssb server](#configure-ssb-server)
- [command and control](#command-and-control)
- [whoami](#whoami)
- [publish to feed](#publish-to-feed)
- [create invites](#create-invites)
- [stop, start, restart service](#stop-start-restart-service)
Expand All @@ -25,20 +26,76 @@ easily host your own [Secure ScuttleButt (SSB)](https://www.scuttlebutt.nz) pub!

### boot Debian server

in the cloud, or in your home, spin up a [Debian](https://www.debian.org/) (or Ubuntu) server.

### download .deb package

```shell
wget TODO
```

### install .deb package

```shell
sudo dpkg -i ssb-pub_*_amd64.deb
```

### configure ssb server

```shell
sudo nano /etc/default/ssb
```

```txt
SSB_PORT=8008
SSB_WS_PORT=8989
```

## command and control

### whoami

```shell
sudo -u ssb ssb-cli call whoami
```

or to save as a variable:

(with `jq` installed)

```shell
ID=$(sudo -u ssb ssb-cli call whoami | jq -r .id)
```

### publish to feed

```shell
sudo -u ssb ssb-cli publish post "your message"
```

```shell
sudo -u ssb ssb-cli publish about --name "wiggle.land" "${ID}"
```

### create invites

the following command creates an invite with 100 uses (number can be changed):

```shell
sudo -u ssb ssb-cli invite create --uses 100
```

take the output, and replace [::] with the IP address or domain name pointing to the server.

### start, stop, restart service

```shell
sudo systemctl status ssb-server
sudo systemctl stop ssb-server
sudo systemctl start ssb-server
sudo systemctl restart ssb-server
```

## upgrading

### migrating to v4
Expand Down
7 changes: 6 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -o pipefail

DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

PKG_VERSION="0.0.1"
PKG_VERSION="4.0.0-pre.1"

DEB_SRC_DIR="${DIR}/deb"
DEB_BUILD_DIR="/tmp/ssb-pub"
Expand Down Expand Up @@ -35,6 +35,8 @@ do
env GOOS=linux GOARCH=${PKG_ARCH} go build ./cmd/sbotcli
echo "compiling go-sbot"
env GOOS=linux GOARCH=${PKG_ARCH} go build ./cmd/go-sbot
echo "compiling ssb-offset-converter"
env GOOS=linux GOARCH=${PKG_ARCH} go build ./cmd/ssb-offset-converter
cd "${DIR}"

###
Expand Down Expand Up @@ -78,6 +80,9 @@ do
cp "${GO_SSB_DIR}/sbotcli" "${DEB_BUILD_DIR}/usr/bin/ssb-cli-go"
chmod 755 "${DEB_BUILD_DIR}/usr/bin/ssb-cli-go"
sudo chown root:root "${DEB_BUILD_DIR}/usr/bin/ssb-cli-go"
cp "${GO_SSB_DIR}/ssb-offset-converter" "${DEB_BUILD_DIR}/usr/bin/ssb-offset-converter"
chmod 755 "${DEB_BUILD_DIR}/usr/bin/ssb-offset-converter"
sudo chown root:root "${DEB_BUILD_DIR}/usr/bin/ssb-offset-converter"

# copy wrapper scripts
cp "${DEB_SRC_DIR}/ssb-server" "${DEB_BUILD_DIR}/usr/bin/ssb-server"
Expand Down
10 changes: 4 additions & 6 deletions deb/postinst
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
#!/bin/sh
set -e

# create user which go-sbot runs as
# create user for ssb to run as
adduser --quiet --system --group --no-create-home ssb

# set permissions
chown ssb:ssb /usr/bin/ssb-server
chown ssb:ssb /usr/bin/ssb-cli
chmod u+s /usr/bin/ssb-cli

# create ssb data dir
mkdir -p /var/lib/ssb

# set permissions
chown ssb:ssb /var/lib/ssb

# Automatically added by cargo-deb
Expand Down

0 comments on commit 318592f

Please sign in to comment.