pinggy 0.6.10 → 0.6.11

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-G3NF35JY.js";
16
+ } from "./chunk-W47AYOH2.js";
17
17
  import "./chunk-VD5ZFCZW.js";
18
18
  import "./chunk-P54K7NPF.js";
19
19
  import {
@@ -44,7 +44,7 @@ import {
44
44
  isDaemonRunning,
45
45
  removeDeadDaemonFiles,
46
46
  setDaemonLauncher
47
- } from "./chunk-AYU3GM4D.js";
47
+ } from "./chunk-RYO5T2JT.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-3D7R75PR.js");
158
+ await import("./main-FCIOVX5I.js");
159
159
  }
160
160
  verifyAndLoad().catch((err) => {
161
161
  printer_default.fatal(`Failed to start CLI:, ${err}`);
@@ -6,7 +6,7 @@ import {
6
6
  getRemoteManagementState,
7
7
  initiateRemoteManagement,
8
8
  runDaemonChild
9
- } from "./chunk-G3NF35JY.js";
9
+ } from "./chunk-W47AYOH2.js";
10
10
  import "./chunk-VD5ZFCZW.js";
11
11
  import "./chunk-P54K7NPF.js";
12
12
  import "./chunk-3IPMFCEF.js";
@@ -21,7 +21,7 @@ import {
21
21
  getDaemonInfo,
22
22
  getInProcessDaemonHandle,
23
23
  isDaemonRunning
24
- } from "./chunk-AYU3GM4D.js";
24
+ } from "./chunk-RYO5T2JT.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-AYU3GM4D.js";
31
+ } from "./chunk-RYO5T2JT.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.10",
3
+ "version": "0.6.11",
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. ",
@@ -519,8 +519,9 @@ function Install-Pinggy {
519
519
  }
520
520
 
521
521
  # Runs $pinggyPath by its full path, with -b, as Invoke-DeviceLogin does. connect reads DEVICE_AGENT_TOKEN
522
- # from the environment it inherits, and reads no key, so it runs the same with no console. The token leaves the
523
- # environment before the service question, so no later command inherits it.
522
+ # from the environment it inherits. It reads the console for 1 question, whether the dashboard may reach this
523
+ # machine's files. With no console it asks nothing and leaves file access on. The token leaves the environment
524
+ # before the service question, so no later command inherits it.
524
525
  function Invoke-DeviceConnect {
525
526
  $connectArguments = @('device', 'connect', '-b')
526
527
  if ($env:PINGGY_MANAGE) { $connectArguments += @('--manage', $env:PINGGY_MANAGE) }
@@ -20,7 +20,8 @@
20
20
  # Setting, from the dashboard's command:
21
21
  # DEVICE_AGENT_TOKEN a device token. `pinggy device connect` runs with no email and no code. Every update question
22
22
  # is still asked, and a pinggy older than 0.6.2 ignores the token. The token reaches the CLI in
23
- # its environment, never on a command line. Set it on sh, not on curl, so curl never holds it
23
+ # its environment, never on a command line. Set it on sh, not on curl, so curl never holds it.
24
+ # In a terminal, connect asks whether the dashboard may reach this machine's files
24
25
  #
25
26
  # Overrides, for dev and tests:
26
27
  # PINGGY_VERSION a release tag, such as v0.6.1. Default: the version pinggy.io publishes, or for an npm copy the
@@ -836,18 +837,23 @@ offer_daemon_restart() {
836
837
  }
837
838
 
838
839
  # Runs $pinggy_path, the copy this script installed, updated or kept, by its full path, so another pinggy earlier on
839
- # PATH does not answer. connect reads DEVICE_AGENT_TOKEN from the environment this script passes on, and reads no
840
- # key, so it runs the same with no terminal. -b is the default now. It is passed anyway, so an older pinggy the user
841
- # kept runs the agent in its daemon too. The token leaves the environment before the service question, so no later
842
- # command inherits it.
840
+ # PATH does not answer. connect reads DEVICE_AGENT_TOKEN from the environment this script passes on. It asks 1
841
+ # question, whether the dashboard may reach this machine's files, so it reads /dev/tty when there is one. With none it
842
+ # reads /dev/null, asks nothing, and leaves file access on. Never this script's stdin, which under `curl | sh` holds
843
+ # the rest of the script. -b is the default now. It is passed anyway, so an older pinggy the user kept runs the agent
844
+ # in its daemon too. The token leaves the environment before the service question, so no later command inherits it.
843
845
  connect_with_device_token() {
844
846
  export DEVICE_AGENT_TOKEN
845
847
  say ""
848
+ connect_input=/dev/null
849
+ if has_terminal; then
850
+ connect_input=/dev/tty
851
+ fi
846
852
  status=0
847
853
  if [ -n "${PINGGY_MANAGE:-}" ]; then
848
- "$pinggy_path" device connect -b --manage "$PINGGY_MANAGE" </dev/null || status=$?
854
+ "$pinggy_path" device connect -b --manage "$PINGGY_MANAGE" <"$connect_input" || status=$?
849
855
  else
850
- "$pinggy_path" device connect -b </dev/null || status=$?
856
+ "$pinggy_path" device connect -b <"$connect_input" || status=$?
851
857
  fi
852
858
  unset DEVICE_AGENT_TOKEN
853
859
  if [ "$status" -ne 0 ]; then