GithubHelp home page GithubHelp logo

ssbc / patchbay Goto Github PK

View Code? Open in Web Editor NEW
384.0 30.0 78.0 8.55 MB

An alternative Secure Scuttlebutt client interface that is fully compatible with Patchwork

Home Page: http://www.scuttlebutt.nz

JavaScript 100.00%
patchbay sbot chess

patchbay's Introduction

Patchbay

Patchbay is a scuttlebutt client designed to be easy to modify and extend. It uses the same database as Patchwork and Patchfoo, so you can easily take it for a spin with your existing identity.

Patchbay was created by Dominic Tarr towards the end of the life of Patchwork v1. It was born our out of the observation that maintaining a large client apps can be really hard work. Patchbay was designed to sidestep this by using some technology (depject) to make parts easier to swap and extend.

Patchbay now shares a common core library (patchcore) with Patchwork, and connects this in using the depject This is another experiment in sharing useful code and maintenance.

Current features boasted:

  • gatherings - a booking system
  • chess - p2p chess games and chat
  • bookblub - a book review interface
  • blogs - can read blogposts created in Ticktack

Install

Download easy installer for Mac / Windows / Linux here : https://github.com/ssbc/patchbay/releases

If you'd like to hack on Patchbay, check out the Developer Install below.

Keyboard shortcuts

See here or in patchbay for to the page /shortcuts

Developer Install

Libsodium has some build dependencies. On ubuntu systems the following might help:

sudo apt-get install m4 libtool eclipse-cdt-autotools

You also might need these for the spellchecker:

sudo apt-get install libxext-dev libxtst-dev libxkbfile-dev

On MacOS you may need the following packages installed (in this example, via Homebrew):

brew install libtool automake autoconf

Embedded sever (recommended)

This runs an embedded sbot with all the right plugins already installed.

git clone https://github.com/ssbc/patchbay
cd patchbay
npm install

Patchbay doesn't give you a way to join pubs yet, so this is good if you've already done that with another client (like Patchwork).

External server

This method runs the ssb-server as a standalone command-line driven server. The danger in this is that you don't install the right plugin versions, and the server won't necessarily be started with the right config (unless you add it to ~/.ssb/config etc).

For this reason I wouldn't currently recommend this approach. Note that core devs aren't often running things this way, so if this is broken we wouldn't know, and might not be keen to fix it right now.

Install a standalone ssb-server (your gossip server)

npm install ssb-server@latest -g
sbot server

# then in another tab (these must be separate commands)
sbot plugins.install ssb-about
sbot plugins.install ssb-backlinks
sbot plugins.install ssb-unread
sbot plugins.install ssb-suggest
sbot plugins.install ssb-search # for search
sbot plugins.install ssb-chess-db # for chess
sbot plugins.install ssb-private # for private messages
sbot plugins.install ssb-meme # for image search

# restart sbot server (go back to previous tab and kill it)

Restart your sbot, then (optionally) use an invite code. This will give you your first friend, from which point you can find others:

sbot invite.accept LONG_INVITE_CODE_MAYBE_IN_QUOTES

Install Patchbay

git clone https://github.com/ssbc/patchbay
cd patchbay
npm install

Running the desktop app

Easy mode (embedded sbot):

# from the patchbay repo folder
npm start

Harder mode:

ssb-server start

# from the patchbay repo folder
npm run lite

Development

Key depject modules in Patchbay

Here's a quick high level overview of the depject modules you're going to want to know about:

app.html.app

The top level module which starts the front end js.

app.sync.initialise

A collection of function which are called on app start. Does things like load css into the app, set up custom listeners, set default settings

app.sync.goTo(location)

The function you call when you want to open a new location. location can be a string (like a message or blob id) or an object.

Note - some locations are normalised before being passed onto the router. Check out router.async.normalise for explicit detail.

router.sync.router

This is the module where you can add routes to the app. This is ultimately reduced along with all other router.sync.router modules into the final router.

app.html.settings

Giving modules here will add settings sections to the settings page (app.page.settings).

Requiring the core of patchbay

If you don't want the default modules, you can grab the main part of patchbay and pick and choose modules like this:

const patchcore = require('patchcore')
const patchbay = require('patchbay/main')
const combine = require('depject')
const entry = require('depject/entry')
const nest = require('depnest')

const sockets = combine(
  require('patchbay-dark-crystal'), // the module(s) you want
  patchbay,
  patchcore // required
)

const api = entry(sockets, nest('app.html.app', 'first'))
document.body.appendChild(api.app.html.app())

You'll need to be running your own sbot and launch this with electro / electron. See index.js to see that

How to add a new page

e.g. to add a 'cats' page to the app:

  • Add a file app/page/cats.js which gives app.page.cats
  • Tell the router to send people browsing to location {page: 'cats'} to send them to this page
    • route will look like [location => location.page === 'cats', api.app.page.cats]
    • Note the normaliser will automaticall turn location /cats to {page: 'cats'}
  • Add a link somewhere which will trigger that route:
    • e.g. activateapi.app.sync.goTo('/cats') onclick
    • e.g. add a link <a href='/cats'>Cats!</a> (which will be clicked up by listeners)

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

License

AGPL-3.0

patchbay's People

Contributors

adinardi avatar ahdinosaur avatar alanz avatar arj03 avatar brhue avatar christianbundy avatar clehner avatar combinatorist avatar cryptix avatar dangerousbeans avatar dominictarr avatar don-smith avatar edrex avatar evbogue avatar gwenbell avatar happy0 avatar hardfire avatar justinabrahms avatar ktorn avatar kyrias avatar lancew avatar magician11 avatar marylychee avatar mixmix avatar mmckegg avatar monkeywithacupcake avatar pietgeursen avatar powersource avatar reconbot avatar staltz 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

patchbay's Issues

connection status

patchbay reconnects to a restarted sbot pretty well, but it would help sometimes to see whether it is currently connected and be able trigger a reconnection. This will be far more important for a lite client.

Also, the status indicator could represent the connectedness of the sbot (which is more an issue for the full peer than the light client)

keyboard shortcut malfunction

I'm using mozilla firefox with the lite version of patchbay.

when I use many functions all is ok for closing and horizontal switch between tabs with: x, h, l

but when I try to scroll in vertical with j,k: it delivers error message:

\ el.scrollIntoViewIfNeeded is not a function

sharing options

is it possible to implement sharing options like in popular social networks or is there a reason why this shouldn't be necessary?

some backlinks don't show

In my patchbay, I'm seeing some messages show with backlinks, and others not.

for example %G74TIna+iO1ByvYA79vNJyhd7xBiNeuDhLTmaWhBso0=.sha256 shows a backlink,
but %4+DpwtUo+lcw4+EzW9znc4hzG8rOeRDN4MRjIb6j8kM=.sha256 does not, although there is a link to it from %2OztgiyeuC5w2seyur3DifOscc3tV2FDmrrFlW6e08M=.sha256. It seems to be the difference is about that I used a markdown link with text.

I always use markdown links with description because I think it will be a valuable curational signal one day

Make replying more intuitive

I've noticed from on-boarding a few people into the lite client that it's not intuitive how to reply to a post in Patchbay. Most people seem to reply with a new message in the stream, which isn't the correct UX for threads.

I don't have any ideas about how to fix this, but I figure I'd open an issue about it.

Simplify Patchbay installation

Installing Patchbay should be easier.

I did a blank install of Patchbay on another computer last night and noticed a few things.

  1. Patchbay requires Patchwork to be running or images are broken.
  2. Patchbay requires Electro + Electron-prebuilt to be installed.

Both of these dependencies take a long time to download on my Internet connection in Mexico.

Is it a realistic goal to simplify installation instructions to...?

% sudo npm install -g scuttlebot
% sbot plugins.install ssb-links ssb-query
% sbot server
% npm start

This would make it easier for newcomers to get Patchbay up and running quickly.

I'm not very familiar with Electron, so I'm not sure how dependent Patchbay is on Electro(n) to function. I'm going to poke around in the code later and see if I can figure out how to achieve these goals.

Error: Cannot find module 'app'

This error appears both when I use try to run patchbay using node v4 or v6:

patchbay (master)@cel (node v6.2.1)$ electro .
App threw an error during load
Error: Cannot find module 'app'
    at Module._resolveFilename (module.js:438:15)
    at Function.Module._resolveFilename (/usr/local/lib/node_modules/electron-prebuilt/dist/resources/electron.asar/common/reset-search-paths.js:47:12)
    at Function.Module._load (module.js:386:25)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/electro/index.js:24:11)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)

Is there supposed to be an app somewhere?

Here is the output of npm ls:

[email protected] /usr/local/src/patchbay
├─┬ [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ └─┬ [email protected]
│ │   └── [email protected]
│ └── [email protected]
├── [email protected]
├─┬ [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ └─┬ [email protected]
│ │ │   └─┬ [email protected]
│ │ │     ├─┬ [email protected]
│ │ │     │ └── [email protected]
│ │ │     ├─┬ [email protected]
│ │ │     │ └─┬ [email protected]
│ │ │     │   ├── [email protected]
│ │ │     │   └── [email protected]
│ │ │     ├── [email protected]
│ │ │     └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └─┬ [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ └── [email protected]
│ │ │ │   ├── [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ ├─┬ [email protected]
│ │ │ │   │ │ └── [email protected]
│ │ │ │   │ └── [email protected]
│ │ │ │   ├── [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ ├── [email protected]
│ │ │ │   │ ├─┬ [email protected]
│ │ │ │   │ │ └── [email protected]
│ │ │ │   │ ├── [email protected]
│ │ │ │   │ └─┬ [email protected]
│ │ │ │   │   ├─┬ [email protected]
│ │ │ │   │   │ └── [email protected]
│ │ │ │   │   └─┬ [email protected]
│ │ │ │   │     └── [email protected]
│ │ │ │   ├── [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ ├─┬ [email protected]
│ │ │ │   │ │ └── [email protected]
│ │ │ │   │ └─┬ [email protected]
│ │ │ │   │   ├─┬ [email protected]
│ │ │ │   │   │ ├── [email protected]
│ │ │ │   │   │ ├─┬ [email protected]
│ │ │ │   │   │ │ └─┬ [email protected]
│ │ │ │   │   │ │   └── [email protected]
│ │ │ │   │   │ ├── [email protected]
│ │ │ │   │   │ └─┬ [email protected]
│ │ │ │   │   │   └── [email protected]
│ │ │ │   │   └── [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ ├─┬ [email protected]
│ │ │ │   │ │ └─┬ [email protected]
│ │ │ │   │ │   └─┬ [email protected]
│ │ │ │   │ │     └── [email protected]
│ │ │ │   │ └── [email protected]
│ │ │ │   └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └─┬ [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ └── [email protected]
│ │ │ │   └─┬ [email protected]
│ │ │ │     └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ └─┬ [email protected]
│ │ │ │ │   └── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ └── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ └── [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ ├─┬ [email protected]
│ │ │ │ │ │ ├── [email protected]
│ │ │ │ │ │ ├── [email protected]
│ │ │ │ │ │ ├─┬ [email protected]
│ │ │ │ │ │ │ └── [email protected]
│ │ │ │ │ │ ├── [email protected]
│ │ │ │ │ │ └── [email protected]
│ │ │ │ │ ├─┬ [email protected]
│ │ │ │ │ │ └── [email protected]
│ │ │ │ │ ├─┬ [email protected]
│ │ │ │ │ │ ├── [email protected]
│ │ │ │ │ │ ├─┬ [email protected]
│ │ │ │ │ │ │ └── [email protected]
│ │ │ │ │ │ ├── [email protected]
│ │ │ │ │ │ └── [email protected]
│ │ │ │ │ └─┬ [email protected]
│ │ │ │ │   └── [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ └── [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ ├─┬ [email protected]
│ │ │ │ │ │ ├── [email protected]
│ │ │ │ │ │ ├── [email protected]
│ │ │ │ │ │ └── [email protected]
│ │ │ │ │ └─┬ [email protected]
│ │ │ │ │   ├── [email protected]
│ │ │ │ │   ├── [email protected]
│ │ │ │ │   ├─┬ [email protected]
│ │ │ │ │   │ └── [email protected]
│ │ │ │ │   ├── [email protected]
│ │ │ │ │   ├─┬ [email protected]
│ │ │ │ │   │ └── [email protected]
│ │ │ │ │   ├── [email protected]
│ │ │ │ │   └── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ └─┬ [email protected]
│ │   ├── [email protected]
│ │   └── [email protected]
│ └─┬ [email protected]
│   ├─┬ [email protected]
│   │ ├── [email protected]
│   │ ├─┬ [email protected]
│   │ │ ├── [email protected]
│   │ │ ├── [email protected]
│   │ │ ├── [email protected]
│   │ │ ├── [email protected]
│   │ │ └── [email protected]
│   │ └── [email protected]
│   ├── [email protected]
│   ├─┬ [email protected]
│   │ └── [email protected]
│   └─┬ [email protected]
│     └─┬ [email protected]
│       └── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ └── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └─┬ [email protected]
│ │ │ │   └── [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ └── [email protected]
│ └─┬ [email protected]
│   ├── [email protected]
│   ├─┬ [email protected]
│   │ ├── [email protected]
│   │ └── [email protected]
│   └─┬ [email protected]
│     ├── [email protected]
│     ├── [email protected]
│     └── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ └─┬ [email protected]
│ │   ├─┬ [email protected]
│ │   │ └── [email protected]
│ │   ├── [email protected]
│ │   └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ └─┬ [email protected]
│   ├── [email protected]
│   └── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
├── [email protected]
├── [email protected]
└─┬ [email protected]
  └── [email protected]

overridable styles

I want to think about how styles work in patchbay. The current way isn't working for everyone, and this is causing @evbogue to maintain a separate fork of patchbay (that isn't efficient!). ev is the vanguard of this, but there are also other projects based on tweaking patchbay (entropy, pangea) so I think this is an important thing for us to consider.

The first thing that comes to mind is that patchbay has a mcss socket which is called as a map (calls all mcss plugs), but it also has a css socket!

My first suggestion is to use only css and just have plugs which want to use mcss compile it themselves, and give a css plug only https://github.com/ssbc/patchbay/blob/master/modules_core/style/styles.js#L24 This would mean there is only one thing to think about.

The problem with calling things as a map is that there is no way to remove items. one simple solution that comes to mind immediately is to instead use a reduce socket. instead of just returning the css for the current module, you'd have a signature like this:

var my_style = '' //your css here, generated from mcss or whatever
module.exports = {
  gives: {css: true},
  create: function () {
    return {css: function (style) { return style + my_style }}
  }
}

that would mean you could have a module that just ignored every other css plug like this:

//no-style.js
module.exports = {
  gives: 'css',
  create: function () {
    return function (style) { return '' } //set style to empty
  }
}

then you'd load that in when you combine the depject modules...

require('depject')(
  require('patchbay'),
  require('./no-style'),
  require('./modules-with-new-styles')
)

That is one approach that would require minimal changes to the current code. I think there are a few other approaches that could work as well, and we should explore these a bit.

how to add a page to the side nav thingy

hey! so patchlite has a special page (/config) for configuring the uxer's key or remote. it'd be sweet if we could add this page to the side nav thingy, so it's discoverable and easy to open. is there a depject plug for this already, or how can we make this happen?

Param 0 must have a .content of type "object"

This error appears when I try to send private messages in Patchbay.

I've gotten this error a few times since pulling the latest master.

When I hit the Publish button and confirm, this appears in the errors tab:

Param 0 must have a .content of type "object"
UsageError: Param 0 must have a .content of type "object"
    at Error.ZE (/home/ev/builds/patchwork/node_modules/zerr/index.js:11:42)
    at ZError (/home/ev/builds/patchwork/node_modules/zerr/index.js:13:14)
    at Object.module.exports.valid.msg (/home/ev/builds/patchwork/node_modules/scuttlebot/lib/validators.js:42:14)
    at validate (/home/ev/builds/patchwork/node_modules/muxrpc-validation/index.js:130:15)
    at Object.<anonymous> (/home/ev/builds/patchwork/node_modules/muxrpc-validation/index.js:78:17)
    at Object.hooked (/home/ev/builds/patchwork/node_modules/hoox/index.js:10:15)
    at Object.localCall (/home/ev/builds/patchwork/node_modules/muxrpc/local-api.js:31:31)
    at Object.<anonymous> (/home/ev/builds/patchwork/node_modules/muxrpc/local-api.js:37:22)
    at Object.PacketStream.request (/home/ev/builds/patchwork/node_modules/muxrpc/stream.js:46:17)
    at PacketStream._onrequest (/home/ev/builds/patchwork/node_modules/packet-stream/index.js:149:17)

Add npm scripts and -g dependencies?

It seems like the

npm install electro electron-prebuilt -g
electro index.js

stuff could be added as dependencies and an npm script to automate those steps.

Is there a reason you didn't do that here?

no blob crash

On pulling 1.8.2 sbot server is crashing on my local when I run CHLORIDE_JS=1 electro index.js on my local. I (re)installed ssb-ws, ssb-links, and ssb-query just to be sure that wasn't it.

Error: no blob:&qjeAs8+uMXLlyovT4JnEpMwTNDx/QXHfOl2nv2u0VCM=.sha256
    at /home/ev/.ssb/node_modules/ssb-ws/node_modules/multiblob-http/index.j
s:39:23
    at /usr/lib/node_modules/scuttlebot/node_modules/multiblob/index.js:141:
15
    at continuation (/usr/lib/node_modules/scuttlebot/node_modules/continuab
le-list/index.js:24:25)
    at /usr/lib/node_modules/scuttlebot/node_modules/multiblob/index.js:114:
9
    at done (/usr/lib/node_modules/scuttlebot/node_modules/multiblob/index.j
s:41:38)
    at FSReqWrap.oncomplete (fs.js:123:15)
/usr/lib/node_modules/scuttlebot/node_modules/libsodium/dist/modules/libsodi
um.js:14
var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};v
ar moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){
moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=typeof window==="ob
ject";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRO
NMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIR
ONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_
IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=function print(x){process["stdout"].write(x+"\n")};if(!Module["printErr"])Module["printErr"]=function printErr(x){process["stderr"].write(x+"\n")};var nodeFS=require("fs");var nodePath=require("path");Module["read"]=function read(filename,binary){filename=nodePath["normalize"](filename);var ret=nodeFS["readFileSync"](filename);if(!ret&&filename!=nodePath["resolve"](

Error: Can't render headers after they are sent to the client
    at ServerResponse.OutgoingMessage._renderHeaders (_http_outgoing.js:399:11)
    at ServerResponse.writeHead (_http_server.js:184:20)
    at /home/ev/.ssb/node_modules/ssb-ws/node_modules/multiblob-http/index.js:41:13
    at /usr/lib/node_modules/scuttlebot/node_modules/multiblob/index.js:141:15
    at continuation (/usr/lib/node_modules/scuttlebot/node_modules/continuable-list/index.js:24:25)
    at /usr/lib/node_modules/scuttlebot/node_modules/multiblob/index.js:114:9
    at done (/usr/lib/node_modules/scuttlebot/node_modules/multiblob/index.js:41:38)
    at FSReqWrap.oncomplete (fs.js:123:15)

initial sync

way to use an invite code, or follow on local network.
show a progress bar when loading, don't try to render all messages, because that will make it take much longer. if pubs are running scuttlebot@>=8.3.2 then it should load pretty fast.

glitch: pub always shows up with id as name

I haven't seen this happen to any other pub, but for some reason my pub always shows up as its' msg.key in Patchbay. I tried naming it a handful of times, and that didn't appear to help.

Is this a bug in ssb-avatar or did I publish a whack message from my pub? Unclear.

In Patchwork my pub shows up with the self-assigned name: evbogue.com

2016-07-20-114514_648x503_scrot

bulk-require is a bad idea

This issue is a note about my objections to bulk-require, I know I'm not currently the main maintainer, so I'm not gonna force anyone on this, but just gonna point out the problems as I see them, but I acknowledge this is not my decision.

First of all: how bulk-require bit me. I had been running v6, and then I checked out 7 and it just acted weird.
turns out, I still had a ./build directory, which was not checked in, as a artifact of v6. But this was being included as part of bulk load, because it was part of '!(node_modules|junk)/**/*.js'.

In this case, it broke things, and was obvious something was wrong, but in a different situation it could have broken things in a way that wasn't obvious. It wasn't a security hole, but this is how security holes happen - it was an unintended data flow. I think it's much better to be completely explicit about what code is included or not.

For example, maybe later we need some scripts to do something in patchbay, and we write some scripts, maybe if you include these scripts they don't seem to do anything, but actually they introduce a security vulnerability. It doesn't look like a vulnerability when it's just run as a script, so it gets merged, but the merger forgets that it should be excluded from the bulk-require glob, because it doesn't break anything.

If it was explicit, then for the scripts directory to be added, there would have to be a commit that adds it, making it less likely it happens by accident, also this wouldn't have loaded the js in the build folder either.

I tried to change the negative glob into a positive glob that at least explicitly lists the directories to load code from, but bulk-require doesn't even document the negative globs, so I tried a few things and it didn't work.

This is not simple. It's using magic not to fight dragons, or to give genuinely new capabilities, just for lazyness.

Read any fairytale, using magic for lazy reasons ends in tragedy.

The honest/explicit solution is to run bulkify manually, and check the result into git, nothing wrong with that. You always know what you are getting then.

/cc @ahdinosaur @mmckegg @mixmix

location/cmd bar

@clehner's search is pretty handy, but it gets in the way when the screen is narrow.

screenshot_narrow-search

my idea: move to just below the tabs, like the browser location bar.

then, on whatever tab you are on, the location bar shows the raw location. i.e. the message hash, feed id, /public /private, etc or search term.

The tab name can then be a human readable name (i.e. feed name or first line of root message in thread)

we can also use this for things like invites codes. just paste the invite code into the location bar to use it.

hide channel field on replies that are not in channels

I just noticed that when a reply is to a thread that is not in a channel, the channel input is still shown. When it is a reply to a thread that is in a channel, the channel input is frozen, so this only effects threads which are not already in channels.

I think it would make the most sense just to hide the channel input on replies.

btw, I am on 6.10.0 de80e70

Traceback when changing date of gathering

The date change is actually published, but then an error tab pops up with this:

TypeError: Cannot read property 'minDate' of undefined
    at isEnabled (/home/stuart/src/patchbay/node_modules/flatpickr/dist/flatpickr.js:921:18)
    at /home/stuart/src/patchbay/node_modules/flatpickr/dist/flatpickr.js:1367:32
    at Array.filter (native)
    at setSelectedDate (/home/stuart/src/patchbay/node_modules/flatpickr/dist/flatpickr.js:1366:43)
    at Flatpickr.setDate (/home/stuart/src/patchbay/node_modules/flatpickr/dist/flatpickr.js:1378:3)
    at Array.startDateTime (/home/stuart/src/patchbay/node_modules/patch-gatherings/gathering/html/startDateTime.js:44:42)
    at Observable.observable.set (/home/stuart/src/patchbay/node_modules/mutant/value.js:12:25)
    at /home/stuart/src/patchbay/node_modules/pull-stream/sinks/drain.js:24:37
    at /home/stuart/src/patchbay/node_modules/pull-stream/throughs/map.js:19:9
    at /home/stuart/src/patchbay/node_modules/pull-stream/throughs/map.js:19:9

Sort channel messages chronologically

Caveat: I'm only about 10 minutes in to using ssb and patchbay.

Following the README here, I got the sbot server set up w/ plugins, and restarted. Connected to a pub (@pub_cel) w/ invite from IRC, followed @pub_cel, and opened #scuttlebutt channel.

Plenty of messages appear in the tab, but they don't seem to be in any sort of order. (I see, in order, 1 msg from 12 minutes ago, 5 from 7 months ago, 5 from 3 days ago, etc.)

Is this the wrong place for this issue? Is it user error? Apologies if so.

Error: could not connect to sbot (lite client)

I'm still working of Cryptix's build of Patchbay for the lite client.

When I run npm run build and navigate to the file in my browser I see this error:

When I use an invite code, I also see this error after pressing 'accept'.

Error: could not connect to sbot
    at file:///home/ev/patchbay/index.html:24294:23
    at file:///home/ev/patchbay/index.html:18060:24
    at onConnect (file:///home/ev/patchbay/index.html:18278:11)
    at WebSocket.<anonymous> (file:///home/ev/patchbay/index.html:21760:13)
    at WebSocket.onError (file:///home/ev/patchbay/index.html:30976:14)
    at WebSocket.EventEmitter.emit (file:///home/ev/patchbay/index.html:48933:17)
    at response (file:///home/ev/patchbay/index.html:31245:12)
  Error: unexpected server response (404)
    at response (file:///home/ev/patchbay/index.html:31243:15)
    at g (file:///home/ev/patchbay/index.html:49017:16)
    at EventEmitter.emit (file:///home/ev/patchbay/index.html:48933:17)
    at ClientRequest._connect (file:///home/ev/patchbay/index.html:60744:7)
    at file:///home/ev/patchbay/index.html:60648:9

If I try to hard code my ws server with localStorage.remote, in the console I see:

GET http://evbogue.com:8989/ 404 (Not Found)

TypeError: Param 1 must by of type object

I've hit error this a few times, so making an issue.

When I reach the installation step where I am installing sbot plugins, I get this error

[ev@arch patchbay]$ sbot plugins.install ssb-links ssb-query
error loading sodium bindings: Cannot find module 'chloridedown/build/Release/sodium'
falling back to javascript version.
TypeError: Param 1 must by of type object
Install a plugin to Scuttlebot.

install {nodeModule} [--from path]

Calls out to npm to install a package into `~/.ssb/node_modules`.

-   nodeModule (string): The name of the plugin to install. Uses npm's module package-name rules.
-   from (string): A location to install from (directory path, url, or any location that npm accepts for its install command).

Is there a manual way to install the plugins?

extract a `layout` module (to enable vert/ horiz tabs)

from : #69 (comment)

I reckon the way we do the minbay thing (with vertical tabs) is there is a module called layout which provides the top level wrapper (minbay, patchbay, and patchwork-next all have their own layouts) If we split the basic set into api and layout I think that will work. (and maybe we'll have to separate layout style from other style)

Reply to reply disappears

If you open a tab for a message that is a reply, and you compose and publish a reply there, your message disappears from the compose box but does not appear in the tab. This makes it look like patchbay "ate" the message and led to me posting a duplicate reply today. I think the rest of a thread should render under a reply, or the composer shouldn't be there.

Sigil for git repos

It would be useful for a new sigil to be added to look up git repos by name.

`index.html` and `bundle.js` are big

The built files index.html and bundle.js are big (2mb each, 500k gz'd). It makes cloning and fetching slower. Also it adds garbage to when using git grep. Do these files need to be checked in to git, or can be they be added in a prepublish script or manual step (or pushed only to gh-pages)?

sbot crash on installation attempt

I'm having trouble installing patchbay. Following the instructions, I install scuttlebot@latest, then..

[sww@figure8 patchbay]$ sbot plugins.install ssb-links
Installing "ssb-links"...

> [email protected] install /tmp/node_modules/ssb-links/node_modules/leveldown
> prebuild-install || node-gyp rebuild

prebuild-install info begin Prebuild-install version 2.1.0
prebuild-install info looking for local prebuild @ prebuilds/leveldown-v1.6.0-node-v51-linux-x64.tar.gz
prebuild-install info looking for cached prebuild @ /home/sww/.npm/_prebuilds/https-github.com-level-leveldown-releases-download-v1.6.0-leveldown-v1.6.0-node-v51-linux-x64.tar.gz
prebuild-install info found cached prebuild 
prebuild-install info unpacking @ /home/sww/.npm/_prebuilds/https-github.com-level-leveldown-releases-download-v1.6.0-leveldown-v1.6.0-node-v51-linux-x64.tar.gz
prebuild-install info unpack resolved to /tmp/node_modules/ssb-links/node_modules/leveldown/build/Release/leveldown.node
prebuild-install info unpack required /tmp/node_modules/ssb-links/node_modules/leveldown/build/Release/leveldown.node successfully
prebuild-install info install Prebuild successfully installed!
- [email protected] node_modules/ssb-links/node_modules/abbrev
- [email protected] node_modules/ssb-links/node_modules/after
- [email protected] node_modules/ssb-links/node_modules/ansi
- [email protected] node_modules/ssb-links/node_modules/ansi-styles
- [email protected] node_modules/ssb-links/node_modules/asn1
- [email protected] node_modules/ssb-links/node_modules/assert-plus
- [email protected] node_modules/ssb-links/node_modules/asynckit
- [email protected] node_modules/ssb-links/node_modules/aws-sign2
- [email protected] node_modules/ssb-links/node_modules/aws4
- [email protected] node_modules/ssb-links/node_modules/balanced-match
- [email protected] node_modules/ssb-links/node_modules/block-stream
- [email protected] node_modules/ssb-links/node_modules/caseless
- [email protected] node_modules/ssb-links/node_modules/chalk/node_modules/supports-color
- [email protected] node_modules/ssb-links/node_modules/concat-map
- [email protected] node_modules/ssb-links/node_modules/brace-expansion
- [email protected] node_modules/ssb-links/node_modules/dashdash/node_modules/assert-plus
- [email protected] node_modules/ssb-links/node_modules/dashdash
- [email protected] node_modules/ssb-links/node_modules/delayed-stream
- [email protected] node_modules/ssb-links/node_modules/combined-stream
- [email protected] node_modules/ssb-links/node_modules/duplexer2
- [email protected] node_modules/ssb-links/node_modules/es6-symbol
- [email protected] node_modules/ssb-links/node_modules/es6-iterator
- [email protected] node_modules/ssb-links/node_modules/es5-ext
- [email protected] node_modules/ssb-links/node_modules/d
- [email protected] node_modules/ssb-links/node_modules/escape-string-regexp
- [email protected] node_modules/ssb-links/node_modules/extend
- [email protected] node_modules/ssb-links/node_modules/extsprintf
- [email protected] node_modules/ssb-links/node_modules/forever-agent
- [email protected] node_modules/ssb-links/node_modules/fs.realpath
- [email protected] node_modules/ssb-links/node_modules/generate-function
- [email protected] node_modules/ssb-links/node_modules/getpass/node_modules/assert-plus
- [email protected] node_modules/ssb-links/node_modules/getpass
- [email protected] node_modules/ssb-links/node_modules/graceful-fs
- [email protected] node_modules/ssb-links/node_modules/graceful-readlink
- [email protected] node_modules/ssb-links/node_modules/commander
- [email protected] node_modules/ssb-links/node_modules/has-ansi
- [email protected] node_modules/ssb-links/node_modules/chalk
- [email protected] node_modules/ssb-links/node_modules/hoek
- [email protected] node_modules/ssb-links/node_modules/boom
- [email protected] node_modules/ssb-links/node_modules/cryptiles
- [email protected] node_modules/ssb-links/node_modules/inflight
- [email protected] node_modules/ssb-links/node_modules/is-property
- [email protected] node_modules/ssb-links/node_modules/generate-object-property
- [email protected] node_modules/ssb-links/node_modules/is-typedarray
- [email protected] node_modules/ssb-links/node_modules/isexe
- [email protected] node_modules/ssb-links/node_modules/isstream
- [email protected] node_modules/ssb-links/node_modules/jsbn
- [email protected] node_modules/ssb-links/node_modules/ecc-jsbn
- [email protected] node_modules/ssb-links/node_modules/jodid25519
- [email protected] node_modules/ssb-links/node_modules/json-schema
- [email protected] node_modules/ssb-links/node_modules/json-stringify-safe
- [email protected] node_modules/ssb-links/node_modules/jsonpointer
- [email protected] node_modules/ssb-links/node_modules/is-my-json-valid
- [email protected] node_modules/ssb-links/node_modules/lodash
- [email protected] node_modules/ssb-links/node_modules/async
- [email protected] node_modules/ssb-links/node_modules/lodash.pad
- [email protected] node_modules/ssb-links/node_modules/lodash.padend
- [email protected] node_modules/ssb-links/node_modules/lodash.padstart
- [email protected] node_modules/ssb-links/node_modules/mime-db
- [email protected] node_modules/ssb-links/node_modules/mime-types
- [email protected] node_modules/ssb-links/node_modules/form-data
- [email protected] node_modules/ssb-links/node_modules/minimatch
- [email protected] node_modules/ssb-links/node_modules/ms
- [email protected] node_modules/ssb-links/node_modules/debug
- [email protected] node_modules/ssb-links/node_modules/array-index
- [email protected] node_modules/ssb-links/node_modules/node-ninja/node_modules/gauge
- [email protected] node_modules/ssb-links/node_modules/node-ninja/node_modules/npmlog
- [email protected] node_modules/ssb-links/node_modules/nopt
- [email protected] node_modules/ssb-links/node_modules/oauth-sign
- [email protected] node_modules/ssb-links/node_modules/os-tmpdir
- [email protected] node_modules/ssb-links/node_modules/osenv
- [email protected] node_modules/ssb-links/node_modules/path-array
- [email protected] node_modules/ssb-links/node_modules/path-is-absolute
- [email protected] node_modules/ssb-links/node_modules/glob
- [email protected] node_modules/ssb-links/node_modules/pinkie
- [email protected] node_modules/ssb-links/node_modules/pinkie-promise
- [email protected] node_modules/ssb-links/node_modules/har-validator
- [email protected] node_modules/ssb-links/node_modules/punycode
- [email protected] node_modules/ssb-links/node_modules/qs
- [email protected] node_modules/ssb-links/node_modules/rimraf
- [email protected] node_modules/ssb-links/node_modules/fstream
- [email protected] node_modules/ssb-links/node_modules/simple-mime
- [email protected] node_modules/ssb-links/node_modules/sntp
- [email protected] node_modules/ssb-links/node_modules/hawk
- [email protected] node_modules/ssb-links/node_modules/sshpk/node_modules/assert-plus
- [email protected] node_modules/ssb-links/node_modules/stringstream
- [email protected] node_modules/ssb-links/node_modules/tar
- [email protected] node_modules/ssb-links/node_modules/through2/node_modules/readable-stream
- [email protected] node_modules/ssb-links/node_modules/through2
- [email protected] node_modules/ssb-links/node_modules/hyperquest
- [email protected] node_modules/ssb-links/node_modules/jsonist
- [email protected] node_modules/ssb-links/node_modules/ghutils
- [email protected] node_modules/ssb-links/node_modules/ghrepos
- [email protected] node_modules/ssb-links/node_modules/tough-cookie
- [email protected] node_modules/ssb-links/node_modules/tweetnacl
- [email protected] node_modules/ssb-links/node_modules/bcrypt-pbkdf
- [email protected] node_modules/ssb-links/node_modules/sshpk
- [email protected] node_modules/ssb-links/node_modules/url-template
- [email protected] node_modules/ssb-links/node_modules/ghreleases
- [email protected] node_modules/ssb-links/node_modules/util-extend
- [email protected] node_modules/ssb-links/node_modules/execspawn
- [email protected] node_modules/ssb-links/node_modules/uuid
- [email protected] node_modules/ssb-links/node_modules/verror
- [email protected] node_modules/ssb-links/node_modules/jsprim
- [email protected] node_modules/ssb-links/node_modules/http-signature
- [email protected] node_modules/ssb-links/node_modules/request
- [email protected] node_modules/ssb-links/node_modules/which
- [email protected] node_modules/ssb-links/node_modules/node-gyp
- [email protected] node_modules/ssb-links/node_modules/node-ninja
- [email protected] node_modules/ssb-links/node_modules/prebuild
[email protected] /tmp
└─┬ [email protected] 
  └─┬ [email protected]
    └─┬ [email protected] 
      └─┬ [email protected] 
        ├── [email protected] 
        └─┬ [email protected] 
          └─┬ [email protected]
            └─┬ [email protected]
              └─┬ [email protected] 
                └── [email protected] 

Exception thrown by PacketStream substream end handler Error: unexpected end of parent stream
    at PacketStream.destroy (/home/sww/.npm-global/lib/node_modules/scuttlebot/node_modules/packet-stream/index.js:68:7)
    at PacketStream.write (/home/sww/.npm-global/lib/node_modules/scuttlebot/node_modules/packet-stream/index.js:121:41)
    at source (/home/sww/.npm-global/lib/node_modules/scuttlebot/node_modules/muxrpc/pull-weird.js:43:24)
    at /home/sww/.npm-global/lib/node_modules/scuttlebot/node_modules/pull-goodbye/endable.js:6:7
    at /home/sww/.npm-global/lib/node_modules/scuttlebot/node_modules/pull-through/index.js:31:16
    at /home/sww/.npm-global/lib/node_modules/scuttlebot/node_modules/pull-through/index.js:31:16
    at source (/home/sww/.npm-global/lib/node_modules/scuttlebot/node_modules/pull-pair/index.js:21:7)
    at /home/sww/.npm-global/lib/node_modules/scuttlebot/node_modules/pull-cat/index.js:7:11
    at Array.forEach (native)
    at abortAll (/home/sww/.npm-global/lib/node_modules/scuttlebot/node_modules/pull-cat/index.js:6:7)
Error: unexpected end of parent stream
    at PacketStream.destroy (/home/sww/.npm-global/lib/node_modules/scuttlebot/node_modules/packet-stream/index.js:68:7)
    at PacketStream.write (/home/sww/.npm-global/lib/node_modules/scuttlebot/node_modules/packet-stream/index.js:121:41)
    at source (/home/sww/.npm-global/lib/node_modules/scuttlebot/node_modules/muxrpc/pull-weird.js:43:24)
    at /home/sww/.npm-global/lib/node_modules/scuttlebot/node_modules/pull-goodbye/endable.js:6:7
    at /home/sww/.npm-global/lib/node_modules/scuttlebot/node_modules/pull-through/index.js:31:16
    at /home/sww/.npm-global/lib/node_modules/scuttlebot/node_modules/pull-through/index.js:31:16
    at source (/home/sww/.npm-global/lib/node_modules/scuttlebot/node_modules/pull-pair/index.js:21:7)
    at /home/sww/.npm-global/lib/node_modules/scuttlebot/node_modules/pull-cat/index.js:7:11
    at Array.forEach (native)
    at abortAll (/home/sww/.npm-global/lib/node_modules/scuttlebot/node_modules/pull-cat/index.js:6:7)

Meanwhile, sbot crashes:

[sww@figure8 ~]$ sbot server
Loading plugins from /home/sww/.ssb/node_modules
Log level: notice
fs.js:871
  return binding.readdir(pathModule._makeLong(path), options.encoding);
                 ^

Error: ENOENT: no such file or directory, scandir '/tmp/ssb-links/node_modules'
    at Object.fs.readdirSync (fs.js:871:18)
    at ChildProcess.<anonymous> (/home/sww/.npm-global/lib/node_modules/scuttlebot/plugins/plugins.js:122:29)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:885:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:501:12)

TypeError: mainWindow.loadUrl is not a function

Just tried to install patchbay following the readme but got this:

~/patchbay(master|…) % electro index.js                                                                                                                                                                                                                                   
/home/cryptix/patchbay/node_modules/electro/index.js:54
  mainWindow.loadUrl('file://' + path.join(__dirname, 'index.html') + '?' +
             ^

TypeError: mainWindow.loadUrl is not a function
    at EventEmitter.next (/home/cryptix/patchbay/node_modules/electro/index.js:54:14)
    at emitOne (events.js:101:20)
    at EventEmitter.emit (events.js:188:7)

I guess this is related to #1.

Also, attached npm ls and versions:

~/patchbay(master|…) % uname -a && npm -v && node -v
Linux higgsArchOne 4.6.2-1-ARCH #1 SMP PREEMPT Wed Jun 8 08:40:59 CEST 2016 x86_64 GNU/Linux
3.9.6
v6.2.2

Error on run in 1.7.0

Uncaught TypeError: Cannot read property 'port' of undefined
  module.exports @ /usr/local/src/patchbay/node_modules/ssb-client/index.js:54
  (anonymous function) @ /usr/local/src/patchbay/sbot-api.js:38
  module.exports @ /usr/local/src/patchbay/node_modules/pull-reconnect/index.js:67
  module.exports @ /usr/local/src/patchbay/sbot-api.js:33
  (anonymous function) @ /usr/local/src/patchbay/index.js:21

Tests failing

Hi,
I installed patchbay using the "official" instructions, everything is working correctly.

Unfortunately, when I run the tests, it failed, here is the trace:

eliott@tux:~/Documents/Blockchain/ssbc/patchbay$ npm run test

> [email protected] test /home/eliott/Documents/Blockchain/ssbc/patchbay
> browserify modules_*/index.test.js | tape-run

{ public: { v4: undefined, v6: undefined },
  private: { v4: undefined, v6: undefined } }
error loading sodium bindings: Cannot find module 'sodium-prebuilt/build/Release/sodium'
falling back to javascript version.
TypeError: fs.existsSync is not a function
    at Object.<anonymous> (file:///home/eliott/Documents/Blockchain/ssbc/patchbay/.source.1488655721855.html:9267:8)
    at Object.123.fs (file:///home/eliott/Documents/Blockchain/ssbc/patchbay/.source.1488655721855.html:9273:4)
    at s (file:///home/eliott/Documents/Blockchain/ssbc/patchbay/.source.1488655721855.html:1:262)
    at file:///home/eliott/Documents/Blockchain/ssbc/patchbay/.source.1488655721855.html:1:313
    at Object.<anonymous> (file:///home/eliott/Documents/Blockchain/ssbc/patchbay/.source.1488655721855.html:3228:16)
    at Object.58.../h (file:///home/eliott/Documents/Blockchain/ssbc/patchbay/.source.1488655721855.html:3479:4)
    at s (file:///home/eliott/Documents/Blockchain/ssbc/patchbay/.source.1488655721855.html:1:262)
    at file:///home/eliott/Documents/Blockchain/ssbc/patchbay/.source.1488655721855.html:1:313
    at Object.46../app (file:///home/eliott/Documents/Blockchain/ssbc/patchbay/.source.1488655721855.html:2509:11)
    at s (file:///home/eliott/Documents/Blockchain/ssbc/patchbay/.source.1488655721855.html:1:262)

npm ERR! Linux 4.4.0-62-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "test"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] test: `browserify modules_*/index.test.js | tape-run`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] test script 'browserify modules_*/index.test.js | tape-run'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the patchbay package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     browserify modules_*/index.test.js | tape-run
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs patchbay
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls patchbay
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/eliott/Documents/Blockchain/ssbc/patchbay/npm-debug.log
eliott@tux:~/Documents/Blockchain/ssbc/patchbay$ cat ./npm-debug.log 
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'run', 'test' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'pretest', 'test', 'posttest' ]
5 info lifecycle [email protected]~pretest: [email protected]
6 silly lifecycle [email protected]~pretest: no script for pretest, continuing
7 info lifecycle [email protected]~test: [email protected]
8 verbose lifecycle [email protected]~test: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]~test: PATH: /usr/share/npm/bin/node-gyp-bin:/home/eliott/Documents/Blockchain/ssbc/patchbay/node_modules/.bin:/home/eliott/bin:/home/eliott/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
10 verbose lifecycle [email protected]~test: CWD: /home/eliott/Documents/Blockchain/ssbc/patchbay
11 silly lifecycle [email protected]~test: Args: [ '-c', 'browserify modules_*/index.test.js | tape-run' ]
12 silly lifecycle [email protected]~test: Returned: code: 1  signal: null
13 info lifecycle [email protected]~test: Failed to exec test script
14 verbose stack Error: [email protected] test: `browserify modules_*/index.test.js | tape-run`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/usr/share/npm/lib/utils/lifecycle.js:232:16)
14 verbose stack     at emitTwo (events.js:87:13)
14 verbose stack     at EventEmitter.emit (events.js:172:7)
14 verbose stack     at ChildProcess.<anonymous> (/usr/share/npm/lib/utils/spawn.js:24:14)
14 verbose stack     at emitTwo (events.js:87:13)
14 verbose stack     at ChildProcess.emit (events.js:172:7)
14 verbose stack     at maybeClose (internal/child_process.js:821:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
15 verbose pkgid [email protected]
16 verbose cwd /home/eliott/Documents/Blockchain/ssbc/patchbay
17 error Linux 4.4.0-62-generic
18 error argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "test"
19 error node v4.2.6
20 error npm  v3.5.2
21 error code ELIFECYCLE
22 error [email protected] test: `browserify modules_*/index.test.js | tape-run`
22 error Exit status 1
23 error Failed at the [email protected] test script 'browserify modules_*/index.test.js | tape-run'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the patchbay package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     browserify modules_*/index.test.js | tape-run
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs patchbay
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls patchbay
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

I can see here some infos:

  • it cannot load the sodium bindings, maybe because I need to install something else
  • it seems that something is calling fs.existsSync as a function

The following error (extracted from the previous logs) might help:

14 verbose stack Error: [email protected] test: `browserify modules_*/index.test.js | tape-run`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/usr/share/npm/lib/utils/lifecycle.js:232:16)
14 verbose stack     at emitTwo (events.js:87:13)
14 verbose stack     at EventEmitter.emit (events.js:172:7)
14 verbose stack     at ChildProcess.<anonymous> (/usr/share/npm/lib/utils/spawn.js:24:14)
14 verbose stack     at emitTwo (events.js:87:13)
14 verbose stack     at ChildProcess.emit (events.js:172:7)
14 verbose stack     at maybeClose (internal/child_process.js:821:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

PS: I know, scuttlebot/patchbay isn't a blockchain 😄

make tabs.js just another screen_view

I think we should treat tabs as just another screen view. and use the # in the browser as a way to set UI state, that way, we can link to {bootstrap_server}#{invite_code}#{welcome_message} and you'll be able to send someone that code, get them in the network, and then lead them to an welcome message from you explaining what you have just gotten them into.

It also means the UI is highly composable, which is surely a good thing. This does also means we'll need to refactor some stuff that assumes tabs is the top level and a singleton.

How to run patchbay on a mobile phone

@evbogue mentioned it's possible to run patchbay lite on a mobile phone.

Here are the steps I took to make patchbay lite work on my laptop:

cd patchbay
npm run lite
sbot server --allowPrivate
sbot invite.create --modern (in another terminal)
o file:///home/oren/p/patchbay/build/index.html#ws://localhost:8989~shs:Q1w9hSUpspxVVbGMuemxiOca7G0Q7FcFY5oflmkjJLk=:tGBXvR0NzVlmVhzbitJEexX5Sg3AAgYLb7NQSDM9NgQ=

Now, how do I run patchbay on my mobile phone?

Thanks!

Easily copyable links

we need some sort of icon to show whether a link is internal or external.
and I think we also need a right click-menu (in electron) that allows you to select the target of the link.

tab width uneven

something has broken the css that keeps the tabs evenly wide.

currently looks like this - can't tell the difference between public and private tabs

patchbay_tabs-uneven

The chess route splits the page into two when closing the tab then opening it again

If you close the 'chess' tab, then open it again, you end up with the page being added to the DOM again at the bottom: http://imgur.com/63jP4J7

I'm not sure if the fix should happen at the ssb-chess side (perhaps https://github.com/Happy0/ssb-chess/pull/14/files) or whether in patchbay (and any other app that follows the app.html.page and app.html.menuItem 'contract') closing a tab should also clean up the DOM.

Any thoughts? :)

does not understand avatar images created by patchwork@3

I noticed that this %27s00//GQ1HOlcZboX43q8c7tWB5DnljJPFbBde/+c8=.sha256 message was showing in the feed, but not showing as the avatar for other posts by clarke. looking closer, it doesn't have a link
property:

{
  "key": "%27s00//GQ1HOlcZboX43q8c7tWB5DnljJPFbBde/+c8=.sha256",
  "value": {
    "previous": "%0dEz6DPoTXkUuRjXXmEPgJC2kNAOPqtaccMkG/RLt1Q=.sha256",
    "author": "@iii/pg320nKa62v1ohHctlhrXYPmY5BzZ1dRjypd7Cg=.ed25519",
    "sequence": 27,
    "timestamp": 1490353167852,
    "hash": "sha256",
    "content": {
      "type": "about",
      "about": "@iii/pg320nKa62v1ohHctlhrXYPmY5BzZ1dRjypd7Cg=.ed25519",
      "image": "&EjY2o1J32yYqYaGzAtr0uZEUCw7VMSSmAVTUaGVbncI=.sha256"
    },
    "signature": "M91yMd9UgJbuWYitW0SvC93yVBGPw+dfnUPiiQXspnUgwzkKQi+XMKL/e33QGDLWVHeA5LHf+9CJIhEhSrKcAA==.sig.ed25519"
  }
}

which makes https://github.com/ssbc/patchbay/blob/master/modules_basic/avatar/image.js#L35-L53 not detect it.

hmm, this is something that is handled by patchcore right?

build failing on mac osx sierra (10.12.2) "fatal error: 'openssl/rsa.h' file not found"

I have tried to follow the README steps but couldn't complete the npm run rebuild command on a mac os 10.12.2 The build fails with this error:

> [email protected] install /Users/fczuardi/github/patchbay/node_modules/ursa
> node-gyp rebuild

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

  CXX(target) Release/obj.target/ursaNative/src/ursaNative.o
In file included from ../src/ursaNative.cc:3:
../src/ursaNative.h:13:10: fatal error: 'openssl/rsa.h' file not found
#include <openssl/rsa.h>

Can't get 7.1.0 to start properly

electron index.js outputs the following. The process does not crash, but it never opens a window.

aljoscha@aljoscha-laptop ~/p/s/patchbay> npm start
> [email protected] start /home/aljoscha/projects/scuttleverse/patchbay
> electron index.js
App threw an error during load
ReferenceError: window is not defined
    at Object.<anonymous> (/home/aljoscha/projects/scuttleverse/patchbay/node_modules/pull-scroll/index.js:6:23)
    at Object.<anonymous> (/home/aljoscha/projects/scuttleverse/patchbay/node_modules/pull-scroll/index.js:109:3)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/aljoscha/projects/scuttleverse/patchbay/app/html/page/channel.js:3:18)
A JavaScript error occurred in the main process
Uncaught Exception:
ReferenceError: window is not defined
    at Object.<anonymous> (/home/aljoscha/projects/scuttleverse/patchbay/node_modules/pull-scroll/index.js:6:23)
    at Object.<anonymous> (/home/aljoscha/projects/scuttleverse/patchbay/node_modules/pull-scroll/index.js:109:3)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/aljoscha/projects/scuttleverse/patchbay/app/html/page/channel.js:3:18)
(node:31256) DeprecationWarning: 'GLOBAL' is deprecated, use 'global'

JSON

post an arbitary mesage type by pasting JSON into compose box?
we also need a way to view the raw json of a message.
simplest way to add that would be a view raw action, which takes to a tab that is just the raw view.
I guess we'd want a raw view of the feeds too?

Install instructions

I ran

npm install scuttlebot@latest -g

with no problems.

However the next step on checking for secure-scuttlebutt..

~/Desktop/golightly+ » npm ls secure-scuttlebutt -g
/Users/andrewgolightly/.nvm/versions/node/v6.2.2/lib
└── (empty)

npm ERR! code 1

Then I tried..

~/Desktop/golightly+ » npm ls -g
/Users/andrewgolightly/.nvm/versions/node/v6.2.2/lib
└── (empty)

I do see modules installed if I list the contents of that directory though..

~/Desktop/golightly+ » ll ~/.nvm/versions/node/v6.2.2/lib/node_modules
total 8
drwxr-xr-x  24 andrewgolightly  staff   816B 17 Jun 21:34 npm
drwxr-xr-x   8 andrewgolightly  staff   272B 24 Jun 23:23 npm-check-updates
drwxr-xr-x  14 andrewgolightly  staff   476B 13 Jul 08:50 patchwork
drwxr-xr-x  14 andrewgolightly  staff   476B 13 Jul 08:40 scuttlebot
lrwxr-xr-x   1 andrewgolightly  staff    47B 21 Jun 16:41 ssb-patchwork -> /Users/andrewgolightly/work/bitnation/patchwork

The after running sbot server, in a new tab I ran..

~ » sbot plugins.install ssb-links ssb-query
TypeError: Param 1 must by of type object
Install a plugin to Scuttlebot.

install {nodeModule} [--from path]

Calls out to npm to install a package into
`~/.ssb/node_modules`.

-   nodeModule (string): The name of the plugin to install.
Uses npm's module package-name rules.
-   from (string): A location to install from (directory path,
url, or any location that npm accepts for its install
command).

So I thought it had something to do with patchwork not being at the latest version.. so I tried

~ » npm install ssb-patchwork -g
npm ERR! Darwin 14.5.0
npm ERR! argv "/Users/andrewgolightly/.nvm/versions/node/v6.2.2/bin/node" "/Users/andrewgolightly/.nvm/versions/node/v6.2.2/bin/npm" "install" "ssb-patchwork" "-g"
npm ERR! node v6.2.2
npm ERR! npm  v3.9.5
npm ERR! path /Users/andrewgolightly/.nvm/versions/node/v6.2.2/lib/node_modules/ssb-patchwork
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall realpath

npm ERR! enoent ENOENT: no such file or directory, realpath '/Users/andrewgolightly/.nvm/versions/node/v6.2.2/lib/node_modules/ssb-patchwork'
npm ERR! enoent ENOENT: no such file or directory, realpath '/Users/andrewgolightly/.nvm/versions/node/v6.2.2/lib/node_modules/ssb-patchwork'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/andrewgolightly/npm-debug.log

.. and then gave up.

fs.readFileSync() in client code

hi, I tried to build index.html to serve it to a browser using

browserify main.js | indexhtmlify --title patchbay > build/index.html

(as mentioned in the Readme).

The resulting file however contains this call to fs.readFileSync and the browser actually hits that code.

I might be totally wrong about how this is meant to work :/

active tab events

we need some events about which the active tab is,
so that we can do things like, detect when there is new content available on a tab
and thus mark where you have read to.

also there is a bug where there an item gets added when you are not looking at the tab,
and then you go back to the tab, and it's still in the pull-scroll queue, and when you move the scrollbar it appears. it would probably be better to appear as soon as you switch to that tab.

Mysterious TypeError

This shows up sometimes on load in the errors tab or console:

TypeError: must start with number, buffer, array or string
    at fromObject (buffer.js:249:9)
    at Function.Buffer.from (buffer.js:115:10)
    at new Buffer (buffer.js:94:17)
    at EventEmitter.<anonymous> (file:///usr/local/src/patchbay/node_modules/electro/index.html?argv%3Delectro%26argv%3D.%26stdin%3D%26stderr%3D%26stdout%3D:24:23)
    at emitTwo (events.js:100:13)
    at EventEmitter.emit (events.js:185:7)

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.