1.9 KiB
1.9 KiB
🚀 快速启动指南
方式一:一键安装(推荐)
cd /root/.openclaw/workspace/ssl-manager
./install.sh
方式二:手动安装
1. 安装后端
cd backend
# 配置淘宝 npm 镜像(可选,加速下载)
npm config set registry https://registry.npmmirror.com
npm install
cp .env.example .env
# 编辑 .env 配置你的邮箱
vim .env
npm start
2. 安装前端(开发模式)
cd frontend
# 配置淘宝 npm 镜像(可选,加速下载)
npm config set registry https://registry.npmmirror.com
npm install
npm run dev
# 访问 http://localhost:5173
3. 生产部署
# 构建前端
cd frontend
# 配置淘宝 npm 镜像(可选,加速下载)
npm config set registry https://registry.npmmirror.com
npm install
npm run build
# 后端会静态文件,直接访问 http://localhost:3000
📋 首次使用
- 访问管理界面 - http://localhost:3000
- 配置 DNS 凭证(如使用 DNS-01)- 设置 → DNS API 凭证管理
- 申请证书 - 申请证书 → 填写域名 → 选择验证方式 → 提交
- 配置自动续期 - 执行以下命令:
chmod +x scripts/auto-renew.sh
crontab -e
# 添加:0 0 * * * /root/.openclaw/workspace/ssl-manager/scripts/auto-renew.sh
🔍 验证安装
# 检查后端服务
curl http://localhost:3000/api/health
# 检查 acme.sh
~/.acme.sh/acme.sh --version
# 查看证书列表
~/.acme.sh/acme.sh --list
🆘 故障排查
后端启动失败
cd backend
npm install # 确保依赖已安装
node src/index.js # 查看详细错误
前端构建失败
cd frontend
rm -rf node_modules package-lock.json
npm install
npm run build
acme.sh 安装失败
# 使用 Gitee 镜像手动安装
git clone https://gitee.com/Neilpang/acme.sh.git ~/.acme.sh
cd ~/.acme.sh
./acme.sh --install
source ~/.bashrc
有问题随时找小弟!👋