diff --git a/Dockerfile b/Dockerfile index ec7a6e7b..bdf877ce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,8 @@ RUN apk add --no-cache --update \ ca-certificates \ tzdata \ fail2ban \ - bash + bash \ + curl COPY --from=builder /app/build/ /app/ COPY --from=builder /app/DockerEntrypoint.sh /app/ diff --git a/install.sh b/install.sh index 59be30ce..d8e95e22 100644 --- a/install.sh +++ b/install.sh @@ -53,7 +53,7 @@ is_ip() { is_ipv4 "$1" || is_ipv6 "$1" } is_domain() { - [[ "$1" =~ ^([A-Za-z0-9](-*[A-Za-z0-9])*)\.([A-Za-z]{2,})$ ]] && return 0 || return 1 + [[ "$1" =~ ^([A-Za-z0-9](-*[A-Za-z0-9])*\.)+(xn--[a-z0-9]{2,}|[A-Za-z]{2,})$ ]] && return 0 || return 1 } # Port helpers diff --git a/update.sh b/update.sh index 800841f5..91c37c37 100755 --- a/update.sh +++ b/update.sh @@ -78,7 +78,7 @@ is_ip() { is_ipv4 "$1" || is_ipv6 "$1" } is_domain() { - [[ "$1" =~ ^([A-Za-z0-9](-*[A-Za-z0-9])*\.)+[A-Za-z]{2,}$ ]] && return 0 || return 1 + [[ "$1" =~ ^([A-Za-z0-9](-*[A-Za-z0-9])*\.)+(xn--[a-z0-9]{2,}|[A-Za-z]{2,})$ ]] && return 0 || return 1 } # Port helpers diff --git a/web/service/xray.go b/web/service/xray.go index 43178d2f..511ffdda 100644 --- a/web/service/xray.go +++ b/web/service/xray.go @@ -40,6 +40,9 @@ func (s *XrayService) GetXrayErr() error { } err := p.GetErr() + if err == nil { + return nil + } if runtime.GOOS == "windows" && err.Error() == "exit status 1" { // exit status 1 on Windows means that Xray process was killed diff --git a/x-ui.sh b/x-ui.sh index 4dda45a0..07aaddc6 100644 --- a/x-ui.sh +++ b/x-ui.sh @@ -47,7 +47,7 @@ is_ip() { is_ipv4 "$1" || is_ipv6 "$1" } is_domain() { - [[ "$1" =~ ^([A-Za-z0-9](-*[A-Za-z0-9])*\.)+[A-Za-z]{2,}$ ]] && return 0 || return 1 + [[ "$1" =~ ^([A-Za-z0-9](-*[A-Za-z0-9])*\.)+(xn--[a-z0-9]{2,}|[A-Za-z]{2,})$ ]] && return 0 || return 1 } # check root