Files
gerrit/确保管理员权限.sh
2025-12-22 17:12:39 +08:00

38 lines
1.1 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# 确保第一个用户是管理员的脚本
# 适用于 Gerrit 3.9.0
GERRIT_DIR="/home/renjianbo/gerrit_install/review_site"
JAVA_HOME="/usr/local/java/jdk-17.0.12+7"
echo "=========================================="
echo "确保第一个用户是管理员"
echo "=========================================="
echo ""
cd "$GERRIT_DIR" || exit 1
export JAVA_HOME
export PATH=$JAVA_HOME/bin:$PATH
# 方法:通过 Gerrit 的 init 命令重新初始化(保留数据)
echo "注意:在开发模式下,第一个登录的用户自动成为管理员"
echo ""
echo "解决方案:"
echo ""
echo "1. 退出当前登录"
echo "2. 清除浏览器 Cookie 和缓存"
echo "3. 使用第一个登录的用户名重新登录"
echo " (或者创建一个新用户,第一个登录的会自动成为管理员)"
echo ""
echo "或者:"
echo ""
echo "4. 访问 Gerrit 首页http://101.43.95.130:8080"
echo "5. 点击 'Sign In'"
echo "6. 输入一个新的用户名例如admin"
echo "7. 第一个登录的用户将自动成为管理员"
echo "8. 然后可以在 Settings → Administration → Groups 中添加其他用户"
echo ""