pinokiod 3.8.147 → 3.8.149
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/kernel/bin/caddy.js +6 -5
- package/kernel/bin/conda.js +5 -1
- package/kernel/bin/index.js +244 -66
- package/kernel/bin/setup.js +130 -0
- package/kernel/environment.js +36 -1
- package/kernel/index.js +23 -13
- package/kernel/loader.js +6 -4
- package/kernel/peer.js +5 -3
- package/kernel/procs.js +2 -1
- package/kernel/prototype.js +12 -9
- package/kernel/router/common.js +50 -41
- package/kernel/router/connector.js +43 -33
- package/kernel/router/index.js +118 -88
- package/kernel/router/localhost_home_router.js +1 -0
- package/kernel/router/localhost_port_router.js +0 -1
- package/kernel/router/localhost_variable_router.js +0 -1
- package/kernel/router/peer_home_router.js +0 -1
- package/kernel/router/peer_peer_router.js +0 -2
- package/kernel/router/peer_port_router.js +0 -5
- package/kernel/router/peer_variable_router.js +0 -4
- package/kernel/util.js +2 -2
- package/package.json +1 -1
- package/server/index.js +240 -375
- package/server/public/fscreator.js +1 -1
- package/server/views/network.ejs +49 -22
- package/server/views/prototypes.ejs +1 -1
- package/server/views/setup.ejs +254 -0
- package/server/views/setup_home.ejs +181 -0
|
@@ -8,7 +8,6 @@ class LocalhostVariableRouter extends Processor {
|
|
|
8
8
|
this.common = new Common(router)
|
|
9
9
|
}
|
|
10
10
|
handle (local) {
|
|
11
|
-
console.log("LocalhostVariableRouter", local)
|
|
12
11
|
for(let script_path in local) {
|
|
13
12
|
let local_variables_for_script = local[script_path]
|
|
14
13
|
for(let key in local_variables_for_script) {
|
|
@@ -5,7 +5,6 @@ class PeerHomeRouter {
|
|
|
5
5
|
this.common = new Common(router)
|
|
6
6
|
}
|
|
7
7
|
handle(peer) {
|
|
8
|
-
console.log("PeerHomeRouter", peer)
|
|
9
8
|
this.common.handle({
|
|
10
9
|
match: `${this.router.default_prefix}.${peer.name}.${this.router.default_suffix}`,
|
|
11
10
|
dial: `${peer.host}:${this.router.default_port}`,
|
|
@@ -5,7 +5,6 @@ class PeerPeerRouter {
|
|
|
5
5
|
this.common = new Common(router)
|
|
6
6
|
}
|
|
7
7
|
handle(peer) {
|
|
8
|
-
console.log("PeerPeerRouter", peer)
|
|
9
8
|
for(let dial in peer.router) {
|
|
10
9
|
let matches = peer.router[dial]
|
|
11
10
|
let exposed_matches = matches.filter((m) => {
|
|
@@ -15,7 +14,6 @@ class PeerPeerRouter {
|
|
|
15
14
|
let port = chunks[chunks.length-1]
|
|
16
15
|
let exposed_dial = `${peer.host}:${port}` // exposed_dial :- 192.168...
|
|
17
16
|
for(let match of exposed_matches) {
|
|
18
|
-
console.log("common.handle", { match, exposed_dial, host: peer.host })
|
|
19
17
|
this.common.handle({
|
|
20
18
|
match,
|
|
21
19
|
dial: exposed_dial,
|
|
@@ -8,14 +8,11 @@ class PeerPortRouter extends Processor {
|
|
|
8
8
|
this.connector = new Connector(router)
|
|
9
9
|
}
|
|
10
10
|
handle(peer) {
|
|
11
|
-
console.log("PeerPortRouter", peer)
|
|
12
11
|
let https_domains_mapping = this.router.info[peer.host]
|
|
13
12
|
console.log({ https_domains_mapping })
|
|
14
13
|
for(let dial in https_domains_mapping) {
|
|
15
14
|
console.log({ dial })
|
|
16
15
|
let parsed_dial = this.parse_ip(dial)
|
|
17
|
-
console.log("Parsed dial", parsed_dial)
|
|
18
|
-
|
|
19
16
|
if (parsed_dial.host !== peer.host) {
|
|
20
17
|
// ONLY connect for 127.0.0.1 or localhost
|
|
21
18
|
// DO NOT connect if it's the actual host => because it will keep creating proxies forever recursively. only need to create proxies for localhost
|
|
@@ -44,8 +41,6 @@ class PeerPortRouter extends Processor {
|
|
|
44
41
|
})
|
|
45
42
|
}
|
|
46
43
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
44
|
}
|
|
50
45
|
}
|
|
51
46
|
}
|
|
@@ -8,19 +8,15 @@ class PeerVariableRouter extends Processor {
|
|
|
8
8
|
this.connector = new Connector(router)
|
|
9
9
|
}
|
|
10
10
|
handle(peer) {
|
|
11
|
-
console.log("PeerVariableRouter", JSON.stringify(peer, null, 2))
|
|
12
11
|
for(let script_path in peer.memory.local) {
|
|
13
12
|
let local_variables = peer.memory.local[script_path]
|
|
14
13
|
for(let key in local_variables) {
|
|
15
14
|
let val = local_variables[key]
|
|
16
|
-
console.log({ key, val })
|
|
17
15
|
if (val.startsWith("http")) {
|
|
18
16
|
let dial = val.replace(/https?:\/\//, '')
|
|
19
17
|
let name = this.api_name(peer.platform, peer.home, script_path)
|
|
20
|
-
console.log({ dial, name, has_port: this.has_port(dial), parsed_dial: this.parse_ip(dial) })
|
|
21
18
|
if (this.has_port(dial)) {
|
|
22
19
|
let parsed_dial = this.parse_ip(dial)
|
|
23
|
-
console.log("PeerVariable", { parsed_dial })
|
|
24
20
|
if (key === "url") {
|
|
25
21
|
this.connector.handle({
|
|
26
22
|
match: `${name}.${peer.name}.localhost`.toLowerCase(),
|
package/kernel/util.js
CHANGED
|
@@ -317,12 +317,12 @@ function fill_object(obj, pattern, list, cache) {
|
|
|
317
317
|
if (!(match in map)) {
|
|
318
318
|
if (replaced_map[match]) {
|
|
319
319
|
map[match] = replaced_map[match]
|
|
320
|
-
console.log("filling with cache", { match, replaced: replaced_map[match] })
|
|
320
|
+
// console.log("filling with cache", { match, replaced: replaced_map[match] })
|
|
321
321
|
} else {
|
|
322
322
|
if (index >= list.length) throw new Error("Not enough items provided");
|
|
323
323
|
map[match] = list[index++];
|
|
324
324
|
replaced_map[match] = map[match]
|
|
325
|
-
console.log("filling with new", { match, replaced: replaced_map[match] })
|
|
325
|
+
// console.log("filling with new", { match, replaced: replaced_map[match] })
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
return map[match];
|