sshler 0.3.2__tar.gz → 0.4.0__tar.gz
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.
- sshler-0.4.0/PKG-INFO +391 -0
- sshler-0.4.0/README.md +350 -0
- {sshler-0.3.2 → sshler-0.4.0}/pyproject.toml +2 -1
- {sshler-0.3.2 → sshler-0.4.0}/sshler/static/base.js +101 -2
- sshler-0.4.0/sshler/static/favicon-terminal-local.svg +8 -0
- {sshler-0.3.2 → sshler-0.4.0}/sshler/static/style.css +16 -1
- {sshler-0.3.2 → sshler-0.4.0}/sshler/static/term.js +199 -10
- {sshler-0.3.2 → sshler-0.4.0}/sshler/templates/box.html +1 -1
- sshler-0.4.0/sshler/templates/docs.html +20 -0
- {sshler-0.3.2 → sshler-0.4.0}/sshler/templates/index.html +16 -11
- {sshler-0.3.2 → sshler-0.4.0}/sshler/templates/partials/dir_listing.html +8 -7
- {sshler-0.3.2 → sshler-0.4.0}/sshler/templates/term.html +16 -15
- {sshler-0.3.2 → sshler-0.4.0}/sshler/webapp.py +62 -13
- sshler-0.4.0/sshler.egg-info/PKG-INFO +391 -0
- {sshler-0.3.2 → sshler-0.4.0}/sshler.egg-info/SOURCES.txt +1 -0
- {sshler-0.3.2 → sshler-0.4.0}/sshler.egg-info/requires.txt +1 -0
- {sshler-0.3.2 → sshler-0.4.0}/tests/test_routes.py +59 -2
- {sshler-0.3.2 → sshler-0.4.0}/tests/test_websocket.py +48 -24
- sshler-0.3.2/PKG-INFO +0 -245
- sshler-0.3.2/README.md +0 -205
- sshler-0.3.2/sshler/templates/docs.html +0 -40
- sshler-0.3.2/sshler.egg-info/PKG-INFO +0 -245
- {sshler-0.3.2 → sshler-0.4.0}/MANIFEST.in +0 -0
- {sshler-0.3.2 → sshler-0.4.0}/setup.cfg +0 -0
- {sshler-0.3.2 → sshler-0.4.0}/sshler/__init__.py +0 -0
- {sshler-0.3.2 → sshler-0.4.0}/sshler/cli.py +0 -0
- {sshler-0.3.2 → sshler-0.4.0}/sshler/config.py +0 -0
- {sshler-0.3.2 → sshler-0.4.0}/sshler/scripts/install-sshler-task.ps1 +0 -0
- {sshler-0.3.2 → sshler-0.4.0}/sshler/scripts/remove-sshler-task.ps1 +0 -0
- {sshler-0.3.2 → sshler-0.4.0}/sshler/scripts/run-sshler.ps1 +0 -0
- {sshler-0.3.2 → sshler-0.4.0}/sshler/ssh.py +0 -0
- {sshler-0.3.2 → sshler-0.4.0}/sshler/ssh_config.py +0 -0
- {sshler-0.3.2 → sshler-0.4.0}/sshler/state.py +0 -0
- {sshler-0.3.2 → sshler-0.4.0}/sshler/static/favicon-terminal.svg +0 -0
- {sshler-0.3.2 → sshler-0.4.0}/sshler/static/favicon.svg +0 -0
- {sshler-0.3.2 → sshler-0.4.0}/sshler/static/file-edit.js +0 -0
- {sshler-0.3.2 → sshler-0.4.0}/sshler/static/file-view.js +0 -0
- {sshler-0.3.2 → sshler-0.4.0}/sshler/templates/base.html +0 -0
- {sshler-0.3.2 → sshler-0.4.0}/sshler/templates/file_edit.html +0 -0
- {sshler-0.3.2 → sshler-0.4.0}/sshler/templates/file_view.html +0 -0
- {sshler-0.3.2 → sshler-0.4.0}/sshler/templates/new_box.html +0 -0
- {sshler-0.3.2 → sshler-0.4.0}/sshler.egg-info/dependency_links.txt +0 -0
- {sshler-0.3.2 → sshler-0.4.0}/sshler.egg-info/entry_points.txt +0 -0
- {sshler-0.3.2 → sshler-0.4.0}/sshler.egg-info/top_level.txt +0 -0
- {sshler-0.3.2 → sshler-0.4.0}/tests/test_basic.py +0 -0
- {sshler-0.3.2 → sshler-0.4.0}/tests/test_config.py +0 -0
- {sshler-0.3.2 → sshler-0.4.0}/tests/test_ssh.py +0 -0
sshler-0.4.0/PKG-INFO
ADDED
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sshler
|
|
3
|
+
Version: 0.4.0
|
|
4
|
+
Summary: A local FastAPI-powered SSH multiplexer for tmux-in-browser — from your laptop only.
|
|
5
|
+
Author: You
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/gabu-quest/sshler
|
|
8
|
+
Project-URL: Repository, https://github.com/gabu-quest/sshler
|
|
9
|
+
Project-URL: Issues, https://github.com/gabu-quest/sshler/issues
|
|
10
|
+
Keywords: ssh,tmux,fastapi,sftp,htmx
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Environment :: Web Environment
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Topic :: System :: Systems Administration
|
|
22
|
+
Classifier: Framework :: FastAPI
|
|
23
|
+
Requires-Python: >=3.12
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
Requires-Dist: fastapi>=0.115.0
|
|
26
|
+
Requires-Dist: uvicorn[standard]>=0.30.0
|
|
27
|
+
Requires-Dist: jinja2>=3.1
|
|
28
|
+
Requires-Dist: pyyaml>=6.0
|
|
29
|
+
Requires-Dist: asyncssh>=2.14.0
|
|
30
|
+
Requires-Dist: platformdirs>=4.2
|
|
31
|
+
Requires-Dist: pydantic>=2.7
|
|
32
|
+
Requires-Dist: python-multipart>=0.0.9
|
|
33
|
+
Requires-Dist: markdown-it-py>=3.0.0
|
|
34
|
+
Requires-Dist: sqler>=1.2025.9.24
|
|
35
|
+
Provides-Extra: dev
|
|
36
|
+
Requires-Dist: anyio>=4.4; extra == "dev"
|
|
37
|
+
Requires-Dist: httpx>=0.27.0; extra == "dev"
|
|
38
|
+
Requires-Dist: pytest>=8.2; extra == "dev"
|
|
39
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
|
|
40
|
+
Requires-Dist: ruff>=0.5.6; extra == "dev"
|
|
41
|
+
|
|
42
|
+
# sshler
|
|
43
|
+
|
|
44
|
+
sshler is a lightweight, local-only web UI that lets you browse remote files over SFTP and jump into tmux sessions in your browser — without installing anything on the remote host.
|
|
45
|
+
|
|
46
|
+
## Features
|
|
47
|
+
|
|
48
|
+
- **Cross-platform**: Runs on Windows 11, macOS, and Linux (anywhere with Python 3.12+)
|
|
49
|
+
- **Local workspace**: Browse your own filesystem and launch native tmux sessions alongside remote hosts (uses WSL tmux on Windows, native tmux on Linux/macOS)
|
|
50
|
+
- **SSH integration**: Uses your existing SSH keys and honors OpenSSH aliases
|
|
51
|
+
- **Terminal in browser**: Opens `tmux new -As <session> -c <dir>` on the remote host and bridges it via WebSocket + xterm.js
|
|
52
|
+
- **File management**: HTMX-based file browser with preview, edit, delete, and "Open Terminal Here"
|
|
53
|
+
- **Auto-configuration**: Creates starter config on first run
|
|
54
|
+
- **Alias resolution**: Falls back to `ssh -G` when DNS fails; reset overrides with one click
|
|
55
|
+
- **File operations**: Preview, edit (≤256 KB), and delete files with CodeMirror editor
|
|
56
|
+
- **Bilingual UI**: Full English and Japanese language support
|
|
57
|
+
|
|
58
|
+
## Install
|
|
59
|
+
|
|
60
|
+
### PyPI (recommended)
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pip install sshler
|
|
64
|
+
|
|
65
|
+
# Launch once to create the config + systemd/service assets
|
|
66
|
+
sshler serve
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Requires Python **3.12+**.
|
|
70
|
+
|
|
71
|
+
### Development
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
uv pip install -e .
|
|
75
|
+
# or: pip install -e .
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
After cloning the repository, install the dev extras and run the usual tooling:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
uv sync --group dev
|
|
82
|
+
uv run ruff check .
|
|
83
|
+
uv run pytest
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Run
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
sshler serve
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
The app will open `http://127.0.0.1:8822` in your default browser.
|
|
93
|
+
|
|
94
|
+
## Configuration
|
|
95
|
+
|
|
96
|
+
sshler reads your existing OpenSSH config (`~/.ssh/config`) and shows every concrete `Host` entry automatically. Any favourites, default directories, or custom hosts you add through the UI are stored in a companion YAML file.
|
|
97
|
+
|
|
98
|
+
A config file is created on first run:
|
|
99
|
+
|
|
100
|
+
- Windows: `%APPDATA%\sshler\boxes.yaml`
|
|
101
|
+
- macOS/Linux: `~/.config/sshler/boxes.yaml`
|
|
102
|
+
|
|
103
|
+
Example:
|
|
104
|
+
|
|
105
|
+
```yaml
|
|
106
|
+
boxes:
|
|
107
|
+
- name: gabu-server
|
|
108
|
+
host: example.tailnet.ts.net # literal IP/FQDN or keep as placeholder
|
|
109
|
+
ssh_alias: gabu-server # optional: resolves via `ssh -G gabu-server`
|
|
110
|
+
user: gabu
|
|
111
|
+
port: 22
|
|
112
|
+
keyfile: "C:/Users/gabu/.ssh/id_ed25519"
|
|
113
|
+
favorites:
|
|
114
|
+
- /home/gabu
|
|
115
|
+
- /home/gabu/projects
|
|
116
|
+
- /srv/codex
|
|
117
|
+
default_dir: /home/gabu
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
> Tip: Set `default_dir` if your home path isn't `/home/<user>`.
|
|
121
|
+
> If you rely on an OpenSSH alias, add `ssh_alias:` and sshler will run `ssh -G` to expand it when DNS fails.
|
|
122
|
+
|
|
123
|
+
### Resetting overrides
|
|
124
|
+
|
|
125
|
+
Boxes imported from SSH config show a highlighted border and "Refresh" button. If you change something in `~/.ssh/config`, hit Refresh to drop any stored overrides (host/user/port/key) so the new settings take effect without editing `boxes.yaml`.
|
|
126
|
+
|
|
127
|
+
### Adding custom boxes
|
|
128
|
+
|
|
129
|
+
Hit "Add Box" in the UI to define a host that isn't in your SSH config (for example, a throwaway Docker container). Fields you leave blank fall back to your SSH defaults.
|
|
130
|
+
|
|
131
|
+
### Security model (important)
|
|
132
|
+
|
|
133
|
+
- sshler is designed for **single-user localhost** use. By default `sshler serve` binds to `127.0.0.1` and prints a random `X-SSHLER-TOKEN` that every state-changing request must send.
|
|
134
|
+
- File uploads are capped at 50 MB (tunable via `--max-upload-mb`). Uploaded content is never executed server-side.
|
|
135
|
+
- SSH connections still honour your system `known_hosts`. Only set `known_hosts: ignore` if you fully understand the risk.
|
|
136
|
+
- If you expose sshler beyond localhost, opt-in via `--allow-origin` and add `--auth user:pass` (basic auth). Use it only on networks you trust and put TLS in front (nginx, Caddy, etc.).
|
|
137
|
+
- There is no telemetry, analytics, or call-home behaviour.
|
|
138
|
+
|
|
139
|
+
### CLI options
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
sshler serve \
|
|
143
|
+
--host 127.0.0.1 \
|
|
144
|
+
--port 8822 \
|
|
145
|
+
--max-upload-mb 50 \
|
|
146
|
+
--allow-origin http://workstation:8822 \
|
|
147
|
+
--auth coder:supersecret \
|
|
148
|
+
--no-ssh-alias \
|
|
149
|
+
--log-level info
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
- `--host` (alias `--bind`) sets the bind address (default: `127.0.0.1` for localhost-only). Use `0.0.0.0` to expose on all interfaces, but **only on trusted networks with `--auth` and TLS**.
|
|
153
|
+
- `--port` sets the port number (default: `8822`).
|
|
154
|
+
- `--allow-origin` can be repeated to expand CORS; combine it with `--auth` if you expose the UI beyond localhost.
|
|
155
|
+
- `--auth user:pass` enables HTTP basic authentication (recommended if binding to `0.0.0.0`).
|
|
156
|
+
- `--max-upload-mb` sets the upload size limit (default: 50 MB).
|
|
157
|
+
- `--no-ssh-alias` disables the `ssh -G` fallback when DNS fails.
|
|
158
|
+
- `--token` lets you supply your own `X-SSHLER-TOKEN` (otherwise a secure random value is generated).
|
|
159
|
+
- `--log-level` feeds directly into uvicorn (options: `critical`, `error`, `warning`, `info`, `debug`, `trace`).
|
|
160
|
+
|
|
161
|
+
The server prints the token (and, if enabled, the basic auth username) on startup so you can copy it into API clients or browser extensions.
|
|
162
|
+
|
|
163
|
+
### Terminal notifications
|
|
164
|
+
|
|
165
|
+
- Send a bell (`printf '\a'`) from tmux or your shell to flash the browser title and raise a desktop notification whenever the sshler tab is hidden.
|
|
166
|
+
- For richer messages use OSC 777: `printf '\033]777;notify=Codex%20done|Check%20the%20output\a'`. The text before the `|` becomes the title; the second part is the body.
|
|
167
|
+
- JSON payloads are also supported: `printf '\033]777;notify={"title":"Codex","message":"All tasks finished"}\a'`.
|
|
168
|
+
- The first notification prompts the browser for permission. Denying it still leaves the in-app toast and title badge when you return to the tab.
|
|
169
|
+
|
|
170
|
+
## Autostart
|
|
171
|
+
|
|
172
|
+
### Windows (Task Scheduler)
|
|
173
|
+
|
|
174
|
+
1. Run `where sshler` to locate the installed executable (for example, `%LOCALAPPDATA%\Programs\Python\Python312\Scripts\sshler.exe`).
|
|
175
|
+
2. Open **Task Scheduler → Create Task…**.
|
|
176
|
+
3. Under **Triggers**, add "At log on".
|
|
177
|
+
4. Under **Actions**, choose "Start a program" and point to the `sshler.exe` path. Add arguments such as `serve --no-browser` and set **Start in** to a writable directory.
|
|
178
|
+
5. Tick "Run with highest privileges" if you need WSL access, then save. sshler will now launch automatically every time you sign in.
|
|
179
|
+
|
|
180
|
+
### Linux / macOS (systemd user service)
|
|
181
|
+
|
|
182
|
+
Create `~/.config/systemd/user/sshler.service`:
|
|
183
|
+
|
|
184
|
+
```ini
|
|
185
|
+
[Unit]
|
|
186
|
+
Description=sshler – local tmux bridge
|
|
187
|
+
After=network.target
|
|
188
|
+
|
|
189
|
+
[Service]
|
|
190
|
+
Type=simple
|
|
191
|
+
ExecStart=%h/.local/bin/sshler serve --bind 127.0.0.1 --no-browser
|
|
192
|
+
Restart=on-failure
|
|
193
|
+
|
|
194
|
+
[Install]
|
|
195
|
+
WantedBy=default.target
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Reload and enable:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
systemctl --user daemon-reload
|
|
202
|
+
systemctl --user enable --now sshler.service
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Dependencies & licenses
|
|
206
|
+
|
|
207
|
+
- FastAPI, uvicorn, asyncssh, platformdirs, yaml (PyPI packages, permissive licenses)
|
|
208
|
+
- HTMX (MIT) and xterm.js (MIT) are loaded from unpkg
|
|
209
|
+
- CodeMirror (MIT) powers the editor
|
|
210
|
+
|
|
211
|
+
All assets are used under their respective MIT/BSD-style licenses. sshler itself ships under the MIT license.
|
|
212
|
+
|
|
213
|
+
## Why "sshler"?
|
|
214
|
+
|
|
215
|
+
Because sometimes you want less VS Code, more terminal — but still in a nice browser tab.
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
# 日本語ドキュメント
|
|
220
|
+
|
|
221
|
+
sshler はローカル専用の軽量 Web UI で、リモートファイルを SFTP で閲覧したり、ブラウザ上で tmux セッションに接続したりできます。リモート側に追加ソフトをインストールする必要はありません。
|
|
222
|
+
|
|
223
|
+
## 特徴
|
|
224
|
+
|
|
225
|
+
- **クロスプラットフォーム**: Windows 11、macOS、Linux で動作(Python 3.12+ が必要)
|
|
226
|
+
- **ローカルワークスペース**: ローカルファイルシステムを閲覧し、リモートホストと並べてネイティブの tmux セッションを起動(Windows では WSL tmux、Linux/macOS ではネイティブ tmux を使用)
|
|
227
|
+
- **SSH 統合**: 既存の SSH 鍵を使用し、OpenSSH エイリアスに対応
|
|
228
|
+
- **ブラウザ内ターミナル**: リモートホストで `tmux new -As <session> -c <dir>` を開き、WebSocket + xterm.js 経由で接続
|
|
229
|
+
- **ファイル管理**: プレビュー、編集、削除、「ここでターミナルを開く」機能を備えた HTMX ベースのファイルブラウザ
|
|
230
|
+
- **自動設定**: 初回起動時にスターター設定を作成
|
|
231
|
+
- **エイリアス解決**: DNS 失敗時は `ssh -G` にフォールバック。ワンクリックで上書きをリセット
|
|
232
|
+
- **ファイル操作**: CodeMirror エディタでファイルのプレビュー、編集(256 KB 以下)、削除が可能
|
|
233
|
+
- **バイリンガル UI**: 英語と日本語の完全サポート
|
|
234
|
+
|
|
235
|
+
## インストール
|
|
236
|
+
|
|
237
|
+
### PyPI(推奨)
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
pip install sshler
|
|
241
|
+
|
|
242
|
+
# 設定ファイルと systemd/サービスアセットを作成するため一度起動
|
|
243
|
+
sshler serve
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
Python **3.12+** が必要です。
|
|
247
|
+
|
|
248
|
+
### 開発用
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
uv pip install -e .
|
|
252
|
+
# または: pip install -e .
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
リポジトリをクローンした後、dev extras をインストールして通常のツールを実行:
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
uv sync --group dev
|
|
259
|
+
uv run ruff check .
|
|
260
|
+
uv run pytest
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
## 実行
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
sshler serve
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
デフォルトブラウザで `http://127.0.0.1:8822` が開きます。
|
|
270
|
+
|
|
271
|
+
## 設定
|
|
272
|
+
|
|
273
|
+
sshler は既存の OpenSSH 設定(`~/.ssh/config`)を読み取り、すべての具体的な `Host` エントリを自動的に表示します。UI を通じて追加したお気に入り、デフォルトディレクトリ、カスタムホストは、付属の YAML ファイルに保存されます。
|
|
274
|
+
|
|
275
|
+
設定ファイルは初回実行時に作成されます:
|
|
276
|
+
|
|
277
|
+
- Windows: `%APPDATA%\sshler\boxes.yaml`
|
|
278
|
+
- macOS/Linux: `~/.config/sshler/boxes.yaml`
|
|
279
|
+
|
|
280
|
+
例:
|
|
281
|
+
|
|
282
|
+
```yaml
|
|
283
|
+
boxes:
|
|
284
|
+
- name: gabu-server
|
|
285
|
+
host: example.tailnet.ts.net
|
|
286
|
+
ssh_alias: gabu-server
|
|
287
|
+
user: gabu
|
|
288
|
+
port: 22
|
|
289
|
+
keyfile: "C:/Users/gabu/.ssh/id_ed25519"
|
|
290
|
+
favorites:
|
|
291
|
+
- /home/gabu
|
|
292
|
+
- /home/gabu/projects
|
|
293
|
+
- /srv/codex
|
|
294
|
+
default_dir: /home/gabu
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
> ヒント: ホームパスが `/home/<user>` でない場合は `default_dir` を設定してください。OpenSSH エイリアスを使用する場合は `ssh_alias:` を追加すると、DNS 失敗時に `ssh -G` で解決します。
|
|
298
|
+
|
|
299
|
+
### 上書き設定のリセット
|
|
300
|
+
|
|
301
|
+
SSH 設定から取り込まれたボックスは枠が強調表示され、「Refresh」ボタンで上書き設定を削除できます。`~/.ssh/config` を更新した際はボタンを押すだけで最新状態になります。
|
|
302
|
+
|
|
303
|
+
### カスタムボックスの追加
|
|
304
|
+
|
|
305
|
+
UI の "Add Box" から SSH 設定に存在しないホストも追加できます(例: 一時的な Docker コンテナ)。未入力の項目は SSH のデフォルト値が使われます。
|
|
306
|
+
|
|
307
|
+
### セキュリティモデル(重要)
|
|
308
|
+
|
|
309
|
+
- sshler は **シングルユーザー・ローカルホスト専用** に設計されています。デフォルトでは `sshler serve` は `127.0.0.1` にバインドし、すべての状態変更リクエストに必要なランダムな `X-SSHLER-TOKEN` を出力します。
|
|
310
|
+
- ファイルアップロードは 50 MB まで(`--max-upload-mb` で調整可能)。アップロードされたコンテンツはサーバー側で実行されません。
|
|
311
|
+
- SSH 接続はシステムの `known_hosts` を尊重します。リスクを完全に理解している場合のみ `known_hosts: ignore` を設定してください。
|
|
312
|
+
- ローカルホスト以外に公開する場合は、`--allow-origin` でオプトインし、`--auth user:pass`(Basic 認証)を追加してください。信頼できるネットワークでのみ使用し、TLS(nginx、Caddy など)を前段に配置してください。
|
|
313
|
+
- テレメトリ、アナリティクス、コールホーム機能は一切ありません。
|
|
314
|
+
|
|
315
|
+
### CLI オプション
|
|
316
|
+
|
|
317
|
+
```bash
|
|
318
|
+
sshler serve \
|
|
319
|
+
--host 127.0.0.1 \
|
|
320
|
+
--port 8822 \
|
|
321
|
+
--max-upload-mb 50 \
|
|
322
|
+
--allow-origin http://workstation:8822 \
|
|
323
|
+
--auth coder:supersecret \
|
|
324
|
+
--no-ssh-alias \
|
|
325
|
+
--log-level info
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
- `--host`(別名 `--bind`): バインドアドレスを設定(デフォルト: `127.0.0.1` でローカルホストのみ)。すべてのインターフェースに公開するには `0.0.0.0` を使用しますが、**信頼できるネットワーク上でのみ `--auth` と TLS を併用してください**。
|
|
329
|
+
- `--port`: ポート番号を設定(デフォルト: `8822`)。
|
|
330
|
+
- `--allow-origin`: CORS を拡張するために繰り返し使用可能。ローカルホスト以外に UI を公開する場合は `--auth` と組み合わせてください。
|
|
331
|
+
- `--auth user:pass`: HTTP Basic 認証を有効化(`0.0.0.0` にバインドする場合は推奨)。
|
|
332
|
+
- `--max-upload-mb`: アップロードサイズ制限を設定(デフォルト: 50 MB)。
|
|
333
|
+
- `--no-ssh-alias`: DNS 失敗時の `ssh -G` フォールバックを無効化。
|
|
334
|
+
- `--token`: 独自の `X-SSHLER-TOKEN` を指定(指定しない場合は安全なランダム値が生成されます)。
|
|
335
|
+
- `--log-level`: uvicorn に直接渡されます(オプション: `critical`、`error`、`warning`、`info`、`debug`、`trace`)。
|
|
336
|
+
|
|
337
|
+
サーバーは起動時にトークン(および有効にした場合は Basic 認証のユーザー名)を出力するので、API クライアントやブラウザ拡張機能にコピーできます。
|
|
338
|
+
|
|
339
|
+
### ターミナル通知
|
|
340
|
+
|
|
341
|
+
- tmux またはシェルからベル(`printf '\a'`)を送信すると、sshler タブが非表示のときにブラウザタイトルが点滅し、デスクトップ通知が表示されます。
|
|
342
|
+
- より豊富なメッセージには OSC 777 を使用: `printf '\033]777;notify=Codex%20done|Check%20the%20output\a'`。`|` の前のテキストがタイトルになり、後半が本文になります。
|
|
343
|
+
- JSON ペイロードもサポート: `printf '\033]777;notify={"title":"Codex","message":"All tasks finished"}\a'`。
|
|
344
|
+
- 初回の通知はブラウザの許可を求めます。拒否した場合でも、タブに戻ったときにアプリ内トーストとタイトルバッジが表示されます。
|
|
345
|
+
|
|
346
|
+
## 自動起動
|
|
347
|
+
|
|
348
|
+
### Windows(タスク スケジューラ)
|
|
349
|
+
|
|
350
|
+
1. `where sshler` を実行してインストールされた実行可能ファイルを見つけます(例: `%LOCALAPPDATA%\Programs\Python\Python312\Scripts\sshler.exe`)。
|
|
351
|
+
2. **タスク スケジューラ → タスクの作成…** を開きます。
|
|
352
|
+
3. **トリガー** で「ログオン時」を追加。
|
|
353
|
+
4. **操作** で「プログラムの開始」を選択し、`sshler.exe` のパスを指定。引数に `serve --no-browser` を追加し、**開始** を書き込み可能なディレクトリに設定。
|
|
354
|
+
5. WSL アクセスが必要な場合は「最上位の特権で実行する」にチェックを入れて保存。サインインするたびに sshler が自動起動します。
|
|
355
|
+
|
|
356
|
+
### Linux / macOS(systemd ユーザーサービス)
|
|
357
|
+
|
|
358
|
+
`~/.config/systemd/user/sshler.service` を作成:
|
|
359
|
+
|
|
360
|
+
```ini
|
|
361
|
+
[Unit]
|
|
362
|
+
Description=sshler – local tmux bridge
|
|
363
|
+
After=network.target
|
|
364
|
+
|
|
365
|
+
[Service]
|
|
366
|
+
Type=simple
|
|
367
|
+
ExecStart=%h/.local/bin/sshler serve --bind 127.0.0.1 --no-browser
|
|
368
|
+
Restart=on-failure
|
|
369
|
+
|
|
370
|
+
[Install]
|
|
371
|
+
WantedBy=default.target
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
リロードして有効化:
|
|
375
|
+
|
|
376
|
+
```bash
|
|
377
|
+
systemctl --user daemon-reload
|
|
378
|
+
systemctl --user enable --now sshler.service
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
## 依存関係とライセンス
|
|
382
|
+
|
|
383
|
+
- FastAPI、uvicorn、asyncssh、platformdirs、yaml(PyPI パッケージ、寛容なライセンス)
|
|
384
|
+
- HTMX(MIT)と xterm.js(MIT)は unpkg から読み込まれます
|
|
385
|
+
- CodeMirror(MIT)がエディタを駆動
|
|
386
|
+
|
|
387
|
+
すべてのアセットはそれぞれの MIT/BSD スタイルのライセンスの下で使用されています。sshler 自体は MIT ライセンスで配布されます。
|
|
388
|
+
|
|
389
|
+
## 名前の由来
|
|
390
|
+
|
|
391
|
+
VS Code だけに頼らず、ブラウザタブの中で軽快にターミナルを扱いたい──そんな願いからこの名前になりました。
|