#!/bin/sh set -eu cd "$(dirname "$0")/.." [ -f .env ] || cp .env.example .env mkdir -p secrets if [ ! -f secrets/postgres_password ]; then python3 -c "import secrets; print(secrets.token_urlsafe(24))" > secrets/postgres_password fi password=$(cat secrets/postgres_password) printf 'postgresql://messenger:%s@postgres:5432/messenger\n' "$password" > secrets/database_url printf 'valkey://valkey:6379/0\n' > secrets/cache_url chmod 700 secrets chmod 600 secrets/postgres_password secrets/database_url secrets/cache_url echo "ready: .env and secrets/ created locally; they stay out of Git"