#!/bin/bash # First-time setup for the secrets-issuance deploy webhook. Generates a # secret, installs the systemd unit, and starts it. set -euo pipefail SECRET_DIR=/etc/secrets-issuance-deploy SECRET=$SECRET_DIR/secret UNIT=secrets-issuance-deploy.service install -d -m 700 "$SECRET_DIR" if [ ! -s "$SECRET" ]; then head -c 32 /dev/urandom | base64 > "$SECRET" chmod 600 "$SECRET" echo "[install] generated webhook secret at $SECRET" fi systemctl daemon-reload systemctl enable --now "$UNIT" systemctl status "$UNIT" --no-pager | head -10 cat <:9821/deploy HTTP Method: POST Content-Type: application/json Secret: $(cat $SECRET) Trigger: Push events EOF