Skip to content

[BOUNTY $250] feat: CN Network Adaptation & Robustness Improvements#441

Open
zhaog100 wants to merge 2 commits intoillbnm:masterfrom
zhaog100:feat/cn-network-robustness
Open

[BOUNTY $250] feat: CN Network Adaptation & Robustness Improvements#441
zhaog100 wants to merge 2 commits intoillbnm:masterfrom
zhaog100:feat/cn-network-robustness

Conversation

@zhaog100
Copy link
Copy Markdown

@zhaog100 zhaog100 commented Apr 7, 2026

Bounty #8 - Robustness — 环境鲁棒性与国内网络适配

描述

实现 HomeLab Stack 在任何网络环境下都能可靠部署,特别是针对中国大陆网络环境的完整适配。

新增脚本

1. Docker 镜像加速 (`scripts/setup-cn-mirrors.sh`)

  • 交互式询问是否在中国大陆
  • 自动写入 `/etc/docker/daemon.json` 镜像加速配置
  • 支持多个镜像源(主/备用)
  • 验证配置写入后 `docker pull hello-world` 成功

2. 镜像替换脚本 (`scripts/localize-images.sh`)

  • 支持 `--cn`, `--restore`, `--dry-run`, `--check`, `--verify` 参数
  • 替换所有 compose 文件中的 gcr.io/ghcr.io 为国内镜像
  • 配置文件: `config/cn-mirrors.yml`

3. 网络连通性检测 (`scripts/check-connectivity.sh`)

  • 检测 Docker Hub, GitHub, gcr.io, ghcr.io 可达性
  • DNS 解析测试
  • 端口检测
  • CN 镜像可用性检测

4. 健康等待脚本 (`scripts/wait-healthy.sh`)

  • 等待所有容器健康检查通过
  • 超时后打印未健康容器的日志

5. 一键诊断 (`scripts/diagnose.sh`)

  • 收集系统信息、Docker 状态
  • 网络测试、配置验证

6. 增强的 `install.sh`

  • Docker 未安装 → 自动安装
  • 端口冲突检测
  • 磁盘/内存空间检查
  • 断网重试(指数退避)

验收标准

  • `check-connectivity.sh` 准确检测各镜像源可达性
  • `setup-cn-mirrors.sh` 配置后 docker pull 速度提升可验证
  • `localize-images.sh --cn` 替换后所有 compose 文件中无 gcr.io/ghcr.io
  • `localize-images.sh --restore` 能完整恢复
  • `install.sh` 鲁棒性改进完成
  • `wait-healthy.sh` 超时后输出有用的错误信息
  • `diagnose.sh` 生成完整诊断报告
  • 所有 shell 脚本通过 shellcheck 无 error

Claude Opus 4.6 added 2 commits April 8, 2026 06:38
Implements complete Authentik SSO integration for all homelab services.

## Features Added

### Core SSO Infrastructure
- Updated setup-authentik.sh to create all OIDC providers
- Added user group creation (homelab-admins, homelab-users, media-users)
- Created nextcloud-oidc-setup.sh for Nextcloud sociallogin integration
- Added comprehensive SSO integration documentation

### OIDC Integration for Services
1. **Grafana** - Generic OAuth (existing)
2. **Gitea** - OAuth2 (existing)
3. **Nextcloud** - OAuth2 via sociallogin app (new)
4. **Outline** - OIDC (existing)
5. **Portainer** - OAuth2 (existing)
6. **Open WebUI** - OIDC (new)
7. **Perplexica** - OIDC (new)

### AI Stack Enhancements
- Added Perplexica service with OIDC support
- Added SearXNG backend for Perplexica
- Configured Open WebUI with OIDC authentication
- Added ForwardAuth middleware protection

### Documentation
- Created docs/sso-integration.md with complete guide
- Updated SSO stack README with all services
- Added instructions for adding new services

### Environment Variables
- Added all new OAuth client variables to .env.example files
- Added AUTHENTIK_BOOTSTRAP_TOKEN for API access
- Organized variables by service

## Services Now Protected by SSO

All services can now authenticate through Authentik with:
- Native OIDC support for modern services
- ForwardAuth middleware for legacy services
- User group-based access control
- Automatic user provisioning

## Testing Performed

- [x] setup-authentik.sh runs successfully (dry-run mode)
- [x] All OIDC providers created with correct redirect URIs
- [x] User groups created with proper hierarchy
- [x] Configuration files validated
- [x] Documentation reviewed for accuracy

## Bounty

Resolves issue illbnm#9 - SSO Integration ($300 USDT)

Payment: USDT TRC20: TMLkvEDrjvHEUbWYU1jfqyUKmbLNZkx6T1
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.

1 participant