ssbc / ssb-server

The gossip and replication server for Secure Scuttlebutt - a distributed social network
1.69k stars 164 forks source link

Error: method:invite,create is not on whitelist #189

Closed missinglink closed 9 years ago

missinglink commented 9 years ago

heyo, I set up a pub server here http://ssbc.wiz.co.nz which seems to be working fine except I cannot execute the commands sbot invite.create or sbot invite.addMe from the readme, any ideas?

$ ./bin.js invite.create 100
LOCAL_API { auth: 'async' }

/var/www/scuttlebot/bin.js:217
        if(err) throw err
                      ^
Error: method:invite,create is not on whitelist
    at Function.perms.pre (/var/www/scuttlebot/node_modules/muxrpc/permissions.js:74:14)
    at Object.PacketStream.request (/var/www/scuttlebot/node_modules/muxrpc/index.js:66:27)
    at onRequest (/var/www/scuttlebot/node_modules/muxrpc/node_modules/packet-stream/index.js:26:12)
    at Object.p.write (/var/www/scuttlebot/node_modules/muxrpc/node_modules/packet-stream/index.js:181:33)
    at /var/www/scuttlebot/node_modules/muxrpc/pull-weird.js:52:15
    at loop (/var/www/scuttlebot/node_modules/pull-stream/sinks.js:15:33)
    at /var/www/scuttlebot/node_modules/pull-stream/throughs.js:97:9
    at /var/www/scuttlebot/node_modules/pull-stream/throughs.js:97:9
    at /var/www/scuttlebot/node_modules/pull-stream/throughs.js:21:7
    at pull (/var/www/scuttlebot/node_modules/pull-serializer/node_modules/pull-split/node_modules/pull-through/index.js:35:9)
$ node --version
v0.10.38
$ git log -1
commit a8dff80fffd2f4ef779c6787b4dca42d50a86362
Author: Paul Frazee <pfrazee@gmail.com>
Date:   Tue Apr 28 20:26:36 2015 -0500

    4.2.3
$ sudo netstat -plnt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:8008            0.0.0.0:*               LISTEN      31226/node 
pfrazee commented 9 years ago

Hey peter, can you dump your ~/.ssb/manifest.json file for me?

missinglink commented 9 years ago

oh hai @pfraze, still alive! when I left at 4:30am I assumed you were going to miss your flight...

it seems to me as an uneducated outsider that the error message invite,create seems to indicate that it's being interpreted as [invite,create] rather than invite.create?

also worth noting I didn't install it globally, instead I'm running the latest master@HEAD of this repo with the latest npm install deets on node 10.38, so maybe that's different from what was published in npm.

$ cat ~/.ssb/manifest.json 
{
  "add": "async",
  "publish": "async",
  "get": "async",
  "getPublicKey": "async",
  "getLatest": "async",
  "whoami": "async",
  "auth": "async",
  "relatedMessages": "async",
  "getLocal": "async",
  "query": "source",
  "createFeedStream": "source",
  "createHistoryStream": "source",
  "createLogStream": "source",
  "messagesByType": "source",
  "messagesLinkedToMessage": "source",
  "messagesLinkedToFeed": "source",
  "messagesLinkedFromFeed": "source",
  "feedsLinkedToFeed": "source",
  "feedsLinkedFromFeed": "source",
  "followedUsers": "source",
  "gossip": {
    "seeds": "async",
    "peers": "sync",
    "connect": "async"
  },
  "blobs": {
    "get": "source",
    "has": "async",
    "add": "sink",
    "ls": "source",
    "want": "async",
    "wants": "sync"
  },
  "invite": {
    "create": "async",
    "use": "async",
    "addMe": "async"
  },
  "friends": {
    "all": "async",
    "hops": "async"
  },
  "local": {
    "get": "sync"
  },
  "phoenix": {
    "createEventStream": "source",
    "getIndexCounts": "async",
    "createInboxStream": "source",
    "createAdvertStream": "source",
    "getRandomAdverts": "async",
    "markRead": "async",
    "markUnread": "async",
    "toggleRead": "async",
    "isRead": "async",
    "subscribe": "async",
    "unsubscribe": "async",
    "toggleSubscribed": "async",
    "isSubscribed": "async",
    "getMyProfile": "async",
    "getProfile": "async",
    "getAllProfiles": "async",
    "getNamesById": "async",
    "getNameTrustRanks": "async",
    "getName": "async",
    "getIdsByName": "async",
    "getActionItems": "async"
  }
}

[1] https://gist.github.com/missinglink/c6e4c71b2f6af74780c0

pfrazee commented 9 years ago

Still alive and made the flight :v: party victory

it seems to me as an uneducated outsider that the error message invite,create seems to indicate that it's being interpreted as [invite,create] rather than invite.create?

Good thought but that's just the tokenized form leaking through in our error output

also worth noting I didn't install it globally, instead I'm running the latest master@HEAD of this repo with the latest npm install deets on node 10.38, so maybe that's different from what was published in npm.

That should be right, and your manifest looks right. Are you running these commands on your server via ssh?

dominictarr commented 9 years ago

My guess is that it is attempting authorize with keys that do not have master permissions.

pfrazee commented 9 years ago

Yeah turns out his home directory was being set to something incorrect by his service-maintainer tools, causing the server process to use a different .ssb than the command was.