diff --git a/README.md b/README.md index 5522a55..18de2ef 100644 --- a/README.md +++ b/README.md @@ -1,71 +1,109 @@ # SMS Forwarder -一个将 iOS 短信转发到 Android 设备的通知服务器。 +🚀 一个将 iOS 短信转发到 Android 设备的高性能通知服务器 -## 功能特性 +[![Docker](https://img.shields.io/badge/Docker-支持-blue?logo=docker)](https://www.docker.com/) +[![Python](https://img.shields.io/badge/Python-3.10+-green?logo=python)](https://www.python.org/) +[![FastAPI](https://img.shields.io/badge/FastAPI-框架-red?logo=fastapi)](https://fastapi.tiangolo.com/) +[![License](https://img.shields.io/badge/License-MIT-yellow)](LICENSE) -- 接收来自 iPhone 快捷指令的短信内容 -- 支持多种推送方式(Pushbullet、FCM、Gotify、ntfy 等) -- 基于 FastAPI 的高性能 HTTP 服务器 -- 使用 Apprise 库支持 80+ 种通知服务 -- YAML 配置文件,支持多推送目标 -- API 密钥认证,确保安全性 -- 完整的日志记录和错误处理 +## ✨ 功能特性 -## 快速开始 +- 📱 **iPhone 集成**:通过快捷指令自动转发短信 +- 🔔 **多种推送**:支持 Gotify、ntfy、Pushbullet 等 80+ 种通知服务 +- ⚡ **低延迟**:Gotify 1-3秒,ntfy 5-15秒延迟 +- 🐳 **Docker 部署**:一键部署,环境隔离 +- 🔒 **安全认证**:API 密钥 + IP 白名单 + 速率限制 +- 📊 **监控完善**:健康检查、状态监控、详细日志 +- 🎯 **高性能**:基于 FastAPI,支持高并发 +- 🛠️ **易于管理**:提供完整的管理脚本 -### 1. 环境要求 +## 🚀 快速开始(推荐 Docker) -- Python 3.10+ -- uv 包管理器 - -### 2. 安装 +### 1. 克隆项目 ```bash -# 克隆项目 -git clone -cd notification - -# 使用 uv 安装依赖 -uv sync +git clone https://gitea.nosuchip.de/zack/sms_forwarder.git +cd sms_forwarder ``` -### 3. 配置 - -复制配置文件模板并编辑: +### 2. 配置服务 ```bash +# 复制配置文件 cp config.example.yaml config.yaml + +# 编辑配置(必须修改 API 密钥和推送服务) +nano config.yaml ``` -编辑 `config.yaml` 文件,配置你的推送服务。 - -### 4. 运行 +### 3. 一键部署 ```bash -# 开发模式 -uv run uvicorn sms_forwarder.main:app --reload --host 0.0.0.0 --port 8000 +# 自动部署(推荐) +./scripts/deploy.sh -# 生产模式 -uv run sms-forwarder +# 或手动部署 +docker-compose up -d ``` -## 支持的推送服务 +### 4. 验证部署 -- **Pushbullet** - 推荐,设置简单 -- **FCM (Firebase Cloud Messaging)** - Google 官方推送 -- **Gotify** - 自托管推送服务 -- **ntfy** - 开源推送服务 -- **Discord、Telegram、Slack** 等 80+ 种服务 +```bash +# 测试服务 +./scripts/test-docker.sh -## iPhone 快捷指令配置 +# 查看状态 +./scripts/docker-manage.sh status +``` -详见 [iPhone 配置指南](docs/iphone-setup.md) +服务启动后访问: +- 🌐 **API 文档**:http://localhost:12152/docs +- 💚 **健康检查**:http://localhost:12152/health +- 📊 **服务状态**:http://localhost:12152/status -## API 文档 +## 📋 支持的推送服务 -服务器启动后访问 `http://localhost:8000/docs` 查看 API 文档。 +| 服务 | 延迟 | 特点 | 推荐度 | +|------|------|------|--------| +| **Gotify** | 1-3秒 | 自托管,完全控制 | ⭐⭐⭐⭐⭐ | +| **ntfy** | 5-15秒 | 免费,无需注册 | ⭐⭐⭐⭐ | +| **Pushbullet** | 30秒-2分钟 | 设置简单 | ⭐⭐⭐ | +| **其他** | 变化 | Discord、Telegram、Slack 等 80+ 种 | ⭐⭐ | -## 许可证 +## 📱 客户端配置 -MIT License +### iPhone 快捷指令 +详见 [iPhone 配置指南](docs/simple-iphone-setup.md) + +### Android 客户端 +- **Gotify**:[F-Droid](https://f-droid.org/packages/com.github.gotify/) | [GitHub](https://github.com/gotify/android) +- **ntfy**:[Google Play](https://play.google.com/store/apps/details?id=io.heckel.ntfy) | [F-Droid](https://f-droid.org/packages/io.heckel.ntfy/) + +## 🛠️ 管理命令 + +```bash +# 服务管理 +./scripts/docker-manage.sh status # 查看状态 +./scripts/docker-manage.sh logs # 查看日志 +./scripts/docker-manage.sh restart # 重启服务 +./scripts/docker-manage.sh test # 测试通知 + +# 部署管理 +./scripts/deploy.sh # 重新部署 +./scripts/test-docker.sh # 完整测试 +``` + +## 📚 文档 + +- 📖 [部署指南](docs/deployment.md) - 详细的 Docker 部署说明 +- 📱 [iPhone 配置](docs/simple-iphone-setup.md) - 快捷指令设置 +- 🔧 [高级配置](docs/iphone-setup.md) - 完整配置选项 + +## 🤝 贡献 + +欢迎提交 Issue 和 Pull Request! + +## 📄 许可证 + +MIT License - 详见 [LICENSE](LICENSE) 文件