No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

26 líneas
1.2KB

  1. <#
  2. .SYNOPSIS
  3. First-time setup of the Foundry Knowledge Engine: .env, containers, schema migrations.
  4. .DESCRIPTION
  5. 1. Creates .env with a random POSTGRES_PASSWORD if it does not exist (never overwritten).
  6. 2. Starts PostgreSQL (docker compose up -d) and waits until it is healthy.
  7. 3. Applies pending migrations from infrastructure/postgres/migrations (idempotent).
  8. 4. Reports the health of the knowledge system, including the embedding model.
  9. #>
  10. [CmdletBinding()]
  11. param()
  12. $ErrorActionPreference = 'Stop'
  13. $root = (Resolve-Path (Join-Path $PSScriptRoot '..')).Path
  14. $envFile = Join-Path $root '.env'
  15. if (-not (Test-Path -LiteralPath $envFile)) {
  16. $bytes = [byte[]]::new(24)
  17. [Security.Cryptography.RandomNumberGenerator]::Fill($bytes)
  18. $pw = [Convert]::ToHexString($bytes).ToLowerInvariant()
  19. [IO.File]::WriteAllText($envFile, "POSTGRES_PASSWORD=$pw`n", [Text.UTF8Encoding]::new($false))
  20. Write-Host 'Created .env with a generated password (not committed).'
  21. }
  22. & (Join-Path $PSScriptRoot 'Start-Foundry.ps1')
  23. Import-Module (Join-Path $root 'powershell/Foundry.Knowledge/Foundry.Knowledge.psd1') -Force
  24. Update-FoundryDatabase
  25. Test-FoundryKnowledge | Format-List

Powered by TurnKey Linux.