diff --git a/scripts/bootstrap/verify-local.sh b/scripts/bootstrap/verify-local.sh index 3f3f62fce..0fb3b7650 100755 --- a/scripts/bootstrap/verify-local.sh +++ b/scripts/bootstrap/verify-local.sh @@ -9,10 +9,11 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" [[ -f "$SCRIPT_DIR/.env" ]] && . "$SCRIPT_DIR/.env" -: "${R720_HOST:=10.0.20.150}" -: "${R720_USER:=ansible}" -: "${FORGEJO_API_URL:=https://forgejo.talas.group}" -: "${FORGEJO_OWNER:=talas}" +: "${R720_HOST:=srv-102v}" +: "${R720_USER:=}" +: "${FORGEJO_API_URL:=https://10.0.20.105:3000}" +: "${FORGEJO_INSECURE:=1}" +: "${FORGEJO_OWNER:=senke}" : "${FORGEJO_REPO:=veza}" REPO_ROOT=$(git -C "$SCRIPT_DIR" rev-parse --show-toplevel 2>/dev/null) || { @@ -132,11 +133,14 @@ if [[ -n "${FORGEJO_ADMIN_TOKEN:-}" ]]; then "curl -fsSL ${_CURL_OPTS[*]} -H 'Authorization: token $FORGEJO_ADMIN_TOKEN' $FORGEJO_API_URL/api/v1/repos/$FORGEJO_OWNER/$FORGEJO_REPO" \ "set FORGEJO_OWNER + FORGEJO_REPO env vars" + # Forgejo doesn't expose GET /actions/secrets/ (values are + # write-only), so list the secrets and grep by name. + _secrets_json="curl -fsSL ${_CURL_OPTS[*]} -H 'Authorization: token $FORGEJO_ADMIN_TOKEN' $FORGEJO_API_URL/api/v1/repos/$FORGEJO_OWNER/$FORGEJO_REPO/actions/secrets" check_with_hint "secret FORGEJO_REGISTRY_TOKEN exists" \ - "curl -fsSL ${_CURL_OPTS[*]} -H 'Authorization: token $FORGEJO_ADMIN_TOKEN' $FORGEJO_API_URL/api/v1/repos/$FORGEJO_OWNER/$FORGEJO_REPO/actions/secrets/FORGEJO_REGISTRY_TOKEN" \ + "$_secrets_json | jq -e '.[]? | select(.name == \"FORGEJO_REGISTRY_TOKEN\")'" \ "PHASE=3 ./bootstrap-local.sh" check_with_hint "secret ANSIBLE_VAULT_PASSWORD exists" \ - "curl -fsSL ${_CURL_OPTS[*]} -H 'Authorization: token $FORGEJO_ADMIN_TOKEN' $FORGEJO_API_URL/api/v1/repos/$FORGEJO_OWNER/$FORGEJO_REPO/actions/secrets/ANSIBLE_VAULT_PASSWORD" \ + "$_secrets_json | jq -e '.[]? | select(.name == \"ANSIBLE_VAULT_PASSWORD\")'" \ "PHASE=3 ./bootstrap-local.sh" check_with_hint "variable FORGEJO_REGISTRY_URL exists" \ "curl -fsSL ${_CURL_OPTS[*]} -H 'Authorization: token $FORGEJO_ADMIN_TOKEN' $FORGEJO_API_URL/api/v1/repos/$FORGEJO_OWNER/$FORGEJO_REPO/actions/variables/FORGEJO_REGISTRY_URL" \