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:
Ilya Kreymer
2021-09-13 07:31:37 -07:00
parent 589ea5ddd4
commit d341c03350
9 changed files with 2561 additions and 3445 deletions
+5
View File
@@ -1,5 +1,10 @@
## 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
- 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)
+3 -3
View File
@@ -1,7 +1,7 @@
{
"name": "replaywebpage",
"productName": "ReplayWeb.page",
"version": "1.5.1",
"version": "1.5.2",
"description": "Serverless Web Archive Replay",
"repository": "https://github.com/webrecorder/replayweb.page",
"homepage": "https://replayweb.page/",
@@ -9,13 +9,13 @@
"license": "AGPL-3.0-or-later",
"dependencies": {
"@fortawesome/fontawesome-free": "^5.13.0",
"@webrecorder/wabac": "^2.9.0-beta.1",
"@webrecorder/wabac": "^2.9.1",
"bulma": "^0.9.3",
"electron-log": "^4.3.0",
"electron-updater": "^4.3.5",
"fetch-ndjson": "^1.1.0",
"flexsearch": "^0.6.32",
"ipfs-core": "^0.5.2",
"ipfs-core": "^0.10.6",
"keyword-mark-element": "^0.1.2",
"lit-element": "^2.4.0",
"marked": "^1.0.0",
Binary file not shown.
+3 -3
View File
@@ -1,7 +1,7 @@
{
"name": "replaywebpage",
"productName": "ReplayWeb.page",
"version": "1.5.1",
"version": "1.5.2",
"description": "Serverless Web Archive Replay",
"repository": "https://github.com/webrecorder/replayweb.page",
"homepage": "https://replayweb.page/",
@@ -9,13 +9,13 @@
"license": "AGPL-3.0-or-later",
"dependencies": {
"@fortawesome/fontawesome-free": "^5.13.0",
"@webrecorder/wabac": "^2.9.0-beta.1",
"@webrecorder/wabac": "^2.9.1",
"bulma": "^0.9.3",
"electron-log": "^4.3.0",
"electron-updater": "^4.3.5",
"fetch-ndjson": "^1.1.0",
"flexsearch": "^0.6.32",
"ipfs-core": "^0.5.2",
"ipfs-core": "^0.10.6",
"keyword-mark-element": "^0.1.2",
"lit-element": "^2.4.0",
"marked": "^1.0.0",
+13 -3
View File
@@ -33,13 +33,18 @@ let IPFS = null;
// ============================================================================
class NativeIPFSClient extends IPFSClient
{
constructor(repoPath) {
super();
this.repoPath = repoPath;
}
async _doInitIPFS() {
if (!IPFS) {
IPFS = require("ipfs-core");
}
this.ipfs = await IPFS.create({
//repo: "/tmp/test-ipfs"
repo: this.repoPath,
init: {emptyRepo: true},
//preload: {enabled: false},
});
@@ -72,7 +77,7 @@ class ElectronReplayApp
this.screenSize = {width: 1024, height: 768};
this.ipfsClient = new NativeIPFSClient();
this.ipfsClient = null;
}
get mainWindowWebPreferences() {
@@ -140,6 +145,11 @@ class ElectronReplayApp
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("open-file", (event, filePath) => {
this.openNextFile = filePath;
@@ -300,7 +310,7 @@ class ElectronReplayApp
if (request.method === "GET") {
const offset = start || 0;
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});
+8 -6
View File
File diff suppressed because one or more lines are too long
+244 -244
View File
File diff suppressed because one or more lines are too long
+6 -4
View File
@@ -4,6 +4,7 @@ const path = require("path");
const webpack = require("webpack");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const CopyPlugin = require("copy-webpack-plugin");
const package_json = require("./package.json");
// fake url used in app to serve files
// 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.'";
// 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*/) => {
@@ -35,7 +36,8 @@ const electronMainConfig = (/*env, argv*/) => {
alias: {
"abort-controller": "abort-controller/dist/abort-controller.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: {
@@ -55,8 +57,8 @@ const electronMainConfig = (/*env, argv*/) => {
new webpack.BannerPlugin(BANNER_TEXT),
new CopyPlugin({
patterns: [
{ from: "node_modules/bcrypto/build/Release/bcrypto.node", to: "build" },
{ 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),
__HELPER_PROXY__ : JSON.stringify(HELPER_PROXY),
__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)
}),
new webpack.BannerPlugin(BANNER_TEXT),
+2279 -3182
View File
File diff suppressed because it is too large Load Diff