pinggy 0.1.10 → 0.2.1
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/.github/workflows/publish-binaries.yml +170 -0
- package/Makefile +4 -0
- package/README.md +73 -37
- package/caxa_build.js +24 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{tui-TJXEPR3U.js → tui-AZUFY7T2.js} +1 -1
- package/package.json +6 -4
- package/scripts/bumpVersion.js +35 -0
- package/src/tui/index.tsx +1 -1
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
name: Publish Binaries to GitHub Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [created]
|
|
6
|
+
|
|
7
|
+
env:
|
|
8
|
+
S3_BUCKET: public.pinggy.cli.binaries
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
Ubuntu:
|
|
12
|
+
name: Build on ${{ matrix.name }} and upload to GitHub Release
|
|
13
|
+
runs-on: ${{ matrix.runner }}
|
|
14
|
+
|
|
15
|
+
strategy:
|
|
16
|
+
matrix:
|
|
17
|
+
include:
|
|
18
|
+
- name: Ubuntu-x64
|
|
19
|
+
runner: ubuntu-latest
|
|
20
|
+
|
|
21
|
+
- name: Ubuntu-arm64
|
|
22
|
+
runner: ubuntu-24.04-arm
|
|
23
|
+
|
|
24
|
+
steps:
|
|
25
|
+
- name: Checkout
|
|
26
|
+
uses: actions/checkout@v4
|
|
27
|
+
|
|
28
|
+
- name: Use Node.js
|
|
29
|
+
uses: actions/setup-node@v4
|
|
30
|
+
with:
|
|
31
|
+
node-version: '24'
|
|
32
|
+
|
|
33
|
+
- name: Install dependencies
|
|
34
|
+
run: npm ci || npm install
|
|
35
|
+
|
|
36
|
+
- name: Build (tsup)
|
|
37
|
+
run: npm run build
|
|
38
|
+
|
|
39
|
+
- name: Run caxa build to produce `bin/`
|
|
40
|
+
run: make pack
|
|
41
|
+
|
|
42
|
+
- name: Show bin directory
|
|
43
|
+
run: ls -R ./bin
|
|
44
|
+
|
|
45
|
+
- name: Upload artifact to GitHub Release
|
|
46
|
+
env:
|
|
47
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
48
|
+
shell: bash
|
|
49
|
+
run: |
|
|
50
|
+
VERSION=$(git describe --tags --always)
|
|
51
|
+
|
|
52
|
+
# Extract the single generated file (e.g., pinggy-linux-x64)
|
|
53
|
+
FILE=$(ls bin)
|
|
54
|
+
|
|
55
|
+
echo "Detected build artifact: $FILE"
|
|
56
|
+
|
|
57
|
+
# Create release if not exists
|
|
58
|
+
gh release create "$VERSION" --notes "Release $VERSION" --title "$VERSION" || true
|
|
59
|
+
|
|
60
|
+
echo "Uploading $FILE to GitHub Release…"
|
|
61
|
+
gh release upload "$VERSION" "bin/$FILE" --clobber
|
|
62
|
+
|
|
63
|
+
Windows:
|
|
64
|
+
name: Build on ${{ matrix.name }} and upload
|
|
65
|
+
runs-on: ${{ matrix.runner }}
|
|
66
|
+
|
|
67
|
+
defaults:
|
|
68
|
+
run:
|
|
69
|
+
shell: bash
|
|
70
|
+
|
|
71
|
+
strategy:
|
|
72
|
+
matrix:
|
|
73
|
+
include:
|
|
74
|
+
- name: Windows-x64
|
|
75
|
+
runner: windows-latest
|
|
76
|
+
|
|
77
|
+
- name: Windows-arm64
|
|
78
|
+
runner: windows-11-arm
|
|
79
|
+
|
|
80
|
+
steps:
|
|
81
|
+
- name: Checkout
|
|
82
|
+
uses: actions/checkout@v4
|
|
83
|
+
|
|
84
|
+
- name: Use Node.js
|
|
85
|
+
uses: actions/setup-node@v4
|
|
86
|
+
with:
|
|
87
|
+
node-version: '24'
|
|
88
|
+
|
|
89
|
+
- name: Install dependencies
|
|
90
|
+
run: npm ci || npm install
|
|
91
|
+
|
|
92
|
+
- name: Build (tsup)
|
|
93
|
+
run: npm run build
|
|
94
|
+
|
|
95
|
+
- name: Run caxa build to produce `bin/`
|
|
96
|
+
run: make pack
|
|
97
|
+
|
|
98
|
+
- name: See bin directory
|
|
99
|
+
run: ls -R ./bin
|
|
100
|
+
|
|
101
|
+
- name: Upload artifact to GitHub Release
|
|
102
|
+
env:
|
|
103
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
104
|
+
shell: bash
|
|
105
|
+
run: |
|
|
106
|
+
VERSION=$(git describe --tags --always)
|
|
107
|
+
|
|
108
|
+
# Extract the single generated file (e.g., pinggy-windows-x64)
|
|
109
|
+
FILE=$(ls bin)
|
|
110
|
+
|
|
111
|
+
echo "Detected build artifact: $FILE"
|
|
112
|
+
|
|
113
|
+
# Create release if not exists
|
|
114
|
+
gh release create "$VERSION" --notes "Release $VERSION" --title "$VERSION" || true
|
|
115
|
+
|
|
116
|
+
echo "Uploading $FILE to GitHub Release…"
|
|
117
|
+
gh release upload "$VERSION" "bin/$FILE" --clobber
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
MacOS:
|
|
121
|
+
name: Build on ${{ matrix.name }} and upload to GitHub Release
|
|
122
|
+
runs-on: ${{ matrix.runner }}
|
|
123
|
+
|
|
124
|
+
strategy:
|
|
125
|
+
matrix:
|
|
126
|
+
include:
|
|
127
|
+
- name: MacOS-x64
|
|
128
|
+
runner: macos-15-intel
|
|
129
|
+
|
|
130
|
+
- name: MacOS-arm64
|
|
131
|
+
runner: macos-15
|
|
132
|
+
|
|
133
|
+
steps:
|
|
134
|
+
- name: Checkout
|
|
135
|
+
uses: actions/checkout@v4
|
|
136
|
+
|
|
137
|
+
- name: Use Node.js
|
|
138
|
+
uses: actions/setup-node@v4
|
|
139
|
+
with:
|
|
140
|
+
node-version: '24'
|
|
141
|
+
|
|
142
|
+
- name: Install dependencies
|
|
143
|
+
run: npm ci || npm install
|
|
144
|
+
|
|
145
|
+
- name: Build (tsup)
|
|
146
|
+
run: npm run build
|
|
147
|
+
|
|
148
|
+
- name: Run caxa build to produce `bin/`
|
|
149
|
+
run: make pack
|
|
150
|
+
|
|
151
|
+
- name: See bin directory
|
|
152
|
+
run: ls -R ./bin
|
|
153
|
+
|
|
154
|
+
- name: Upload artifact to GitHub Release
|
|
155
|
+
env:
|
|
156
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
157
|
+
shell: bash
|
|
158
|
+
run: |
|
|
159
|
+
VERSION=$(git describe --tags --always)
|
|
160
|
+
|
|
161
|
+
# Get the file in bin/ (e.g., pinggy-macos-x64)
|
|
162
|
+
FILE=$(ls bin)
|
|
163
|
+
echo "Detected build artifact: $FILE"
|
|
164
|
+
|
|
165
|
+
# Create release if it does not exist
|
|
166
|
+
gh release create "$VERSION" --notes "Release $VERSION" --title "$VERSION" || true
|
|
167
|
+
|
|
168
|
+
echo "Uploading $FILE to GitHub Release…"
|
|
169
|
+
gh release upload "$VERSION" "bin/$FILE" --clobber
|
|
170
|
+
|
package/Makefile
ADDED
package/README.md
CHANGED
|
@@ -65,41 +65,75 @@ Basic syntax:
|
|
|
65
65
|
- user@domain is optional. Domain can be any valid domain supported by the service backend (e.g., ap.example.com).
|
|
66
66
|
|
|
67
67
|
### Options
|
|
68
|
-
The CLI supports both SSH-style flags and more descriptive long flags. Below is a consolidated list (only public ones are shown here). For the most up-to-date help, run pinggy --help
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
68
|
+
The CLI supports both SSH-style flags and more descriptive long flags. Below is a consolidated list (only public ones are shown here). For the most up-to-date help, run `pinggy --help`.
|
|
69
|
+
|
|
70
|
+
### **Port Forwarding**
|
|
71
|
+
| Flag | Description | Example |
|
|
72
|
+
|------|-------------|---------|
|
|
73
|
+
| `-R`, `--R` | Local port forwarding (SSH-style) | `-R0:localhost:3000` |
|
|
74
|
+
| `-L`, `--L` | Web debugger address (SSH-style) | `-L4300:localhost:4300` |
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
### **Connection**
|
|
79
|
+
|
|
80
|
+
| Flag | Description | Example |
|
|
81
|
+
|------|-------------|---------|
|
|
82
|
+
| `-p`, `--server-port` | Pinggy server port (default: 443) | `--server-port 8080` |
|
|
83
|
+
| `--type` | Type of connection (e.g., `tcp`) | `--type tcp` |
|
|
84
|
+
| `-l`, `--localport` | Local endpoint `[protocol:][host:]port` | `--localport https://localhost:8000` |
|
|
85
|
+
| `-d`, `--debugger` | Port for web debugger | `-d 4300` |
|
|
86
|
+
| `--token` | Token for authentication | `--token abc123` |
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
### **Logging**
|
|
91
|
+
| Flag | Description |
|
|
92
|
+
|------|-------------|
|
|
93
|
+
| `--loglevel` | Logging level: `ERROR`, `INFO`, `DEBUG` |
|
|
94
|
+
| `--logfile` | Path to log file |
|
|
95
|
+
| `--v` | Print logs to stdout |
|
|
96
|
+
| `--vv` | Detailed logs (Node.js SDK + Libpinggy) |
|
|
97
|
+
| `--vvv` | Enable logs from CLI, SDK, and Libpinggy |Libpinggy.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
### **Config**
|
|
102
|
+
| Flag | Description |
|
|
103
|
+
|------|-------------|
|
|
104
|
+
| `--saveconf <file>` | Create configuration file with provided options |
|
|
105
|
+
| `--conf <file>` | Load configuration from file (CLI flags override) |
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
### **File server**
|
|
110
|
+
| Flag | Description |
|
|
111
|
+
|------|-------------|
|
|
112
|
+
| `--serve <path>` | Serve files from a local directory via simple web server |
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
### **AutoReconnect**
|
|
117
|
+
| Flag | Description |
|
|
118
|
+
|------|-------------|
|
|
119
|
+
| `--autoreconnect`, `-a` | Automatically reconnect tunnel on failure |
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
### **Remote control**
|
|
124
|
+
| Flag | Description |
|
|
125
|
+
|------|-------------|
|
|
126
|
+
| `--remote-management <token>` | Enable remote tunnel management |
|
|
127
|
+
| `--manage <addr>` | Remote management server (default: `dashboard.pinggy.io`) |
|
|
128
|
+
| `--NoTUI` | Disable TUI in remote management mode |
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
### **Misc**
|
|
133
|
+
| Flag | Description |
|
|
134
|
+
|------|-------------|
|
|
135
|
+
| `--version` | Print version and exit |
|
|
136
|
+
| `-h`, `--help` | Show help and exit |
|
|
103
137
|
|
|
104
138
|
|
|
105
139
|
### Extended options
|
|
@@ -149,7 +183,7 @@ You can control logs via CLI flags (which override environment variables). If lo
|
|
|
149
183
|
```bash
|
|
150
184
|
pinggy -p 3000 --logfile ~/.pinggy/pinggy.log --loglevel INFO --v
|
|
151
185
|
```
|
|
152
|
-
If you provide
|
|
186
|
+
If you provide `--v`, `--vv`, or `--vvv` without specifying a log level, the default log level is INFO.
|
|
153
187
|
|
|
154
188
|
|
|
155
189
|
|
|
@@ -166,7 +200,7 @@ pinggy --conf ./myconfig.json -p 8080
|
|
|
166
200
|
|
|
167
201
|
## File server mode
|
|
168
202
|
Serve a local directory quickly over a tunnel:
|
|
169
|
-
pinggy --serve /path/to/files
|
|
203
|
+
` pinggy --serve /path/to/files`
|
|
170
204
|
Optionally combine with other flags (auth, IP whitelist) as needed.
|
|
171
205
|
|
|
172
206
|
|
|
@@ -181,3 +215,5 @@ This package follows semantic versioning. See package.json for the current versi
|
|
|
181
215
|
|
|
182
216
|
## License
|
|
183
217
|
Apache License Version 2.0
|
|
218
|
+
|
|
219
|
+
|
package/caxa_build.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import caxa from 'caxa';
|
|
2
|
+
import { readFileSync } from 'fs';
|
|
3
|
+
|
|
4
|
+
(async () => {
|
|
5
|
+
const platform = process.platform; // win32, linux, darwin
|
|
6
|
+
const arch = process.arch; // x64, arm64, ia32
|
|
7
|
+
|
|
8
|
+
const packageJson = JSON.parse(readFileSync('./package.json', 'utf-8'));
|
|
9
|
+
const version = packageJson.version;
|
|
10
|
+
|
|
11
|
+
const extension =
|
|
12
|
+
platform === "win32" ? ".exe" :
|
|
13
|
+
platform === "darwin" ? "" : "";
|
|
14
|
+
|
|
15
|
+
await caxa({
|
|
16
|
+
input: "./",
|
|
17
|
+
output: `bin/pinggy-${version}-${platform}-${arch}${extension}`,
|
|
18
|
+
includeNode: true,
|
|
19
|
+
command: [
|
|
20
|
+
"{{caxa}}/node_modules/.bin/node",
|
|
21
|
+
"{{caxa}}/dist/index.js",
|
|
22
|
+
],
|
|
23
|
+
});
|
|
24
|
+
})();
|
package/dist/index.cjs
CHANGED
|
@@ -825,7 +825,7 @@ var init_tui = __esm({
|
|
|
825
825
|
isQrCodeRequested && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(QrCodeSection, { qrCodes, urls, currentQrIndex })
|
|
826
826
|
] })
|
|
827
827
|
] }),
|
|
828
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_ink8.Box, { justifyContent: "center", marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_ink8.Text, { dimColor: true, children: "Press Ctrl+C to stop the tunnel Or press h for key bindings" }) })
|
|
828
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_ink8.Box, { justifyContent: "center", marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_ink8.Text, { dimColor: true, children: "Press Ctrl+C twice to stop the tunnel. Or press h for key bindings." }) })
|
|
829
829
|
] }) }) }),
|
|
830
830
|
inDetailView && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
831
831
|
DebuggerDetailModal,
|
package/dist/index.js
CHANGED
|
@@ -2329,7 +2329,7 @@ var updateDisconnectState = null;
|
|
|
2329
2329
|
async function launchTui(finalConfig, urls, greet) {
|
|
2330
2330
|
try {
|
|
2331
2331
|
const { withFullScreen } = await import("fullscreen-ink");
|
|
2332
|
-
const { default: TunnelTui } = await import("./tui-
|
|
2332
|
+
const { default: TunnelTui } = await import("./tui-AZUFY7T2.js");
|
|
2333
2333
|
const React = await import("react");
|
|
2334
2334
|
const isTTYEnabled = process.stdin.isTTY;
|
|
2335
2335
|
const TunnelTuiWrapper = ({ finalConfig: finalConfig2, urls: urls2, greet: greet2 }) => {
|
|
@@ -565,7 +565,7 @@ var TunnelTui = ({ urls, greet, tunnelConfig, disconnectInfo }) => {
|
|
|
565
565
|
isQrCodeRequested && /* @__PURE__ */ jsx8(QrCodeSection, { qrCodes, urls, currentQrIndex })
|
|
566
566
|
] })
|
|
567
567
|
] }),
|
|
568
|
-
/* @__PURE__ */ jsx8(Box8, { justifyContent: "center", marginTop: 1, children: /* @__PURE__ */ jsx8(Text7, { dimColor: true, children: "Press Ctrl+C to stop the tunnel Or press h for key bindings" }) })
|
|
568
|
+
/* @__PURE__ */ jsx8(Box8, { justifyContent: "center", marginTop: 1, children: /* @__PURE__ */ jsx8(Text7, { dimColor: true, children: "Press Ctrl+C twice to stop the tunnel. Or press h for key bindings." }) })
|
|
569
569
|
] }) }) }),
|
|
570
570
|
inDetailView && /* @__PURE__ */ jsx8(
|
|
571
571
|
DebuggerDetailModal,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pinggy",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
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. ",
|
|
@@ -15,16 +15,18 @@
|
|
|
15
15
|
"build": "tsup",
|
|
16
16
|
"start": "node dist/index.js",
|
|
17
17
|
"test": "jest --config jest.config.js",
|
|
18
|
-
"
|
|
18
|
+
"bump": "node scripts/bumpVersion.js --bump && npm install",
|
|
19
|
+
"bump:minor": "node scripts/bumpVersion.js --bump --minor && npm install",
|
|
20
|
+
"bump:major": "node scripts/bumpVersion.js --bump --major && npm install",
|
|
21
|
+
"dev": "npm link @pinggy/pinggy && npm run build && npm link "
|
|
19
22
|
},
|
|
20
|
-
|
|
23
|
+
"exports": {
|
|
21
24
|
".": {
|
|
22
25
|
"types": "./dist/index.d.ts",
|
|
23
26
|
"import": "./dist/index.js",
|
|
24
27
|
"require": "./dist/index.cjs"
|
|
25
28
|
}
|
|
26
29
|
},
|
|
27
|
-
|
|
28
30
|
"dependencies": {
|
|
29
31
|
"@pinggy/pinggy": "^0.2.13",
|
|
30
32
|
"chalk": "^5.6.2",
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { readFileSync, writeFileSync } from "fs";
|
|
2
|
+
|
|
3
|
+
function bumpVersion(version, type = "patch") {
|
|
4
|
+
const [major, minor, patch] = version.split(".").map(Number);
|
|
5
|
+
switch(type) {
|
|
6
|
+
case "major":
|
|
7
|
+
return `${major + 1}.0.0`;
|
|
8
|
+
case "minor":
|
|
9
|
+
return `${major}.${minor + 1}.0`;
|
|
10
|
+
case "patch":
|
|
11
|
+
default:
|
|
12
|
+
return `${major}.${minor}.${patch + 1}`;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Read command line arguments
|
|
17
|
+
const shouldBump = process.argv.includes("--bump");
|
|
18
|
+
const bumpType = process.argv.includes("--major") ? "major"
|
|
19
|
+
: process.argv.includes("--minor") ? "minor"
|
|
20
|
+
: "patch";
|
|
21
|
+
|
|
22
|
+
// Read version from package.json
|
|
23
|
+
const pkg = JSON.parse(readFileSync("package.json", "utf8"));
|
|
24
|
+
let version = pkg.version;
|
|
25
|
+
|
|
26
|
+
// Bump version if requested
|
|
27
|
+
if (shouldBump) {
|
|
28
|
+
version = bumpVersion(version, bumpType);
|
|
29
|
+
// Update package.json
|
|
30
|
+
pkg.version = version;
|
|
31
|
+
writeFileSync("package.json", JSON.stringify(pkg, null, 2) + "\n");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
console.log(`Version ${version} synchronized${shouldBump ? " and bumped" : ""}`);
|
package/src/tui/index.tsx
CHANGED
|
@@ -211,7 +211,7 @@ const TunnelTui = ({ urls, greet, tunnelConfig, disconnectInfo }: TunnelAppProps
|
|
|
211
211
|
|
|
212
212
|
{/* ===== Bottom sticky message ===== */}
|
|
213
213
|
<Box justifyContent="center" marginTop={1}>
|
|
214
|
-
<Text dimColor>Press Ctrl+C to stop the tunnel Or press h for key bindings
|
|
214
|
+
<Text dimColor>Press Ctrl+C twice to stop the tunnel. Or press h for key bindings.</Text>
|
|
215
215
|
</Box>
|
|
216
216
|
</Box>
|
|
217
217
|
</Borders>
|