初始化询价智能体新仓:同步本地工程并排除密钥与 .env。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
linmianxun
2026-09-13 14:30:44 +08:00
co-authored by Cursor
commit 2a14def882
2621 changed files with 393165 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
$ErrorActionPreference = "Continue"
Write-Output "=== env resource lines (no secrets) ==="
$envFile = "E:\wwwroot\.env"
if (Test-Path $envFile) {
Select-String -Path $envFile -Pattern '^(MYSQL_HOST|MYSQL_PORT|MYSQL_DB|MYSQL_USER|PG_HOST|PG_PORT|PG_DATABASE|PG_USER|REDIS_URL|REDIS_KEY_PREFIX|YTD_REDIS_HOST|YTD_REDIS_PORT|OBJECT_STORAGE_)=' |
ForEach-Object {
$line = $_.Line
if ($line -match 'PASSWORD|SECRET|ACCESS_KEY|REDIS_URL=') {
if ($line -match '^REDIS_URL=') {
# mask password in redis url
$line -replace '://([^:]+):([^@]+)@', '://$1:***@'
} elseif ($line -match '=') {
($line -split '=',2)[0] + '=***'
} else { $line }
} else { $line }
}
} else { "missing .env" }
Write-Output "=== password filled? (bool only) ==="
function HasVal([string]$key) {
$m = Select-String -Path $envFile -Pattern ("^" + [regex]::Escape($key) + "=(.+)$") | Select-Object -First 1
if (-not $m) { return "$key=MISSING" }
$v = ($m.Line -split '=',2)[1]
if ([string]::IsNullOrWhiteSpace($v) -or $v -match '^<.*>$') { return "$key=EMPTY" }
return "$key=SET"
}
HasVal "MYSQL_PASSWORD"
HasVal "PG_PASSWORD"
HasVal "OBJECT_STORAGE_ACCESS_KEY"
HasVal "OBJECT_STORAGE_SECRET_KEY"
HasVal "REDIS_URL"
Write-Output "=== local tools that can probe ==="
@(
'C:\yutongda\tools\mysql-8.0.39-winx64\bin\mysql.exe',
'C:\yutongda\tools\pgsql\bin\psql.exe',
'C:\yutongda\tools\redis-5.0.14.1\redis-cli.exe'
) | ForEach-Object { "$_ exists=$(Test-Path $_)" }
Write-Output "DONE"