diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 9f1fcbc5..3316d662 100755 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -9,9 +9,8 @@ export isFirstStartServer=true echo -e "======================1. 检测配置文件========================\n" make_dir /etc/nginx/conf.d make_dir /run/nginx -cp -fv $nginx_conf /etc/nginx/nginx.conf -cp -fv $nginx_app_conf /etc/nginx/conf.d/front.conf -sed -i "s,QL_BASE_URL,${qlBaseUrl},g" /etc/nginx/conf.d/front.conf +init_nginx + pm2 l &>/dev/null patch_version &>/dev/null diff --git a/docker/front.conf b/docker/front.conf index c219b20d..5d64a2de 100644 --- a/docker/front.conf +++ b/docker/front.conf @@ -13,7 +13,7 @@ map $http_upgrade $connection_upgrade { server { listen 5700; - listen [::]:5700 ipv6only=on; + IPV6_CONFIG root /ql/static/dist; ssl_session_timeout 5m; diff --git a/shell/check.sh b/shell/check.sh index 3b2c7ed1..09325928 100755 --- a/shell/check.sh +++ b/shell/check.sh @@ -25,9 +25,7 @@ copy_dep() { echo -e "---> 通知文件复制完成\n" echo -e "---> 2. 复制nginx配置文件\n" - cp -fv $nginx_conf /etc/nginx/nginx.conf - cp -fv $nginx_app_conf /etc/nginx/conf.d/front.conf - sed -i "s,QL_BASE_URL,${qlBaseUrl},g" /etc/nginx/conf.d/front.conf + init_nginx echo -e "---> 配置文件复制完成\n" } diff --git a/shell/share.sh b/shell/share.sh index 3d236b29..77b73e54 100755 --- a/shell/share.sh +++ b/shell/share.sh @@ -482,6 +482,19 @@ patch_version() { fi } +init_nginx() { + cp -fv $nginx_conf /etc/nginx/nginx.conf + cp -fv $nginx_app_conf /etc/nginx/conf.d/front.conf + sed -i "s,QL_BASE_URL,${qlBaseUrl},g" /etc/nginx/conf.d/front.conf + + ipv6=$(ip a | grep inet6) + ipv6Str="" + if [[ $ipv6 ]]; then + ipv6Str="listen [::]:5700 ipv6only=on;" + fi + sed -i "s,IPV6_CONFIG,${ipv6Str},g" /etc/nginx/conf.d/front.conf +} + init_env detect_termux detect_macos