Skip to content

Commit

Permalink
fix no-auto-tls err
Browse files Browse the repository at this point in the history
  • Loading branch information
233boy committed Jun 29, 2023
1 parent 4771de7 commit 5c6f48d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/caddy.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
caddy_config() {
is_caddy_site_file=$is_caddy_conf/${host}.conf
[[ ! $tlsport ]] && tlsport=443
case $1 in
new)
mkdir -p $is_caddy_dir $is_caddy_dir/sites $is_caddy_conf
Expand Down
8 changes: 4 additions & 4 deletions src/core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ create() {
api add $is_json_file $is_dynamic_port_link_file &>/dev/null
fi
# caddy auto tls
[[ $is_caddy && $host ]] && {
[[ $is_caddy && $host && ! $is_no_auto_tls ]] && {
create caddy $net
}
# restart core
Expand Down Expand Up @@ -1210,10 +1210,10 @@ get() {
is_dynamic_port_range=$(jq -r '.inbounds[0].port' $is_dynamic_port_file)
[[ $? != 0 ]] && err "无法读取动态端口文件: $is_dynamic_port"
fi
if [[ $is_caddy && $host ]]; then
tlsport=$(egrep -o "$host:[1-9][0-9]?+" $is_caddy_conf/$host.conf | sed s/.*://)
if [[ $is_caddy && $host && -f $is_caddy_conf/$host.conf ]]; then
tmp_tlsport=$(egrep -o "$host:[1-9][0-9]?+" $is_caddy_conf/$host.conf | sed s/.*://)
fi
[[ ! $tlsport ]] && tlsport=443
[[ $tmp_tlsport ]] && tlsport=$tmp_tlsport
[[ $is_client && $host ]] && port=$tlsport
get protocol $is_protocol-$net
fi
Expand Down
1 change: 1 addition & 0 deletions src/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ is_caddy_repo=caddyserver/caddy
is_caddyfile=$is_caddy_dir/Caddyfile
is_caddy_conf=$is_caddy_dir/$author
is_caddy_service=$(systemctl list-units --full -all | grep caddy.service)
tlsport=443

# core ver
is_core_ver=$($is_core_bin version | head -n1 | cut -d " " -f1-2)
Expand Down
2 changes: 1 addition & 1 deletion v2ray.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

args=$@
is_sh_ver=v4.10
is_sh_ver=v4.11

. /etc/v2ray/sh/src/init.sh

0 comments on commit 5c6f48d

Please sign in to comment.