$ErrorActionPreference = 'Stop' New-Item -ItemType Directory -Force secrets | Out-Null $values = @{postgres_db='messenger'; postgres_user='messenger'; postgres_password=''; minio_root_user='labadmin'; minio_root_password=''; s3_access_key_id='labapi'; s3_secret_access_key=''} foreach ($name in $values.Keys) { $path = Join-Path secrets ($name + '.txt') if (!(Test-Path -LiteralPath $path)) { $value = $values[$name] if (!$value) { $value = [Convert]::ToBase64String([System.Security.Cryptography.RandomNumberGenerator]::GetBytes(32)) } [System.IO.File]::WriteAllText((Join-Path (Get-Location) $path), $value) } } if (!(Test-Path .env)) { Copy-Item .env.example .env }