#!/bin/bash # init.sh for gitea-admin harness (M22 Phase 9) # Sets up non-secret env vars and configures git credential helper. # Credential token is NOT exported here — only read at exec time by the wrapper. set -euo pipefail # Non-secret configuration export GITEA_BASE_URL="${GITEA_BASE_URL:-https://gitea.oreillyit.nz}" # Ensure SSH directory exists with correct permissions mkdir -p /home/agent/.ssh chmod 700 /home/agent/.ssh # Configure git to use the gitea-admin credential helper wrapper # The wrapper reads the ESO-mounted token at exec time git config --global credential.helper "!/opt/harness/contexts/gitea-admin/v1/bin/gitea-admin-wrapper.sh git-credential-helper" echo "[gitea-admin] init complete"