Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ghproxy.net cannot be accessed #223

Closed
dorian-li opened this issue Feb 18, 2024 · 2 comments
Closed

ghproxy.net cannot be accessed #223

dorian-li opened this issue Feb 18, 2024 · 2 comments
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed manifest-fix-needed verified

Comments

@dorian-li
Copy link
Contributor

It seems that all URLs using the ghproxy.net proxy cannot be accessed. Consider ghproxy.com or mirror.ghproxy.com?

@dorian-li dorian-li added the bug Something isn't working label Feb 18, 2024
@anderlli0053
Copy link
Owner

As far as i can tell there are 6170 files that need to be changed... that's .. that's a lot and i don't have time right now to do this or to write a script... maybe later, but cannot do now... anyone can do a pull request to do this if they have time and if they want

found_files.txt

@dorian-li
Copy link
Contributor Author

dorian-li commented Feb 24, 2024

In fact, there are 6169 of them, because the specific_search_in_json.py you wrote is also included👀.

I used Powershell to write the following two scripts:

  1. Place it in the repo directory, count the number of files containing the ghproxy.net in the bucket folder of the repo
# CheckGhproxyInBucket.ps1
$searchString = "ghproxy.net"
$bucketPath = Join-Path -Path (Get-Location) -ChildPath "bucket"
$files = Get-ChildItem -Path $bucketPath -Recurse | Where-Object {!$_.PSIsContainer}
$matchCount = 0
foreach ($file in $files) {
    $containsMatch = Select-String -Path $file.FullName -Pattern $searchString -Quiet
    if ($containsMatch) {
        $matchCount++
    }
}
Write-Output "Number of files containing '$searchString': $matchCount"
  1. Place it in the repo directory, replace all ghproxy.net in all files in the bucket folder of the repo with ghproxy.com
# ReplaceGhproxyInBucket.ps1
$originalString = "ghproxy.net"
$targetString = "ghproxy.com"
$bucketPath = Join-Path -Path (Get-Location) -ChildPath "bucket"
$files = Get-ChildItem -Path $bucketPath -Recurse | Where-Object {!$_.PSIsContainer}
foreach ($file in $files) {
    if (Select-String -Path $file.FullName -Pattern $originalString -Quiet) {
        $content = Get-Content -Path $file.FullName -Raw
        $newContent = $content -replace $originalString, $targetString
        Set-Content -Path $file.FullName -Value $newContent
    }
}
Write-Output "Completed string replacement in files."

The modified PR following this process is here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed manifest-fix-needed verified
Projects
None yet
Development

No branches or pull requests

2 participants