Compare commits
No commits in common. "v0.1.0-develop.16" and "v0.1.0-develop.15" have entirely different histories.
v0.1.0-dev
...
v0.1.0-dev
|
@ -1,11 +1,3 @@
|
|||
# [0.1.0-develop.16](https://git.lumeweb.com/LumeWeb/hosted-kernel/compare/v0.1.0-develop.15...v0.1.0-develop.16) (2023-11-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* call savePortalSessions before kernel load ([c5f7059](https://git.lumeweb.com/LumeWeb/hosted-kernel/commit/c5f7059161223dfd96a718109bfb3b396539767b))
|
||||
* need to add indexeddb detection due to browser security ([cd7ad86](https://git.lumeweb.com/LumeWeb/hosted-kernel/commit/cd7ad86869655cc6dbbe9078c49a295efd435b22))
|
||||
|
||||
# [0.1.0-develop.15](https://git.lumeweb.com/LumeWeb/hosted-kernel/compare/v0.1.0-develop.14...v0.1.0-develop.15) (2023-10-11)
|
||||
|
||||
# [0.1.0-develop.14](https://git.lumeweb.com/LumeWeb/hosted-kernel/compare/v0.1.0-develop.13...v0.1.0-develop.14) (2023-09-20)
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
{
|
||||
"name": "@lumeweb/hosted-kernel",
|
||||
"version": "0.1.0-develop.16",
|
||||
"version": "0.1.0-develop.15",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@lumeweb/hosted-kernel",
|
||||
"version": "0.1.0-develop.16",
|
||||
"version": "0.1.0-develop.15",
|
||||
"dependencies": {
|
||||
"@lumeweb/libkernel": "^0.1.0-develop.67",
|
||||
"@lumeweb/libkernel": "^0.1.0-develop.50",
|
||||
"@noble/ciphers": "^0.1.4",
|
||||
"binconv": "^0.2.0"
|
||||
},
|
||||
|
@ -1678,11 +1678,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@lumeweb/libkernel": {
|
||||
"version": "0.1.0-develop.67",
|
||||
"resolved": "https://registry.npmjs.org/@lumeweb/libkernel/-/libkernel-0.1.0-develop.67.tgz",
|
||||
"integrity": "sha512-1GPaMO20agALnxjkqkswaXW+s6CpdqsvwgrdOgC4WkGdY4P4z3mD08FEqkvaVnVQpcJdUqPlLurQddCP+m0Y7g==",
|
||||
"version": "0.1.0-develop.50",
|
||||
"resolved": "https://registry.npmjs.org/@lumeweb/libkernel/-/libkernel-0.1.0-develop.50.tgz",
|
||||
"integrity": "sha512-KfJSdJ/nNIQmx1GenH92JEF80Fz/KzNvQV07wO7VZ2jQGwJhB1tR+ufX9foLxt+ydmVLKbE6A6XaPwrlU+DGVg==",
|
||||
"dependencies": {
|
||||
"@lumeweb/libweb": "0.2.0-develop.60",
|
||||
"@lumeweb/libweb": "0.2.0-develop.55",
|
||||
"emittery": "^1.0.1",
|
||||
"p-defer": "^4.0.0"
|
||||
}
|
||||
|
@ -1699,11 +1699,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@lumeweb/libportal": {
|
||||
"version": "0.2.0-develop.40",
|
||||
"resolved": "https://registry.npmjs.org/@lumeweb/libportal/-/libportal-0.2.0-develop.40.tgz",
|
||||
"integrity": "sha512-vtdYK92JFUGR1VxQxwghcb5eTLXx8J4wlnCWNpfbNlSEkABJPzM+V5BAhfIqO1d3M55FUBLpIb+h4nibxflcRA==",
|
||||
"version": "0.2.0-develop.34",
|
||||
"resolved": "https://registry.npmjs.org/@lumeweb/libportal/-/libportal-0.2.0-develop.34.tgz",
|
||||
"integrity": "sha512-Lr0HpYzt89n7ZmPJBLXD4HrOX1D6325g2S5q0uZwx33o0gBeylUVMXp3PsN3fpaiMELyz06jFkOCtlYzVlFSDQ==",
|
||||
"dependencies": {
|
||||
"@lumeweb/libs5": "^0.1.0-develop.60",
|
||||
"@lumeweb/libs5": "^0.1.0-develop.55",
|
||||
"@noble/curves": "^1.1.0",
|
||||
"@noble/hashes": "^1.3.1",
|
||||
"detect-node": "^2.1.0",
|
||||
|
@ -1716,9 +1716,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@lumeweb/libs5": {
|
||||
"version": "0.1.0-develop.60",
|
||||
"resolved": "https://registry.npmjs.org/@lumeweb/libs5/-/libs5-0.1.0-develop.60.tgz",
|
||||
"integrity": "sha512-gbfZAs3huJ0r21+n5UBHxBm4xSAt6DdMGLQKDTgvJc2gtiu2OYMQcecgw5vscBVPeTE6ZhtW1sX16MhT1jQ34A==",
|
||||
"version": "0.1.0-develop.55",
|
||||
"resolved": "https://registry.npmjs.org/@lumeweb/libs5/-/libs5-0.1.0-develop.55.tgz",
|
||||
"integrity": "sha512-bUhnmL6tW9XW7A5nSbBp4IZm0TU2Du3wPWecxiSXofXP3GprOxw6bylu7btgZVoh24qGeFVhmqkHBzR63dSEBQ==",
|
||||
"dependencies": {
|
||||
"@noble/curves": "^1.1.0",
|
||||
"@noble/hashes": "^1.3.1",
|
||||
|
@ -1730,21 +1730,21 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@lumeweb/libs5/node_modules/multiformats": {
|
||||
"version": "12.1.2",
|
||||
"resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.1.2.tgz",
|
||||
"integrity": "sha512-6mRIsrZXyw5xNPO31IGBMmxgDXBSgCGDsBAtazkZ02ip4hMwZNrQvfxXZtytRoBSWuzSq5f9VmMnXj76fIz5FQ==",
|
||||
"version": "12.1.1",
|
||||
"resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.1.1.tgz",
|
||||
"integrity": "sha512-GBSToTmri2vJYs8wqcZQ8kB21dCaeTOzHTIAlr8J06C1eL6UbzqURXFZ5Fl0EYm9GAFz1IlYY8SxGOs9G9NJRg==",
|
||||
"engines": {
|
||||
"node": ">=16.0.0",
|
||||
"npm": ">=7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@lumeweb/libweb": {
|
||||
"version": "0.2.0-develop.60",
|
||||
"resolved": "https://registry.npmjs.org/@lumeweb/libweb/-/libweb-0.2.0-develop.60.tgz",
|
||||
"integrity": "sha512-GNgc+OwRp/Lz8fnQ5r5aWJchdWDoClXS1T+Vg3i3KZ73RMcbBvOG2dwliLW6RWl6spFjw+BunwexQxLz6BzqjA==",
|
||||
"version": "0.2.0-develop.55",
|
||||
"resolved": "https://registry.npmjs.org/@lumeweb/libweb/-/libweb-0.2.0-develop.55.tgz",
|
||||
"integrity": "sha512-5CqsU2KjkNovRj92N9M/dGNu9Z5Tyu6pr8XwrFZQOLPseDebbFY3d+Wp+PV5Z3TqtuXaQ/+j7buR3K3175d37A==",
|
||||
"dependencies": {
|
||||
"@lumeweb/community-portals": "^0.1.0-develop.6",
|
||||
"@lumeweb/libportal": "0.2.0-develop.40",
|
||||
"@lumeweb/libportal": "0.2.0-develop.34",
|
||||
"@lumeweb/node-library-preset": "0.2.7",
|
||||
"@noble/ciphers": "^0.3.0",
|
||||
"@noble/curves": "^1.1.0",
|
||||
|
@ -19705,9 +19705,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/ws": {
|
||||
"version": "8.14.2",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz",
|
||||
"integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==",
|
||||
"version": "8.14.1",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.14.1.tgz",
|
||||
"integrity": "sha512-4OOseMUq8AzRBI/7SLMUwO+FEDnguetSk7KMb1sHwvF2w2Wv5Hoj0nlifx8vtGsftE/jWHojPy8sMMzYLJ2G/A==",
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@lumeweb/hosted-kernel",
|
||||
"version": "0.1.0-develop.16",
|
||||
"version": "0.1.0-develop.15",
|
||||
"type": "module",
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
|
@ -16,7 +16,7 @@
|
|||
"@lumeweb/presetter-kernel-module-preset": "^0.1.0-develop.43"
|
||||
},
|
||||
"dependencies": {
|
||||
"@lumeweb/libkernel": "^0.1.0-develop.67",
|
||||
"@lumeweb/libkernel": "^0.1.0-develop.50",
|
||||
"@noble/ciphers": "^0.1.4",
|
||||
"binconv": "^0.2.0"
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ import {
|
|||
downloadSmallObject,
|
||||
maybeInitDefaultPortals,
|
||||
savePortals,
|
||||
savePortalSessions,
|
||||
setActivePortalMasterKey,
|
||||
} from "@lumeweb/libweb";
|
||||
import { log, logErr, sendAuthUpdate } from "./util.js";
|
||||
|
@ -17,50 +16,9 @@ import { addContextToErr } from "@lumeweb/libkernel";
|
|||
|
||||
let kernelLoadAttempt = false;
|
||||
|
||||
function testIndexedDBSupport() {
|
||||
return new Promise((resolve, reject) => {
|
||||
// Check for IndexedDB support
|
||||
if (!("indexedDB" in window)) {
|
||||
reject(new Error("IndexedDB is not supported by this browser."));
|
||||
} else {
|
||||
// Attempt to open an IndexedDB database
|
||||
const request = indexedDB.open("test_db", 1);
|
||||
|
||||
request.onerror = function (event) {
|
||||
// Error occurred, reject the promise
|
||||
// @ts-ignore
|
||||
reject(new Error("IndexedDB test error: " + event?.target?.errorCode));
|
||||
};
|
||||
|
||||
request.onsuccess = function (event) {
|
||||
// Success, resolve the promise
|
||||
// @ts-ignore
|
||||
event?.target?.result.close(); // Close the DB when done
|
||||
resolve(true);
|
||||
};
|
||||
|
||||
request.onupgradeneeded = function (event: IDBVersionChangeEvent) {
|
||||
// Database needs to be created or upgraded
|
||||
// @ts-ignore
|
||||
const db = event?.target?.result;
|
||||
if (!db.objectStoreNames.contains("test_store")) {
|
||||
// Create an object store
|
||||
db.createObjectStore("test_store", { keyPath: "id" });
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export async function boot() {
|
||||
export function boot() {
|
||||
let userKey;
|
||||
|
||||
if (!(await testIndexedDBSupport())) {
|
||||
setKernelLoaded("indexeddb_error");
|
||||
logErr("indexed db is not supported or is blocked");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
userKey = getStoredUserKey();
|
||||
} catch (e) {
|
||||
|
@ -109,7 +67,6 @@ export async function loadKernel() {
|
|||
}
|
||||
|
||||
savePortals();
|
||||
savePortalSessions();
|
||||
|
||||
try {
|
||||
await new Promise(async (resolve, reject) => {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { x25519 } from "@noble/curves/ed25519";
|
||||
|
||||
export const defaultKernelLink =
|
||||
"z2H7HFjPt7zi4ZPwaoD95Ka9eJzmTPLyvLnLt3Hm75bpR7ApL1qv";
|
||||
"z2H6z98zxZGWmwLXd7ArM8eoWfcmQY4BWxNormQJhsnWwgqj21oi";
|
||||
|
||||
const store = new Map<string, any>(
|
||||
Object.entries({
|
||||
|
|
Loading…
Reference in New Issue