Files
sentinel-home-ai/scripts/start_ui.sh

29 lines
742 B
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
# FAM-UI 启动脚本 (NAS 端)
# 用法: ./scripts/start_ui.sh
set -e
APP_DIR="$(cd "$(dirname "$0")/.." && pwd)/fam-ui"
CONFIG_FILE="$APP_DIR/config/config.yaml"
if [ ! -f "$CONFIG_FILE" ]; then
echo "错误: 配置文件不存在: $CONFIG_FILE"
echo "请复制 config.yaml.example 为 config.yaml 并修改实际值"
exit 1
fi
cd "$APP_DIR"
# 注入项目级 .envORACLE_SYNC_TOKEN 等),供 config.yaml ${VAR} 解析
if [ -f "$(dirname "$APP_DIR")/.env" ]; then
source "$(dirname "$APP_DIR")/.env"
fi
# 检查虚拟环境
if [ -d "venv" ]; then
source venv/bin/activate
fi
echo "启动 FAM-UI Streamlit (端口 8501)..."
exec streamlit run src/app.py --server.port 8501 --server.address 0.0.0.0