Add automatic configuration of Gitea credential helpers for go-gitea.mywire.org and 192.168.88.97:3000, and enhance --checks to show detailed status for these servers
This commit is contained in:
@@ -395,22 +395,53 @@ configure_git_presets() {
|
|||||||
presets_needed+=("git config --global credential.https://bitbucket.org.helper manager")
|
presets_needed+=("git config --global credential.https://bitbucket.org.helper manager")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check Gitea configuration (if any Gitea URL is configured)
|
# Check specific Gitea configurations
|
||||||
local gitea_urls=0
|
local gitea_configured=0
|
||||||
gitea_urls=$(git config --global --get-regexp "credential.*gitea.*helper" 2>/dev/null | wc -l) || gitea_urls=0
|
local gitea_needed=()
|
||||||
if [[ $gitea_urls -gt 0 ]]; then
|
|
||||||
print_success "✓ Gitea credential helpers configured ($gitea_urls found)"
|
# Check go-gitea.mywire.org
|
||||||
presets_configured=$((presets_configured + 1))
|
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
|
else
|
||||||
print_warning "✗ No Gitea credential helpers configured"
|
print_warning "✗ Gitea (go-gitea.mywire.org) credential helper not configured"
|
||||||
presets_needed+=("# For Gitea servers, configure domain-specific helper:")
|
gitea_needed+=("git config --global credential.https://go-gitea.mywire.org.helper manager")
|
||||||
presets_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
|
||||||
|
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[@]}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Summary
|
# Summary
|
||||||
echo
|
echo
|
||||||
print_status "Git Credential Manager Configuration Summary:"
|
print_status "Git Credential Manager Configuration Summary:"
|
||||||
print_status "Presets configured: $presets_configured/6"
|
print_status "Presets configured: $presets_configured/7"
|
||||||
|
|
||||||
if [[ ${#presets_needed[@]} -eq 0 ]]; then
|
if [[ ${#presets_needed[@]} -eq 0 ]]; then
|
||||||
print_success "All recommended presets are configured!"
|
print_success "All recommended presets are configured!"
|
||||||
|
|||||||
Reference in New Issue
Block a user