ipfs improvements:
- fix ipfs for apple m1 osx builds by adding extra binary prebuilds (for now) - use <profile directory>/js-ipfs for ipfs repo - update to js-ipfs 0.10.6 bump to 1.5.2
This commit is contained in:
@@ -1,5 +1,10 @@
|
|||||||
## CHANGES
|
## CHANGES
|
||||||
|
|
||||||
|
v1.5.2
|
||||||
|
- App: IPFS: Configure js-ipfs repo directory to be in existing profile directory
|
||||||
|
- App: IPFS: Fix IPFS support for OSX M1 builds by including leveldown prebuilds
|
||||||
|
- Dependencies: update to wabac.js 2.9.1, wombat 3.3.3
|
||||||
|
|
||||||
v1.5.1
|
v1.5.1
|
||||||
- Library usage: Simplfy download options in editable mode, add warc/1.0 download opt (for archiveweb.page)
|
- Library usage: Simplfy download options in editable mode, add warc/1.0 download opt (for archiveweb.page)
|
||||||
- Library usage: Allow custom service worker init path on app init (or none)
|
- Library usage: Allow custom service worker init path on app init (or none)
|
||||||
|
|||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "replaywebpage",
|
"name": "replaywebpage",
|
||||||
"productName": "ReplayWeb.page",
|
"productName": "ReplayWeb.page",
|
||||||
"version": "1.5.1",
|
"version": "1.5.2",
|
||||||
"description": "Serverless Web Archive Replay",
|
"description": "Serverless Web Archive Replay",
|
||||||
"repository": "https://github.com/webrecorder/replayweb.page",
|
"repository": "https://github.com/webrecorder/replayweb.page",
|
||||||
"homepage": "https://replayweb.page/",
|
"homepage": "https://replayweb.page/",
|
||||||
@@ -9,13 +9,13 @@
|
|||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fortawesome/fontawesome-free": "^5.13.0",
|
"@fortawesome/fontawesome-free": "^5.13.0",
|
||||||
"@webrecorder/wabac": "^2.9.0-beta.1",
|
"@webrecorder/wabac": "^2.9.1",
|
||||||
"bulma": "^0.9.3",
|
"bulma": "^0.9.3",
|
||||||
"electron-log": "^4.3.0",
|
"electron-log": "^4.3.0",
|
||||||
"electron-updater": "^4.3.5",
|
"electron-updater": "^4.3.5",
|
||||||
"fetch-ndjson": "^1.1.0",
|
"fetch-ndjson": "^1.1.0",
|
||||||
"flexsearch": "^0.6.32",
|
"flexsearch": "^0.6.32",
|
||||||
"ipfs-core": "^0.5.2",
|
"ipfs-core": "^0.10.6",
|
||||||
"keyword-mark-element": "^0.1.2",
|
"keyword-mark-element": "^0.1.2",
|
||||||
"lit-element": "^2.4.0",
|
"lit-element": "^2.4.0",
|
||||||
"marked": "^1.0.0",
|
"marked": "^1.0.0",
|
||||||
|
|||||||
BIN
Binary file not shown.
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "replaywebpage",
|
"name": "replaywebpage",
|
||||||
"productName": "ReplayWeb.page",
|
"productName": "ReplayWeb.page",
|
||||||
"version": "1.5.1",
|
"version": "1.5.2",
|
||||||
"description": "Serverless Web Archive Replay",
|
"description": "Serverless Web Archive Replay",
|
||||||
"repository": "https://github.com/webrecorder/replayweb.page",
|
"repository": "https://github.com/webrecorder/replayweb.page",
|
||||||
"homepage": "https://replayweb.page/",
|
"homepage": "https://replayweb.page/",
|
||||||
@@ -9,13 +9,13 @@
|
|||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fortawesome/fontawesome-free": "^5.13.0",
|
"@fortawesome/fontawesome-free": "^5.13.0",
|
||||||
"@webrecorder/wabac": "^2.9.0-beta.1",
|
"@webrecorder/wabac": "^2.9.1",
|
||||||
"bulma": "^0.9.3",
|
"bulma": "^0.9.3",
|
||||||
"electron-log": "^4.3.0",
|
"electron-log": "^4.3.0",
|
||||||
"electron-updater": "^4.3.5",
|
"electron-updater": "^4.3.5",
|
||||||
"fetch-ndjson": "^1.1.0",
|
"fetch-ndjson": "^1.1.0",
|
||||||
"flexsearch": "^0.6.32",
|
"flexsearch": "^0.6.32",
|
||||||
"ipfs-core": "^0.5.2",
|
"ipfs-core": "^0.10.6",
|
||||||
"keyword-mark-element": "^0.1.2",
|
"keyword-mark-element": "^0.1.2",
|
||||||
"lit-element": "^2.4.0",
|
"lit-element": "^2.4.0",
|
||||||
"marked": "^1.0.0",
|
"marked": "^1.0.0",
|
||||||
|
|||||||
@@ -33,13 +33,18 @@ let IPFS = null;
|
|||||||
// ============================================================================
|
// ============================================================================
|
||||||
class NativeIPFSClient extends IPFSClient
|
class NativeIPFSClient extends IPFSClient
|
||||||
{
|
{
|
||||||
|
constructor(repoPath) {
|
||||||
|
super();
|
||||||
|
this.repoPath = repoPath;
|
||||||
|
}
|
||||||
|
|
||||||
async _doInitIPFS() {
|
async _doInitIPFS() {
|
||||||
if (!IPFS) {
|
if (!IPFS) {
|
||||||
IPFS = require("ipfs-core");
|
IPFS = require("ipfs-core");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.ipfs = await IPFS.create({
|
this.ipfs = await IPFS.create({
|
||||||
//repo: "/tmp/test-ipfs"
|
repo: this.repoPath,
|
||||||
init: {emptyRepo: true},
|
init: {emptyRepo: true},
|
||||||
//preload: {enabled: false},
|
//preload: {enabled: false},
|
||||||
});
|
});
|
||||||
@@ -72,7 +77,7 @@ class ElectronReplayApp
|
|||||||
|
|
||||||
this.screenSize = {width: 1024, height: 768};
|
this.screenSize = {width: 1024, height: 768};
|
||||||
|
|
||||||
this.ipfsClient = new NativeIPFSClient();
|
this.ipfsClient = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
get mainWindowWebPreferences() {
|
get mainWindowWebPreferences() {
|
||||||
@@ -140,6 +145,11 @@ class ElectronReplayApp
|
|||||||
app.setPath("userData", path.join(app.getPath("appData"), this.profileName));
|
app.setPath("userData", path.join(app.getPath("appData"), this.profileName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ipfsRepoPath = path.join(app.getPath("userData"), "js-ipfs");
|
||||||
|
console.log("ipfs path", ipfsRepoPath);
|
||||||
|
|
||||||
|
this.ipfsClient = new NativeIPFSClient(ipfsRepoPath);
|
||||||
|
|
||||||
app.on("will-finish-launching", () => {
|
app.on("will-finish-launching", () => {
|
||||||
app.on("open-file", (event, filePath) => {
|
app.on("open-file", (event, filePath) => {
|
||||||
this.openNextFile = filePath;
|
this.openNextFile = filePath;
|
||||||
@@ -300,7 +310,7 @@ class ElectronReplayApp
|
|||||||
if (request.method === "GET") {
|
if (request.method === "GET") {
|
||||||
const offset = start || 0;
|
const offset = start || 0;
|
||||||
const length = end ? end - start + 1 : size;
|
const length = end ? end - start + 1 : size;
|
||||||
data = Readable.from(this.ipfsClient.cat(ipfsCID, {offset, length}));
|
data = Readable.from(await this.ipfsClient.cat(ipfsCID, {offset, length}));
|
||||||
}
|
}
|
||||||
|
|
||||||
callback({statusCode, headers, data});
|
callback({statusCode, headers, data});
|
||||||
|
|||||||
+6
-4
@@ -4,6 +4,7 @@ const path = require("path");
|
|||||||
const webpack = require("webpack");
|
const webpack = require("webpack");
|
||||||
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||||||
const CopyPlugin = require("copy-webpack-plugin");
|
const CopyPlugin = require("copy-webpack-plugin");
|
||||||
|
const package_json = require("./package.json");
|
||||||
|
|
||||||
// fake url used in app to serve files
|
// fake url used in app to serve files
|
||||||
// can not use custom scheme due to service worker issues
|
// can not use custom scheme due to service worker issues
|
||||||
@@ -21,7 +22,7 @@ const GDRIVE_CLIENT_ID = "160798412227-tko4c82uopud11q105b2lvbogsj77hlg.apps.goo
|
|||||||
const BANNER_TEXT = "'[name].js is part of ReplayWeb.page (https://replayweb.page) Copyright (C) 2020-2021, Webrecorder Software. Licensed under the Affero General Public License v3.'";
|
const BANNER_TEXT = "'[name].js is part of ReplayWeb.page (https://replayweb.page) Copyright (C) 2020-2021, Webrecorder Software. Licensed under the Affero General Public License v3.'";
|
||||||
|
|
||||||
// IPFS ipfs-core lib url
|
// IPFS ipfs-core lib url
|
||||||
const IPFS_CORE_URL = "https://cdn.jsdelivr.net/npm/ipfs-core@0.7.1/dist/index.min.js";
|
const IPFS_CORE_URL = `https://cdn.jsdelivr.net/npm/ipfs-core@${package_json.dependencies["ipfs-core"].replace("^", "")}/dist/index.min.js`;
|
||||||
|
|
||||||
|
|
||||||
const electronMainConfig = (/*env, argv*/) => {
|
const electronMainConfig = (/*env, argv*/) => {
|
||||||
@@ -35,7 +36,8 @@ const electronMainConfig = (/*env, argv*/) => {
|
|||||||
alias: {
|
alias: {
|
||||||
"abort-controller": "abort-controller/dist/abort-controller.js",
|
"abort-controller": "abort-controller/dist/abort-controller.js",
|
||||||
"dlv": "dlv/dist/dlv.js",
|
"dlv": "dlv/dist/dlv.js",
|
||||||
"bignumber.js": "bignumber.js/bignumber.js"
|
"bignumber.js": "bignumber.js/bignumber.js",
|
||||||
|
"multiformats/hashes/sha2": "multiformats/cjs/src/hashes/sha2.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
@@ -55,8 +57,8 @@ const electronMainConfig = (/*env, argv*/) => {
|
|||||||
new webpack.BannerPlugin(BANNER_TEXT),
|
new webpack.BannerPlugin(BANNER_TEXT),
|
||||||
new CopyPlugin({
|
new CopyPlugin({
|
||||||
patterns: [
|
patterns: [
|
||||||
{ from: "node_modules/bcrypto/build/Release/bcrypto.node", to: "build" },
|
|
||||||
{ from: "node_modules/leveldown/prebuilds/", to: "prebuilds" },
|
{ from: "node_modules/leveldown/prebuilds/", to: "prebuilds" },
|
||||||
|
{ from: "build/extra_prebuilds/", to: "prebuilds" },
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
@@ -128,7 +130,7 @@ const browserConfig = (/*env, argv*/) => {
|
|||||||
__APP_FILE_SERVE_PREFIX__ : JSON.stringify(APP_FILE_SERVE_PREFIX),
|
__APP_FILE_SERVE_PREFIX__ : JSON.stringify(APP_FILE_SERVE_PREFIX),
|
||||||
__HELPER_PROXY__ : JSON.stringify(HELPER_PROXY),
|
__HELPER_PROXY__ : JSON.stringify(HELPER_PROXY),
|
||||||
__GDRIVE_CLIENT_ID__ : JSON.stringify(GDRIVE_CLIENT_ID),
|
__GDRIVE_CLIENT_ID__ : JSON.stringify(GDRIVE_CLIENT_ID),
|
||||||
__VERSION__: JSON.stringify(require("./package.json").version),
|
__VERSION__: JSON.stringify(package_json.version),
|
||||||
__IPFS_CORE_URL__: JSON.stringify(IPFS_CORE_URL)
|
__IPFS_CORE_URL__: JSON.stringify(IPFS_CORE_URL)
|
||||||
}),
|
}),
|
||||||
new webpack.BannerPlugin(BANNER_TEXT),
|
new webpack.BannerPlugin(BANNER_TEXT),
|
||||||
|
|||||||
Reference in New Issue
Block a user