ЛР2: PostgreSQL, сессии (Basic + Bearer), Compose, миграции
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
2026-10-16 11:11:00 +03:00
parent 65003b6119
commit 4937d6d4e8
56 changed files with 1969 additions and 26 deletions
+19
View File
@@ -0,0 +1,19 @@
# Windows twin of scripts/init-secrets.sh. Existing files are kept.
$ErrorActionPreference = 'Stop'
Set-Location (Join-Path $PSScriptRoot '..')
New-Item -ItemType Directory -Force secrets | Out-Null
function New-Secret($name, $bytes) {
$path = Join-Path 'secrets' $name
if ((Test-Path $path) -and (Get-Item $path).Length -gt 0) { "kept secrets/$name"; return }
$buffer = New-Object byte[] $bytes
[Security.Cryptography.RandomNumberGenerator]::Create().GetBytes($buffer)
$value = [Convert]::ToBase64String($buffer) -replace '[+/=]', ''
# ASCII, no BOM, no trailing newline.
[IO.File]::WriteAllText((Join-Path (Get-Location) $path), $value, [Text.Encoding]::ASCII)
"created secrets/$name"
}
New-Secret 'postgres_password' 32
New-Secret 'jwt_secret' 64
if (-not (Test-Path .env)) { Copy-Item .env.example .env; 'created .env' }