1.7 KiB
1.7 KiB
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_repaireddeploy/test-1panel-redis.sh— 移除 root 探测deploy/verify-1panel-install-wizard.sh— 3b2856f+ 与.envRedis 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)
验证
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 连接全绿。