修改config位置
This commit is contained in:
parent
8661527fc0
commit
bfa08217b7
@ -5,7 +5,7 @@ gen_self_tls() {
|
|||||||
local domain="${1:-bing.com}"
|
local domain="${1:-bing.com}"
|
||||||
local script_dir="$(dirname "$(realpath "$0")")"
|
local script_dir="$(dirname "$(realpath "$0")")"
|
||||||
local key_dir="$script_dir/../tls"
|
local key_dir="$script_dir/../tls"
|
||||||
local config_file="$script_dir/../config.json"
|
local config_file="$script_dir/../config/config.json"
|
||||||
|
|
||||||
# 导入utils文件夹中的jq_util.sh脚本
|
# 导入utils文件夹中的jq_util.sh脚本
|
||||||
source "$script_dir/utils/jq_util.sh"
|
source "$script_dir/utils/jq_util.sh"
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
print_share_link() {
|
print_share_link() {
|
||||||
local script_dir=$(cd "$(dirname "$0")"; pwd)
|
local script_dir=$(cd "$(dirname "$0")"; pwd)
|
||||||
local config_dir=$(readlink -f "$script_dir/../")
|
local config_dir=$(readlink -f "$script_dir/../config")
|
||||||
source "${script_dir}/utils/base.sh"
|
source "${script_dir}/utils/base.sh"
|
||||||
|
|
||||||
# 检查jq是否安装
|
# 检查jq是否安装
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
# 更新密码的函数
|
# 更新密码的函数
|
||||||
update_password() {
|
update_password() {
|
||||||
local script_dir="$(dirname "$(realpath "$0")")"
|
local script_dir="$(dirname "$(realpath "$0")")"
|
||||||
local config_file="$script_dir/../config.json"
|
local config_file="$script_dir/../config/config.json"
|
||||||
|
|
||||||
# 加载工具脚本
|
# 加载工具脚本
|
||||||
source "$script_dir/utils/base.sh"
|
source "$script_dir/utils/base.sh"
|
||||||
|
|||||||
@ -46,7 +46,7 @@ find_free_port() {
|
|||||||
|
|
||||||
update_port(){
|
update_port(){
|
||||||
local script_dir=$(cd "$(dirname "$0")"; pwd)
|
local script_dir=$(cd "$(dirname "$0")"; pwd)
|
||||||
local config_dir="$script_dir/../"
|
local config_dir="$script_dir/../config"
|
||||||
source "$script_dir/utils/jq_util.sh"
|
source "$script_dir/utils/jq_util.sh"
|
||||||
|
|
||||||
local port=$(find_free_port)
|
local port=$(find_free_port)
|
||||||
@ -54,4 +54,4 @@ update_port(){
|
|||||||
echo "设置端口成功"
|
echo "设置端口成功"
|
||||||
}
|
}
|
||||||
|
|
||||||
update_port
|
update_port
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
update_uuid(){
|
update_uuid(){
|
||||||
|
|
||||||
script_dir=$(cd "$(dirname "$0")"; pwd) # 脚本文件绝对路径
|
script_dir=$(cd "$(dirname "$0")"; pwd) # 脚本文件绝对路径
|
||||||
config_dir="$script_dir/../"
|
config_dir="$script_dir/../config"
|
||||||
|
|
||||||
# 生成 UUID
|
# 生成 UUID
|
||||||
uuid=$(docker run --rm teddysun/xray:latest xray uuid)
|
uuid=$(docker run --rm teddysun/xray:latest xray uuid)
|
||||||
|
|||||||
53
config/template/self_cert_config.json
Normal file
53
config/template/self_cert_config.json
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
{
|
||||||
|
"log": {
|
||||||
|
"level": "info",
|
||||||
|
"timestamp": true
|
||||||
|
},
|
||||||
|
"inbounds": [
|
||||||
|
{
|
||||||
|
"type": "tuic",
|
||||||
|
"tag": "tuic-in",
|
||||||
|
"listen": "::",
|
||||||
|
"listen_port": 8443,
|
||||||
|
"users": [
|
||||||
|
{
|
||||||
|
"name": "user1",
|
||||||
|
"uuid": "你的UUID",
|
||||||
|
"password": "你的密码"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"congestion_control": "bbr",
|
||||||
|
"auth_timeout": "3s",
|
||||||
|
"zero_rtt_handshake": false,
|
||||||
|
"heartbeat": "10s",
|
||||||
|
"tls": {
|
||||||
|
"enabled": true,
|
||||||
|
"server_name": "bing.com",
|
||||||
|
"alpn": [
|
||||||
|
"h3"
|
||||||
|
],
|
||||||
|
"key_path": "/etc/sing-box/tls/server.key",
|
||||||
|
"certificate_path": "/etc/sing-box/tls/server.crt"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"outbounds": [
|
||||||
|
{
|
||||||
|
"type": "direct",
|
||||||
|
"tag": "direct"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "block",
|
||||||
|
"tag": "block"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"route": {
|
||||||
|
"rules": [
|
||||||
|
{
|
||||||
|
"ip_is_private": true,
|
||||||
|
"outbound": "block"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"final": "direct"
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -5,7 +5,7 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
network_mode: host
|
network_mode: host
|
||||||
volumes:
|
volumes:
|
||||||
- ./config.json:/etc/sing-box/config.json
|
- ./config/config.json:/etc/sing-box/config.json
|
||||||
- ./tls:/etc/sing-box/tls
|
- ./tls:/etc/sing-box/tls
|
||||||
command: -C /etc/sing-box run
|
command: -C /etc/sing-box run
|
||||||
logging:
|
logging:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user