Commit Graph

24 Commits

Author SHA1 Message Date
Abner
01df53a9df 🔧 chore(hooks): 新增提交与推送质量门禁 2026-04-06 18:13:44 +08:00
Abner
1db402a372 chore: 更新依赖版本并添加新依赖
- 将 serialize-javascript 依赖版本从 ^7.0.3 更新到 ^7.0.5
- 新增 path-to-regexp 依赖,版本为 ^0.1.13
- 同步更新 package-lock.json 文件以反映依赖变更
2026-03-29 22:03:32 +08:00
Abner
7869a729c9 fix(deps): 修复 Dependabot 安全漏洞
- serialize-javascript: 6.0.2 → ^7.0.3 (RCE 漏洞, GHSA #39)
- minimatch: ^10.2.2 → ^10.2.3 (ReDoS 漏洞, GHSA-7r86/GHSA-23c5)
- rollup: 2.79.2 → ^2.80.0 (路径遍历漏洞, GHSA-mw96)

通过 package.json overrides 强制版本提升,npm audit 0 漏洞
2026-03-01 15:42:58 +08:00
Abner
ea0d187acd fix(deps): 修复 Dependabot 安全漏洞
- 添加 npm overrides 强制使用安全版本
  - minimatch: ^10.2.2 (修复 ReDoS 漏洞 CVE-2026-26996)
  - glob: ^11.1.0
- 更新 Jest 到 v30.2.0
- 漏洞数量: 31 → 0
2026-02-21 17:14:45 +08:00
dependabot[bot]
3e159f4079 build(deps): bump axios from 1.13.2 to 1.13.5 (#21)
Bumps [axios](https://github.com/axios/axios) from 1.13.2 to 1.13.5.
- [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.13.2...v1.13.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-12 08:08:57 +08:00
dependabot[bot]
2698bb0acb build(deps-dev): bump webpack from 5.103.0 to 5.105.0
升级 webpack 及相关依赖以修复已知问题并提升性能

主要变更:
- webpack: 5.103.0 → 5.105.0
- browserslist: 4.28.0 → 4.28.1
- enhanced-resolve: 5.18.3 → 5.19.0
- es-module-lexer: 1.7.0 → 2.0.0
- terser-webpack-plugin: 5.3.14 → 5.3.16
- watchpack: 2.4.4 → 2.5.1

改进内容:
- 修复 ESM 模块处理 bug
- 优化 import.meta.env 性能
- 改进 Worker 模块解析
- 更新 TypeScript 类型定义

安全审查: 已通过所有安全检查
2026-02-08 09:38:29 +08:00
dependabot[bot]
023dfe3de1 build(deps): bump qs and express
Bumps [qs](https://github.com/ljharb/qs) to 6.14.1 and updates ancestor dependency [express](https://github.com/expressjs/express). These dependencies need to be updated together.


Updates `qs` from 6.13.0 to 6.14.1
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.13.0...v6.14.1)

Updates `express` from 4.21.2 to 4.22.1
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/v4.22.1/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.21.2...v4.22.1)

---
updated-dependencies:
- dependency-name: qs
  dependency-version: 6.14.1
  dependency-type: indirect
- dependency-name: express
  dependency-version: 4.22.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-01 18:29:54 +00:00
Abner
9da2e0bf95 fix: giffgaff tutorial link; freeze legacy pages 2025-12-31 00:21:43 +08:00
Abner
0d99f1f600 feat: 集成 Sentry 错误监控系统
前端监控 (src/js/modules/sentry-init.js):
- 使用 @sentry/browser SDK v10+ 和 browserTracingIntegration()
- 智能环境检测,开发环境自动禁用
- 敏感数据过滤 (authKey, token, password, cookie)
- 性能追踪采样率 10%

后端监控 (netlify/functions/_shared/sentry.js):
- 使用 @sentry/node 用于 Netlify Functions
- 仅上报 5xx 服务端错误,节省配额
- Serverless 环境 flush() 确保错误发送

构建集成 (webpack.config.js):
- @sentry/webpack-plugin 自动上传 Source Maps
- 自动使用 Netlify COMMIT_REF 作为 release 版本
- 上传后自动删除本地 source maps

环境变量:
- SENTRY_DSN: 错误上报端点
- SENTRY_AUTH_TOKEN: Source Maps 上传认证
- SENTRY_ORG / SENTRY_PROJECT: 组织和项目标识
2025-12-13 22:03:02 +08:00
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