Code Monkey home page Code Monkey logo

ssb-pub's Introduction

ssb-pub

UNMAINTAINED, for a maintained alternative to ssb-pub, see go-ssb-room.

easily host your own Secure ScuttleButt (SSB) pub in a docker container

if you feel like sharing your pub, please add it to the informal registry of pubs as a private pub with your contact details so newbies may request an invite from you!

(if you are running a pub version less than 2.2.0, please upgrade! 🎉 )

❤️

table of contents

one-click setup

(currently broken, soz)

  1. go to Install on DigitalOcean at http://legacy-installer.butt.nz/
  2. choose your server size and region

digital-butt-step-1.png

  1. log in to Digital Ocean, if not done already
  2. add ssh keys, if not done already
  3. start creating your pub server! 🙌

digital-butt-step-2.png

  1. wait for a few minutes ⌛

digital-butt-step-3.png

  1. log in to your server using ssh
  1. test your pub server works
./sbot whoami
  1. create your first invite!
./sbot invite.create 1

digital-butt-step-4.png

  1. invite and host your friends on Scuttlebutt 🏡
  1. give your pub a name and description
./sbot publish --type about --about "@your.pubs.id.here" --name "Pubby McPubFace" --description "everyone should have a pub, this is mine"
  1. setup your pub's domain name

point a domain name (example.com) to your pub server's IP address (using a DNS A record)

edit ~/ssb-pub-data/config to change the connections.incoming.net[].external property from your server ip address to your domain name:

{
  "connections": {
    "incoming": {
      "net": [
        {
          "scope": "public",
          "host": "0.0.0.0",
          "external": "hostname.yourdomain.tld",
          "transform": "shs",
          "port": 8008
        }
      ]
    },
    "outgoing": {
      "net": [
        {
          "transform": "shs"
        }
      ]
    }
  }
}

then restart sbot:

docker restart sbot

(credit to seven1m/do-install-button for the Digital Ocean installer)

manual setup

install docker

to run a pub you need to have a static public IP, ideally with a DNS record (i.e.<hostname.yourdomain.tld>)

on a fresh Debian 9 box, as root

apt update
apt upgrade -y
apt install -y apt-transport-https ca-certificates curl software-properties-common
wget https://download.docker.com/linux/debian/gpg -O docker-gpg
sudo apt-key add docker-gpg
echo "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee -a /etc/apt/sources.list.d/docker.list
apt update
apt install -y docker-ce
systemctl start docker
systemctl enable docker

install ssb-pub image

(option a) pull image from docker hub

docker pull ahdinosaur/ssb-pub

(option b) build image from source

from GitHub:

git clone https://github.com/ahdinosaur/ssb-pub.git
cd ssb-pub
docker build -t ahdinosaur/ssb-pub .

create sbot container

step 1. create a directory on the docker host for persisting the pub's data

mkdir ~/ssb-pub-data
chown -R 1000:1000 ~/ssb-pub-data

if migrating from an old server, copy your old secret and gossip.json (maybe also blobs) now.

rsync -avz ~/ssb-pub-data/blobs/sha256/ $HOST:~/ssb-pub-data/blobs/sha256/

step 2. setup ssb config

EXTERNAL=<hostname.yourdomain.tld>

cat > ~/ssb-pub-data/config <<EOF
{
  "connections": {
    "incoming": {
      "net": [
        {
          "scope": "public",
          "host": "0.0.0.0",
          "external": "${EXTERNAL}",
          "transform": "shs",
          "port": 8008
        }
      ]
    },
    "outgoing": {
      "net": [
        {
          "transform": "shs"
        }
      ]
    }
  }
}
EOF

step 3. run the container

create a ./create-sbot script:

cat > ./create-sbot <<EOF
#!/bin/bash

memory_limit="\$((\$(free -b --si | awk '/Mem\:/ { print \$2 }') - 200*(10**6)))"

docker run -d --name sbot \
   -v ~/ssb-pub-data/:/home/node/.ssb/ \
   -p 8008:8008 \
   --restart unless-stopped \
   --memory "\$memory_limit" \
   ahdinosaur/ssb-pub
EOF

where

  • --memory sets an upper memory limit of your total memory minus 200 MB (for example: on a 1 GB server this could be simplified to --memory 800m)

then

# make the script executable
chmod +x ./create-sbot
# run the script
./create-sbot

step 4. create ./sbot script

we will now create a shell script in ./sbot to help us command our Scuttlebutt server running:

# create the script
cat > ./sbot <<EOF
#!/bin/sh

docker exec -it sbot sbot \$@
EOF

then

# make the script executable
chmod +x ./sbot
# test the script
./sbot whoami

setup auto-healer

the ssb-pub has a built-in health check: sbot whoami.

when sbot becomes unhealthy (it will!), we want to kill the container, so it will be automatically restarted by Docker.

for this situation, we will use somarat/healer:

docker pull ahdinosaur/healer
docker run -d --name healer \
  -v /var/run/docker.sock:/tmp/docker.sock \
  --restart unless-stopped \
  ahdinosaur/healer

ensure containers are always running

sometimes the sbot or healer containers will stop running (despite --restart unless-stopped!).

for this sitaution, we will setup two cron job scripts:

printf '#!/bin/sh\n\ndocker start sbot\n' | tee /etc/cron.hourly/sbot && chmod +x /etc/cron.hourly/sbot
printf '#!/bin/sh\n\ndocker start healer\n' | tee /etc/cron.hourly/healer && chmod +x /etc/cron.hourly/healer

because docker start <service> is idempotent, it will not change anything if the service is already running, but if the service is not running it will start it.

(optional) add ssb-viewer plugin

enter your sbot container with:

docker exec -it sbot bash

then run:

npm install -g git-ssb
mkdir -p ~/.ssb/node_modules
cd ~/.ssb/node_modules
git clone ssb://%MeCTQrz9uszf9EZoTnKCeFeIedhnKWuB3JHW2l1g9NA=.sha256 ssb-viewer
cd ssb-viewer
npm install
sbot plugins.enable ssb-viewer

edit your config to include

{
  "plugins": {
    "ssb-viewer": true
  },
  "viewer": {
    "host": "0.0.0.0"
  }
}

edit your ./create-sbot to include -p 8807:8807.

stop, remove, and re-create sbot:

docker stop sbot
docker rm sbot
./create-sbot

kubernetes setup

Yaml config files for Kubernetes are included in this repository at hack/k8s/deployment.yaml. This has been tested on DigitalOcean. Tweaks may be necessary for clusters hosted by other providers.

The SSB config file is injected into the container as a volume mount. You should update the ssb-config configMap in the deployment file with your external IP or domain, and any other changes you require. Unfortunately, because this is being done on a subPath, changes to the configMap will not propogate automatically. Please keep this in mind if you find you need to make config changes, or, pull requests welcome.

SSB requires persistence to store the log, secrets. The chosen default in the included config is 5gb, but you should raise this to a level that makes sense for your traffic. If you should find your volume filling up, follow the instructions for your provider as to how to increase the size or migrate to a larger volume.

After updating the config, you can install SSB into your cluster with the following:

kubectl apply -f hack/k8s/deployment.yaml

This will do a number of things:

  1. create a namespace on your cluster called scuttlebutt
  2. create a service exposing port 8008
  3. create a 5gb persistent volume which is mapped to /home/node/.ssb
  4. create and inject your ssb config

Much remains the same as with the manual install. However, since we're using Kubernetes in this case for orchestration, there is no need to run additional services like healer, etc. as liveness checks are handled by the deployment configuration.

I've opted short-term not to expose ssh access to the running container, but you may access it by first getting the name of your running pod, then:

kubectl exec -it <your pod name> -n scuttlebutt /bin/bash

From here you can invoke any of the commands detailed below.

command and control

create invites

from your server:

./sbot invite.create 1

from your local machine, using ssh:

ssh -t root@server ./sbot invite.create 1

start, stop, restart containers

for sbot

  • docker stop sbot
  • docker start sbot
  • docker restart sbot

for healer

  • docker stop healer
  • docker start healer
  • docker restart healer

upgrading

update ssb-pub image

docker pull ahdinosaur/ssb-pub
docker stop sbot
docker rm sbot
# edit ~/ssb-pub-data/config if necessary
./create-sbot

migrating from <2.2.0 to 2.2.0+

edit your ~/ssb-pub-data/config, such that connections.incoming.net[].external changes from an array of strings to a single string.

{
  "connections": {
    "incoming": {
      "net": [
        {
          "scope": "public",
          "host": "0.0.0.0",
-          "external": ["hostname.yourdomain.tld"],
+          "external": "hostname.yourdomain.tld",
          "transform": "shs",
          "port": 8008
        }
      ]
    },
    "outgoing": {
      "net": [
        {
          "transform": "shs"
        }
      ]
    }
  }
}

migrating from v1 to v2

for a v1 pub owner to update to the latest v2 version of ssb-pub:

  1. pull the latest v2 image: docker pull ahdinosaur/ssb-pub
  2. stop sbot container: docker stop sbot
  3. remove sbot container: docker rm sbot
  4. create ~/ssb-pub-data/config
  5. re-create ./create-sbot
  6. ./create-sbot

check things are working with docker logs sbot and ./sbot whoami 🎉

ssb-pub's People

Contributors

ahdinosaur avatar cblgh avatar coyote240 avatar cryptix avatar mk270 avatar optikfluffel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ssb-pub's Issues

container fails on startup

"docker logs sbot" yields the following error, repeated many times:

fs.js:646
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: EACCES: permission denied, open '/home/node/.ssb/secret'
    at Object.fs.openSync (fs.js:646:18)
    at Object.fs.writeFileSync (fs.js:1299:33)
    at Object.exports.createSync (/home/node/.npm-global/lib/node_modules/scuttl
ebot-release/node_modules/ssb-keys/storage.js:104:8)
    at Object.exports.loadOrCreateSync (/home/node/.npm-global/lib/node_modules/
scuttlebot-release/node_modules/ssb-keys/index.js:89:20)
    at Object.<anonymous> (/home/node/.npm-global/lib/node_modules/scuttlebot-re
lease/node_modules/scuttlebot/bin.js:27:20)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)

It is not possible to get into the SSB container

Hey guys!
I'm following this tutorial to install my local server for Manyverse, but I can't get into the SSB server when I ran:
docker exec -it sbot bash
Error response from daemon: Container 124dfsfd123 is restarting, wait until the container is running

It happens all times when try to do this:/

I'm not very familiar with docker, so, could you guys give me some help on this job?

Thanks :)

Issue with SSB-Viewer installation via repo

I'm following the Docker instructions and would like to add the optional SSB-Viewer. Ran into this issue...

$ git clone ssb://%MeCTQrz9uszf9EZoTnKCeFeIedhnKWuB3JHW2l1g9NA=.sha256 ssb-viewer
Cloning into 'ssb-viewer'...

Repo not found with ID %MeCTQrz9uszf9EZoTnKCeFeIedhnKWuB3JHW2l1g9NA=.sha256

Okay to clear out Pub data?

Wondering if it is okay to clear out Pub data since it is growing very large on our VPS. Thanks for any advice!

Resource unavailable error

After running the digital ocean one click installer and getting no UI i attempted to run the server (found it in a thread on ssb)

root@ssb-pub:~# ./sbot server
flumelog-offset: blockSize and codec params moved into an object. https://github.com/flumedb/flumelog-offset
Log level: notice

events.js:183
      throw er; // Unhandled 'error' event
      ^
OpenError: IO error: lock /home/node/.ssb/db/LOCK: Resource temporarily unavailable
    at /home/node/.npm-global/lib/node_modules/scuttlebot/node_modules/level-packager/node_modules/levelup/lib/levelup.js:117:34
    at /home/node/.npm-global/lib/node_modules/scuttlebot/node_modules/leveldown/node_modules/abstract-leveldown/abstract-leveldown.js:39:16
root@ssb-pub:~#

it should be noted that /home/node is not a valid directory via normal means even though the erroring code seems to be there. Maybe this is some aspect of docker that i don't understand (i'm pretty ignorant about docker)

$ ls /home/
debian

also, the first time i ran it i hit control+c after a minute or two of it seeming to not be doing anything at all and yet not giving me a prompt back. maybe i borked something by doing that?

Hosting multiple pubs

I'm curious about hosting multiple pubs. What would be the best way to setup and navigate between multiple pub servers hosted on the same machine? Thanks for any suggestions.

v4: --uses always set to 1

It appears the --uses parameter is always set to 1.

Running:

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

Results in:

Jan  9 10:35:05 pub-ewr ssb-server[881]: t=8m12.670849823s unit=legacyInvites invite=created uses=1

I've tried other values, but it always uses 1.

Error in invite creation`resultHost.replace is not a function`

Hello, I recently pulled the latest ssb-pub image on my digital ocean droplet and while it seems to run fine, I'm getting errors when I try to create an invite.

root@ssb-pub:~# ./sbot invite.create 1

/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/muxrpcli/index.js:123
      throw err
      ^
{
  message: 'resultHost.replace is not a function',
  name: 'TypeError',
  stack: 'TypeError: resultHost.replace is not a function\n' +
    '    at Object.stringify (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/multiserver/plugins/net.js:124:31)\n' +
    '    at /home/node/.npm-global/lib/node_modules/ssb-server/node_modules/multiserver/compose.js:111:19\n' +
    '    at Array.map (<anonymous>)\n' +
    '    at Object.stringify (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/multiserver/compose.js:110:22)\n' +
    '    at /home/node/.npm-global/lib/node_modules/ssb-server/node_modules/multiserver/index.js:67:44\n' +
    '    at Array.map (<anonymous>)\n' +
    '    at Object.stringify (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/multiserver/index.js:67:10)\n' +
    '    at EventEmitter.getAddress (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/secret-stack/core.js:213:21)\n' +
    '    at EventEmitter.hooked [as getAddress] (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/hoox/index.js:10:15)\n' +
    '    at getInviteAddress (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/ssb-invite/index.js:75:18)'
}

The image digest is Digest: sha256:ffc0a521f21ff4fc8af89a1454ea5dfa3d371c6415efb1fec8be9613a32fe256 and the version is 19.2.0

Adding ssb-viewer to the container, and then removing the container, removes ssb-viewer.

In readme you write:


(optional) add ssb-viewer plugin

enter your sbot container with:

docker exec -it sbot bash

then run:

npm install -g git-ssb
mkdir -p ~/.ssb/node_modules
cd ~/.ssb/node_modules
git clone ssb://%MeCTQrz9uszf9EZoTnKCeFeIedhnKWuB3JHW2l1g9NA=.sha256 ssb-viewer
cd ssb-viewer
npm install
sbot plugins.enable ssb-viewer

edit your config to include

{
  "plugins": {
    "ssb-viewer": true
  },
  "viewer": {
    "host": "0.0.0.0"
  }
}

edit your ./create-sbot to include -p 8807:8807.

stop, remove, and re-create sbot:

docker stop sbot
docker rm sbot
./create-sbot

But if you first enter a container and installs something, and then afterwards you stop and rm the container, what you installed will be gone, right?

Question about Advanced Setup

Hey hey hey! This is cool!

I read through the Readme, and found installing the pub on digital ocean a (digital ocean)breeze!
I also registered a site and domain at thesolarpunk.club. What I'd like to do is host a pub at pub.thesolarpunk.club and so my invites are coming from there instead of a random ip string.

In the Readme the advanced setup section seems to be for this use case, but it was unclear to me whether this setup was separate from the ssb-pub installer. Like, would I run through those debian commands while ssh'ed into my digital ocean droplet? Or would I have to host the site pub.thesolarpunk.club somewhere else that had a debian server, ssh into there, and then run through the commands? If it is the former, do I need to point this domain to my digital ocean droplet first, through some other method?

Thank you!

droplet seems broken

When i go to try and use the droplet to install a new pub on digital ocean i get this error... a few weeks ago it worked, and i'm already logged in but it doesn't seem to recognize it. Hard to debug. Not sure what's going on.

Screen Shot 2021-01-04 at 6 00 03 PM

Image continues restarting when old secret was copied into ssb-pub-data

using docker logs --tail 50 --follow --timestamps sbot to see what was going on inside the container I got the following error:

2019-05-23T19:36:50.831066939Z Error: EEXIST: file already exists, open '/home/node/.ssb/secret'
2019-05-23T19:36:50.831072476Z     at Object.fs.openSync (fs.js:646:18)
2019-05-23T19:36:50.831077713Z     at Object.fs.writeFileSync (fs.js:1299:33)
2019-05-23T19:36:50.831082928Z     at Object.exports.createSync (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/ssb-keys/storage.js:104:8)
2019-05-23T19:36:50.831112140Z     at Object.exports.loadOrCreateSync (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/ssb-keys/index.js:89:20)
2019-05-23T19:36:50.831118765Z     at setDefaults (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/ssb-config/defaults.js:78:27)
2019-05-23T19:36:50.831124436Z     at module.exports (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/ssb-config/inject.js:7:16)
2019-05-23T19:36:50.831130006Z     at Object.<anonymous> (/home/node/.npm-global/lib/node_modules/ssb-server/bin.js:25:14)
2019-05-23T19:36:50.831135832Z     at Module._compile (module.js:653:30)
2019-05-23T19:36:50.831141105Z     at Object.Module._extensions..js (module.js:664:10)
2019-05-23T19:36:50.831150566Z     at Module.load (module.js:566:32)
2019-05-23T19:37:17.500758652Z fs.js:646
2019-05-23T19:37:17.500814845Z   return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
2019-05-23T19:37:17.500822129Z                  ^
2019-05-23T19:37:17.500827657Z

I removed the secret (and the gossip.json) and tried again, and voila - it worked!

DO installer can't upload image

cat vyrsebio.jpg | ./sbot blobs.add
returns:
the input device is not a TTY

Is there a different process in the docker to upload an image to the server?

Possibly useful documentation.

I got the k8s version of this setup tonight. Here are my notes. Maybe they'll help make good docs.

Setup a k8s version of the ./sbot file that you use for docker. Unfortunately vi vim or similar are missing from the image (which makes sense)

$ echo "#!/bin/bash" > sbot
$ echo "SSB_APPNAME=mm MM_SSB_HOST=127.0.0.1 sbot \$@" >> sbot

You can get your ID from here:

./sbot whoami

You can name yourself here:

./sbot publish --type about --about $MY_ID --name $MY_PUB_NAME

You can accept the invite of another pub (so they will push out the things you sync to them) like this:

./sbot invite.accept $OTHER_PUB_INVITE_HERE

You can follow the other pub like this:

./sbot publish --type contact --contact $OTHER_PUB_ID --following

Generate an invite

./sbot invite.create 1

That's what I did to get my system running, after editing the config as mentioned in the README.

SBot docker container keeps stopping itself

I deleted your setup container, and recreated it with the same command, so I could specify the hostname as my actual DNS name. Now it stops itself periodically, even though the container is set to restart unless it is manually stopped.

E: Disregard that, it keeps getting hit by the OOM killer. Oh well.

Replication not working with Manyverse

I know this repo isn't being maintained, but I wanted to open this in case others are having this issue. My friend just installed Manyverse and redeemed an invitation to my pub sucessfully, but replication fails with this error (IP address redacted):

sbot_1    | server error, from net:11.11.111.111:53861~shs:
sbot_1    | Error: stream ended with:0 but wanted:64
sbot_1    |     at drain (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/pull-reader/index.js:43:26)
sbot_1    |     at /home/node/.npm-global/lib/node_modules/ssb-server/node_modules/pull-reader/index.js:63:18
sbot_1    |     at /home/node/.npm-global/lib/node_modules/ssb-server/node_modules/pull-reader/index.js:20:7
sbot_1    |     at drain (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/stream-to-pull-stream/index.js:126:18)
sbot_1    |     at Socket.<anonymous> (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/stream-to-pull-stream/index.js:143:5)
sbot_1    |     at Socket.emit (events.js:388:22)
sbot_1    |     at endReadableNT (internal/streams/readable.js:1336:12)
sbot_1    |     at processTicksAndRejections (internal/process/task_queues.js:82:21)

Replication does appear to still be working with other apps, like Planetary.

add cron job to ensure docker services are always up

continuation from #10

at the moment, there is still a breaking case where the sbot or healer docker services go down (despite the docker config to keep them always running unless stopped).

i also notice that docker start sbot is idempotent, meaning if sbot is already running it won't change anything, but if sbot is not running it will start it.

so, we should add to the documentation a section about adding two cron jobs. on debian, we only need to run:

echo "docker start sbot" | tee /etc/cron.hourly/sbot && chmod +x /etc/cron.hourly/sbot
echo "docker start healer" | tee /etc/cron.hourly/healer && chmod +x /etc/cron.hourly/healer

/cc @mixmix @soapdog

could not start sbot after crash

root@ssb-pub:~# docker start sbot
Error response from daemon: OCI runtime create failed: container with id exists: 823319aecc21969612bd995cc2cf32ebfcaa3919c4a944abf7c893b52aa8df6c: unknown
Error: failed to start containers: sbot

Connections need to be adjusted for viewer

I had trouble doing npm install for ssb-viewer (manual setup) because port 8989 could not be reached for retrieving some blobs. So I had to add that connection to the config file. While I was at it, I also changed the host fields to :: instead of 0.0.0.0. There might be issues with this, see ssbc/ssb-config#53, but for me it works.

Full config after modification:

{
  "plugins": {
    "ssb-viewer": true
  },
  "viewer": {
    "host": "::"
  },
  "connections": {
    "incoming": {
      "net": [
        {
          "scope": ["device", "public"],
          "host": "::",
          "external": ["muchmuch.coffee"],
          "transform": "shs",
          "port": 8008
        }
      ],
      "ws":[
        { "host": "::",
          "port": 8989,
          "scope": [ "device", "local", "public" ],
          "transform": "shs" } ]
    },
    "outgoing": {
      "net": [
        {
          "transform": "shs"
        }
      ]
    }
  }
}

Not sure if the scope fields are at the right values honestly, but since everything has "transform": "shs" I should be fine, right?

./sbot whoiam -> Could not connect to the scuttlebot server.

I am stuck at step 3 of the manual setup tutorial. The container ahdinosaur/ssb-pub starts:

CONTAINER ID        IMAGE                       COMMAND   CREATED              STATUS                         
2e2b79e0083e        ahdinosaur/healer      "/bin/healer"  32 minutes ago      Up 32 minutes healer
ddbbe986ce08        ahdinosaur/ssb-pub   "sbot server" About an hour ago  Up About an hour (unhealthy)   0.0.0.0:8008->8008/tcp   sbot

Nevertheless,

% ./sbot whoami
Error: Could not connect to the scuttlebot server.
Use the "server" command to start it.

It is possible to ssh into the container and issue the command with the same output:

% docker exec -it sbot bash
node@ddbbe986ce08:~/.npm-global/bin$ ./sbot whoiam
Error: Could not connect to the scuttlebot server.
Use the "server" command to start it.

I would appreciate any hint on how to debug this issue. Thanks!

server keeps restarting

I think this may be related to the recent bug in ssb-links; but my pub keeps restarting and no longer works. How do I recover?

Error trying to run `./sbot publish`

I run this pub on a docker container and the processes is running as follow:

$ docker ps
CONTAINER ID        IMAGE                     COMMAND                  CREATED             STATUS                    PORTS                    NAMES
a389d14bbc60        ahdinosaur/healer         "/bin/healer"            26 minutes ago      Up 26 minutes                                      healer
200a628f3ec9        ahdinosaur/ssb-pub        "/tini -- ssb-server…"   26 minutes ago      Up 51 seconds (healthy)   0.0.0.0:8008->8008/tcp   sbot

I can run ./sbot whoami and ./sbot invite.create 1.

In the past I managed to run ./sbot publish --type about --about @xzVNju0I2n3N7SlAc76BSx0HKAoUCkWwNu7vsuZNyNU=.ed25519 --name PUBNAME

But when I try to add a description or a name with whitespaces (therefore wrapped in ", right?) I get the following error:

./sbot publish --type about --about @pubid  --description "Everybody should have a pub, this is mine"

/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/muxrpcli/index.js:68
      throw err
      ^
TypeError: cb is not a function
    at /home/node/.npm-global/lib/node_modules/ssb-server/node_modules/ssb-db/minimal.js:201:7
    at EventEmitter.append (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/ssb-db/minimal.js:162:18)
    at Object.add (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/ssb-db/create.js:93:10)
    at apply (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/muxrpc-validation/index.js:202:13)
    at Object.<anonymous> (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/muxrpc-validation/index.js:86:14)
    at Object.hooked (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/hoox/index.js:10:15)
    at Object.localCall (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/muxrpc/local-api.js:31:29)
    at Object.<anonymous> (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/muxrpc/local-api.js:37:22)
    at Object.request (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/muxrpc/stream.js:48:17)
    at PacketStream._onrequest (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/packet-stream/index.js:161:17)

What am I doing wrong this time?

crashes without restart?

i must have been too optimistic about the docker container restarting on fail, checking the monitoring over the last month i see

ssb.mikey.nz (not many followers)

screenshot_20171218_221142

ssb.rootsystems.nz (soooooooo many followers)

screenshot_20171218_221223

i wonder why this is happening?

a quick and dirty fix is to cron schedule a hard restart every day or so, i wonder how we should do that.

Couldn't start sbot after setup

Linux ssb-pub 4.9.0-11-amd64 #1 SMP Debian 4.9.189-3+deb9u1 (2019-09-20) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@ssb-pub:~# apt update
Hit:1 http://security.debian.org stretch/updates InRelease
Ign:2 http://mirrors.digitalocean.com/debian stretch InRelease
Hit:3 http://mirrors.digitalocean.com/debian stretch-updates InRelease
Hit:4 http://mirrors.digitalocean.com/debian stretch Release
Hit:5 https://download.docker.com/linux/debian stretch InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
4 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@ssb-pub:~# apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  file libmagic-mgc libmagic1 linux-image-4.9.0-11-amd64
4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 39.6 MB of archives.
After this operation, 26.6 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://security.debian.org stretch/updates/main amd64 file amd64 1:5.30-1+deb9u3 [64.2 kB]
Get:2 http://security.debian.org stretch/updates/main amd64 libmagic1 amd64 1:5.30-1+deb9u3 [111 kB]
Get:3 http://security.debian.org stretch/updates/main amd64 libmagic-mgc amd64 1:5.30-1+deb9u3 [222 kB]
Get:4 http://security.debian.org stretch/updates/main amd64 linux-image-4.9.0-11-amd64 amd64 4.9.189-3+deb9u2 [39.2 MB]
Fetched 39.6 MB in 0s (44.0 MB/s)                     
(Reading database ... 56164 files and directories currently installed.)
Preparing to unpack .../file_1%3a5.30-1+deb9u3_amd64.deb ...
Unpacking file (1:5.30-1+deb9u3) over (1:5.30-1+deb9u2) ...
Preparing to unpack .../libmagic1_1%3a5.30-1+deb9u3_amd64.deb ...
Unpacking libmagic1:amd64 (1:5.30-1+deb9u3) over (1:5.30-1+deb9u2) ...
Preparing to unpack .../libmagic-mgc_1%3a5.30-1+deb9u3_amd64.deb ...
Unpacking libmagic-mgc (1:5.30-1+deb9u3) over (1:5.30-1+deb9u2) ...
Preparing to unpack .../linux-image-4.9.0-11-amd64_4.9.189-3+deb9u2_amd64.deb ...
Unpacking linux-image-4.9.0-11-amd64 (4.9.189-3+deb9u2) over (4.9.189-3+deb9u1) ...
Setting up libmagic-mgc (1:5.30-1+deb9u3) ...
Setting up libmagic1:amd64 (1:5.30-1+deb9u3) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Setting up linux-image-4.9.0-11-amd64 (4.9.189-3+deb9u2) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.9.0-11-amd64
/etc/kernel/postinst.d/zz-update-grub:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.9.0-11-amd64
Found initrd image: /boot/initrd.img-4.9.0-11-amd64
done
Setting up file (1:5.30-1+deb9u3) ...
root@ssb-pub:~# sbot whoami
-bash: sbot: command not found
root@ssb-pub:~# .sbot whoami
-bash: .sbot: command not found
root@ssb-pub:~# ls
create-sbot  docker-gpg  sbot  ssb-pub-data
root@ssb-pub:~# ./sbot
Cannot read property 'apply' of undefined

cb is not a function when when attempting to post text

/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/muxrpcli/index.js:123
      throw err
      ^
{
  message: 'cb is not a function',
  name: 'TypeError',
  stack: 'TypeError: cb is not a function\n' +
    '    at /home/node/.npm-global/lib/node_modules/ssb-server/node_modules/ssb-db/minimal.js:201:7\n' +
    '    at EventEmitter.append (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/ssb-db/minimal.js:162:18)\n' +
    '    at Object.add (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/ssb-db/create.js:93:10)\n' +
    '    at apply (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/muxrpc-validation/index.js:202:13)\n' +
    '    at Object.<anonymous> (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/muxrpc-validation/index.js:86:14)\n' +
    '    at Object.hooked (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/hoox/index.js:10:15)\n' +
    '    at Object.localCall (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/muxrpc/local-api.js:31:29)\n' +
    '    at Object.<anonymous> (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/muxrpc/local-api.js:37:22)\n' +
    '    at Object.request (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/muxrpc/stream.js:48:17)\n' +
    '    at PacketStream._onrequest (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/packet-stream/index.js:161:17)'
}

Simpler way to create invites

I just created a new pub using the docker container on my server, however it took ~2 minutes for ssb to start for some reason (still unsure why).

I noticed the command to create invites in the README basically spawns a new container just to run the invite.create command, and this doesn't work for me because the sbot server hasn't started yet. I get the following:

Error: Could not connect to the scuttlebot server.
Use the "server" command to start it.

I discovered there's a much simpler way to create invites. With the following:

docker exec -it sbot sbot invite.create 1     

My docker container is called sbot, This is just executing the command sbot invite.create 1 inside of it. It might make sense to add this to the README.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.