kangda-robot-backend/ruoyi-fastapi-backend/install_service.sh
haotian 234121a503 ```
feat(ragflow): 添加 RAGFlow 配置支持并优化环境变量加载逻辑

- 在 `.env.prod` 中新增 RAGFlow 相关配置项,包括服务地址和 API Key
- `config/env.py` 中引入 `RAGFlowSettings` 类,继承 `BaseSettings` 以支持配置读取
- 为 `app_docs_url` 等字段添加 Optional 类型标注,提升类型安全性
- 改进 `.env` 文件加载机制,优先从项目根目录读取,并增加手动解析兜底逻辑
- 优化 ragflow controller 异常响应处理,返回更明确的错误信息
```
2025-12-15 11:10:58 +08:00

37 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# Script to install ruoyi-fastapi-backend as a systemd service
SERVICE_NAME="ruoyi-fastapi-backend"
SERVICE_FILE="/home/admin-root/haotian/康达瑞贝斯机器人后台/kangda-robot-backend/ruoyi-fastapi-backend/ruoyi-fastapi-backend.service"
SYSTEMD_SERVICE_FILE="/etc/systemd/system/${SERVICE_NAME}.service"
# Check if running as root
if [ "$EUID" -ne 0 ]; then
echo "Please run as root (use sudo)"
exit 1
fi
echo "Installing ${SERVICE_NAME} service..."
# Copy service file to systemd directory
cp $SERVICE_FILE $SYSTEMD_SERVICE_FILE
if [ $? -eq 0 ]; then
echo "Service file installed successfully"
# Reload systemd daemon
systemctl daemon-reload
echo "Service installed successfully!"
echo "You can now manage the service with:"
echo " sudo systemctl start ruoyi-fastapi-backend"
echo " sudo systemctl stop ruoyi-fastapi-backend"
echo " sudo systemctl restart ruoyi-fastapi-backend"
echo " sudo systemctl status ruoyi-fastapi-backend"
echo " sudo systemctl enable ruoyi-fastapi-backend # to start on boot"
echo " sudo systemctl disable ruoyi-fastapi-backend # to disable auto-start on boot"
else
echo "Failed to install service file"
exit 1
fi