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

Fix GitHub.com access issues in mainland China & Add checksum support #290

Merged
merged 2 commits into from
Nov 19, 2024

Conversation

Alice39s
Copy link
Contributor

@Alice39s Alice39s commented Nov 19, 2024

Problem

Users in mainland China frequently encounter issues when installing beszel-agent:

  • GitHub access is blocked or extremely slow
  • Downloads frequently timeout and fail
  • MitM Risks Frequent in the internet

Solution

This commit adds support for GitHub mirrors to resolve network issues:

  • New --china-mirrors flag to use ghp.ci mirror for reliable downloads
  • Implement checksum verification for downloaded files
  • Add progress bar for file downloads
  • Better error messages for troubleshooting

Usage

# Install using China-friendly mirror
./install-agent.sh --china-mirrors ...

Additional Notes

The ghp.ci mirror is widely used in China and provides reliable access to GitHub resources. This solution follows similar patterns used by other popular open-source projects to support users in mainland China.


Thank you for taking the time to review this PR!

If you feel that this improvement would be helpful to the community, please feel free to discuss it with me. I'm also happy to make changes based on your suggestions to ensure code quality and user experience.

- Add `-c` flag to use GitHub mirror (ghp.ci) for mainland China users
- Implement checksum verification for downloaded files
- Add progress bar for file downloads

This change improves installation reliability and user experience,
especially for users in regions (China mainland etc.) with limited GitHub access.
@henrygd
Copy link
Owner

henrygd commented Nov 19, 2024

Thank you, I was not aware of those problems. Your changes sound great!

I saw this PR right as I'm about to go to sleep, but I'll follow up tomorrow.

Also, in the web UI we can add the --china-mirrors flag automatically based on the user's locale when they click the button to copy the command.

@henrygd henrygd merged commit d51ffa1 into henrygd:main Nov 19, 2024
@henrygd
Copy link
Owner

henrygd commented Nov 19, 2024

Merged, thanks 👍

@ImYrS
Copy link

ImYrS commented Dec 18, 2024

But "ghp.ci" doesn't seem to be accessible in mainland China anymore.
image

@henrygd
Copy link
Owner

henrygd commented Dec 18, 2024

@ImYrS It looks like it's back up. Hopefully a temporary problem. If it still doesn't work, try without the --china-mirrors flag. If there is a more reliable proxy or method, please let me know. Maybe I can try creating a mirror repository on Gitee or selfhosted Gitea.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants