Try fix prettier format

This commit is contained in:
yuhan6665
2025-04-09 22:39:12 -04:00
parent ab2f511011
commit f9761b7b84
144 changed files with 6723 additions and 4280 deletions
+9 -5
View File
@@ -42,19 +42,20 @@ Use "xray help <command>" for more information about a command.
```
Run Xray with config, the default command.
The -config=file, -c=file flags set the config files for
The -config=file, -c=file flags set the config files for
Xray. Multiple assign is accepted.
The -confdir=dir flag sets a dir with multiple json config
The -format=json flag sets the format of config files.
The -format=json flag sets the format of config files.
Default "auto".
The -test flag tells Xray to test config files only,
The -test flag tells Xray to test config files only,
without launching the server.
The -dump flag tells Xray to print the merged config.
```
`-config=` / `-c=` 用于指定使用的配置文件的位置,支持多文件配置。
`-confdir=` 用于指定一个包含多个配置文件的文件夹。
`-format=` 用于指定使用的配置文件的格式。
@@ -117,6 +118,7 @@ The commands are:
```
`pb` 子命令使用示例:
```bash
# 用法:xray convert pb [-debug] [-type] [json file] [json file] ...
@@ -134,6 +136,7 @@ xray help convert pb
```
json 子命令使用示例:
```bash
# 用法:xray convert json [-type] [stdin:] [typedMessage file]
@@ -171,6 +174,7 @@ xray tls <command> [arguments]
```
### xray uuid
生成 UUID。
使用方法:
@@ -180,6 +184,7 @@ xray uuid [-i "example"]
```
### xray x25519
生成 x25519 密钥对。
使用方法:
@@ -189,6 +194,7 @@ xray x25519 [-i "(base64.RawURLEncoding)" --std-encoding ]
```
### xray wg
生成 wireguard curve25519 密钥对。
使用方法:
@@ -203,5 +209,3 @@ xray wg [-i "(base64.StdEncoding)"]
- 工作目录(Working Directory)
- [环境变量](../config/features/env.md#资源文件路径)中 `Xray.location.asset` 所指定的路径
:::
+4 -3
View File
@@ -26,7 +26,7 @@
"settings": {
"clients": [
{
"id": "b831381d-6324-4d53-ad4f-8cda48b30811" // 记得替换这个字段,使用 `xray uuid` 或 `uuidgen` 生成
"id": "b831381d-6324-4d53-ad4f-8cda48b30811" // 记得替换这个字段,使用 `xray uuid` 或 `uuidgen` 生成
}
]
}
@@ -68,7 +68,7 @@
"port": 10086, // 服务器端口
"users": [
{
"id": "b831381d-6324-4d53-ad4f-8cda48b30811" // 记得替换这个字段,使用 `xray uuid` 或 `uuidgen` 生成
"id": "b831381d-6324-4d53-ad4f-8cda48b30811" // 记得替换这个字段,使用 `xray uuid` 或 `uuidgen` 生成
}
]
}
@@ -85,13 +85,14 @@
"rules": [
{
"type": "field",
"ip": ["geoip:private","geoip:cn"], // 绕过局域网和国内IP段
"ip": ["geoip:private", "geoip:cn"], // 绕过局域网和国内IP段
"outboundTag": "direct"
}
]
}
}
```
上述配置唯一要更改的地方是你的服务器 IP 和用户 uuid,配置中已注明。上述配置会把除局域网(比如访问路由器)和国内IP段(比如访问bilibili、acfun)以外的所有流量转发至你的服务器。
## 运行
+1 -1
View File
@@ -5,7 +5,7 @@
Xray 在以下平台中可用:
- Windows 7 及之后版本(x86 / amd64 / arm32 / arm64);
- Windows 7 中使用 1.8.4、1.8.6 的常规版本以及 1.8.18 以后的 ```win7``` 版本需要系统安装有 **KB4474419** 更新方可使用;推荐同时安装 KB4490628 以便联网后接受后续的操作系统安全更新。
- Windows 7 中使用 1.8.4、1.8.6 的常规版本以及 1.8.18 以后的 `win7` 版本需要系统安装有 **KB4474419** 更新方可使用;推荐同时安装 KB4490628 以便联网后接受后续的操作系统安全更新。
- macOS 10.10 Yosemite 及之后版本(amd64 / arm64);
- Linux 2.6.23 及之后版本(x86 / amd64 / arm / arm64 / mips64 / mips / ppc64 / s390x / riscv64);
- 包括但不限于 Debian 7 / 8、Ubuntu 12.04 / 14.04 及后续版本、CentOS 7 / 8、Arch Linux 等;
+1 -1
View File
@@ -85,9 +85,9 @@ Linux 服务器的安全防护是一个纷繁复杂的巨大课题。无数的
- 如果第 3 步你有仔细观察,就会发现保存并不是常见的 `ctrl+s`。
- 正确的快捷键:保存是 `ctrl+o` + `回车`,退出是 `ctrl+x`
- (部分操作系统) 新增一个防火墙规则,设置为新增的SSH端口, 否则实例重启后无法SSH登陆。
- 如 Ubuntu 的 ufw
```shell
sudo ufw allow 9753/tcp
```
+8 -2
View File
@@ -31,10 +31,13 @@
3. 如果无法看到上述Nginx默认页面,可能是需要配置Debian系统上默认的防火墙组件Uncomplicated Firewall (UFW),以便启用 HTTP (80) 和 HTTPS (443) 端口流量。
a. 验证方法,输入:
```shell
sudo ufw status
```
b. 如果输出如下,表明80和433端口未开启,需要执行c步骤
```shell
Status: active
To Action From
@@ -42,11 +45,15 @@
22/tcp ALLOW Anywhere
22/tcp (v6) ALLOW Anywhere (v6)
```
c. 启用UFW的Nginx 80 和 443 端口命令
```shell
sudo ufw allow 'Nginx Full'
```
d. 输入a中命令再次验证,如果输出如下,表示Nginx流量已经被防火墙放行,这样就应该可以看到前述第2点中的Nginx默认页面。
```shell
Status: active
To Action From
@@ -57,7 +64,6 @@
Nginx Full (v6) ALLOW Anywhere (v6)
```
## 5.3 创建一个最简单的网页
1. 小小白白 Linux 基础命令:
@@ -130,7 +136,7 @@
chmod -R a+r .
```
6. 修改 `nginx.conf` 并重启 `Nginx` 服务,将`80`端口的 http 访问定位到刚才建立的 `html` 页面上
5. 修改 `nginx.conf` 并重启 `Nginx` 服务,将`80`端口的 http 访问定位到刚才建立的 `html` 页面上
1. 修改 `nginx.conf` 。
+7 -4
View File
@@ -41,6 +41,7 @@ Endpoint = <EndpointIP>:<Port>
```
在 `[Interface]` 下添加如下命令:
```ini
Table = <table>
### fwmark
@@ -59,13 +60,14 @@ PostDown = ip rule del oif %i lookup <table>
PreUp = ip -6 rule add oif %i lookup <table>
PostDown = ip -6 rule del oif %i lookup <table>
```
::: tip
- 此配置文件融合了 `fwmark` / `sendThrough` / `sockopt.interface`,表示
- 送入此设备 `%i` 的连接 / 送入此 `<IPv4/6>` 的连接 / `fwmark` 被标记为 `<mark>` 的连接
- 送入此设备 `%i` 的连接 / 送入此 `<IPv4/6>` 的连接 / `fwmark` 被标记为 `<mark>` 的连接
- 将会使用 wireguard 进行转发
- `%i` 是 wireguard 配置文件中的占位符,表示在启动时替换为这个设备的名称
:::
:::
保存
@@ -242,4 +244,5 @@ systemctl start wg-quick@wg0
## 感谢
[XTLS/Xray-core](https://github.com/XTLS/Xray-core); [v2fly/v2ray-core](https://github.com/v2fly/v2ray-core); [WireGuard](https://www.wireguard.com/); [@p3terx](https://p3terx.com/); @w; @Hiram; @Luminous; @Ln; @JackChou;
<!--剩下几位大佬我实在找不到他们的地址或Github空间,请大家帮忙找吧-->
<!--剩下几位大佬我实在找不到他们的地址或Github空间,请大家帮忙找吧-->
+1 -1
View File
@@ -322,4 +322,4 @@ ExecStop=/usr/sbin/netfilter-persistent stop ; /usr/sbin/ip route flush dev lo t
[Install]
WantedBy=multi-user.target
```
```
@@ -91,6 +91,7 @@ Linux 使用`Netfilter`来管理网络,`Netfilter`模型如下:
4. 能够手写客户端 json 文件配置,至少要能看懂
### 前期准备工作
::: warning
在开始操作前,记得使用 `sysctl -w net.ipv4.ip_forward=1` 打开linux ipv4封包转发
:::
+45 -37
View File
@@ -15,7 +15,9 @@ Xray(1.6.5+)新加入了 WireGuard 出站,虽然增加的代码和依赖
## 申请 Warp 账户
### 感谢 Cloudflare 推动自由的互联网,现在你可以免费使用 Warp 服务,连接的时候会根据出口自动选择最近的服务器
#### 方法 1:
1. 使用一台 vps,下载 [wgcf](https://github.com/ViRb3/wgcf/releases)
2. 运行 `wgcf register` 生成 `wgcf-account.toml`
3. 运行 `wgcf generate` 生成 `wgcf-profile.conf` 拷贝内容如下:
@@ -33,34 +35,45 @@ AllowedIPs = 0.0.0.0/0
AllowedIPs = ::/0
Endpoint = engage.cloudflareclient.com:2408
```
#### 方法 2:
1. 使用 [warp-reg.sh](https://github.com/chise0713/warp-reg.sh),运行:
```
bash -c "$(curl -L warp-reg.vercel.app)"
```
- 输出
```json
{
"endpoint":{
"v4": "162.159.192.7",
"v6": "[2606:4700:d0::a29f:c007]",
},
"reserved_dec": [35, 74, 190],
"reserved_hex": "0x234abe",
"reserved_str": "I0q+",
"private_key": "yL0kApRiZW4VFfNkKAQ/nYxnMFT3AH0dfVkj1GAlr1k=",
"public_key": "bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=",
"v4": "172.16.0.2",
"v6": "2606:4700:110:81f3:2a5b:3cad:9d4:9ea6"
"endpoint": {
"v4": "162.159.192.7",
"v6": "[2606:4700:d0::a29f:c007]"
},
"reserved_dec": [35, 74, 190],
"reserved_hex": "0x234abe",
"reserved_str": "I0q+",
"private_key": "yL0kApRiZW4VFfNkKAQ/nYxnMFT3AH0dfVkj1GAlr1k=",
"public_key": "bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=",
"v4": "172.16.0.2",
"v6": "2606:4700:110:81f3:2a5b:3cad:9d4:9ea6"
}
```
2. 拷贝输出的内容
#### 方法 3:
1. 使用[wgcf-cli](https://github.com/ArchiveNetwork/wgcf-cli),运行以下内容进行安装:
```
bash -c "$(curl -L wgcf-cli.vercel.app)"
```
2. 运行 `wgcf-cli register` 进行注册,输出:
```json
❯ wgcf-cli register
{
@@ -83,38 +96,33 @@ bash -c "$(curl -L wgcf-cli.vercel.app)"
}
}
```
- 完整文件将会保存到工作目录的 `wgcf.json` 内。
3. 运行 `wgcf-cli generate --xray` 来生成一个WireGurad出站,他会将内容保存到 `wgcf.xray.json` 内
- 示例文件:
```json
{
"protocol": "wireguard",
"settings": {
"secretKey": "6CRVRLgFwGajnikoVOPTDNZnDhx3EydhPsMgpxHfBCY=",
"address": [
"172.16.0.2/32",
"2606:4700:110:857a:6a95:fe27:1870:2a9d/128"
],
"peers": [
{
"publicKey": "bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=",
"allowedIPs": [
"0.0.0.0/0",
"::/0"
],
"endpoint": "162.159.192.1:2408"
}
],
"reserved": [
240,
25,
146
],
"mtu": 1280
},
"tag": "wireguard"
"protocol": "wireguard",
"settings": {
"secretKey": "6CRVRLgFwGajnikoVOPTDNZnDhx3EydhPsMgpxHfBCY=",
"address": ["172.16.0.2/32", "2606:4700:110:857a:6a95:fe27:1870:2a9d/128"],
"peers": [
{
"publicKey": "bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=",
"allowedIPs": ["0.0.0.0/0", "::/0"],
"endpoint": "162.159.192.1:2408"
}
],
"reserved": [240, 25, 146],
"mtu": 1280
},
"tag": "wireguard"
}
```
## 在服务端分流回国流量至 warp
在现有出站中新增一个 WireGurad 出站
@@ -131,7 +139,7 @@ bash -c "$(curl -L wgcf-cli.vercel.app)"
"endpoint": "engage.cloudflareclient.com:2408"
}
],
"reserved":[0, 0, 0] // 如果你有的话,粘贴reserved到这里
"reserved": [0, 0, 0] // 如果你有的话,粘贴reserved到这里
},
"tag": "wireguard-1"
}