#!/bin/bash
# KeyIssue Prototype 本地开发启动脚本
cd "$(dirname "$0")"

# 数据文件路径（默认非 Windows 会找 /var/lib/keyissue-prototype/，本地需要覆盖）
export DATA_FILE="$PWD/data/app-state.json"

# 可选：设置初始密码（首次启动未持久化时生效，已有密码哈希后忽略）
export KEYISSUE_ADMIN_PASSWORD=123456
export KEYISSUE_EXECUTIVE_PASSWORD=123456
export KEYISSUE_DELIVERY_PASSWORD=123456
export KEYISSUE_MANAGER_PASSWORD=123456
export KEYISSUE_AUDITOR_PASSWORD=123456
export KEYISSUE_DESIGNER_PASSWORD=123456
export KEYISSUE_DESIGN_MANAGER_PASSWORD=123456

# 监听地址和端口
export HOST=0.0.0.0
export PORT=8787

echo "数据文件: $DATA_FILE"
echo "启动服务: http://localhost:$PORT/prototype/index.html"
echo ""

exec node server.js
