Initial commit: SMS Receiver Web Service

Features:
- Receive SMS from TranspondSms Android APP
- HMAC-SHA256 signature verification (optional)
- SQLite database storage
- Web UI with login authentication
- Multiple API tokens support
- Timezone conversion (Asia/Shanghai)
- Search, filter, and statistics
- Auto refresh and session management

Tech Stack:
- Flask 3.0
- SQLite database
- HTML5/CSS3 responsive design
This commit is contained in:
OpenClaw Agent
2026-02-06 23:23:49 +00:00
commit 4e5e93660d
16 changed files with 3754 additions and 0 deletions

68
start.sh Executable file
View File

@@ -0,0 +1,68 @@
#!/bin/bash
# 短信转发接收端启动脚本
# 颜色定义
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# 设置项目目录
PROJECT_DIR="/root/.openclaw/workspace/sms-receiver"
cd "$PROJECT_DIR" || exit 1
# 检查 Python
if ! command -v python3 &> /dev/null; then
echo -e "${RED}错误: 未找到 Python3${NC}"
exit 1
fi
# 检查依赖
echo -e "${YELLOW}检查依赖...${NC}"
# 创建虚拟环境(如果不存在)
if [ ! -d "venv" ]; then
echo -e "${YELLOW}创建虚拟环境...${NC}"
python3 -m venv venv
fi
# 激活虚拟环境
source venv/bin/activate
# 安装依赖
pip install -q -r requirements.txt
# 配置文件检查
if [ ! -f ".env" ]; then
echo -e "${YELLOW}创建配置文件...${NC}"
cat > .env << EOF
# 短信转发接收端配置
FLASK_ENV=development
SMS_SECRET_KEY=default_secret_key_change_me
EOF
echo -e "${YELLOW}请修改 .env 文件中的 SMS_SECRET_KEY${NC}"
fi
# 启动服务
echo -e "${GREEN}========================================${NC}"
echo -e "${GREEN}短信转发接收端${NC}"
echo -e "${GREEN}========================================${NC}"
echo ""
echo -e "服务地址: ${GREEN}http://127.0.0.1:9518${NC}"
echo -e "接收API: ${GREEN}http://127.0.0.1:9518/api/receive${NC}"
echo ""
echo -e "${YELLOW}在 TranspondSms APP 中配置:${NC}"
echo -e " Token (URL): ${GREEN}http://your-server-ip:9518/api/receive${NC}"
echo -e " Secret: ${GREEN}default_secret_key_change_me${NC}"
echo ""
echo -e "${YELLOW}按 Ctrl+C 停止服务${NC}"
echo -e "${GREEN}========================================${NC}"
echo ""
# 设置环境变量
export FLASK_ENV=$(grep "FLASK_ENV" .env | cut -d '=' -f2)
export SMS_SECRET_KEY=$(grep "SMS_SECRET_KEY" .env | cut -d '=' -f2)
# 启动应用
python3 app.py