合并SingBox Stable源码
This commit is contained in:
17
README.md
17
README.md
@@ -49,7 +49,8 @@
|
|||||||
- `acmedns`
|
- `acmedns`
|
||||||
- 安装脚本默认生成:
|
- 安装脚本默认生成:
|
||||||
- `/etc/sing-box/config.d/10-base.json`
|
- `/etc/sing-box/config.d/10-base.json`
|
||||||
- `/etc/sing-box/config.d/20-outbounds.json`
|
- `/etc/sing-box/config.d/route.json`
|
||||||
|
- `/etc/sing-box/config.d/outbound.json`
|
||||||
- 安装后的服务名为:
|
- 安装后的服务名为:
|
||||||
- `singbox.service`
|
- `singbox.service`
|
||||||
|
|
||||||
@@ -139,7 +140,13 @@ sing-box -D /var/lib/sing-box -C /etc/sing-box/config.d run
|
|||||||
- `services`
|
- `services`
|
||||||
- 基础路由规则
|
- 基础路由规则
|
||||||
|
|
||||||
### `20-outbounds.json`
|
### `route.json`
|
||||||
|
|
||||||
|
- `route.rules`
|
||||||
|
- `route.auto_detect_interface`
|
||||||
|
- common DNS hijack rules
|
||||||
|
|
||||||
|
### `outbound.json`
|
||||||
|
|
||||||
放这些内容:
|
放这些内容:
|
||||||
|
|
||||||
@@ -157,7 +164,8 @@ sing-box -D /var/lib/sing-box -C /etc/sing-box/config.d run
|
|||||||
|
|
||||||
- [configs/10-base.single-node.json](./configs/10-base.single-node.json)
|
- [configs/10-base.single-node.json](./configs/10-base.single-node.json)
|
||||||
- [configs/10-base.multi-node.json](./configs/10-base.multi-node.json)
|
- [configs/10-base.multi-node.json](./configs/10-base.multi-node.json)
|
||||||
- [configs/20-outbounds.example.json](./configs/20-outbounds.example.json)
|
- [configs/route.json](./configs/route.json)
|
||||||
|
- [configs/outbound.json](./configs/outbound.json)
|
||||||
|
|
||||||
## `services.xboard` 配置说明
|
## `services.xboard` 配置说明
|
||||||
|
|
||||||
@@ -362,7 +370,8 @@ Xboard setup error: missing certificate
|
|||||||
单节点基础配置
|
单节点基础配置
|
||||||
- [configs/10-base.multi-node.json](./configs/10-base.multi-node.json)
|
- [configs/10-base.multi-node.json](./configs/10-base.multi-node.json)
|
||||||
多节点基础配置
|
多节点基础配置
|
||||||
- [configs/20-outbounds.example.json](./configs/20-outbounds.example.json)
|
- [configs/route.json](./configs/route.json)
|
||||||
|
- [configs/outbound.json](./configs/outbound.json)
|
||||||
出站配置模板
|
出站配置模板
|
||||||
- [configs/panel-response.vless-reality.json](./configs/panel-response.vless-reality.json)
|
- [configs/panel-response.vless-reality.json](./configs/panel-response.vless-reality.json)
|
||||||
VLESS REALITY 面板回包
|
VLESS REALITY 面板回包
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ NC='\033[0m'
|
|||||||
CONFIG_DIR="/etc/sing-box"
|
CONFIG_DIR="/etc/sing-box"
|
||||||
CONFIG_MERGE_DIR="$CONFIG_DIR/config.d"
|
CONFIG_MERGE_DIR="$CONFIG_DIR/config.d"
|
||||||
CONFIG_BASE_FILE="$CONFIG_MERGE_DIR/10-base.json"
|
CONFIG_BASE_FILE="$CONFIG_MERGE_DIR/10-base.json"
|
||||||
CONFIG_OUTBOUNDS_FILE="$CONFIG_MERGE_DIR/20-outbounds.json"
|
CONFIG_ROUTE_FILE="$CONFIG_MERGE_DIR/route.json"
|
||||||
|
CONFIG_OUTBOUNDS_FILE="$CONFIG_MERGE_DIR/outbound.json"
|
||||||
WORK_DIR="/var/lib/sing-box"
|
WORK_DIR="/var/lib/sing-box"
|
||||||
BINARY_PATH="/usr/local/bin/sing-box"
|
BINARY_PATH="/usr/local/bin/sing-box"
|
||||||
SERVICE_NAME="singbox"
|
SERVICE_NAME="singbox"
|
||||||
@@ -332,7 +333,12 @@ ${DNS_SERVER_JSON}
|
|||||||
"services": [
|
"services": [
|
||||||
${SERVICE_JSON}
|
${SERVICE_JSON}
|
||||||
],
|
],
|
||||||
"inbounds": [],
|
"inbounds": []
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat > "$CONFIG_ROUTE_FILE" <<EOF
|
||||||
|
{
|
||||||
"route": {
|
"route": {
|
||||||
"rules": [
|
"rules": [
|
||||||
{
|
{
|
||||||
@@ -357,6 +363,7 @@ cat > "$CONFIG_OUTBOUNDS_FILE" <<EOF
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo -e "${GREEN}Base configuration written to $CONFIG_BASE_FILE${NC}"
|
echo -e "${GREEN}Base configuration written to $CONFIG_BASE_FILE${NC}"
|
||||||
|
echo -e "${GREEN}Route configuration written to $CONFIG_ROUTE_FILE${NC}"
|
||||||
echo -e "${GREEN}Outbound configuration written to $CONFIG_OUTBOUNDS_FILE${NC}"
|
echo -e "${GREEN}Outbound configuration written to $CONFIG_OUTBOUNDS_FILE${NC}"
|
||||||
echo -e "${YELLOW}Edit $CONFIG_OUTBOUNDS_FILE when adding custom sing-box outbounds.${NC}"
|
echo -e "${YELLOW}Edit $CONFIG_OUTBOUNDS_FILE when adding custom sing-box outbounds.${NC}"
|
||||||
|
|
||||||
|
|||||||
@@ -37,14 +37,5 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"inbounds": [],
|
"inbounds": []
|
||||||
"route": {
|
|
||||||
"rules": [
|
|
||||||
{
|
|
||||||
"protocol": "dns",
|
|
||||||
"action": "hijack-dns"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"auto_detect_interface": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,14 +29,5 @@
|
|||||||
"node_id": 286
|
"node_id": 286
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"inbounds": [],
|
"inbounds": []
|
||||||
"route": {
|
|
||||||
"rules": [
|
|
||||||
{
|
|
||||||
"protocol": "dns",
|
|
||||||
"action": "hijack-dns"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"auto_detect_interface": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
12
configs/outbound.json
Normal file
12
configs/outbound.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"outbounds": [
|
||||||
|
{
|
||||||
|
"type": "direct",
|
||||||
|
"tag": "direct"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "block",
|
||||||
|
"tag": "block"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
11
configs/route.json
Normal file
11
configs/route.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"route": {
|
||||||
|
"rules": [
|
||||||
|
{
|
||||||
|
"protocol": "dns",
|
||||||
|
"action": "hijack-dns"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"auto_detect_interface": true
|
||||||
|
}
|
||||||
|
}
|
||||||
11
install.sh
11
install.sh
@@ -10,7 +10,8 @@ NC='\033[0m'
|
|||||||
CONFIG_DIR="/etc/sing-box"
|
CONFIG_DIR="/etc/sing-box"
|
||||||
CONFIG_MERGE_DIR="$CONFIG_DIR/config.d"
|
CONFIG_MERGE_DIR="$CONFIG_DIR/config.d"
|
||||||
CONFIG_BASE_FILE="$CONFIG_MERGE_DIR/10-base.json"
|
CONFIG_BASE_FILE="$CONFIG_MERGE_DIR/10-base.json"
|
||||||
CONFIG_OUTBOUNDS_FILE="$CONFIG_MERGE_DIR/20-outbounds.json"
|
CONFIG_ROUTE_FILE="$CONFIG_MERGE_DIR/route.json"
|
||||||
|
CONFIG_OUTBOUNDS_FILE="$CONFIG_MERGE_DIR/outbound.json"
|
||||||
WORK_DIR="/var/lib/sing-box"
|
WORK_DIR="/var/lib/sing-box"
|
||||||
BINARY_PATH="/usr/local/bin/sing-box"
|
BINARY_PATH="/usr/local/bin/sing-box"
|
||||||
SERVICE_NAME="singbox"
|
SERVICE_NAME="singbox"
|
||||||
@@ -507,7 +508,12 @@ ${DNS_SERVER_JSON}
|
|||||||
"services": [
|
"services": [
|
||||||
${SERVICE_JSON}
|
${SERVICE_JSON}
|
||||||
],
|
],
|
||||||
"inbounds": [],
|
"inbounds": []
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat > "$CONFIG_ROUTE_FILE" <<EOF
|
||||||
|
{
|
||||||
"route": {
|
"route": {
|
||||||
"rules": [
|
"rules": [
|
||||||
{
|
{
|
||||||
@@ -532,6 +538,7 @@ cat > "$CONFIG_OUTBOUNDS_FILE" <<EOF
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo -e "${GREEN}Base configuration written to $CONFIG_BASE_FILE${NC}"
|
echo -e "${GREEN}Base configuration written to $CONFIG_BASE_FILE${NC}"
|
||||||
|
echo -e "${GREEN}Route configuration written to $CONFIG_ROUTE_FILE${NC}"
|
||||||
echo -e "${GREEN}Outbound configuration written to $CONFIG_OUTBOUNDS_FILE${NC}"
|
echo -e "${GREEN}Outbound configuration written to $CONFIG_OUTBOUNDS_FILE${NC}"
|
||||||
echo -e "${YELLOW}Edit $CONFIG_OUTBOUNDS_FILE when adding custom sing-box outbounds.${NC}"
|
echo -e "${YELLOW}Edit $CONFIG_OUTBOUNDS_FILE when adding custom sing-box outbounds.${NC}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user