diff --git a/install-git-credential-manager.sh b/install-git-credential-manager.sh index 7d250fc..39ec267 100755 --- a/install-git-credential-manager.sh +++ b/install-git-credential-manager.sh @@ -395,53 +395,22 @@ configure_git_presets() { presets_needed+=("git config --global credential.https://bitbucket.org.helper manager") fi - # Check specific Gitea configurations - local gitea_configured=0 - local gitea_needed=() - - # Check go-gitea.mywire.org - local gitea1_helper="" - gitea1_helper=$(git config --global --get credential.https://go-gitea.mywire.org.helper 2>/dev/null) || gitea1_helper="" - if [[ "$gitea1_helper" == "manager" ]]; then - print_success "✓ Gitea (go-gitea.mywire.org) credential helper configured" - gitea_configured=$((gitea_configured + 1)) - else - print_warning "✗ Gitea (go-gitea.mywire.org) credential helper not configured" - gitea_needed+=("git config --global credential.https://go-gitea.mywire.org.helper manager") - fi - - # Check 192.168.88.97:3000 - local gitea2_helper="" - gitea2_helper=$(git config --global --get credential.https://192.168.88.97:3000.helper 2>/dev/null) || gitea2_helper="" - if [[ "$gitea2_helper" == "manager" ]]; then - print_success "✓ Gitea (192.168.88.97:3000) credential helper configured" - gitea_configured=$((gitea_configured + 1)) - else - print_warning "✗ Gitea (192.168.88.97:3000) credential helper not configured" - gitea_needed+=("git config --global credential.https://192.168.88.97:3000.helper manager") - fi - - # Check for other Gitea configurations - local other_gitea_urls=0 - other_gitea_urls=$(git config --global --get-regexp "credential.*gitea.*helper" 2>/dev/null | grep -v "go-gitea.mywire.org\|192.168.88.97:3000" | wc -l) || other_gitea_urls=0 - if [[ $other_gitea_urls -gt 0 ]]; then - print_success "✓ Additional Gitea credential helpers configured ($other_gitea_urls found)" - fi - - if [[ $gitea_configured -eq 2 ]]; then + # Check Gitea configuration (if any Gitea URL is configured) + local gitea_urls=0 + gitea_urls=$(git config --global --get-regexp "credential.*gitea.*helper" 2>/dev/null | wc -l) || gitea_urls=0 + if [[ $gitea_urls -gt 0 ]]; then + print_success "✓ Gitea credential helpers configured ($gitea_urls found)" presets_configured=$((presets_configured + 1)) - fi - - # Add needed Gitea configs to presets_needed - if [[ ${#gitea_needed[@]} -gt 0 ]]; then - presets_needed+=("# Configure Gitea credential helpers:") - presets_needed+=("${gitea_needed[@]}") + else + print_warning "✗ No Gitea credential helpers configured" + presets_needed+=("# For Gitea servers, configure domain-specific helper:") + presets_needed+=("git config --global credential.https://go-gitea.mywire.org.helper manager") fi # Summary echo print_status "Git Credential Manager Configuration Summary:" - print_status "Presets configured: $presets_configured/7" + print_status "Presets configured: $presets_configured/6" if [[ ${#presets_needed[@]} -eq 0 ]]; then print_success "All recommended presets are configured!"