Lab2: PostgreSQL, Bearer sessions and Redis for grade 4
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
# Creates local synthetic secrets for compose (never commit secrets/).
|
||||
$ErrorActionPreference = "Stop"
|
||||
$root = Split-Path -Parent $PSScriptRoot
|
||||
$secrets = Join-Path $root "secrets"
|
||||
New-Item -ItemType Directory -Force -Path $secrets | Out-Null
|
||||
|
||||
$password = "lab2-pg-pass-" + [guid]::NewGuid().ToString("N").Substring(0, 12)
|
||||
Set-Content -Path (Join-Path $secrets "postgres_password") -Value $password -NoNewline
|
||||
# URL for the API container (service DNS name "postgres" / "redis").
|
||||
$dbUrl = "postgresql://messenger:${password}@postgres:5432/messenger"
|
||||
Set-Content -Path (Join-Path $secrets "database_url") -Value $dbUrl -NoNewline
|
||||
Set-Content -Path (Join-Path $secrets "cache_url") -Value "redis://redis:6379/0" -NoNewline
|
||||
Write-Host "Wrote secrets/postgres_password, secrets/database_url, secrets/cache_url"
|
||||
Reference in New Issue
Block a user