Compare commits
6 Commits
v0.1.0-dev
...
v0.1.0-dev
Author | SHA1 | Date |
---|---|---|
semantic-release-bot | e1dc79c0dd | |
Derrick Hammer | 9bfbc3a145 | |
Derrick Hammer | a3f12abb78 | |
Derrick Hammer | cd7ad86869 | |
Derrick Hammer | c5f7059161 | |
Derrick Hammer | 760cade655 |
|
@ -1,3 +1,11 @@
|
||||||
|
# [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.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)
|
# [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",
|
"name": "@lumeweb/hosted-kernel",
|
||||||
"version": "0.1.0-develop.15",
|
"version": "0.1.0-develop.16",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@lumeweb/hosted-kernel",
|
"name": "@lumeweb/hosted-kernel",
|
||||||
"version": "0.1.0-develop.15",
|
"version": "0.1.0-develop.16",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@lumeweb/libkernel": "^0.1.0-develop.50",
|
"@lumeweb/libkernel": "^0.1.0-develop.67",
|
||||||
"@noble/ciphers": "^0.1.4",
|
"@noble/ciphers": "^0.1.4",
|
||||||
"binconv": "^0.2.0"
|
"binconv": "^0.2.0"
|
||||||
},
|
},
|
||||||
|
@ -1678,11 +1678,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@lumeweb/libkernel": {
|
"node_modules/@lumeweb/libkernel": {
|
||||||
"version": "0.1.0-develop.50",
|
"version": "0.1.0-develop.67",
|
||||||
"resolved": "https://registry.npmjs.org/@lumeweb/libkernel/-/libkernel-0.1.0-develop.50.tgz",
|
"resolved": "https://registry.npmjs.org/@lumeweb/libkernel/-/libkernel-0.1.0-develop.67.tgz",
|
||||||
"integrity": "sha512-KfJSdJ/nNIQmx1GenH92JEF80Fz/KzNvQV07wO7VZ2jQGwJhB1tR+ufX9foLxt+ydmVLKbE6A6XaPwrlU+DGVg==",
|
"integrity": "sha512-1GPaMO20agALnxjkqkswaXW+s6CpdqsvwgrdOgC4WkGdY4P4z3mD08FEqkvaVnVQpcJdUqPlLurQddCP+m0Y7g==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@lumeweb/libweb": "0.2.0-develop.55",
|
"@lumeweb/libweb": "0.2.0-develop.60",
|
||||||
"emittery": "^1.0.1",
|
"emittery": "^1.0.1",
|
||||||
"p-defer": "^4.0.0"
|
"p-defer": "^4.0.0"
|
||||||
}
|
}
|
||||||
|
@ -1699,11 +1699,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@lumeweb/libportal": {
|
"node_modules/@lumeweb/libportal": {
|
||||||
"version": "0.2.0-develop.34",
|
"version": "0.2.0-develop.40",
|
||||||
"resolved": "https://registry.npmjs.org/@lumeweb/libportal/-/libportal-0.2.0-develop.34.tgz",
|
"resolved": "https://registry.npmjs.org/@lumeweb/libportal/-/libportal-0.2.0-develop.40.tgz",
|
||||||
"integrity": "sha512-Lr0HpYzt89n7ZmPJBLXD4HrOX1D6325g2S5q0uZwx33o0gBeylUVMXp3PsN3fpaiMELyz06jFkOCtlYzVlFSDQ==",
|
"integrity": "sha512-vtdYK92JFUGR1VxQxwghcb5eTLXx8J4wlnCWNpfbNlSEkABJPzM+V5BAhfIqO1d3M55FUBLpIb+h4nibxflcRA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@lumeweb/libs5": "^0.1.0-develop.55",
|
"@lumeweb/libs5": "^0.1.0-develop.60",
|
||||||
"@noble/curves": "^1.1.0",
|
"@noble/curves": "^1.1.0",
|
||||||
"@noble/hashes": "^1.3.1",
|
"@noble/hashes": "^1.3.1",
|
||||||
"detect-node": "^2.1.0",
|
"detect-node": "^2.1.0",
|
||||||
|
@ -1716,9 +1716,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@lumeweb/libs5": {
|
"node_modules/@lumeweb/libs5": {
|
||||||
"version": "0.1.0-develop.55",
|
"version": "0.1.0-develop.60",
|
||||||
"resolved": "https://registry.npmjs.org/@lumeweb/libs5/-/libs5-0.1.0-develop.55.tgz",
|
"resolved": "https://registry.npmjs.org/@lumeweb/libs5/-/libs5-0.1.0-develop.60.tgz",
|
||||||
"integrity": "sha512-bUhnmL6tW9XW7A5nSbBp4IZm0TU2Du3wPWecxiSXofXP3GprOxw6bylu7btgZVoh24qGeFVhmqkHBzR63dSEBQ==",
|
"integrity": "sha512-gbfZAs3huJ0r21+n5UBHxBm4xSAt6DdMGLQKDTgvJc2gtiu2OYMQcecgw5vscBVPeTE6ZhtW1sX16MhT1jQ34A==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@noble/curves": "^1.1.0",
|
"@noble/curves": "^1.1.0",
|
||||||
"@noble/hashes": "^1.3.1",
|
"@noble/hashes": "^1.3.1",
|
||||||
|
@ -1730,21 +1730,21 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@lumeweb/libs5/node_modules/multiformats": {
|
"node_modules/@lumeweb/libs5/node_modules/multiformats": {
|
||||||
"version": "12.1.1",
|
"version": "12.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.1.2.tgz",
|
||||||
"integrity": "sha512-GBSToTmri2vJYs8wqcZQ8kB21dCaeTOzHTIAlr8J06C1eL6UbzqURXFZ5Fl0EYm9GAFz1IlYY8SxGOs9G9NJRg==",
|
"integrity": "sha512-6mRIsrZXyw5xNPO31IGBMmxgDXBSgCGDsBAtazkZ02ip4hMwZNrQvfxXZtytRoBSWuzSq5f9VmMnXj76fIz5FQ==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.0.0",
|
"node": ">=16.0.0",
|
||||||
"npm": ">=7.0.0"
|
"npm": ">=7.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@lumeweb/libweb": {
|
"node_modules/@lumeweb/libweb": {
|
||||||
"version": "0.2.0-develop.55",
|
"version": "0.2.0-develop.60",
|
||||||
"resolved": "https://registry.npmjs.org/@lumeweb/libweb/-/libweb-0.2.0-develop.55.tgz",
|
"resolved": "https://registry.npmjs.org/@lumeweb/libweb/-/libweb-0.2.0-develop.60.tgz",
|
||||||
"integrity": "sha512-5CqsU2KjkNovRj92N9M/dGNu9Z5Tyu6pr8XwrFZQOLPseDebbFY3d+Wp+PV5Z3TqtuXaQ/+j7buR3K3175d37A==",
|
"integrity": "sha512-GNgc+OwRp/Lz8fnQ5r5aWJchdWDoClXS1T+Vg3i3KZ73RMcbBvOG2dwliLW6RWl6spFjw+BunwexQxLz6BzqjA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@lumeweb/community-portals": "^0.1.0-develop.6",
|
"@lumeweb/community-portals": "^0.1.0-develop.6",
|
||||||
"@lumeweb/libportal": "0.2.0-develop.34",
|
"@lumeweb/libportal": "0.2.0-develop.40",
|
||||||
"@lumeweb/node-library-preset": "0.2.7",
|
"@lumeweb/node-library-preset": "0.2.7",
|
||||||
"@noble/ciphers": "^0.3.0",
|
"@noble/ciphers": "^0.3.0",
|
||||||
"@noble/curves": "^1.1.0",
|
"@noble/curves": "^1.1.0",
|
||||||
|
@ -19705,9 +19705,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/ws": {
|
"node_modules/ws": {
|
||||||
"version": "8.14.1",
|
"version": "8.14.2",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.14.1.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz",
|
||||||
"integrity": "sha512-4OOseMUq8AzRBI/7SLMUwO+FEDnguetSk7KMb1sHwvF2w2Wv5Hoj0nlifx8vtGsftE/jWHojPy8sMMzYLJ2G/A==",
|
"integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10.0.0"
|
"node": ">=10.0.0"
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@lumeweb/hosted-kernel",
|
"name": "@lumeweb/hosted-kernel",
|
||||||
"version": "0.1.0-develop.15",
|
"version": "0.1.0-develop.16",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"readme": "ERROR: No README data found!",
|
"readme": "ERROR: No README data found!",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
"@lumeweb/presetter-kernel-module-preset": "^0.1.0-develop.43"
|
"@lumeweb/presetter-kernel-module-preset": "^0.1.0-develop.43"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@lumeweb/libkernel": "^0.1.0-develop.50",
|
"@lumeweb/libkernel": "^0.1.0-develop.67",
|
||||||
"@noble/ciphers": "^0.1.4",
|
"@noble/ciphers": "^0.1.4",
|
||||||
"binconv": "^0.2.0"
|
"binconv": "^0.2.0"
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ import {
|
||||||
downloadSmallObject,
|
downloadSmallObject,
|
||||||
maybeInitDefaultPortals,
|
maybeInitDefaultPortals,
|
||||||
savePortals,
|
savePortals,
|
||||||
|
savePortalSessions,
|
||||||
setActivePortalMasterKey,
|
setActivePortalMasterKey,
|
||||||
} from "@lumeweb/libweb";
|
} from "@lumeweb/libweb";
|
||||||
import { log, logErr, sendAuthUpdate } from "./util.js";
|
import { log, logErr, sendAuthUpdate } from "./util.js";
|
||||||
|
@ -16,9 +17,50 @@ import { addContextToErr } from "@lumeweb/libkernel";
|
||||||
|
|
||||||
let kernelLoadAttempt = false;
|
let kernelLoadAttempt = false;
|
||||||
|
|
||||||
export function boot() {
|
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() {
|
||||||
let userKey;
|
let userKey;
|
||||||
|
|
||||||
|
if (!(await testIndexedDBSupport())) {
|
||||||
|
setKernelLoaded("indexeddb_error");
|
||||||
|
logErr("indexed db is not supported or is blocked");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
userKey = getStoredUserKey();
|
userKey = getStoredUserKey();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -67,6 +109,7 @@ export async function loadKernel() {
|
||||||
}
|
}
|
||||||
|
|
||||||
savePortals();
|
savePortals();
|
||||||
|
savePortalSessions();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await new Promise(async (resolve, reject) => {
|
await new Promise(async (resolve, reject) => {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { x25519 } from "@noble/curves/ed25519";
|
import { x25519 } from "@noble/curves/ed25519";
|
||||||
|
|
||||||
export const defaultKernelLink =
|
export const defaultKernelLink =
|
||||||
"z2H6z98zxZGWmwLXd7ArM8eoWfcmQY4BWxNormQJhsnWwgqj21oi";
|
"z2H7HFjPt7zi4ZPwaoD95Ka9eJzmTPLyvLnLt3Hm75bpR7ApL1qv";
|
||||||
|
|
||||||
const store = new Map<string, any>(
|
const store = new Map<string, any>(
|
||||||
Object.entries({
|
Object.entries({
|
||||||
|
|
Loading…
Reference in New Issue