#!/bin/sh # Prints freshly generated secrets for the reference deployment's env files (ADR 0044). Writes # nothing: paste each line into the file named above it, then install that file root-owned with # mode 600. # # sh deploy/scripts/gen-secrets.sh # # Every value is URL-safe (hexadecimal), so the database password needs no percent-encoding in # DATABASE_URL. set -eu command -v openssl >/dev/null 2>&1 || { echo "gen-secrets: openssl is required." >&2 exit 69 } hex() { openssl rand -hex "$1" } postgres_password=$(hex 24) s3_access_key=$(hex 10) s3_secret_key=$(hex 32) cat <