修改tls文件存放位置
This commit is contained in:
parent
4d3c9975fb
commit
c86b1e54a6
@ -4,13 +4,13 @@
|
||||
gen_self_tls() {
|
||||
local domain="${1:-bing.com}"
|
||||
local script_dir="$(dirname "$(realpath "$0")")"
|
||||
local key_dir="$script_dir/../key"
|
||||
local config_file="$script_dir/../config/config.json"
|
||||
local key_dir="$script_dir/../tls/self-tls"
|
||||
|
||||
# 导入utils文件夹中的jq_util.sh脚本
|
||||
source "$script_dir/utils/jq_util.sh"
|
||||
|
||||
# 生成自签名证书
|
||||
mkdir -p "$key_dir"
|
||||
openssl req -x509 -nodes -newkey ec:<(openssl ecparam -name prime256v1) \
|
||||
-keyout "$key_dir/server.key" \
|
||||
-out "$key_dir/server.crt" \
|
||||
@ -18,6 +18,7 @@ gen_self_tls() {
|
||||
-days 36500
|
||||
|
||||
# 更新config.json文件中的域名信息
|
||||
local config_file="$script_dir/../config/config.json"
|
||||
modify_json_file "$config_file" "masquerade.proxy.url" "https://$domain"
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
{
|
||||
"listen": ":8004",
|
||||
"tls": {
|
||||
"cert": "/etc/hysteria/server.crt",
|
||||
"key": "/etc/hysteria/server.key"
|
||||
"cert": "/tls/self-tls/server.crt",
|
||||
"key": "/tls/self-tls/server.key"
|
||||
},
|
||||
"auth": {
|
||||
"type": "password",
|
||||
@ -11,7 +11,7 @@
|
||||
"obfs": {
|
||||
"type": "salamander",
|
||||
"salamander": {
|
||||
"password": "bLa4AdWOoE57OdtwYa"
|
||||
"password": "你的混淆密码"
|
||||
}
|
||||
},
|
||||
"masquerade": {
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
"你的域名"
|
||||
],
|
||||
"email": "你的邮箱",
|
||||
"dir":"/acme",
|
||||
"dir":"/tls/acme",
|
||||
"type": "dns",
|
||||
"dns": {
|
||||
"name": "cloudflare",
|
||||
|
||||
@ -5,9 +5,7 @@ services:
|
||||
restart: always
|
||||
network_mode: "host"
|
||||
volumes:
|
||||
- ./acme:/acme
|
||||
- ./tls:/tls
|
||||
- ./config/config.json:/etc/hysteria/config.json
|
||||
- ./key/server.crt:/etc/hysteria/server.crt
|
||||
- ./key/server.key:/etc/hysteria/server.key
|
||||
command: ["server", "-c", "/etc/hysteria/config.json"]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user