#!/usr/bin/env bash # Prepare host Postgres DB/user for Gitea + UFW ports. Does not touch Tloto app DB. set -euo pipefail ROOT="$(cd "$(dirname "$0")" && pwd)" cd "$ROOT" if [[ ! -f .env ]]; then echo "Missing .env — copy .env.example and set secrets first." >&2 exit 1 fi # shellcheck disable=SC1091 set -a; source .env; set +a if [[ -z "${GITEA_DB_PASSWORD:-}" ]]; then echo "GITEA_DB_PASSWORD required" >&2 exit 1 fi echo "== Create Postgres role/db gitea (idempotent) ==" sudo -u postgres psql -v ON_ERROR_STOP=1 <