修改tls文件存放位置

This commit is contained in:
Olia Lisa 2025-12-31 01:10:52 +08:00
parent 4d3c9975fb
commit c86b1e54a6
4 changed files with 9 additions and 10 deletions

View File

@ -4,13 +4,13 @@
gen_self_tls() { 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/../key" local key_dir="$script_dir/../tls/self-tls"
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"
# 生成自签名证书 # 生成自签名证书
mkdir -p "$key_dir"
openssl req -x509 -nodes -newkey ec:<(openssl ecparam -name prime256v1) \ openssl req -x509 -nodes -newkey ec:<(openssl ecparam -name prime256v1) \
-keyout "$key_dir/server.key" \ -keyout "$key_dir/server.key" \
-out "$key_dir/server.crt" \ -out "$key_dir/server.crt" \
@ -18,6 +18,7 @@ gen_self_tls() {
-days 36500 -days 36500
# 更新config.json文件中的域名信息 # 更新config.json文件中的域名信息
local config_file="$script_dir/../config/config.json"
modify_json_file "$config_file" "masquerade.proxy.url" "https://$domain" modify_json_file "$config_file" "masquerade.proxy.url" "https://$domain"
} }

View File

@ -1,8 +1,8 @@
{ {
"listen": ":8004", "listen": ":8004",
"tls": { "tls": {
"cert": "/etc/hysteria/server.crt", "cert": "/tls/self-tls/server.crt",
"key": "/etc/hysteria/server.key" "key": "/tls/self-tls/server.key"
}, },
"auth": { "auth": {
"type": "password", "type": "password",
@ -11,7 +11,7 @@
"obfs": { "obfs": {
"type": "salamander", "type": "salamander",
"salamander": { "salamander": {
"password": "bLa4AdWOoE57OdtwYa" "password": "你的混淆密码"
} }
}, },
"masquerade": { "masquerade": {

View File

@ -5,7 +5,7 @@
"你的域名" "你的域名"
], ],
"email": "你的邮箱", "email": "你的邮箱",
"dir":"/acme", "dir":"/tls/acme",
"type": "dns", "type": "dns",
"dns": { "dns": {
"name": "cloudflare", "name": "cloudflare",

View File

@ -5,9 +5,7 @@ services:
restart: always restart: always
network_mode: "host" network_mode: "host"
volumes: volumes:
- ./acme:/acme - ./tls:/tls
- ./config/config.json:/etc/hysteria/config.json - ./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"] command: ["server", "-c", "/etc/hysteria/config.json"]