dsh-home-hosted 0.3.2 → 0.3.3
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/docs/DESIGN.md +11 -0
- package/lib/index.js +4 -8
- package/lib/index.js.map +2 -2
- package/lib/types/home-hosted/dsh-entry.d.ts +0 -1
- package/package.json +1 -1
package/docs/DESIGN.md
CHANGED
|
@@ -53,6 +53,17 @@ the rest from the platform default policy; removing one restores an entry this
|
|
|
53
53
|
plugin merely adopted, and deletes one it created. Removing an entry the panel
|
|
54
54
|
supervises stops that process — which may be the session asking for it.
|
|
55
55
|
|
|
56
|
+
Deleting on toggle-off is the intended reading of that switch, not an oversight:
|
|
57
|
+
"manage" means the plugin owns the entry, so switching it off gives the entry
|
|
58
|
+
back — removed if this plugin created it, restored if it only adopted one.
|
|
59
|
+
Pausing instead would leave an entry nobody manages. The state that must never
|
|
60
|
+
happen is the third one: a toggle that is on with no entry behind it, which is
|
|
61
|
+
why the entry is recreated from the intent while the switch is on.
|
|
62
|
+
|
|
63
|
+
The generated entry always binds loopback (`bind: 'local'`, `--host 127.0.0.1`):
|
|
64
|
+
`dsh` rejects `--host 0.0.0.0` as a usage error, so repeating a running harness's
|
|
65
|
+
network bind would produce an entry that can never start.
|
|
66
|
+
|
|
56
67
|
## The sign-in page points at the log
|
|
57
68
|
|
|
58
69
|
dsh web's unauthenticated 401 is a plain-text line written by the in-box
|
package/lib/index.js
CHANGED
|
@@ -2758,13 +2758,11 @@ function buildDshEntry(facts) {
|
|
|
2758
2758
|
"--port",
|
|
2759
2759
|
"{port}",
|
|
2760
2760
|
"--host",
|
|
2761
|
-
"
|
|
2761
|
+
"127.0.0.1",
|
|
2762
2762
|
"--no-open",
|
|
2763
2763
|
"--trusted-host",
|
|
2764
2764
|
`localhost:{port}`
|
|
2765
2765
|
);
|
|
2766
|
-
if (facts.host === "0.0.0.0")
|
|
2767
|
-
appArgs.push("--trusted-host", "{lanIp}:{port}");
|
|
2768
2766
|
}
|
|
2769
2767
|
const launcherArgs = profile === "web" ? ["web"] : ["--profile", profile];
|
|
2770
2768
|
const generated = launch === null ? { command: "dsh", entryArgs: [] } : buildCommand(launch, facts.launcherPath ?? null);
|
|
@@ -2775,7 +2773,7 @@ function buildDshEntry(facts) {
|
|
|
2775
2773
|
autostart: true,
|
|
2776
2774
|
command: generated.command,
|
|
2777
2775
|
args: [...generated.entryArgs, ...launcherArgs, ...appArgs],
|
|
2778
|
-
bind:
|
|
2776
|
+
bind: "local",
|
|
2779
2777
|
port: facts.port,
|
|
2780
2778
|
cwd: process7.cwd(),
|
|
2781
2779
|
env: {},
|
|
@@ -3291,8 +3289,7 @@ var HomeHostedService = class extends Service {
|
|
|
3291
3289
|
webServer() {
|
|
3292
3290
|
const service = this.ctx.get("webServer");
|
|
3293
3291
|
const port = typeof service?.port === "number" ? service.port : null;
|
|
3294
|
-
|
|
3295
|
-
return { port, host };
|
|
3292
|
+
return { port };
|
|
3296
3293
|
}
|
|
3297
3294
|
cliCache = null;
|
|
3298
3295
|
/**
|
|
@@ -3520,11 +3517,10 @@ var HomeHostedService = class extends Service {
|
|
|
3520
3517
|
return null;
|
|
3521
3518
|
const harnessHome = process10.env.DSH_HOME ?? dshHome();
|
|
3522
3519
|
const dsh = await this.resolveDsh(harnessHome);
|
|
3523
|
-
const { port
|
|
3520
|
+
const { port } = this.webServer();
|
|
3524
3521
|
const generated = buildDshEntry({
|
|
3525
3522
|
id: intent.id,
|
|
3526
3523
|
port,
|
|
3527
|
-
host,
|
|
3528
3524
|
profile: detectProfile(process10.argv, process10.env),
|
|
3529
3525
|
dshHome: harnessHome,
|
|
3530
3526
|
launch: dsh,
|