pinggy 0.6.11 → 0.7.0

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 CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  restorableTunnelCount,
14
14
  runDaemonChild,
15
15
  startRemoteManagement
16
- } from "./chunk-W47AYOH2.js";
16
+ } from "./chunk-ZSED6OIR.js";
17
17
  import "./chunk-VD5ZFCZW.js";
18
18
  import "./chunk-P54K7NPF.js";
19
19
  import {
@@ -33,7 +33,7 @@ import {
33
33
  validateName,
34
34
  validateNameForStorage,
35
35
  validateNameStrict
36
- } from "./chunk-3IPMFCEF.js";
36
+ } from "./chunk-QUVQ7ODD.js";
37
37
  import "./chunk-XZ64ZAGO.js";
38
38
  import {
39
39
  TunnelManager
@@ -44,7 +44,7 @@ import {
44
44
  isDaemonRunning,
45
45
  removeDeadDaemonFiles,
46
46
  setDaemonLauncher
47
- } from "./chunk-RYO5T2JT.js";
47
+ } from "./chunk-2IPBK3RG.js";
48
48
  import {
49
49
  DaemonHost,
50
50
  DeviceAgentState
@@ -155,7 +155,7 @@ async function verifyAndLoad() {
155
155
  process.exit(1);
156
156
  }
157
157
  }
158
- await import("./main-FCIOVX5I.js");
158
+ await import("./main-M4BTDE2A.js");
159
159
  }
160
160
  verifyAndLoad().catch((err) => {
161
161
  printer_default.fatal(`Failed to start CLI:, ${err}`);
@@ -6,10 +6,10 @@ import {
6
6
  getRemoteManagementState,
7
7
  initiateRemoteManagement,
8
8
  runDaemonChild
9
- } from "./chunk-W47AYOH2.js";
9
+ } from "./chunk-ZSED6OIR.js";
10
10
  import "./chunk-VD5ZFCZW.js";
11
11
  import "./chunk-P54K7NPF.js";
12
- import "./chunk-3IPMFCEF.js";
12
+ import "./chunk-QUVQ7ODD.js";
13
13
  import "./chunk-XZ64ZAGO.js";
14
14
  import {
15
15
  TunnelManager
@@ -21,7 +21,7 @@ import {
21
21
  getDaemonInfo,
22
22
  getInProcessDaemonHandle,
23
23
  isDaemonRunning
24
- } from "./chunk-RYO5T2JT.js";
24
+ } from "./chunk-2IPBK3RG.js";
25
25
  import {
26
26
  DaemonHost
27
27
  } from "./chunk-MKGD2QAI.js";
@@ -28,7 +28,7 @@ import {
28
28
  unixLayoutPaths,
29
29
  versionFromTag,
30
30
  writeUpdateState
31
- } from "./chunk-RYO5T2JT.js";
31
+ } from "./chunk-2IPBK3RG.js";
32
32
  import "./chunk-MKGD2QAI.js";
33
33
  import {
34
34
  errorMessage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinggy",
3
- "version": "0.6.11",
3
+ "version": "0.7.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "description": "Create secure, shareable tunnels to your localhost and manage them from the command line. ",
@@ -71,6 +71,7 @@
71
71
  "@xterm/headless": "^6.0.0",
72
72
  "blessed": "^0.1.81",
73
73
  "clipboardy": "^5.0.0",
74
+ "major": "^1.0.26",
74
75
  "mime": "^4.1.0",
75
76
  "node-pty": "^1.1.0",
76
77
  "picocolors": "^1.1.1",
@@ -53,7 +53,7 @@ function Install-Pinggy {
53
53
  $npmPackage = 'pinggy'
54
54
  # The file a running daemon writes. Its path lives in src/utils/configDir.ts.
55
55
  $daemonInfoPath = Join-Path $env:APPDATA 'pinggy\daemon.json'
56
- # The task `pinggy daemon service-install` registers. Its name lives in src/daemon/lifecycle/serviceInstaller.ts.
56
+ # The task `pinggy autostart on` registers. Its name lives in src/daemon/lifecycle/serviceInstaller.ts.
57
57
  $loginTaskName = 'PinggyDaemon'
58
58
  $cpuArchitectureX64 = 9
59
59
  $cpuArchitectureArm64 = 12
@@ -390,8 +390,8 @@ function Install-Pinggy {
390
390
  }
391
391
 
392
392
  # The task counts only when it runs the binary this script installs. A task left by a pinggy elsewhere gets the
393
- # question, and service-install replaces it. Get-ScheduledTask, because schtasks prints field names in the
394
- # language of Windows.
393
+ # question, and `pinggy autostart on` replaces it. Get-ScheduledTask, because schtasks prints field names
394
+ # in the language of Windows.
395
395
  function Test-LoginTask {
396
396
  try {
397
397
  $task = Get-ScheduledTask -TaskName $loginTaskName -ErrorAction Stop
@@ -402,22 +402,23 @@ function Install-Pinggy {
402
402
  }
403
403
 
404
404
  # Asks once the device connects, so the agent starts again after a restart. Leaves a registered task as it is.
405
- # `pinggy daemon service-install` runs only from this script's binary, so another copy skips the question.
405
+ # `pinggy autostart on` writes the task only from this script's binary, so another copy skips the
406
+ # question. After `device login -b` the agent is saved, so `on` asks nothing more.
406
407
  function Invoke-LoginServiceOffer {
407
408
  if ($skipLoginService) { return }
408
409
  if (Test-LoginTask) { return }
409
410
  if (-not (Test-Interactive)) {
410
- Write-Host 'To start pinggy when this computer starts, run: pinggy daemon service-install'
411
+ Write-Host 'To start pinggy when this computer starts, run: pinggy autostart on'
411
412
  return
412
413
  }
413
414
  Write-Host ''
414
415
  if (-not (Confirm-Question 'Start pinggy automatically when this computer starts? [Y/n]')) {
415
- Write-Host 'To start pinggy when this computer starts, run: pinggy daemon service-install'
416
+ Write-Host 'To start pinggy when this computer starts, run: pinggy autostart on'
416
417
  return
417
418
  }
418
- & $installPath daemon service-install
419
+ & $installPath autostart on
419
420
  if ($LASTEXITCODE -ne 0) {
420
- Write-Host 'Could not set up the login service. To try again, run: pinggy daemon service-install'
421
+ Write-Host 'Could not turn on autostart. To try again, run: pinggy autostart on'
421
422
  }
422
423
  }
423
424
 
@@ -651,9 +651,9 @@ add_link_dir_to_rc_file() {
651
651
  say "In this terminal, run: source $(shown "$rc_file")"
652
652
  }
653
653
 
654
- # The service file `pinggy daemon service-install` writes. Its paths live in src/daemon/lifecycle/serviceInstaller.ts.
654
+ # The boot entry `pinggy autostart on` writes. Its paths live in src/daemon/lifecycle/serviceInstaller.ts.
655
655
  # The service counts only when it runs the binary this script installs. A service left by a pinggy elsewhere gets the
656
- # question, and service-install replaces it.
656
+ # question, and `pinggy autostart on` replaces it.
657
657
  login_service_installed() {
658
658
  case "$os" in
659
659
  macos) service_file="$HOME/Library/LaunchAgents/$LAUNCHD_LABEL.plist" ;;
@@ -671,7 +671,8 @@ login_service_supported() {
671
671
  }
672
672
 
673
673
  # Asks once the device connects, so the agent starts again after a restart. Leaves an installed service as it is.
674
- # `pinggy daemon service-install` runs only from this script's binary, so another copy skips the question.
674
+ # `pinggy autostart on` writes the boot entry only from this script's binary, so another copy skips the
675
+ # question. After `device login -b` the agent is saved, so `on` asks nothing more with no terminal.
675
676
  offer_login_service() {
676
677
  if [ "${skip_login_service:-0}" = 1 ]; then
677
678
  return 0
@@ -680,17 +681,17 @@ offer_login_service() {
680
681
  return 0
681
682
  fi
682
683
  if ! has_terminal; then
683
- say "To start pinggy when this computer starts, run: pinggy daemon service-install"
684
+ say "To start pinggy when this computer starts, run: pinggy autostart on"
684
685
  return 0
685
686
  fi
686
687
 
687
688
  say ""
688
689
  if ! confirm "Start pinggy automatically when this computer starts? [Y/n] "; then
689
- say "To start pinggy when this computer starts, run: pinggy daemon service-install"
690
+ say "To start pinggy when this computer starts, run: pinggy autostart on"
690
691
  return 0
691
692
  fi
692
- if ! "$INSTALL_PATH" daemon service-install </dev/null; then
693
- say "Could not set up the login service. To try again, run: pinggy daemon service-install"
693
+ if ! "$INSTALL_PATH" autostart on </dev/null; then
694
+ say "Could not turn on autostart. To try again, run: pinggy autostart on"
694
695
  fi
695
696
  }
696
697