pocketshell 1.0.6 → 1.0.8
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/README.md +100 -15
- package/bin/pocketshell.js +4 -2
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -44,19 +44,21 @@ The `mobile/src/locales/` tree is here because translations benefit from being p
|
|
|
44
44
|
|
|
45
45
|
## Install
|
|
46
46
|
|
|
47
|
-
Pre-built binaries
|
|
47
|
+
### Pre-built binaries
|
|
48
|
+
|
|
49
|
+
Pick either:
|
|
48
50
|
|
|
49
51
|
```bash
|
|
50
|
-
# install script
|
|
52
|
+
# install script — macOS & Linux
|
|
51
53
|
brew install cosign # one-time, for Sigstore signature verification
|
|
52
54
|
curl -fsSL https://pocketshell.app/install.sh | bash
|
|
53
55
|
|
|
54
|
-
# npm
|
|
56
|
+
# npm — macOS, Linux & Windows
|
|
55
57
|
npm i -g pocketshell
|
|
56
58
|
```
|
|
57
59
|
|
|
58
|
-
**Install script** detects your OS and arch, fetches the
|
|
59
|
-
tarball from the latest [GitHub
|
|
60
|
+
**Install script** (macOS / Linux) detects your OS and arch, fetches the
|
|
61
|
+
matching tarball from the latest [GitHub
|
|
60
62
|
Release](https://github.com/yashagldit/PocketShell/releases), verifies
|
|
61
63
|
its SHA-256 checksum **and the Sigstore cosign keyless signature**
|
|
62
64
|
(pinned to this repo's release workflow identity), then installs to
|
|
@@ -65,33 +67,107 @@ root). Without cosign installed the script refuses to proceed — the
|
|
|
65
67
|
SHA-256 alone is same-origin integrity, not authenticity, so a
|
|
66
68
|
compromised release publisher could serve a matching checksum for a
|
|
67
69
|
malicious binary. Set `POCKETSHELL_SKIP_COSIGN=1` only if you've
|
|
68
|
-
verified the artifact out of band.
|
|
70
|
+
verified the artifact out of band. It's a POSIX shell script — on
|
|
71
|
+
**Windows** use npm (below) or [build from source](#build-from-source).
|
|
69
72
|
|
|
70
73
|
Read the script first if you'd rather not pipe to bash blindly — it's
|
|
71
74
|
served from the static site and intentionally short.
|
|
72
75
|
|
|
73
76
|
**npm** ships the binary inside platform-specific packages
|
|
74
|
-
(`@pocketshell/darwin-arm64`, `@pocketshell/linux-x64-gnu`,
|
|
75
|
-
selected by npm's `os` / `cpu` /
|
|
76
|
-
|
|
77
|
+
(`@pocketshell/darwin-arm64`, `@pocketshell/linux-x64-gnu`,
|
|
78
|
+
`@pocketshell/win32-x64-msvc`, etc.) selected by npm's `os` / `cpu` /
|
|
79
|
+
`libc` filters — this is the **recommended path on Windows**. The
|
|
80
|
+
packages are published from this repo's release workflow via [npm Trusted
|
|
77
81
|
Publishing](https://docs.npmjs.com/trusted-publishers/) (OIDC, no
|
|
78
82
|
long-lived tokens), with build provenance attached automatically.
|
|
79
83
|
|
|
80
|
-
|
|
84
|
+
Verify either install:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
pocketshell --version
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Build from source
|
|
91
|
+
|
|
92
|
+
Prefer to compile the agent yourself rather than trust a pre-built
|
|
93
|
+
binary? The source carries **no backend URL** — you supply PocketShell's
|
|
94
|
+
endpoints either at build time (baked into the binary) or at runtime
|
|
95
|
+
(per invocation).
|
|
96
|
+
|
|
97
|
+
**Prerequisites**
|
|
98
|
+
|
|
99
|
+
- Rust 1.78+ — install via [rustup](https://rustup.rs).
|
|
100
|
+
- A C linker/toolchain: `build-essential` (Debian/Ubuntu) or the
|
|
101
|
+
equivalent `gcc`/`clang` package on Linux · Xcode Command Line Tools
|
|
102
|
+
(`xcode-select --install`) on macOS · [Visual Studio C++ Build
|
|
103
|
+
Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/) on
|
|
104
|
+
Windows.
|
|
105
|
+
- Nothing else — the keychain (native OS keyring on macOS / Linux /
|
|
106
|
+
Windows) and the WebRTC stack are pure-Rust, so there's no OpenSSL,
|
|
107
|
+
dbus, or pkg-config to install.
|
|
108
|
+
|
|
109
|
+
**Clone, then build with the backend URL baked in** (recommended) —
|
|
110
|
+
macOS / Linux:
|
|
81
111
|
|
|
82
112
|
```bash
|
|
83
113
|
git clone https://github.com/yashagldit/PocketShell.git
|
|
84
114
|
cd PocketShell
|
|
85
|
-
|
|
115
|
+
POCKETSHELL_DEFAULT_BACKEND_URL=https://api.pocketshell.app \
|
|
116
|
+
POCKETSHELL_DEFAULT_WS_URL=wss://api.pocketshell.app/ws/host \
|
|
117
|
+
cargo install --path crates/host-agent --root ~/.local
|
|
86
118
|
export PATH="$HOME/.local/bin:$PATH"
|
|
87
119
|
```
|
|
88
120
|
|
|
89
|
-
|
|
121
|
+
Windows (PowerShell):
|
|
122
|
+
|
|
123
|
+
```powershell
|
|
124
|
+
git clone https://github.com/yashagldit/PocketShell.git
|
|
125
|
+
cd PocketShell
|
|
126
|
+
$env:POCKETSHELL_DEFAULT_BACKEND_URL = "https://api.pocketshell.app"
|
|
127
|
+
$env:POCKETSHELL_DEFAULT_WS_URL = "wss://api.pocketshell.app/ws/host"
|
|
128
|
+
cargo install --path crates/host-agent --root "$env:USERPROFILE\.local"
|
|
129
|
+
# then add %USERPROFILE%\.local\bin to your PATH
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
> **Why the env vars matter.** `crates/host-core/src/config.rs` reads
|
|
133
|
+
> them at compile time via `option_env!`. Build *without* them and the
|
|
134
|
+
> binary ships with empty URLs and fails its first connection with a
|
|
135
|
+
> misleading `invalid ws request` error. Cargo also **doesn't treat an
|
|
136
|
+
> env-var change as a reason to rebuild** — if you already built once
|
|
137
|
+
> without them set, force a clean recompile first:
|
|
138
|
+
> `cargo clean -p host-core -p host-agent`.
|
|
139
|
+
|
|
140
|
+
Alternatively, build with no URL baked in and supply it at runtime:
|
|
90
141
|
|
|
91
142
|
```bash
|
|
92
|
-
pocketshell
|
|
143
|
+
POCKETSHELL_BACKEND_URL=https://api.pocketshell.app \
|
|
144
|
+
POCKETSHELL_WS_URL=wss://api.pocketshell.app/ws/host \
|
|
145
|
+
pocketshell daemon run
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**Verify the URL is baked in** before relying on the binary:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
# macOS / Linux
|
|
152
|
+
strings ~/.local/bin/pocketshell \
|
|
153
|
+
| grep -oE '(wss|https)://[a-z.]+\.pocketshell\.app[a-z/]*' | sort -u
|
|
93
154
|
```
|
|
94
155
|
|
|
156
|
+
```powershell
|
|
157
|
+
# Windows (PowerShell)
|
|
158
|
+
Select-String -Path "$env:USERPROFILE\.local\bin\pocketshell.exe" `
|
|
159
|
+
-Pattern 'wss?://[a-z.]+\.pocketshell\.app' |
|
|
160
|
+
ForEach-Object { $_.Matches.Value } | Sort-Object -Unique
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Both the `https://` and `wss://` URLs should print. If nothing does, the
|
|
164
|
+
binary won't connect — rebuild after `cargo clean` (see the note above).
|
|
165
|
+
|
|
166
|
+
> PocketShell's backend is **not self-hostable** — a from-source build
|
|
167
|
+
> still talks to the hosted control plane at `api.pocketshell.app`. The
|
|
168
|
+
> `POCKETSHELL_*` overrides exist for our own dev/test, not for pointing
|
|
169
|
+
> the agent at a server you run.
|
|
170
|
+
|
|
95
171
|
## Pair and run
|
|
96
172
|
|
|
97
173
|
Pairing is QR-based — run `pocketshell pair` on the host, scan the QR from the mobile app.
|
|
@@ -104,12 +180,17 @@ pocketshell pair
|
|
|
104
180
|
# point the camera at the QR shown in step 1
|
|
105
181
|
|
|
106
182
|
# 3. start the daemon (runs as your user, not root)
|
|
107
|
-
pocketshell daemon start
|
|
183
|
+
pocketshell daemon start # linux / macOS — installs a user service
|
|
184
|
+
|
|
185
|
+
# windows: the background service isn't wired up yet, so run it in the
|
|
186
|
+
# foreground in a terminal you keep open instead of `daemon start`:
|
|
187
|
+
pocketshell daemon run # windows
|
|
108
188
|
|
|
109
189
|
# 4. status & logs
|
|
110
190
|
pocketshell daemon status
|
|
111
191
|
journalctl --user -fu pocketshell-host-agent # linux
|
|
112
192
|
log stream --predicate 'process == "pocketshell"' # macOS
|
|
193
|
+
# windows: logs stream to the console running `daemon run`
|
|
113
194
|
```
|
|
114
195
|
|
|
115
196
|
The QR carries a short-lived claim plus the host's public key, so the mobile app pins the host identity at pair time rather than trusting a backend-relayed field. To re-pair an existing host onto a different account, run `pocketshell pair --reset` — this wipes the local identity before generating a fresh QR.
|
|
@@ -264,7 +345,11 @@ cargo test -p host-agent # CLI tests
|
|
|
264
345
|
RUST_LOG=debug cargo run -p host-agent -- daemon run # run with verbose logs
|
|
265
346
|
```
|
|
266
347
|
|
|
267
|
-
|
|
348
|
+
Running an actual daemon from a dev build needs the backend URLs too —
|
|
349
|
+
bake them in or set `POCKETSHELL_BACKEND_URL` / `POCKETSHELL_WS_URL` at
|
|
350
|
+
runtime (see [Build from source](#build-from-source)).
|
|
351
|
+
|
|
352
|
+
Targets supported today: `x86_64-unknown-linux-gnu`, `aarch64-unknown-linux-gnu`, `aarch64-apple-darwin`, `x86_64-apple-darwin`, `x86_64-pc-windows-msvc`. Windows x64 is distributed via npm (`npm i -g pocketshell`); some host features (service install, local-attach, PTY relay) are still stubbed on Windows.
|
|
268
353
|
|
|
269
354
|
---
|
|
270
355
|
|
package/bin/pocketshell.js
CHANGED
|
@@ -38,6 +38,7 @@ function resolvePackageName() {
|
|
|
38
38
|
? '@pocketshell/linux-x64-musl'
|
|
39
39
|
: '@pocketshell/linux-x64-gnu';
|
|
40
40
|
}
|
|
41
|
+
if (platform === 'win32' && arch === 'x64') return '@pocketshell/win32-x64-msvc';
|
|
41
42
|
return null;
|
|
42
43
|
}
|
|
43
44
|
|
|
@@ -45,7 +46,7 @@ const pkgName = resolvePackageName();
|
|
|
45
46
|
if (!pkgName) {
|
|
46
47
|
console.error(
|
|
47
48
|
`pocketshell: no prebuilt binary for ${process.platform}/${process.arch}.\n` +
|
|
48
|
-
`Supported: darwin/arm64, linux/x64 (gnu+musl), linux/arm64.\n` +
|
|
49
|
+
`Supported: darwin/arm64, linux/x64 (gnu+musl), linux/arm64, win32/x64.\n` +
|
|
49
50
|
`See https://pocketshell.app for manual install options.`
|
|
50
51
|
);
|
|
51
52
|
process.exit(1);
|
|
@@ -64,7 +65,8 @@ try {
|
|
|
64
65
|
process.exit(1);
|
|
65
66
|
}
|
|
66
67
|
|
|
67
|
-
const
|
|
68
|
+
const binName = process.platform === 'win32' ? 'pocketshell.exe' : 'pocketshell';
|
|
69
|
+
const binPath = path.join(pkgRoot, 'bin', binName);
|
|
68
70
|
const result = spawnSync(binPath, process.argv.slice(2), { stdio: 'inherit' });
|
|
69
71
|
|
|
70
72
|
if (result.error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pocketshell",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "Secure mobile-to-host terminal access — installs the pocketshell host-agent CLI.",
|
|
5
5
|
"homepage": "https://pocketshell.app",
|
|
6
6
|
"repository": {
|
|
@@ -18,9 +18,10 @@
|
|
|
18
18
|
"node": ">=14"
|
|
19
19
|
},
|
|
20
20
|
"optionalDependencies": {
|
|
21
|
-
"@pocketshell/darwin-arm64": "1.0.
|
|
22
|
-
"@pocketshell/linux-x64-gnu": "1.0.
|
|
23
|
-
"@pocketshell/linux-arm64-gnu": "1.0.
|
|
24
|
-
"@pocketshell/linux-x64-musl": "1.0.
|
|
21
|
+
"@pocketshell/darwin-arm64": "1.0.8",
|
|
22
|
+
"@pocketshell/linux-x64-gnu": "1.0.8",
|
|
23
|
+
"@pocketshell/linux-arm64-gnu": "1.0.8",
|
|
24
|
+
"@pocketshell/linux-x64-musl": "1.0.8",
|
|
25
|
+
"@pocketshell/win32-x64-msvc": "1.0.8"
|
|
25
26
|
}
|
|
26
27
|
}
|