fix(security): 收紧默认部署暴露面

This commit is contained in:
2026-09-12 21:56:37 +08:00
parent 40732c011b
commit f4e7b9b461
9 changed files with 504 additions and 115 deletions
+2
View File
@@ -175,6 +175,8 @@ function Setup-EnvFiles {
$content = Upsert-Env $content "NUXT_PUBLIC_SG_APIURL" "http://$($script:DeployIP):3003"
$serverBindIp = if ($script:DeployIP -eq "127.0.0.1" -or $script:DeployIP -eq "localhost") { "127.0.0.1" } else { "0.0.0.0" }
$content = Upsert-Env $content "SERVER_HTTP_BIND_IP" $serverBindIp
# Windows 当前仍使用 Docker Desktop 直连端口;显式覆盖 Linux Nginx 模式的回环默认值。
$content = Upsert-Env $content "EASYAI_PROXY_BIND_IP" $serverBindIp
$webPortMatch = [regex]::Match($content, '(?m)^WEB_PORT=(\d+)$')
$webPort = if ($webPortMatch.Success) { $webPortMatch.Groups[1].Value } else { "3010" }
$content = Upsert-Env $content "CONFIG_SECURITY_ORIGIN" "http://$($script:DeployIP):$webPort"