pubblue 0.4.4 → 0.4.5
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/dist/index.js +8 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -226,6 +226,9 @@ function getFollowReadDelayMs(disconnected, consecutiveFailures) {
|
|
|
226
226
|
function resolveTunnelIdSelection(tunnelIdArg, tunnelOpt) {
|
|
227
227
|
return tunnelOpt || tunnelIdArg;
|
|
228
228
|
}
|
|
229
|
+
function buildDaemonForkStdio(logFd) {
|
|
230
|
+
return ["ignore", logFd, logFd, "ipc"];
|
|
231
|
+
}
|
|
229
232
|
function registerTunnelCommands(program2) {
|
|
230
233
|
const tunnel = program2.command("tunnel").description("P2P encrypted tunnel to browser");
|
|
231
234
|
tunnel.command("start").description("Start a new tunnel (spawns background daemon)").option("--expires <duration>", "Auto-close after duration (e.g. 4h, 1d)", "24h").option("--foreground", "Run in foreground (don't fork)").action(async (opts) => {
|
|
@@ -261,7 +264,7 @@ function registerTunnelCommands(program2) {
|
|
|
261
264
|
const daemonLogFd = fs2.openSync(logPath, "a");
|
|
262
265
|
const child = fork(daemonScript, [], {
|
|
263
266
|
detached: true,
|
|
264
|
-
stdio:
|
|
267
|
+
stdio: buildDaemonForkStdio(daemonLogFd),
|
|
265
268
|
env: {
|
|
266
269
|
...process.env,
|
|
267
270
|
PUBBLUE_DAEMON_TUNNEL_ID: result.tunnelId,
|
|
@@ -272,6 +275,9 @@ function registerTunnelCommands(program2) {
|
|
|
272
275
|
}
|
|
273
276
|
});
|
|
274
277
|
fs2.closeSync(daemonLogFd);
|
|
278
|
+
if (child.connected) {
|
|
279
|
+
child.disconnect();
|
|
280
|
+
}
|
|
275
281
|
child.unref();
|
|
276
282
|
const ready = await waitForDaemonReady(infoPath, child, 5e3);
|
|
277
283
|
if (!ready) {
|
|
@@ -626,7 +632,7 @@ function readFile(filePath) {
|
|
|
626
632
|
basename: path3.basename(resolved)
|
|
627
633
|
};
|
|
628
634
|
}
|
|
629
|
-
program.name("pubblue").description("Publish static content and get shareable URLs").version("0.4.
|
|
635
|
+
program.name("pubblue").description("Publish static content and get shareable URLs").version("0.4.5");
|
|
630
636
|
program.command("configure").description("Configure the CLI with your API key").option("--api-key <key>", "Your API key (less secure: appears in shell history)").option("--api-key-stdin", "Read API key from stdin").action(async (opts) => {
|
|
631
637
|
try {
|
|
632
638
|
const apiKey = await resolveConfigureApiKey(opts);
|