mirror of
https://github.com/KingHWJ/WeReadBoard.git
synced 2026-11-03 18:24:58 +08:00
feat: 添加配置读取工具,支持从环境变量和 .env 文件加载 WEREAD_API_KEY
fix: 修复启动脚本中的 Python 解释器路径识别 style: 更新样式以支持按钮最小宽度和灵活布局 docs: 添加项目最终文档,整合各类信息与说明
This commit is contained in:
1 parent
3d5a402117
commit
92a48d14cd
9 files changed
+461
-20
No files matched your search
+11
-4
@@ -7,8 +7,8 @@
|
||||
# ./start_server.sh restart 重启服务
|
||||
# ./start_server.sh status 查看状态
|
||||
|
||||
PROJECT_DIR="/Users/hwj/WorkBuddy/2026-07-17-09-48-20"
|
||||
PYTHON="/Users/hwj/.workbuddy/binaries/python/envs/default/bin/python"
|
||||
PROJECT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
PYTHON="${PYTHON:-$(command -v python3 || command -v python)}"
|
||||
PID_FILE="$PROJECT_DIR/.server.pid"
|
||||
LOG_FILE="/tmp/weread_server.log"
|
||||
PORT=8080
|
||||
@@ -61,6 +61,10 @@ start_foreground() {
|
||||
echo "服务已在运行 (PID: $(get_pid))"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$PYTHON" ]; then
|
||||
echo "未找到可用的 Python 解释器"
|
||||
exit 1
|
||||
fi
|
||||
echo "启动服务(前台模式)..."
|
||||
exec "$PYTHON" app.py
|
||||
}
|
||||
@@ -70,9 +74,12 @@ start_daemon() {
|
||||
echo "服务已在运行 (PID: $(get_pid))"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$PYTHON" ]; then
|
||||
echo "未找到可用的 Python 解释器"
|
||||
exit 1
|
||||
fi
|
||||
echo "启动服务(后台守护模式)..."
|
||||
WEREAD_API_KEY="${WEREAD_API_KEY:-wrk-ZL_oy0woT5yKFaO1jn_15AAA}" \
|
||||
nohup "$PYTHON" app.py > "$LOG_FILE" 2>&1 &
|
||||
nohup "$PYTHON" app.py > "$LOG_FILE" 2>&1 &
|
||||
local pid=$!
|
||||
echo "$pid" > "$PID_FILE"
|
||||
sleep 2
|
||||
|
||||
Reference in new issue
Block a user