pinggy 0.1.9 → 0.2.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/.github/workflows/publish-binaries.yml +177 -0
- package/Makefile +4 -0
- package/README.md +73 -37
- package/caxa_build.js +24 -0
- package/dist/index.cjs +453 -146
- package/dist/index.d.cts +145 -8
- package/dist/index.d.ts +145 -8
- package/dist/index.js +448 -144
- package/dist/{tui-TJXEPR3U.js → tui-AZUFY7T2.js} +1 -1
- package/package.json +3 -2
- package/src/cli/buildConfig.ts +1 -0
- package/src/cli/defaults.ts +1 -0
- package/src/cli/options.ts +2 -0
- package/src/cli/starCli.tsx +119 -51
- package/src/index.ts +6 -2
- package/src/remote_management/handler.ts +48 -9
- package/src/remote_management/remoteManagement.ts +144 -83
- package/src/remote_management/remote_schema.ts +57 -32
- package/src/remote_management/websocket_handlers.ts +15 -1
- package/src/tui/index.tsx +1 -1
- package/src/tunnel_manager/TunnelManager.ts +199 -29
- package/src/types.ts +27 -3
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
name: Build and upload bin to S3
|
|
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: Configure AWS credentials
|
|
102
|
+
uses: aws-actions/configure-aws-credentials@v2
|
|
103
|
+
with:
|
|
104
|
+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
105
|
+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
106
|
+
aws-region: ${{ secrets.AWS_REGION }}
|
|
107
|
+
|
|
108
|
+
- name: Upload artifact to GitHub Release
|
|
109
|
+
env:
|
|
110
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
111
|
+
shell: bash
|
|
112
|
+
run: |
|
|
113
|
+
VERSION=$(git describe --tags --always)
|
|
114
|
+
|
|
115
|
+
# Extract the single generated file (e.g., pinggy-windows-x64)
|
|
116
|
+
FILE=$(ls bin)
|
|
117
|
+
|
|
118
|
+
echo "Detected build artifact: $FILE"
|
|
119
|
+
|
|
120
|
+
# Create release if not exists
|
|
121
|
+
gh release create "$VERSION" --notes "Release $VERSION" --title "$VERSION" || true
|
|
122
|
+
|
|
123
|
+
echo "Uploading $FILE to GitHub Release…"
|
|
124
|
+
gh release upload "$VERSION" "bin/$FILE" --clobber
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
MacOS:
|
|
128
|
+
name: Build on ${{ matrix.name }} and upload to GitHub Release
|
|
129
|
+
runs-on: ${{ matrix.runner }}
|
|
130
|
+
|
|
131
|
+
strategy:
|
|
132
|
+
matrix:
|
|
133
|
+
include:
|
|
134
|
+
- name: MacOS-x64
|
|
135
|
+
runner: macos-15-intel
|
|
136
|
+
|
|
137
|
+
- name: MacOS-arm64
|
|
138
|
+
runner: macos-15
|
|
139
|
+
|
|
140
|
+
steps:
|
|
141
|
+
- name: Checkout
|
|
142
|
+
uses: actions/checkout@v4
|
|
143
|
+
|
|
144
|
+
- name: Use Node.js
|
|
145
|
+
uses: actions/setup-node@v4
|
|
146
|
+
with:
|
|
147
|
+
node-version: '24'
|
|
148
|
+
|
|
149
|
+
- name: Install dependencies
|
|
150
|
+
run: npm ci || npm install
|
|
151
|
+
|
|
152
|
+
- name: Build (tsup)
|
|
153
|
+
run: npm run build
|
|
154
|
+
|
|
155
|
+
- name: Run caxa build to produce `bin/`
|
|
156
|
+
run: make pack
|
|
157
|
+
|
|
158
|
+
- name: See bin directory
|
|
159
|
+
run: ls -R ./bin
|
|
160
|
+
|
|
161
|
+
- name: Upload artifact to GitHub Release
|
|
162
|
+
env:
|
|
163
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
164
|
+
shell: bash
|
|
165
|
+
run: |
|
|
166
|
+
VERSION=$(git describe --tags --always)
|
|
167
|
+
|
|
168
|
+
# Get the file in bin/ (e.g., pinggy-macos-x64)
|
|
169
|
+
FILE=$(ls bin)
|
|
170
|
+
echo "Detected build artifact: $FILE"
|
|
171
|
+
|
|
172
|
+
# Create release if it does not exist
|
|
173
|
+
gh release create "$VERSION" --notes "Release $VERSION" --title "$VERSION" || true
|
|
174
|
+
|
|
175
|
+
echo "Uploading $FILE to GitHub Release…"
|
|
176
|
+
gh release upload "$VERSION" "bin/$FILE" --clobber
|
|
177
|
+
|
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
|
+
})();
|