Files
Nexus/docs/changelog/2026-06-06-install-redis-no-account-repair.md
T

36 lines
1.7 KiB
Markdown
Raw Normal View History

# 2026-06-06 — 安装向导 Redis:无账号 + 步骤 4 自愈
## 摘要
确立 1Panel Redis **无账号**铁律;Docker 安装模式仅尝试 `redis://:pass@``default`;步骤 4 `connection-check` 可自动修正错误的 `NEXUS_REDIS_URL`;前端 1Panel 模式隐藏 Redis 用户名字段。
## 动机
- 1Panel Redis 只有 `requirepass` 口令,不是 MySQL 式 `root` 用户;历史误读导致 `redis://root:pass@` 认证失败。
- 步骤 3 在旧版本写入错误 URL 后,步骤 4 仅读 `.env` 原文无法通过,需向导内自愈。
- 暴露「Redis 用户名」输入框易误导运维填 `root`
## 涉及文件
- `server/api/install.py``_sanitize_redis_request`、候选顺序、`_init_db_request_from_redis_url``_patch_env_redis_url``connection-check` 修复
- `web/app/install.html` — 1Panel 隐藏 `redis_user`、展示 `resolved_redis_url` / `redis_repaired`
- `deploy/test-1panel-redis.sh` — 移除 root 探测
- `deploy/verify-1panel-install-wizard.sh` — 3b2856f+ 与 `.env` Redis URL 检查
- `docs/project/nexus-1panel-operations-knowledge.md` — 全文去 Redis root 表述
- `tests/test_security_unit.py` — Redis 解析与 connection-check 修复用例
## 迁移 / 重启
- 已有错误 `.env`:步骤 4 点「重新检测连接」可自动修补;或手动改为 `redis://:密码@1Panel-redis-xxxx:6379/0`
- 部署:`git pull``bash deploy/sync-install-wizard-to-container.sh`(或 `nx update`
## 验证
```bash
pytest tests/test_security_unit.py -k redis
bash deploy/test-1panel-redis.sh # 服务器,需 REDIS_PASS
bash deploy/verify-1panel-install-wizard.sh
```
浏览器:步骤 3 仅填 Redis 密码 → 检测 → 初始化 → 步骤 4 连接全绿。