git ssb

3+

cel-desktop / ssb-music-player



Add blob packaging method

%QqkqRZ73uY088K6cCjgQuLiiZ6ayvqUvttzCSnYJ26U=.sha256
Open cel-desktop wants to merge commits into main from blob
cel-desktop · 1/1/2021, 10:10:00 PM

Add blob packaging method

As requested by @farewellutopia in %f6ltg+C....

I package the app by rewriting index.html to replace the links to styles.css and dependencies.js with relative blob URLs. The build script, blobbify.js, outputs the resulting blob ids, along with a markdown link and some URLs for convenience.

The build script does not connect to ssb-server but adds blobs directly into the filesystem. It follows environmental variables ssb_appname and ssb_path, can be used with go-sbot by setting ssb_appname=ssb-go.

I implement "deslash" to ensure that the generated blob ids do not contain slashes, so they can be used with relative URLs where the blob id may or may not be URL-encoded.

Demo

Here is a resulting build: ssb-music-player-0.1.0.html.
Dependency blobs: dependencies.js, styles.css

Compatibility

This build technique works in ssb-ws with ssb-server. Try: http://localhost:8989/blobs/get/&Awi+rU8Xngiy9Kd51ekT18PBDWKwFTHrVzxTa5g9b3o=.sha256

It also works in patchfoo: http://localhost:8027/&Awi+rU8Xngiy9Kd51ekT18PBDWKwFTHrVzxTa5g9b3o=.sha256

It doesn't work in Oasis since the CSP is too strict.

It works somewhat with go-sbot's ssb-ws. The stylesheet does not load since the Content-type is not correct.

It doesn't work in git-ssb-web, because of the stylesheet Content-type and what looks like a bug causing the script to be truncated.

Content-type issues can be addressed for ssb-server's ssb-ws by setting query string parameter contentType= in the blob URL. Patchfoo also implements that interface. But git-ssb-web , go-sbot, and Oasis do not. A workaround for this could be to inline the stylesheet rather than load it from a blob. (Either programatically, or in the source). Or load it from a blob via XHR and adding it to the DOM.

Mobile

I don't know if this can work with Manyverse or Planetary. I don't think either of them linkify blob IDs in messages. Manyverse runs a local HTTP server, ssb-serve-blobs on port 26835. I'm not sure about planetary-ios. But first would be to see if Scuttle Shell Browser can work on Firefox for Android or iOS. It may be difficult since you don't have access to the user's secret file and can't load plugins. I don't know if Native Messaging works on mobile either.

%CapTUx2AgvYSJdAYRX8l2wrxFhLyrTF2OzED+NId/4g=.sha256 farewellutopia-dev · 1/3/2021, 1:04:39 PM

I'm looking into Scuttle Shell Browser on mobile, right now I'm trying to compile Manyverse. The idea would be to a geckoview based screen. As I understand something like native messaging is possible for geckoview but not in the Firefox App. An alternative approach would be a Firefox add-on that uses an ssb-browser-demo approach (see also: %qTwq2Z6...).

Built with git-ssb-web