# Siftlode self-host installer (Windows / PowerShell). Generates secrets into .env, starts the # stack from the prebuilt image, and prints the first-run setup-wizard URL. Re-running is safe: an # existing .env is left untouched. Requires Docker Desktop (with the compose plugin). $ErrorActionPreference = "Stop" $Port = if ($env:HTTP_PORT) { $env:HTTP_PORT } else { "8080" } function New-RandBytes([int]$n) { $b = New-Object byte[] $n $rng = [System.Security.Cryptography.RandomNumberGenerator]::Create() $rng.GetBytes($b) return $b } if (Test-Path .env) { Write-Host ".env already exists — leaving it untouched (delete it to re-generate)." } else { $url = Read-Host "Public URL where this instance will be reached [http://localhost:$Port]" if ([string]::IsNullOrWhiteSpace($url)) { $url = "http://localhost:$Port" } $url = $url.TrimEnd('/') $secretKey = (New-RandBytes 32 | ForEach-Object { $_.ToString("x2") }) -join "" $fernet = [Convert]::ToBase64String((New-RandBytes 32)).Replace('+', '-').Replace('/', '_') $pgPass = (New-RandBytes 16 | ForEach-Object { $_.ToString("x2") }) -join "" @" # Generated by install.ps1 — keep secret, never commit. Re-run after deleting to reset. POSTGRES_PASSWORD=$pgPass SECRET_KEY=$secretKey TOKEN_ENCRYPTION_KEY=$fernet OAUTH_REDIRECT_URL=$url/auth/callback # Optional: store Download Center media in a host folder (e.g. one your Plex server reads) instead # of a Docker volume. Must be writable by uid 1000 (chown -R 1000:1000