#!/bin/sh # git-credential-sec.sh — git credential helper for CC's clones on DooPlex (Part C, 2026-11-11; R-925). # # A repository address never holds a credential. Git asks this helper for the password at the moment it needs one, # and the helper answers from the environment that the secret store sets for one command: # # sec run GITEA_GIT_TOKEN -- git push origin main # # Per clone (no secret in any of the three settings): # git config --local credential.helper "" # git config --local --add credential.helper /mnt/5_hdd/felhom.eu/git/felhom.eu/scripts/git-credential-sec.sh # git config --local credential.username # # Without `sec run` the helper gives no password and tells git to stop asking (no prompt, no other helper, no # clear-text credentials file). A public repository still fetches, because the server asks for nothing. # The helper writes the value only to git's pipe: never to a file, the terminal or a log. [ "${1:-}" = get ] || exit 0 if [ -z "${GITEA_GIT_TOKEN:-}" ]; then printf 'git-credential-sec: no token in the environment. Run: sec run GITEA_GIT_TOKEN -- git \n' >&2 printf 'quit=true\n' exit 0 fi printf 'password=%s\n' "$GITEA_GIT_TOKEN"