别着急,坐和放宽
# 切到 root(可选。如果你打算用普通用户运行服务,只用 sudo 即可)
sudo su
# 创建总目录
mkdir -p /opt/bot && cd /opt/bot
git clone https://github.com/Genshin-bots/gsuid_core.git # 如受网络限制,可换镜像
cd gsuid_core
启动必须在 gsuid_core 主目录执行,否则会报找不到资源。
pip install -U uv # 没有 Python 时先 apt install python3‑pip
uv venv --seed # 生成 .venv
uv sync # 安装核心依赖
localhost:8765/genshinuid
,账号密码 root/root
。务必登录后修改密码。gsuid_core/data/config.json
里的 HOST
改成 0.0.0.0
后重启即可。
WorkingDirectory
必须指向gsuid_core
主目录;否则插件与静态文件无法加载。
WebUI Local Panel Url: http://127.0.0.1:6099/webui?token=XXXX
/opt/QQ/.../webui.json
找 token。ws://127.0.0.1:8080/onebot/v11/ws
,勾选启用,保存。8080 是 NoneBot 默认端口,如有修改请同步改 URL。
NapCat 安装脚本会自动生成 napcat.service
,可直接查看状态:
uv sync
→ systemctl restart gs-core
nb plugin update-all
→ systemctl restart nonebot
bash napcat.sh --update
或按官方文档升级。uv run core
cd plugins
git clone https://github.com/tyql688/WutheringWavesUID
cd ..
uv run core
cat >/etc/systemd/system/gs-core.service <<'EOF'
[Unit]
Description=GsCore
After=network.target
[Service]
Type=simple
# 修改你自己的GsCore路径
WorkingDirectory=/home/lighthouse/bot/gsuid_core
# uv 启动命令
ExecStart=uv run core
# 如果服务异常退出,则自动重启
Restart=on-failure
RestartSec=5
# 如需要指定运行用户,可添加 User=(例如非 root 用户)
User=root
[Install]
WantedBy=multi-user.target
# 安装并启动一个会话
sudo apt update && sudo apt install -y tmux
tmux new -s sayu
# 在 tmux 里启动
uv run core
# 按 Ctrl-b 然后 d 退出会话,进程继续在后台跑
# 需要时重新连接
tmux attach -t sayu
pip install -U nb-cli nb-cli-plugin-bootstrap
cd /opt/bot
nb bs # 按提示输入项目名
# 空格选择适配器:OneBot V11;内置插件可选 echo,其余默认
cd /opt/bot/<你的项目名>
nb plugin install nonebot-plugin-genshinuid
nb run
cd /opt/bot
mkdir NapCat && cd NapCat
curl -o napcat.sh https://nclatest.znin.net/NapNeko/NapCat-Installer/main/script/install.sh \
&& sudo bash napcat.sh
systemctl status napcat