Skip to content

feat(robustness): CN network adaptation + environment robustness#312

Open
Problemsolver0070 wants to merge 1 commit intoillbnm:masterfrom
Problemsolver0070:feat/robustness-stack
Open

feat(robustness): CN network adaptation + environment robustness#312
Problemsolver0070 wants to merge 1 commit intoillbnm:masterfrom
Problemsolver0070:feat/robustness-stack

Conversation

@Problemsolver0070
Copy link

@Problemsolver0070 Problemsolver0070 commented Mar 24, 2026

Summary

Closes #8[BOUNTY $250] Robustness — 环境鲁棒性与国内网络适配

  • scripts/setup-cn-mirrors.sh — Interactive Docker mirror config for CN users. Tests mirror reachability, writes /etc/docker/daemon.json, verifies with docker pull hello-world
  • scripts/localize-images.sh--cn / --restore / --dry-run / --check modes to swap gcr.io/ghcr.io images in all compose files
  • config/cn-mirrors.yml — Complete image mapping table for all non-Docker Hub registries
  • scripts/check-connectivity.sh — Tests all registries + CN mirrors with latency, DNS, and port checks
  • install.sh — Full rewrite: auto Docker install (Ubuntu/Debian/CentOS/Arch), Compose v2 check, disk/memory validation, port conflict detection, firewall rules check, curl retry with exponential backoff, user docker group management
  • scripts/wait-healthy.sh--stack <name> --timeout <s> polls healthchecks, prints container logs on timeout
  • scripts/diagnose.sh — Generates full diagnostic report (system info, Docker status, container state, error logs, connectivity, port usage, config validation)

All 6 scripts pass shellcheck with zero errors.

Acceptance Criteria

  • check-connectivity.sh accurately detects registry reachability
  • setup-cn-mirrors.sh configures Docker daemon mirrors interactively
  • localize-images.sh --cn replaces all gcr.io/ghcr.io in compose files
  • localize-images.sh --restore fully restores from backup
  • install.sh handles Docker not installed → auto-install (Ubuntu/Debian/CentOS/Arch)
  • install.sh handles Docker Compose v1 → prompt upgrade to v2
  • install.sh detects port conflicts (53/80/443/3000 etc.)
  • install.sh warns on low disk (<20GB) and blocks on <5GB
  • install.sh warns on low memory (<2GB)
  • install.sh handles non-root users (auto docker group add)
  • install.sh checks firewall rules (ufw/firewalld)
  • install.sh retries network requests with exponential backoff
  • wait-healthy.sh outputs useful error info on timeout
  • diagnose.sh generates complete diagnostic report
  • All shell scripts pass shellcheck with no errors

Test Plan

  • Run shellcheck on all scripts — verified zero errors
  • Run ./scripts/check-connectivity.sh — verify registry status output
  • Run ./scripts/localize-images.sh --dry-run — verify image replacements listed
  • Run ./scripts/localize-images.sh --cn && --restore cycle — verify roundtrip
  • Run ./scripts/diagnose.sh — verify full report generation
  • Run ./install.sh on fresh Ubuntu 22.04 — verify full flow
  • Run ./install.sh on existing Docker install — verify idempotent

Generated/reviewed with: claude-opus-4-6

🤖 Generated with Claude Code

Reviewed/verified with: GPT-5.3 Codex

…bnm#8)

- Add scripts/setup-cn-mirrors.sh: interactive Docker mirror configuration
- Add scripts/localize-images.sh: replace gcr.io/ghcr.io with CN mirrors
- Add config/cn-mirrors.yml: complete image mirror mapping table
- Add scripts/check-connectivity.sh: registry reachability detection
- Add scripts/wait-healthy.sh: container health check waiter with diagnostics
- Add scripts/diagnose.sh: one-click diagnostic report generator
- Rewrite install.sh: auto Docker install (Ubuntu/Debian/CentOS/Arch),
  disk/memory checks, port conflict detection, firewall checks,
  curl retry with exponential backoff, user group management

All scripts pass shellcheck with zero errors.

Generated/reviewed with: claude-opus-4-6

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@zhuzhushiwojia
Copy link

🦞 CLAIMING BOUNTY #312 - Robustness $250 USDT

Hi @illbnm!

Claiming this bounty immediately!

Developer: 大眼 (bigeye)
Wallet (USDT TRC20): TMLkvEDrjvHEUbWYU1jfqyUKmbLNZkx6T1

Ready to start work! 🚀

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.

[BOUNTY $250] Robustness — 国内网络适配 + 环境鲁棒性

2 participants