diff --git a/README.md b/README.md index 56af828..8198b54 100644 --- a/README.md +++ b/README.md @@ -164,7 +164,7 @@ bash <(wget -qO- https://raw.githubusercontent.com/fscarmen/sing-box/main/sing-b ``` docker run -dit \ --pull always \ - --name sing-box + --name sing-box \ -p 8800-8820:8800-8820/tcp \ -p 8800-8820:8800-8820/udp \ -e START_PORT=8800 \ @@ -203,8 +203,8 @@ services: networks: - sing-box ports: - - "8000-8020:8800-8820/tcp" - - "8000-8020:8800-8820/udp" + - "8800-8820:8800-8820/tcp" + - "8800-8820:8800-8820/udp" environment: - START_PORT=8800 - SERVER_IP=123.123.123.123 diff --git a/docker_init.sh b/docker_init.sh index 5513057..253a11f 100644 --- a/docker_init.sh +++ b/docker_init.sh @@ -132,7 +132,7 @@ EOF } EOF - # 生成 route 配置 + # 生成 route 配置 cat > $WORK_DIR/conf/02_route.json << EOF { "route":{ @@ -295,7 +295,7 @@ EOF } EOF - # 生成 ShadowTLS V5 配置 + # 生成 ShadowTLS V5 配置 [ "${SHADOWTLS}" = 'true' ] && ((PORT++)) && PORT_SHADOWTLS=$PORT && cat > $WORK_DIR/conf/14_ShadowTLS_inbounds.json << EOF { "inbounds":[ @@ -442,7 +442,7 @@ EOF } EOF - # 生成 vless + ws + tls 配置 + # 生成 vless + ws + tls 配置 [ "${VLESS_WS}" = 'true' ] && ((PORT++)) && PORT_VLESS_WS=$PORT && cat > $WORK_DIR/conf/18_vless-ws-tls_inbounds.json << EOF // "CDN": "${CDN}" { @@ -643,8 +643,11 @@ stdout_logfile=/dev/null echo "$SUPERVISORD_CONF" > /etc/supervisor.d/daemon.ini # 如使用临时隧道,先运行 cloudflared 以获取临时隧道域名 - $WORK_DIR/$ARGO_RUNS >/dev/null 2>&1 & - [ -n "$METRICS_PORT" ] && sleep 3 && ARGO_DOMAIN=$(wget -qO- http://localhost:$METRICS_PORT/quicktunnel | awk -F '"' '{print $4}') + if [ -n "$METRICS_PORT" ]; then + $WORK_DIR/$ARGO_RUNS >/dev/null 2>&1 & + sleep 3 + local ARGO_DOMAIN=$(wget -qO- http://localhost:$METRICS_PORT/quicktunnel | awk -F '"' '{print $4}') + fi # 生成 nginx 配置文件 local NGINX_CONF="user root;