pinggy 0.6.4 → 0.6.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/ARCHITECTURE.md +37 -22
- package/CLAUDE.md +8 -5
- package/README.md +5 -5
- package/dist/{TunnelManager-NGSUBZYI.js → TunnelManager-DXNXIH5W.js} +3 -3
- package/dist/{TunnelTui-UCG2YSLX.js → TunnelTui-K7KESRTQ.js} +3 -3
- package/dist/{chunk-CIOYQU7F.js → chunk-3PTLHLFL.js} +32 -9
- package/dist/{chunk-QNUVQ6KD.js → chunk-EMCDDH3B.js} +2 -2
- package/dist/{chunk-MV56U3E6.js → chunk-IRKMUV37.js} +2 -2
- package/dist/{chunk-UVJYL2ZN.js → chunk-K5QHR5KU.js} +648 -238
- package/dist/{chunk-AFMTIELL.js → chunk-N5WE4DYD.js} +8 -0
- package/dist/{chunk-Y435RMHQ.js → chunk-QZJGTQZC.js} +2 -2
- package/dist/{chunk-PD7HXVQ3.js → chunk-X6TZN5CT.js} +18 -1
- package/dist/{configStore-RR5ZU4E3.js → configStore-DXC6WMYO.js} +3 -3
- package/dist/{daemonChild-WHS676G4.js → daemonChild-HZ27YJKQ.js} +7 -11
- package/dist/daemonConfig-MCAKZHY2.js +17 -0
- package/dist/index.cjs +768 -253
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +6 -6
- package/dist/{main-JRVKAIHH.js → main-TDQB5ZB4.js} +7 -7
- package/dist/workers/file_serve_worker.js +1 -1
- package/package.json +1 -1
- package/scripts/install/install.ps1 +46 -4
- package/scripts/install/install.sh +65 -6
- package/dist/daemonConfig-QVXQ47XH.js +0 -9
|
@@ -23,6 +23,9 @@ function ensureTunnelConfigDir() {
|
|
|
23
23
|
function getDaemonInfoPath() {
|
|
24
24
|
return path.join(getPinggyConfigDir(), "daemon.json");
|
|
25
25
|
}
|
|
26
|
+
function getDaemonLockPath() {
|
|
27
|
+
return path.join(getPinggyConfigDir(), "daemon.lock");
|
|
28
|
+
}
|
|
26
29
|
function getDaemonConfigPath() {
|
|
27
30
|
return path.join(getPinggyConfigDir(), "daemon-config.json");
|
|
28
31
|
}
|
|
@@ -60,6 +63,9 @@ function getDaemonLogPath() {
|
|
|
60
63
|
function getDeviceConfigPath() {
|
|
61
64
|
return path.join(getPinggyConfigDir(), "device.json");
|
|
62
65
|
}
|
|
66
|
+
function getForegroundAgentPath() {
|
|
67
|
+
return path.join(getPinggyConfigDir(), "device-agent.json");
|
|
68
|
+
}
|
|
63
69
|
function ensurePinggyConfigDir() {
|
|
64
70
|
const dir = getPinggyConfigDir();
|
|
65
71
|
fs.mkdirSync(dir, { recursive: true });
|
|
@@ -71,11 +77,13 @@ export {
|
|
|
71
77
|
getTunnelConfigDir,
|
|
72
78
|
ensureTunnelConfigDir,
|
|
73
79
|
getDaemonInfoPath,
|
|
80
|
+
getDaemonLockPath,
|
|
74
81
|
getDaemonConfigPath,
|
|
75
82
|
ensurePinggyLogDir,
|
|
76
83
|
getTunnelLogDir,
|
|
77
84
|
getTunnelLogPath,
|
|
78
85
|
getDaemonLogPath,
|
|
79
86
|
getDeviceConfigPath,
|
|
87
|
+
getForegroundAgentPath,
|
|
80
88
|
ensurePinggyConfigDir
|
|
81
89
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
logger
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IRKMUV37.js";
|
|
4
4
|
import {
|
|
5
5
|
ensureTunnelConfigDir,
|
|
6
6
|
getTunnelConfigDir
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-N5WE4DYD.js";
|
|
8
8
|
|
|
9
9
|
// src/cli/configStore.ts
|
|
10
10
|
import fs from "fs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensurePinggyConfigDir,
|
|
3
3
|
getDaemonConfigPath
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-N5WE4DYD.js";
|
|
5
5
|
|
|
6
6
|
// src/daemon/lifecycle/daemonConfig.ts
|
|
7
7
|
import fs from "fs";
|
|
@@ -17,6 +17,19 @@ function readDaemonConfig() {
|
|
|
17
17
|
return null;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
+
function configuredLogLevel() {
|
|
21
|
+
return readDaemonConfig()?.logLevel ?? process.env.PINGGY_LOG_LEVEL ?? "info";
|
|
22
|
+
}
|
|
23
|
+
function savedDeviceAgent() {
|
|
24
|
+
return readDaemonConfig()?.deviceAgent ?? null;
|
|
25
|
+
}
|
|
26
|
+
function saveDeviceAgent(startedBy) {
|
|
27
|
+
writeDaemonConfig({ deviceAgent: { startedAt: (/* @__PURE__ */ new Date()).toISOString(), startedBy } });
|
|
28
|
+
}
|
|
29
|
+
function forgetDeviceAgent() {
|
|
30
|
+
if (!savedDeviceAgent()) return;
|
|
31
|
+
writeDaemonConfig({ deviceAgent: void 0 });
|
|
32
|
+
}
|
|
20
33
|
function writeDaemonConfig(partial) {
|
|
21
34
|
try {
|
|
22
35
|
ensurePinggyConfigDir();
|
|
@@ -32,5 +45,9 @@ function writeDaemonConfig(partial) {
|
|
|
32
45
|
|
|
33
46
|
export {
|
|
34
47
|
readDaemonConfig,
|
|
48
|
+
configuredLogLevel,
|
|
49
|
+
savedDeviceAgent,
|
|
50
|
+
saveDeviceAgent,
|
|
51
|
+
forgetDeviceAgent,
|
|
35
52
|
writeDaemonConfig
|
|
36
53
|
};
|
|
@@ -22,9 +22,9 @@ import {
|
|
|
22
22
|
validateName,
|
|
23
23
|
validateNameForStorage,
|
|
24
24
|
validateNameStrict
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-QZJGTQZC.js";
|
|
26
|
+
import "./chunk-IRKMUV37.js";
|
|
27
|
+
import "./chunk-N5WE4DYD.js";
|
|
28
28
|
export {
|
|
29
29
|
CONFIG_VERBS,
|
|
30
30
|
ConfigVerb,
|
|
@@ -3,31 +3,27 @@ import {
|
|
|
3
3
|
removeDaemonInfo,
|
|
4
4
|
runDaemonChild,
|
|
5
5
|
setDaemonSessionTracker,
|
|
6
|
-
trackDeviceAgentStart,
|
|
7
|
-
trackDeviceAgentStop,
|
|
8
6
|
trackIPCTunnelStart,
|
|
9
7
|
trackTunnelStart,
|
|
10
8
|
trackTunnelStop
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-K5QHR5KU.js";
|
|
10
|
+
import "./chunk-3PTLHLFL.js";
|
|
11
|
+
import "./chunk-X6TZN5CT.js";
|
|
14
12
|
import {
|
|
15
13
|
DaemonHost
|
|
16
14
|
} from "./chunk-7EQKHVQX.js";
|
|
17
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-QZJGTQZC.js";
|
|
18
16
|
import "./chunk-XZ64ZAGO.js";
|
|
19
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-EMCDDH3B.js";
|
|
20
18
|
import "./chunk-UB26QJ4T.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-IRKMUV37.js";
|
|
20
|
+
import "./chunk-N5WE4DYD.js";
|
|
23
21
|
export {
|
|
24
22
|
DaemonHost,
|
|
25
23
|
getDaemonHost,
|
|
26
24
|
removeDaemonInfo,
|
|
27
25
|
runDaemonChild,
|
|
28
26
|
setDaemonSessionTracker,
|
|
29
|
-
trackDeviceAgentStart,
|
|
30
|
-
trackDeviceAgentStop,
|
|
31
27
|
trackIPCTunnelStart,
|
|
32
28
|
trackTunnelStart,
|
|
33
29
|
trackTunnelStop
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
configuredLogLevel,
|
|
3
|
+
forgetDeviceAgent,
|
|
4
|
+
readDaemonConfig,
|
|
5
|
+
saveDeviceAgent,
|
|
6
|
+
savedDeviceAgent,
|
|
7
|
+
writeDaemonConfig
|
|
8
|
+
} from "./chunk-X6TZN5CT.js";
|
|
9
|
+
import "./chunk-N5WE4DYD.js";
|
|
10
|
+
export {
|
|
11
|
+
configuredLogLevel,
|
|
12
|
+
forgetDeviceAgent,
|
|
13
|
+
readDaemonConfig,
|
|
14
|
+
saveDeviceAgent,
|
|
15
|
+
savedDeviceAgent,
|
|
16
|
+
writeDaemonConfig
|
|
17
|
+
};
|