360 Secure SkillHub
360 安全技能中心

Github Hosts Optimizer Cn

面向中国 Linux 服务器,检测 GitHub CDN 速度,在访问缓慢或不可达时通过 DNS 获取新 IP,并向 /etc/hosts 追加优化条目;更新前自动备份,支持一键回滚,并可自动 git 提交及可选发布到 ClawHub。

分类:自动化
guanqi0914
guanqi0914
热度 0.00
最近更新 2026-03-24 10:56:50

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add guanqi0914/github-hosts-cn
兼容性
通用兼容
联网要求
需要联网
数据出网
数据不出本机
Metadata
name
GitHub Hosts CN
description
Optimize GitHub access for China-based servers. Auto-detect fast GitHub CDN IPs, update /etc/hosts on failure, auto-commit changes. Fixes GitHub timeout, rate limiting, and connection failures on China servers.
metadata
{"openclaw":{"tags":["github","hosts","china","network","linux","optimization"]}}
version
1.2.1

GitHub Hosts CN

Fix GitHub timeout and rate limits on China servers.

Security

  • Appends to /etc/hosts only (never overwrites existing)
  • Auto-backs up hosts before each update
  • One-click rollback: python3 scripts/rollback.py
  • No packages, no daemons, no system changes

One-Line Run

sudo python3 scripts/update_hosts.py

How It Works

  1. Test GitHub CDN speed
  2. If slow/unreachable, find new IP via DNS
  3. Append optimized entry to /etc/hosts
  4. Auto-commit to git + optional ClawHub publish

Manual Commands

# Force update
sudo python3 scripts/update_hosts.py --force

# Rollback to last backup
sudo python3 scripts/rollback.py

# Check current hosts entries
grep github /etc/hosts