xray-manager 1.2.0 → 1.3.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.
Files changed (39) hide show
  1. package/README.md +31 -863
  2. package/dist/commands/interactive.d.ts +0 -42
  3. package/dist/commands/interactive.d.ts.map +1 -1
  4. package/dist/commands/interactive.js +59 -182
  5. package/dist/commands/interactive.js.map +1 -1
  6. package/dist/commands/user.d.ts.map +1 -1
  7. package/dist/commands/user.js +23 -14
  8. package/dist/commands/user.js.map +1 -1
  9. package/dist/components/dashboard-widget.d.ts +18 -0
  10. package/dist/components/dashboard-widget.d.ts.map +1 -0
  11. package/dist/components/dashboard-widget.js +159 -0
  12. package/dist/components/dashboard-widget.js.map +1 -0
  13. package/dist/components/user-table.d.ts +8 -0
  14. package/dist/components/user-table.d.ts.map +1 -0
  15. package/dist/components/user-table.js +86 -0
  16. package/dist/components/user-table.js.map +1 -0
  17. package/dist/constants/theme.d.ts +34 -0
  18. package/dist/constants/theme.d.ts.map +1 -0
  19. package/dist/constants/theme.js +52 -0
  20. package/dist/constants/theme.js.map +1 -0
  21. package/dist/services/layout-manager.d.ts +8 -0
  22. package/dist/services/layout-manager.d.ts.map +1 -1
  23. package/dist/services/layout-manager.js +11 -0
  24. package/dist/services/layout-manager.js.map +1 -1
  25. package/dist/services/navigation-manager.d.ts +23 -0
  26. package/dist/services/navigation-manager.d.ts.map +1 -0
  27. package/dist/services/navigation-manager.js +39 -0
  28. package/dist/services/navigation-manager.js.map +1 -0
  29. package/dist/services/screen-manager.d.ts +13 -0
  30. package/dist/services/screen-manager.d.ts.map +1 -0
  31. package/dist/services/screen-manager.js +42 -0
  32. package/dist/services/screen-manager.js.map +1 -0
  33. package/dist/types/ui-components.d.ts +53 -0
  34. package/dist/types/ui-components.d.ts.map +1 -0
  35. package/dist/types/ui-components.js +3 -0
  36. package/dist/types/ui-components.js.map +1 -0
  37. package/dist/types/user.d.ts +11 -0
  38. package/dist/types/user.d.ts.map +1 -1
  39. package/package.json +2 -2
package/README.md CHANGED
@@ -1,884 +1,52 @@
1
- <div align="center">
1
+ # Xray VPN OneClick Manager
2
2
 
3
- # 🚀 Xray VPN OneClick
3
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.0-blue.svg)](https://www.typescriptlang.org/)
4
5
 
5
- <h3>一键部署 Xray VLESS+Reality 代理服务器</h3>
6
+ A powerful, interactive CLI tool for managing Xray VPN services on Linux. Simplifies installation, user management, and service monitoring.
6
7
 
7
- <p align="center">
8
- <strong>最新协议 | 安全可靠 | 5分钟部署 | 全平台支持</strong>
9
- </p>
8
+ ## ✨ Features
10
9
 
11
- [![npm version](https://img.shields.io/npm/v/xray-manager?style=for-the-badge&logo=npm&color=red)](https://www.npmjs.com/package/xray-manager)
12
- [![npm downloads](https://img.shields.io/npm/dm/xray-manager?style=for-the-badge&logo=npm&color=orange)](https://www.npmjs.com/package/xray-manager)
13
- [![GitHub Stars](https://img.shields.io/github/stars/DanOps-1/Xray-VPN-OneClick?style=for-the-badge&logo=github&color=yellow)](https://github.com/DanOps-1/Xray-VPN-OneClick/stargazers)
14
- [![codecov](https://codecov.io/gh/DanOps-1/Xray-VPN-OneClick/branch/main/graph/badge.svg)](https://codecov.io/gh/DanOps-1/Xray-VPN-OneClick)
15
- [![License](https://img.shields.io/github/license/DanOps-1/Xray-VPN-OneClick?style=for-the-badge&color=blue)](https://github.com/DanOps-1/Xray-VPN-OneClick/blob/main/LICENSE)
16
- [![Last Commit](https://img.shields.io/github/last-commit/DanOps-1/Xray-VPN-OneClick?style=for-the-badge&color=green)](https://github.com/DanOps-1/Xray-VPN-OneClick/commits/main)
10
+ - **Improved Interactive UI**: Persistent dashboard with service status, system resources, and breadcrumb navigation.
11
+ - **Responsive Tables**: Adaptive user lists that look good on terminals of all sizes.
12
+ - **One-Click Installation**: Automated setup script for Xray service.
13
+ - **User Management**: Add, remove, list users, and generate connection links.
14
+ - **Service Control**: Start, stop, restart, and view status of Xray service.
15
+ - **Multi-Protocol Support**: VLESS, VMESS, Trojan, Shadowsocks, etc.
17
16
 
18
- [![Platform](https://img.shields.io/badge/Platform-Linux-blue?style=for-the-badge&logo=linux)](https://github.com/DanOps-1/Xray-VPN-OneClick)
19
- [![Protocol](https://img.shields.io/badge/Protocol-VLESS%2BReality-purple?style=for-the-badge)](https://github.com/XTLS/REALITY)
20
- [![Docker](https://img.shields.io/badge/Docker-Supported-2496ED?style=for-the-badge&logo=docker&logoColor=white)](https://www.docker.com/)
21
-
22
- [**中文**](README.md) | [**English**](docs/README-en.md)
23
-
24
- </div>
25
-
26
- ---
27
-
28
- ## 📑 目录
29
-
30
- - [✨ 项目简介](#-项目简介)
31
- - [🎯 主要特性](#-主要特性)
32
- - [🆚 协议对比](#-协议对比)
33
- - [🚀 快速开始](#-快速开始)
34
- - [系统要求](#系统要求)
35
- - [一键安装](#一键安装推荐)
36
- - [📱 客户端配置](#-客户端配置)
37
- - [🛠️ 服务管理](#️-服务管理)
38
- - [🗑️ 卸载与清理](#️-卸载与清理)
39
- - [📖 详细文档](#-详细文档)
40
- - [🔒 安全建议](#-安全建议)
41
- - [📊 支持的云平台](#-支持的云平台)
42
- - [💡 常见问题](#-常见问题)
43
- - [🤝 贡献指南](#-贡献指南)
44
- - [📄 许可证](#-许可证)
45
- - [⚠️ 免责声明](#️-免责声明)
46
-
47
- ---
48
-
49
- ## ✨ 项目简介
50
-
51
- **Xray VPN OneClick** 是一个完全自动化的 Xray 服务端部署项目,使用最新的 **VLESS + XTLS-Reality** 协议,为用户提供安全、高速、难以被检测的代理服务。
52
-
53
- ### 为什么选择本项目?
54
-
55
- | 特点 | 说明 |
56
- |------|------|
57
- | 🎯 **零配置部署** | 一行命令完成安装,自动生成所有配置参数 |
58
- | 🔐 **顶级安全** | 使用 Reality 协议,流量特征与正常 TLS 无法区分 |
59
- | ⚡ **高性能** | 内置 BBR 拥塞控制和 TCP Fast Open 优化 |
60
- | 📱 **全平台兼容** | 支持 Windows、macOS、Linux、Android、iOS |
61
- | 🛠️ **完善工具** | 提供用户管理、备份恢复、一键更新等工具 |
62
- | 📚 **详尽文档** | 完整的中英文文档和故障排查指南 |
63
-
64
- ---
65
-
66
- ## 🎯 主要特性
67
-
68
- <table>
69
- <tr>
70
- <td width="50%">
71
-
72
- ### 🚀 部署特性
73
- - ✅ **一键安装** - 5分钟内完成部署
74
- - ✅ **自动配置** - UUID、密钥自动生成
75
- - ✅ **systemd 集成** - 开机自启动
76
- - ✅ **多种安装方式** - wget、curl、git clone
77
- - ✅ **国内加速** - 提供镜像加速下载
78
-
79
- </td>
80
- <td width="50%">
81
-
82
- ### 🔒 安全特性
83
- - ✅ **VLESS 协议** - 轻量级高性能
84
- - ✅ **Reality 伪装** - 流量难以识别
85
- - ✅ **x25519 密钥** - 强加密保护
86
- - ✅ **Short ID** - 增强安全性
87
- - ✅ **防重放攻击** - 内置保护机制
88
-
89
- </td>
90
- </tr>
91
- <tr>
92
- <td width="50%">
93
-
94
- ### 🛠️ 管理特性
95
- - ✅ **用户管理** - 添加/删除用户
96
- - ✅ **配置备份** - 自动备份恢复
97
- - ✅ **一键更新** - 升级到最新版本
98
- - ✅ **查看配置** - 显示连接信息
99
- - ✅ **安全卸载** - 完整清理系统
100
-
101
- </td>
102
- <td width="50%">
103
-
104
- ### 📱 客户端特性
105
- - ✅ **分享链接** - 自动生成 VLESS URL
106
- - ✅ **二维码** - 扫码快速导入
107
- - ✅ **全平台** - 主流系统全覆盖
108
- - ✅ **多协议** - 兼容 v2ray 生态
109
- - ✅ **详细教程** - 分平台配置指南
110
-
111
- </td>
112
- </tr>
113
- </table>
114
-
115
- ---
116
-
117
- ## 🆚 协议对比
118
-
119
- | 协议 | 速度 | 安全性 | 抗检测 | 配置难度 | 推荐度 |
120
- |------|------|--------|--------|----------|--------|
121
- | **VLESS+Reality** | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ✅ **推荐** |
122
- | VMess+WebSocket+TLS | ⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐ | ⚠️ 一般 |
123
- | Shadowsocks | ⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐ | ⭐⭐⭐⭐⭐ | ⚠️ 易封锁 |
124
- | Trojan | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐ | ✅ 可选 |
125
- | V2Ray (传统) | ⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐ | ❌ 过时 |
126
-
127
- **VLESS+Reality 优势:**
128
- - 🎯 流量特征与真实 TLS 1.3 连接完全相同
129
- - 🎯 无需购买域名和配置证书
130
- - 🎯 性能损耗极小,接近直连速度
131
- - 🎯 主动探测无法识别代理特征
132
-
133
- ---
134
-
135
- ## 🚀 快速开始
136
-
137
- ### 系统要求
138
-
139
- <table>
140
- <tr>
141
- <td width="50%">
142
-
143
- #### 最低配置
144
- - **操作系统**: Linux (Debian/Ubuntu/CentOS/Kali)
145
- - **内存**: 512 MB RAM
146
- - **存储**: 100 MB 可用空间
147
- - **网络**: 公网 IP 地址
148
-
149
- </td>
150
- <td width="50%">
151
-
152
- #### 推荐配置
153
- - **操作系统**: Ubuntu 22.04 LTS / Debian 12
154
- - **内存**: 1 GB RAM
155
- - **CPU**: 1 核心
156
- - **带宽**: 10 Mbps+
157
- - **终端尺寸**:
158
- - **最小**: 60x20(紧凑模式)
159
- - **标准**: 80x24(推荐,完整显示)
160
- - **宽屏**: 120+ 列(多列布局,最佳体验)
161
-
162
- </td>
163
- </tr>
164
- </table>
165
-
166
- ### 一键安装(推荐)
167
-
168
- #### 方式一:直接下载(国外服务器)
169
-
170
- ```bash
171
- wget https://raw.githubusercontent.com/DanOps-1/Xray-VPN-OneClick/main/scripts/install.sh -O xray-install.sh
172
- sudo bash xray-install.sh
173
- ```
174
-
175
- 或者使用 curl:
176
-
177
- ```bash
178
- curl -O https://raw.githubusercontent.com/DanOps-1/Xray-VPN-OneClick/main/scripts/install.sh
179
- sudo bash install.sh
180
- ```
181
-
182
- #### 方式二:加速下载(国内服务器或网络受限)
183
-
184
- 如果上述命令连接超时,使用以下加速方法:
185
-
186
- ```bash
187
- # 使用 GitHub 代理加速
188
- wget https://ghproxy.com/https://raw.githubusercontent.com/DanOps-1/Xray-VPN-OneClick/main/scripts/install.sh -O xray-install.sh
189
- sudo bash xray-install.sh
190
- ```
191
-
192
- 或使用 jsDelivr CDN:
193
-
194
- ```bash
195
- # jsDelivr CDN 加速
196
- wget https://cdn.jsdelivr.net/gh/DanOps-1/Xray-VPN-OneClick@main/scripts/install.sh -O xray-install.sh
197
- sudo bash xray-install.sh
198
- ```
199
-
200
- #### 方式三:克隆仓库(最完整)
17
+ ## Quick Start
201
18
 
202
19
  ```bash
203
- # 直接克隆
204
- git clone https://github.com/DanOps-1/Xray-VPN-OneClick.git
205
- cd Xray-VPN-OneClick/scripts
206
- sudo bash install.sh
207
-
208
- # 如果 git clone 也超时,使用代理
209
- git clone https://ghproxy.com/https://github.com/DanOps-1/Xray-VPN-OneClick.git
210
- cd Xray-VPN-OneClick/scripts
211
- sudo bash install.sh
212
- ```
213
-
214
- ### 安装过程
215
-
216
- 安装脚本会自动完成以下步骤:
217
-
218
- 1. ✅ 检测系统环境并安装依赖
219
- 2. ✅ 下载并安装最新版 Xray-core
220
- 3. ✅ 自动生成配置参数(UUID、密钥对、Short ID)
221
- 4. ✅ 创建优化的服务端配置文件
222
- 5. ✅ 配置并启动 systemd 服务
223
- 6. ✅ 显示客户端配置信息和分享链接
224
-
225
- ### 安装完成后
226
-
227
- 安装完成后,脚本会输出以下信息:
228
-
229
- ```
230
- ================================
231
- ✅ Xray 安装成功!
232
- ================================
233
-
234
- 📋 服务器信息:
235
- 地址: YOUR_SERVER_IP
236
- 端口: 443
237
-
238
- 🔑 客户端配置:
239
- UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
240
- Public Key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
241
- ...
242
-
243
- 📱 分享链接:
244
- vless://xxxxxxxx@YOUR_IP:443?...
245
- ```
246
-
247
- **保存好这些信息**,用于客户端配置。
248
-
249
- ---
250
-
251
- ## 📱 客户端配置
252
-
253
- ### 支持的客户端
254
-
255
- | 平台 | 推荐客户端 | 下载链接 |
256
- |------|-----------|---------|
257
- | **Windows** | v2rayN | [GitHub Releases](https://github.com/2dust/v2rayN/releases) |
258
- | **macOS** | V2rayU / V2RayXS | [V2rayU](https://github.com/yanue/V2rayU/releases) \| [V2RayXS](https://github.com/tzmax/V2RayXS/releases) |
259
- | **Linux** | v2ray-core / Qv2ray | [v2ray](https://github.com/v2fly/v2ray-core/releases) \| [Qv2ray](https://github.com/Qv2ray/Qv2ray/releases) |
260
- | **Android** | v2rayNG | [GitHub Releases](https://github.com/2dust/v2rayNG/releases) |
261
- | **iOS** | Shadowrocket / Quantumult X | App Store(需美区账号)|
262
-
263
- ### 快速导入配置
264
-
265
- **方式一:使用分享链接(推荐)**
266
-
267
- 1. 复制安装脚本输出的 VLESS 分享链接
268
- 2. 打开客户端应用
269
- 3. 选择"从剪贴板导入"或"扫描二维码"
270
- 4. 连接并开始使用
271
-
272
- **方式二:手动配置**
273
-
274
- 查看详细教程:[客户端配置指南](docs/client-setup.md)
275
-
276
- ---
277
-
278
- ## 🛠️ 服务管理
279
-
280
- ### 方式一:交互式 CLI 工具(推荐)⭐
281
-
282
- 我们提供了一个强大的 npm 命令行工具,让 Xray 服务管理变得简单直观:
283
-
284
- #### 安装 CLI 工具
285
-
286
- **方式一:从 npm 安装(推荐)⭐**
287
-
288
- ```bash
289
- # 全局安装(推荐)
290
- npm install -g xray-manager
291
-
292
- # 或使用 npx(无需安装)
293
- npx xray-manager
294
- ```
295
-
296
- **方式二:从源代码安装**
297
-
298
- ```bash
299
- # 克隆仓库
300
- git clone https://github.com/DanOps-1/Xray-VPN-OneClick.git
301
- cd Xray-VPN-OneClick
302
-
303
- # 安装依赖并全局安装
20
+ # Install dependencies
304
21
  npm install
305
- sudo npm install -g .
306
- ```
307
-
308
- **npm 包信息**
309
- - 📦 包名: `xray-manager`
310
- - 🔗 npm 主页: https://www.npmjs.com/package/xray-manager
311
- - 📥 每周下载: [![npm](https://img.shields.io/npm/dw/xray-manager)](https://www.npmjs.com/package/xray-manager)
312
-
313
- #### 启动交互式菜单
314
-
315
- ```bash
316
- # 使用全名
317
- xray-manager
318
-
319
- # 或使用简短别名
320
- xm
321
- ```
322
-
323
- #### CLI 功能特性
324
-
325
- <table>
326
- <tr>
327
- <td width="50%">
328
-
329
- **📊 服务管理**
330
- - 查看服务状态(运行时长、内存使用)
331
- - 启动/停止/重启服务
332
- - 自动检测权限和 systemd
333
-
334
- </td>
335
- <td width="50%">
336
-
337
- **👥 用户管理**
338
- - 列出所有用户
339
- - 添加新用户(自动生成 UUID)
340
- - 删除用户
341
- - 显示分享链接(自动复制到剪贴板)
342
-
343
- </td>
344
- </tr>
345
- <tr>
346
- <td width="50%">
347
-
348
- **⚙️ 配置管理**
349
- - 查看当前配置
350
- - 创建配置备份(时间戳命名)
351
- - 列出所有备份
352
- - 恢复配置
353
- - 修改配置项
354
-
355
- </td>
356
- <td width="50%">
357
-
358
- **📝 日志查看**
359
- - 查看最近日志
360
- - 实时跟踪日志(Ctrl+C 停止)
361
- - 按级别过滤(error/warning/info/debug)
362
- - 按时间范围过滤
363
-
364
- </td>
365
- </tr>
366
- </table>
367
-
368
- #### 终端兼容性 🌍
369
-
370
- CLI 工具现已支持多种终端环境,自动适配不同系统:
371
-
372
- **🖥️ 支持的终端**
373
- - ✅ **现代终端**: xterm, iTerm2, GNOME Terminal, Konsole(Unicode + 彩色)
374
- - ✅ **Windows CMD**: 完全兼容(纯 ASCII 文本图标)
375
- - ✅ **SSH 会话**: 自动检测并适配远程终端
376
- - ✅ **传统终端**: vt100, dumb terminal(降级到 ASCII)
377
- - ✅ **管道输出**: 重定向时自动切换到纯文本 + 时间戳模式
378
-
379
- **🎨 三种输出模式**
380
-
381
- | 模式 | 使用场景 | 特性 |
382
- |------|---------|------|
383
- | **RICH** | 现代终端(默认) | 彩色 + Unicode 图标 + 格式化 |
384
- | **PLAIN_TTY** | 无彩色终端 | ASCII 图标 + 格式化(无彩色) |
385
- | **PIPE** | 管道/日志文件 | 纯文本 + 时间戳 + 结构化输出 |
386
-
387
- **🔧 自动检测特性**
388
- - TTY 状态检测
389
- - 颜色支持检测(支持 NO_COLOR 环境变量)
390
- - Unicode 支持检测(基于 TERM 环境变量和平台)
391
- - 终端宽度自适应(80-160 列优化)
392
-
393
- **📐 80 列兼容**
394
-
395
- 所有 UI 元素已优化为 80 列布局,确保在各种终端宽度下正确显示:
396
- - 菜单选项 + 描述 ≤ 80 列
397
- - 表格和分隔符自适应终端宽度
398
- - 窄终端(40-80 列)友好
399
-
400
- **示例输出**
401
-
402
- ```
403
- # 现代终端 (RICH 模式)
404
- ✓ 服务启动成功!
405
- [查看] 查看服务状态
406
- [启动] 启动服务
407
-
408
- # Windows CMD (PLAIN_TTY 模式)
409
- [OK] 服务启动成功!
410
- [查看] 查看服务状态
411
- [启动] 启动服务
412
-
413
- # 管道输出 (PIPE 模式)
414
- 2026-01-08T10:30:45.123Z [OK] 服务启动成功
415
- ```
416
-
417
- #### 菜单结构
418
-
419
- ```
420
- Xray Manager - 交互式管理工具
421
- ├── 📊 查看服务状态
422
- ├── 🚀 启动服务
423
- ├── 🛑 停止服务
424
- ├── 🔄 重启服务
425
- ├── 👥 用户管理
426
- │ ├── 📋 查看用户列表
427
- │ ├── ➕ 添加用户
428
- │ ├── ➖ 删除用户
429
- │ └── 📤 显示分享链接
430
- ├── ⚙️ 配置管理
431
- │ ├── 📄 查看当前配置
432
- │ ├── 💾 备份配置
433
- │ ├── 📋 查看备份列表
434
- │ ├── ♻️ 恢复配置
435
- │ └── ✏️ 修改配置项
436
- └── 📝 日志查看
437
- ├── 📄 查看最近日志
438
- ├── 🔴 实时跟踪日志
439
- └── 🔍 过滤日志
440
- ```
441
-
442
- #### 安全特性
443
-
444
- - ✅ **命令注入防护** - 所有输入都经过严格验证
445
- - ✅ **敏感信息脱敏** - UUID、密钥显示为 `前4后4` 格式
446
- - ✅ **自动备份** - 修改配置前自动创建备份
447
- - ✅ **权限检测** - 自动检测 sudo 权限并提示
448
- - ✅ **安全文件权限** - 配置文件权限设置为 600
449
-
450
- ---
451
-
452
- ### 方式二:systemd 原生命令
453
-
454
- ```bash
455
- # 查看服务状态
456
- sudo systemctl status xray
457
-
458
- # 启动服务
459
- sudo systemctl start xray
460
-
461
- # 停止服务
462
- sudo systemctl stop xray
463
-
464
- # 重启服务
465
- sudo systemctl restart xray
466
-
467
- # 查看实时日志
468
- sudo journalctl -u xray -f
469
-
470
- # 查看最近日志
471
- sudo journalctl -u xray -n 100
472
- ```
473
-
474
- ### 方式三:Bash 脚本工具
475
-
476
- ```bash
477
- # 添加新用户
478
- sudo bash scripts/add-user.sh user@example.com
479
-
480
- # 删除用户
481
- sudo bash scripts/del-user.sh user@example.com
482
-
483
- # 列出所有用户
484
- sudo bash scripts/show-config.sh users
485
-
486
- # 显示用户的分享链接
487
- sudo bash scripts/show-config.sh link user@example.com
488
- ```
489
-
490
- ### 系统维护
491
-
492
- ```bash
493
- # 更新 Xray 到最新版本
494
- sudo bash scripts/update.sh
495
-
496
- # 备份当前配置
497
- sudo bash scripts/backup.sh
498
-
499
- # 恢复配置
500
- sudo bash scripts/restore.sh <备份文件>
501
-
502
- # 卸载 Xray
503
- sudo bash scripts/uninstall.sh
504
- ```
505
-
506
- ---
507
-
508
- ## 🗑️ 卸载与清理
509
-
510
- ### 一键卸载(推荐)
511
-
512
- 使用提供的卸载脚本可以安全地卸载 Xray:
513
-
514
- ```bash
515
- # 如果克隆了仓库
516
- sudo bash scripts/uninstall.sh
517
-
518
- # 如果没有仓库,下载卸载脚本
519
- wget https://ghproxy.com/https://raw.githubusercontent.com/DanOps-1/Xray-VPN-OneClick/main/scripts/uninstall.sh
520
- sudo bash uninstall.sh
521
- ```
522
-
523
- **卸载过程:**
524
-
525
- 1. 确认卸载:输入 `yes` 确认
526
- 2. 选择是否保留配置备份:
527
- - 输入 `Y` 或回车:保留备份到 `/var/backups/xray/`
528
- - 输入 `n`:不保留备份
529
-
530
- **自动清理内容:**
531
- - ✅ 停止并禁用 Xray 服务
532
- - ✅ 备份配置文件(可选)
533
- - ✅ 卸载 Xray-core 程序
534
- - ✅ 删除配置目录 `/usr/local/etc/xray`
535
- - ✅ 删除日志目录 `/var/log/xray`
536
- - ✅ 删除 systemd 服务文件
537
-
538
- ### 手动清理
539
-
540
- 如果卸载脚本无法使用,可以手动执行以下命令:
541
-
542
- ```bash
543
- # 1. 停止并禁用服务
544
- sudo systemctl stop xray
545
- sudo systemctl disable xray
546
-
547
- # 2. 备份配置(可选)
548
- sudo mkdir -p /var/backups/xray
549
- sudo cp /usr/local/etc/xray/config.json /var/backups/xray/config-backup-$(date +%Y%m%d).json
550
-
551
- # 3. 使用官方脚本卸载 Xray
552
- bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ remove --purge
553
-
554
- # 4. 删除残留文件
555
- sudo rm -rf /usr/local/etc/xray
556
- sudo rm -rf /var/log/xray
557
- sudo rm -f /etc/systemd/system/xray.service
558
- sudo rm -f /etc/systemd/system/xray@.service
559
- sudo systemctl daemon-reload
560
- ```
561
22
 
562
- ### 彻底清理(包括备份)
23
+ # Build the project
24
+ npm run build
563
25
 
564
- 如果要完全删除所有相关文件:
565
-
566
- ```bash
567
- # 删除配置备份
568
- sudo rm -rf /var/backups/xray
569
-
570
- # 删除项目目录(如果克隆了仓库)
571
- rm -rf ~/Xray-VPN-OneClick
572
- ```
573
-
574
- ### 验证清理结果
575
-
576
- 卸载后运行以下命令检查是否清理干净:
577
-
578
- ```bash
579
- # 检查服务状态(应该显示 "could not be found")
580
- systemctl status xray
581
-
582
- # 检查程序是否存在(应该没有输出)
583
- which xray
584
-
585
- # 检查配置目录(应该不存在)
586
- ls /usr/local/etc/xray
587
-
588
- # 检查端口占用(443 端口应该空闲)
589
- sudo lsof -i :443
590
- ```
591
-
592
- ---
593
-
594
- ## 📖 详细文档
595
-
596
- - [完整安装教程](docs/installation-guide.md) - 手动安装的详细步骤说明
597
- - [客户端配置指南](docs/client-setup.md) - 各平台客户端的详细配置方法
598
- - [用户管理指南](docs/user-management.md) - 如何添加、删除和管理多个用户
599
- - [常见问题解答](docs/installation-guide.md#常见问题) - 常见问题的排查和解决方案
600
- - [性能优化指南](docs/installation-guide.md#性能优化) - 提升服务器性能的建议
601
-
602
- ---
603
-
604
- ## 🔒 安全建议
605
-
606
- ### 基本安全措施
607
-
608
- 1. ✅ **定期更换密钥** - 建议每 3-6 个月更换 UUID 和密钥对
609
- 2. ✅ **使用强密码** - 为服务器 SSH 设置强密码或密钥认证
610
- 3. ✅ **配置防火墙** - 只开放必要的端口(443)
611
- 4. ✅ **定期更新** - 及时更新 Xray 到最新版本修复安全漏洞
612
- 5. ✅ **监控日志** - 定期检查日志发现异常访问
613
- 6. ✅ **配置备份** - 定期备份配置文件到安全位置
614
-
615
- ### 进阶安全配置
616
-
617
- ```bash
618
- # 限制 SSH 访问
619
- sudo ufw allow 22/tcp
620
- sudo ufw allow 443/tcp
621
- sudo ufw enable
622
-
623
- # 禁用 root 登录(推荐)
624
- sudo nano /etc/ssh/sshd_config
625
- # 设置: PermitRootLogin no
626
- sudo systemctl restart sshd
627
-
628
- # 配置自动安全更新
629
- sudo apt install unattended-upgrades
630
- sudo dpkg-reconfigure --priority=low unattended-upgrades
26
+ # Run the interactive manager
27
+ npm start
28
+ # or
29
+ sudo ./dist/cli.js interactive
631
30
  ```
632
31
 
633
- ---
634
-
635
- ## 📊 支持的云平台
636
-
637
- 本项目已在以下云平台测试通过:
32
+ ## Interactive UI
638
33
 
639
- ### 国外云平台
640
- - ✅ **AWS EC2** - Amazon Web Services
641
- - ✅ **Google Cloud Platform** - GCP Compute Engine
642
- - ✅ **Microsoft Azure** - Azure Virtual Machines
643
- - ✅ **DigitalOcean** - Droplets
644
- - ✅ **Vultr** - Cloud Compute
645
- - ✅ **Linode** - Akamai Cloud
646
- - ✅ **Hetzner** - Cloud Servers
34
+ The new interactive interface (v1.3+) features:
647
35
 
648
- ### 国内云平台
649
- - **阿里云** - ECS 云服务器
650
- - **腾讯云** - CVM 云服务器
651
- - ✅ **华为云** - ECS 弹性云服务器
36
+ - **Dashboard**: Always-on status bar showing Xray service state, uptime, and connected user count.
37
+ - **Navigation**: Breadcrumb bar (e.g., `Home > User Management`) to keep track of your location.
38
+ - **User Tables**: Adaptive tables that show more details on wider screens and summarize large user lists.
652
39
 
653
- > **注意**: 在国内云平台使用可能面临合规风险,请谨慎选择。
654
-
655
- ---
656
-
657
- ## 🐳 Docker 部署
658
-
659
- ### 使用 Docker 部署
40
+ ## Development
660
41
 
661
42
  ```bash
662
- # 拉取镜像(开发中)
663
- docker pull danops/xray-reality
664
-
665
- # 运行容器
666
- docker run -d \
667
- --name xray \
668
- -p 443:443 \
669
- -v /etc/xray:/etc/xray \
670
- --restart=unless-stopped \
671
- danops/xray-reality
672
- ```
673
-
674
- ### 使用 Docker Compose
43
+ # Run tests
44
+ npm test
675
45
 
676
- ```yaml
677
- version: '3'
678
- services:
679
- xray:
680
- image: danops/xray-reality
681
- container_name: xray
682
- restart: unless-stopped
683
- ports:
684
- - "443:443"
685
- volumes:
686
- - ./config:/etc/xray
46
+ # Lint code
47
+ npm run lint
687
48
  ```
688
49
 
689
- 详细说明:即将推出
690
-
691
- ---
692
-
693
- ## 💡 常见问题
694
-
695
- ### 1. 端口 443 被占用怎么办?
696
-
697
- ```bash
698
- # 查看占用端口的进程
699
- sudo lsof -i :443
700
-
701
- # 停止占用的服务
702
- sudo systemctl stop nginx # 或其他服务
703
-
704
- # 或修改 Xray 配置使用其他端口
705
- sudo nano /usr/local/etc/xray/config.json
706
- ```
707
-
708
- ### 2. 客户端无法连接?
709
-
710
- **排查步骤**:
711
-
712
- 1. 确认服务正在运行:`sudo systemctl status xray`
713
- 2. 检查防火墙规则:`sudo ufw status`
714
- 3. 确认云服务商安全组已开放 443 端口
715
- 4. 检查配置信息是否正确(UUID、公钥等)
716
- 5. 查看服务日志:`sudo journalctl -u xray -f`
717
-
718
- ### 3. 如何更换伪装目标网站?
719
-
720
- 编辑配置文件 `/usr/local/etc/xray/config.json`:
721
-
722
- ```json
723
- "dest": "www.cloudflare.com:443",
724
- "serverNames": ["www.cloudflare.com"]
725
- ```
726
-
727
- 推荐使用:`www.microsoft.com`、`www.apple.com`、`www.cloudflare.com`
728
-
729
- ### 4. 如何提升连接速度?
730
-
731
- ```bash
732
- # 启用 BBR 拥塞控制
733
- echo "net.core.default_qdisc=fq" | sudo tee -a /etc/sysctl.conf
734
- echo "net.ipv4.tcp_congestion_control=bbr" | sudo tee -a /etc/sysctl.conf
735
- sudo sysctl -p
736
-
737
- # 启用 TCP Fast Open
738
- echo "net.ipv4.tcp_fastopen=3" | sudo tee -a /etc/sysctl.conf
739
- sudo sysctl -p
740
- ```
741
-
742
- 更多问题查看:[常见问题完整列表](docs/installation-guide.md#常见问题)
743
-
744
- ---
745
-
746
- ## 🤝 贡献指南
747
-
748
- 欢迎提交 Issue 和 Pull Request 来改进本项目!
749
-
750
- ### 贡献流程
751
-
752
- 1. Fork 本项目到你的账号
753
- 2. 创建特性分支:`git checkout -b feature/AmazingFeature`
754
- 3. 提交你的更改:`git commit -m 'Add some AmazingFeature'`
755
- 4. 推送到分支:`git push origin feature/AmazingFeature`
756
- 5. 提交 Pull Request
757
-
758
- ### 贡献建议
759
-
760
- - 📝 改进文档和教程
761
- - 🐛 修复 bug 和问题
762
- - ✨ 添加新功能和工具
763
- - 🌍 翻译文档到其他语言
764
- - 📊 优化脚本性能
765
-
766
- ---
767
-
768
- ## 📝 更新日志
769
-
770
- ### v1.1.0 (2026-01-08)
771
-
772
- **CLI 用户界面优化**
773
-
774
- - ✅ 终端能力自动检测系统(TTY/颜色/Unicode/宽度)
775
- - ✅ 智能图标解析器(Unicode ↔️ ASCII 自动适配)
776
- - ✅ 三种输出模式(RICH/PLAIN_TTY/PIPE)
777
- - ✅ Windows CMD 完全兼容(纯 ASCII 文本图标)
778
- - ✅ 所有 emoji 替换为文本标签 [标签] 格式
779
- - ✅ 菜单清晰分组(服务操作/管理功能/退出)
780
- - ✅ 80 列布局优化(所有 UI 元素宽度验证)
781
- - ✅ 210 个测试全部通过,覆盖率 >90%
782
-
783
- ### v1.0.0 (2026-01-07)
784
-
785
- **首次发布**
786
-
787
- - ✅ 完整的 VLESS + XTLS-Reality 配置教程
788
- - ✅ 全自动一键安装脚本
789
- - ✅ 用户管理工具(添加、删除、列表)
790
- - ✅ 服务维护工具(更新、备份、卸载)
791
- - ✅ 详细的中英文文档
792
- - ✅ 多平台客户端配置指南
793
- - ✅ 性能优化和安全加固指南
794
-
795
- ---
796
-
797
- ## 📚 参考资源
798
-
799
- ### 官方文档
800
- - [Xray 官方网站](https://xtls.github.io/)
801
- - [VLESS 协议规范](https://xtls.github.io/config/features/vless.html)
802
- - [Reality 协议介绍](https://github.com/XTLS/REALITY)
803
- - [Xray-core 源代码](https://github.com/XTLS/Xray-core)
804
-
805
- ### 相关项目
806
- - [v2rayN (Windows 客户端)](https://github.com/2dust/v2rayN)
807
- - [v2rayNG (Android 客户端)](https://github.com/2dust/v2rayNG)
808
- - [V2rayU (macOS 客户端)](https://github.com/yanue/V2rayU)
809
-
810
- ---
811
-
812
- ## 📄 许可证
813
-
814
- 本项目采用 [MIT License](LICENSE) 开源许可证。
815
-
816
- **重要**: 使用前请务必阅读 [NOTICE - 使用须知与免责声明](NOTICE)
817
-
818
- 这意味着你可以:
819
- - ✅ 自由使用、复制、修改和分发本项目
820
- - ✅ 用于商业或非商业目的(需遵守法律)
821
- - ✅ 在遵守许可证的前提下自由修改
822
-
823
- 但需要:
824
- - ⚠️ 保留原作者的版权声明
825
- - ⚠️ 提供许可证副本
826
- - ⚠️ 遵守 NOTICE 文件中的使用限制
827
-
828
- ---
829
-
830
- ## ⚠️ 免责声明
831
-
832
- **重要提示**: 本项目仅供**学习和研究**使用。
833
-
834
- ### 使用限制
835
-
836
- - ✅ **允许**: 个人学习、技术研究、合法的企业内网、授权的安全测试
837
- - ❌ **禁止**: 任何违反当地法律法规的行为、访问非法内容、未授权的商业使用
838
-
839
- ### 法律责任
840
-
841
- 1. 使用代理技术需**遵守当地法律法规**
842
- 2. 在某些国家/地区(如中国大陆),未经授权使用 VPN 可能**违法**
843
- 3. 用户需**自行承担**所有法律后果
844
- 4. 作者**不对使用本项目造成的任何后果负责**
845
- 5. 使用者应**自行评估**法律风险
846
-
847
- ### 详细说明
848
-
849
- **使用前请务必阅读**: [NOTICE - 完整的使用须知与免责声明](NOTICE)
850
-
851
- **如果你不同意相关条款或无法确保合法使用,请勿使用本项目。**
852
-
853
- ---
854
-
855
- ## 💬 获取帮助
856
-
857
- ### 如何获取支持
858
-
859
- - 📧 **提交 Issue**: [GitHub Issues](https://github.com/DanOps-1/Xray-VPN-OneClick/issues)
860
- - 💡 **常见问题**: 查看 [FAQ 文档](docs/installation-guide.md#常见问题)
861
- - 📖 **阅读文档**: 完整的 [安装和配置教程](docs/installation-guide.md)
862
- - 🔍 **搜索已有问题**: 在提问前先搜索是否有相同问题
863
-
864
- ### 提交 Issue 的建议
865
-
866
- 请在 Issue 中提供以下信息:
867
-
868
- 1. 你的操作系统和版本
869
- 2. Xray 版本号
870
- 3. 详细的问题描述和错误信息
871
- 4. 相关的配置文件(隐藏敏感信息)
872
- 5. 你已经尝试过的解决方法
873
-
874
- ---
875
-
876
- <div align="center">
877
-
878
- **⭐ 如果这个项目对你有帮助,请给一个 Star 支持一下!**
879
-
880
- **🔄 也欢迎 Fork 和分享给需要的朋友!**
881
-
882
- Made with ❤️ by [DanOps-1](https://github.com/DanOps-1)
50
+ ## License
883
51
 
884
- </div>
52
+ MIT