This commit is contained in:
2026-04-18 15:08:57 +08:00
commit 2a67f56512
13 changed files with 2729 additions and 0 deletions

32
nas-uploader/start.sh Normal file
View File

@@ -0,0 +1,32 @@
#!/bin/bash
# NAS图片上传系统 - 启动脚本
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$SCRIPT_DIR"
# 检查 .env 文件是否存在
if [ ! -f .env ]; then
echo "错误:未找到 .env 配置文件"
echo "请复制 .env.example 为 .env 并修改配置:"
echo " cp .env.example .env"
exit 1
fi
# 检查是否在虚拟环境中
if [ -z "$VIRTUAL_ENV" ]; then
# 尝试激活本地虚拟环境
if [ -d "venv" ]; then
source venv/bin/activate
echo "已激活虚拟环境: venv"
fi
fi
# 检查依赖
python3 -c "import flask" 2>/dev/null
if [ $? -ne 0 ]; then
echo "正在安装依赖..."
pip3 install -r requirements.txt --break-system-packages
fi
echo "启动服务..."
python3 app.py