tmux-weblink 2.0.33 → 2.1.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/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # tmux-weblink
2
2
 
3
+ **English** | [中文](README.zh-CN.md)
4
+
3
5
  Access your tmux sessions from the browser. A lightweight web server that lists running tmux sessions and lets you attach through a full terminal in your browser — with built-in notes and a sidebar.
4
6
 
5
7
  ## Install
@@ -0,0 +1,112 @@
1
+ # tmux-weblink
2
+
3
+ [English](README.md) | **中文**
4
+
5
+ 在浏览器里访问你的 tmux 会话。一个轻量级 Web 服务器:列出正在运行的 tmux 会话,并让你通过浏览器里的完整终端接入——内置笔记与侧边栏,移动端与桌面端都能用。
6
+
7
+ ## 特性
8
+
9
+ - **完整终端**:xterm.js 渲染,支持 256 色、复制粘贴、粘贴图片到 CLI 工具
10
+ - **触摸优化**:移动端惯性滚动、Shift+拖选松手自动复制、虚拟键盘工具栏
11
+ - **PWA**:手机"添加到主屏幕"、桌面浏览器"安装应用"即为独立窗口应用
12
+ - **侧边栏会话分组**:按工作目录自动聚类(显示文件夹名),可折叠
13
+ - **New Session 目录树选择器**:层层展开目录树,直接定位到当前会话所在路径
14
+ - **笔记(Notes)**:每个会话独立的 Markdown 便签
15
+ - **文件浏览/编辑(Files)**:浏览、编辑本地文件(默认仅本机,路径受限)
16
+ - **Machines 联邦**:把 NAT 后的机器加入公共 hub(hub 无需开放端口),多机终端矩阵
17
+ - **窗口抽屉**:在终端头部切换 tmux 窗口(移动端友好的标签选择器)
18
+ - **安全**:scrypt 哈希 token 认证、登录限流、审计日志
19
+
20
+ ## 安装
21
+
22
+ ```bash
23
+ npm install -g tmux-weblink
24
+ ```
25
+
26
+ 或者直接用 npx 运行:
27
+
28
+ ```bash
29
+ npx tmux-weblink
30
+ ```
31
+
32
+ ## 使用
33
+
34
+ ```bash
35
+ # 交互式初始化(创建 token 等)
36
+ tmux-weblink setup
37
+
38
+ # 默认端口 21000 启动
39
+ tmux-weblink
40
+
41
+ # 自定义端口
42
+ PORT=8080 tmux-weblink
43
+
44
+ # 可选:先读尾部缓冲再加载历史(见 docs/architecture.md)
45
+ TMUX_WEB_INITIAL_LINES=1000 TMUX_WEB_HISTORY_CHUNK=500 tmux-weblink
46
+
47
+ # Machines:把本机加入一个 hub(无需开放端口)
48
+ tmux-weblink agent --hub wss://hub.example.com --token <agent-token> --name laptop
49
+ ```
50
+
51
+ > **每台机器都用同一条启动命令。** 加入 hub:在要接入的机器上打开
52
+ > `http://localhost:21000/settings/machines`,粘贴 hub 地址 + token,点
53
+ > **Save & Connect**——agent 客户端与普通服务器同进程运行。hub 自己的
54
+ > `/settings/machines` 页面负责创建/吊销 token。
55
+
56
+ 然后浏览器打开 `http://localhost:21000`,你会看到活跃的 tmux 会话列表——点击即可接入。
57
+
58
+ ## 手机端 / PWA
59
+
60
+ - **iOS**:Safari 分享 → "添加到主屏幕",全屏独立运行
61
+ - **Android / Chrome**:菜单 → "添加到主屏幕" / "安装应用"
62
+ - 支持软键盘自动适配、触摸惯性滚动、拖选复制
63
+
64
+ ## 桌面端(Linux / Windows / macOS)
65
+
66
+ 桌面浏览器(Chrome / Edge / Chromium)地址栏右侧点"安装"图标即可生成**独立窗口应用**:
67
+
68
+ - 本机 `http://localhost:端口` 或 HTTPS 均可;内网 HTTP IP 不会出现安装提示(非 secure context)
69
+ - Windows 上服务端原生运行受限(node-pty 需 WSL2),可用 WSL2 或接入远程 hub 使用
70
+
71
+ ## 文档
72
+
73
+ - [文档中心](docs/index.md)
74
+ - [笔记](docs/notes.md) — 每个会话独立的 Markdown 便签
75
+ - [文件](docs/files.md) — 浏览/编辑本地文件
76
+ - [Machines / Agents](docs/agents.md) — 把 NAT 机器接入公共 hub
77
+ - [架构](docs/architecture.md) — 服务器、终端、侧边栏如何协作
78
+
79
+ ## 环境变量(常用)
80
+
81
+ | 变量 | 默认 | 说明 |
82
+ | --- | --- | --- |
83
+ | `PORT` | `21000` | HTTP 端口 |
84
+ | `TMUX_WEB_MODE` | `production` | `development` 用 dev 数据目录 |
85
+ | `TMUX_WEB_INITIAL_LINES` | — | 打开会话时先读尾部 N 行 |
86
+ | `TMUX_WEB_HISTORY_CHUNK` | — | 历史分批加载的块大小 |
87
+ | `TMUX_WEB_AGENT_HUB` / `TMUX_WEB_AGENT_TOKEN` / `TMUX_WEB_AGENT_NAME` | — | agent 连接参数 |
88
+ | `FS_ROOTS` | `~` | 文件浏览可访问的根目录(逗号分隔) |
89
+
90
+ ## 前提条件
91
+
92
+ - **Node.js** >= 22
93
+ - **tmux** 已安装且在 PATH 中
94
+ - 可写的 `~/.tmux-web/` 和 `~/.config/tmux-web/`(dev 模式路径见 [docs](docs/index.md))
95
+
96
+ ## Windows 说明
97
+
98
+ - 服务端在 Windows 上原生运行受限(node-pty 在 Windows 无 linux-x64 类 prebuild,需源码编译;推荐 **WSL2** 内运行服务)
99
+ - 浏览器客户端(PWA / 网页)在 Windows 上完全正常,可接入本机 WSL2 或远程 hub 的会话
100
+
101
+ ## 致谢
102
+
103
+ 本项目建立在以下项目的想法和代码之上:
104
+
105
+ - [tmux-web](https://github.com/ashutoshpw/tmux-web) by [@ashutoshpw](https://github.com/ashutoshpw)
106
+ - [persalink](https://github.com/brobata/persalink) by [@brobata](https://github.com/brobata)
107
+
108
+ 它是这些实验的延续与重新打包,目标是做一个单用户、浏览器优先、易于安装运行的 tmux 伴侣。
109
+
110
+ ## 许可证
111
+
112
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tmux-weblink",
3
- "version": "2.0.33",
3
+ "version": "2.1.0",
4
4
  "description": "Access your tmux sessions from the browser. A continuation of tmux-web and persalink.",
5
5
  "type": "module",
6
6
  "bin": {