Commit Graph

15 Commits

Author SHA1 Message Date
Abner
4a0fcc94fe feat: 重构Netlify Functions架构并增强代码质量
- 新增统一的中间件模块,提供鉴权、CORS和错误处理功能
- 重构所有Functions使用withAuth中间件简化代码结构
- 添加安全存储模块替代localStorage,防御XSS攻击
- 引入HTML清理工具,自动转义特殊字符和验证URL安全性
- 创建代码质量检查脚本,验证语法、环境变量和依赖完整性
- 添加构建日志工具和重构脚本,统一替换console.log为Logger
- 引入ESLint配置,提升代码质量和一致性
- 重构Giffgaff相关API,统一错误处理和验证逻辑
- 优化构建脚本,添加压缩和图片优化功能
- 新增健康检查端点,用于服务监控和状态报告
2025-11-23 22:20:02 +08:00
Abner
5a29e64ec7 feat: 重构部署流程并移除 Service Worker
- 新增部署工具脚本:添加 `build-static.js`、`deploy-prepare.js`、`deploy-analyze.js` 和 `test-deploy-config.js` 标准化构建部署流程
- 配置 Netlify 发布目录:修改 `netlify.toml` 将 `publish` 从根目录切换到 `dist` 目录以增强安全性
- 移除 Service Worker 相关代码:删除 `sw.js` 并清理相关注册逻辑,简化性能优化策略
- 增强服务器静态文件服务:重构静态资源中间件,增加环境检查和错误处理
- 改进 API 密钥处理逻辑:统一 Netlify Functions 的密钥验证流程,增加配置缺失提示
- 添加 Serena AI 配置文件:包含项目元数据、语言服务器设置和常用命令记忆
- 重构 HTML 页面路由:使用配置化的路由表替代硬编码路径,提高可维护性
2025-11-23 19:44:45 +08:00
dependabot[bot]
4183c1ef69 build(deps): bump axios from 1.11.0 to 1.12.0
Bumps [axios](https://github.com/axios/axios) from 1.11.0 to 1.12.0.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.11.0...v1.12.0)

---
updated-dependencies:
- dependency-name: axios
  dependency-version: 1.12.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-13 17:43:14 +00:00
Abner
576f574d29 feat: 更新品牌标识和版权年份
- 将品牌名称从 "eSIM工具集" 修改为 "eSIM Tools"
- 更新 GitHub 仓库地址和相关链接
- 添加自定义应用品牌与年份范围配置功能
- 实现统一版权页脚自动注入
- 优化部分页面结构和样式
2025-08-12 19:17:22 +08:00
Abner
251da627ad docs(security): 更新内容安全策略并移除冗余代码
- 更新内容安全策略以允许 Google Tag Manager
- 移除 verify_cookie.php 文件
- 优化 Service Worker 注册和缓存逻辑
- 更新时间检查逻辑以使用国际时区
- 调整 OAuth 2.0 PKCE 配置,移除前端的 clientSecret
2025-08-09 17:43:44 +08:00
Abner
f97d8339e4 feat(auth): 增加 OAuth 2.0 PKCE 令牌交换功能
- 新增 giffgaff-token-exchange.js 函数,用于交换 authorization code 和 access token
- 更新 verify-cookie.js 函数,增加对 cookie 中 access token 的提取和验证
- 修改 giffgaff-graphql.js、giffgaff-mfa-challenge.js 和 giffgaff-mfa-validation.js 函数,支持使用 access token 或 cookie 进行身份验证
- 更新 README.md 和 COOKIE_LOGIN_SETUP.md 文档,说明新的身份验证流程和安全注意事项
2025-08-09 14:39:29 +08:00
Abner
ce5390b5b6 feat(giffgaff): 添加 Giffgaff eSIM 功能模块
- 新增 Giffgaff eSIM 主应用控制器和相关模块
- 实现 OAuth 登录、Cookie 验证、邮件验证码发送和验证等功能
- 添加会员信息获取、eSIM 预订和下载信息获取等核心功能
- 开发响应式 UI 和状态显示逻辑
- 集成 Jest 测试框架并配置相关测试命令
2025-08-07 22:21:45 +08:00
Abner
d9de45745b fix(deployment): 修复Netlify部署配置并优化性能
- 移除了不支持的配置项,简化了netlify.toml文件结构
- 添加了配置测试脚本,提高了部署的可靠性和稳定性
- 优化了部署流程,大幅减少了部署大小和提高了部署速度
- 调整了服务时间卡片的样式,使布局更加居中和美观
2025-08-06 00:46:34 +08:00
Abner
dd77aabd63 docs(deployment): 添加 Netlify 部署配置和优化指南
- 新增 DEPLOYMENT.md 文件,详细说明 Netlify 部署配置和优化策略
- 更新 .netlifyignore 文件,排除非必要文件以提高部署效率
- 修改 netlify.toml 文件,启用资源压缩和缓存控制
- 添加部署分析脚本,生成部署清单和统计信息
- 优化 package.json,增加部署相关命令
2025-08-06 00:41:33 +08:00
Abner
b6f7434aac feat(images): 重构图片优化脚本并替换为 sharp 库
- 移除 imagemin 及其相关插件依赖,改用更高效的 sharp 库处理图片
- 支持生成多种格式(JPEG、PNG、WebP)和多尺寸缩略图
- 新增命令行参数支持,可自定义输入输出目录及图片质量
- 自动创建示例目录及说明文件,提升易用性
- 优化失败处理逻辑并提供详细日志反馈

此变更提高了图片处理性能与灵活性,同时简化了依赖管理。
2025-08-05 23:40:44 +08:00
Abner
c004e069e7 fix: 本地化 Font Awesome 图标
- 下载并配置本地 Font Awesome 文件
- 修改 HTML 文件中的图标引用路径
- 更新 Content Security Policy 策略
- 创建测试页面验证图标显示
- 优化图标加载性能
2025-08-05 23:15:41 +08:00
Abner
b72de71775 feat(security): 添加内容安全策略 (CSP)
- 在 HTML 头部加入 Content-Security-Policy 元标签
- 配置了各种资源的加载来源,增强了页面的安全性
- 包括脚本、样式、字体、图像等资源的加载限制
2025-08-05 22:55:38 +08:00
Abner
ac0744c4d5 feat(performance): 优化性能并添加离线支持
- 新增 .babelrc 配置文件,使用 Babel 进行代码转换和压缩
- 添加 PERFORMANCE.md 文件,详细说明性能优化措施
- 在 README.md 中增加性能优化相关说明
- 更新 index.html,添加 Service Worker 注册和性能优化脚本
2025-08-05 22:33:56 +08:00
Abner
ab8f0c05d8 🚀 Major upgrade: Convert to Node.js architecture with Netlify Functions
🔄 Complete Architecture Transformation:
- Migrated from PHP to Node.js backend
- Implemented Netlify Functions for serverless deployment
- Added Express.js server for local development
- Full compatibility with modern deployment platforms

🛠️ New Netlify Functions:
- giffgaff-mfa-challenge.js: Handles MFA email verification with proper headers
- giffgaff-mfa-validation.js: Processes MFA code validation
- verify-cookie.js: Cookie authentication converted from PHP to Node.js

 MFA 403 Error Resolution:
- Proper Origin and Referer headers in server-side requests
- Comprehensive error logging for debugging
- Timeout handling and robust error responses
- Should completely resolve MFA authentication issues

🍪 Enhanced Cookie Login:
- Full Node.js implementation replacing PHP dependency
- Works on all deployment platforms (Netlify, Vercel, traditional servers)
- Intelligent cookie parsing and validation
- Secure API calls with proper headers

�� Development Experience:
- package.json with all necessary dependencies
- Local development server (server.js)
- Environment configuration (env.example)
- Hot reload support with nodemon

🌐 Deployment Improvements:
- Netlify Functions integration
- Updated netlify.toml configuration
- Automatic dependency installation
- Zero-config deployment process

🎯 Key Benefits:
-  Resolves MFA 403 errors through proper server-side handling
-  Cookie login works on all platforms (no PHP dependency)
-  Better error handling and logging
-  Modern serverless architecture
-  Improved development experience
-  Full compatibility with static hosting platforms

📋 Technical Stack:
- Frontend: Pure HTML/CSS/JavaScript (unchanged)
- Backend: Node.js + Express.js (local) / Netlify Functions (production)
- Dependencies: axios, cors, helmet, morgan, dotenv
- Deployment: Netlify with automatic function deployment

This major upgrade modernizes the entire backend architecture while maintaining full frontend compatibility. The MFA 403 error should now be completely resolved through proper server-side request handling.
2025-08-01 21:03:25 +08:00
Abner
974b6034f3 🚀 Initial commit: eSIM Tools v1.0
 Features:
- Complete Giffgaff eSIM management with OAuth 2.0 PKCE
- Simyo eSIM tools with device switching support
- Netlify deployment ready with CORS proxy
- Responsive UI with Bootstrap 5
- Comprehensive testing suite
- Multi-language support (Chinese)

🔧 Technical:
- Node.js proxy server for CORS handling
- Environment-aware API endpoints
- Static deployment optimization
- Professional documentation

📦 Deployment:
- Netlify configuration included
- GitHub Actions ready
- Custom domain support
- HTTPS enabled
2025-08-01 18:42:54 +08:00