#!/bin/sh # Writes halkyon.li's first deploy/.env (ADR 0039; first-start.md, step 4), as deploy, # on the instance's host at home: # # sh deploy/host/halkyon-li-env.sh deploy/.env # # Every secret is made here and now (32 random bytes, in hex), and never leaves the # host but into Proton Pass (vault Infra, a note "halkyon.li .env", the whole file). # It refuses to write over an existing file: the session peppers and the database # passwords must never change once the instance runs (.env.example says why for each). # The settings are the developer's choices of 8 Nov 2026; .env.example explains each # one. SimpleLogin's client ID and secret stay empty until its app is registered # (first-start.md, step 5). set -eu target=${1:?usage: halkyon-li-env.sh } if [ -e "$target" ]; then echo "Error: $target exists; its secrets must stay as they are." >&2 exit 1 fi secret() { openssl rand -hex 32; } umask 077 cat >"$target" <