diff --git a/README.md b/README.md index 8cb839f..05a5dd1 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 diff --git a/build.sh b/build.sh index dc45f5a..bff6e6f 100755 --- a/build.sh +++ b/build.sh @@ -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" @@ -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}" ### @@ -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" diff --git a/deb/postinst b/deb/postinst index bdd25a7..b1722c8 100644 --- a/deb/postinst +++ b/deb/postinst @@ -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