Skip to content

Commit 3abf53e

Browse files
committed
[feat] v1.0.0:首次公开发布
1 parent d13d4d7 commit 3abf53e

28 files changed

Lines changed: 2580 additions & 55 deletions

CHANGELOG.md

Lines changed: 46 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -7,49 +7,54 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
## [0.2.0] - 2026-04-12
10+
## [1.0.0] - 2026-04-11
1111

12-
### Added
13-
- C++26 反射层(双轨设计):原生 P2996 + C++20 宏回退
14-
- `MetaJson.h` — 自动 JSON 序列化/反序列化(`toJson` / `fromJson` / `req.readJson<T>()`
15-
- `MetaRoutes.h` — 自动路由注册(`HICAL_HANDLER` / `HICAL_ROUTES` 宏 + `registerRoutes()`
16-
- `Reflection.h` — 特性检测 `HICAL_HAS_REFLECTION``RouteInfo``HasRouteTable` / `HasJsonFields` 类型萃取
17-
- MSVC + vcpkg CI 支持
18-
- 安全策略文件 `SECURITY.md`
19-
- 社区基础设施:PR 模板、Issue 模板(Bug/Feature)、`CODEOWNERS`
20-
- `CONTRIBUTING.md` 贡献指南、`CODE_OF_CONDUCT.md` 行为准则
21-
- `.editorconfig` / `.gitattributes` 统一编辑器与行尾配置
22-
- 多平台构建文档(Linux / macOS / MSYS2 / MSVC)
23-
- 技术博客系列(`docs/blog/`
24-
25-
### Changed
26-
- 移除 `AsioTcpConnection` 向后兼容层,统一使用 `GenericConnection<SocketType>`
27-
28-
### Fixed
29-
- 添加 `/Zc:__cplusplus` 修复 MSVC CI 测试失败
30-
- 修复 CI 格式检查和 MSVC 构建失败
31-
- 使用 CI 默认 clang-format(v18)统一代码格式
32-
33-
### Performance
34-
- 全面性能优化(PMR 内存池、路由分发、中间件管线)
35-
- 全面代码审查,修复 P0/P1 级问题
36-
37-
## [0.1.0] - 2026-04-07
12+
首次公开发布。
3813

3914
### Added
40-
- 项目初始化
41-
- Boost.Asio/Beast 异步网络层
42-
- 协程异步 I/O(`co_await` + `boost::asio::use_awaitable`
43-
- 三级 PMR 内存策略(全局同步 / 线程本地 / 请求级单调缓冲)
44-
- C++20 Concepts 编译期类型约束(`EventLoopLike``TcpConnectionLike``TimerLike``NetworkBackend`
45-
- 静态路由(hash map O(1))+ 参数路由(`{id}` 模式)+ WebSocket 路由
46-
- 洋葱模型中间件管线
47-
- SSL/TLS 支持(`GenericConnection<ssl::stream<tcp::socket>>`
15+
16+
**网络层 & 异步核心**
17+
- Boost.Asio/Beast 异步网络层,协程 I/O(`co_await` + `boost::asio::use_awaitable`
4818
- `EventLoopPool` 多线程池(1 线程 : 1 io_context,轮询分发)
49-
- 18 个测试用例(GTest + CTest 集成)
50-
- GitHub Actions CI(GCC / Clang / MSYS2 三平台矩阵)
51-
- README 及文档(快速入门、架构概览、API 参考、性能报告)
19+
- SSL/TLS 支持(模板化 `GenericConnection<ssl::stream<tcp::socket>>`,编译期分支)
5220

53-
[Unreleased]: https://github.com/Hical61/Hical/compare/v0.2.0...HEAD
54-
[0.2.0]: https://github.com/Hical61/Hical/compare/v0.1.0...v0.2.0
55-
[0.1.0]: https://github.com/Hical61/Hical/releases/tag/v0.1.0
21+
**HTTP 框架**
22+
- 静态路由(hash map O(1))+ 参数路由(`{id}` 模式)+ WebSocket 路由
23+
- 洋葱模型中间件管线(`MiddlewarePipeline`
24+
- `HttpServer` 一键启动门面
25+
26+
**内存 & 性能**
27+
- 三层 PMR 内存策略:全局同步池 / 线程本地池 / 请求级单调缓冲
28+
- `PmrBuffer` 统一缓冲区(prepend 区域 + 自动扩容)
29+
30+
**类型系统**
31+
- C++20 Concepts 编译期约束(`EventLoopLike``TcpConnectionLike``TimerLike``NetworkBackend`
32+
33+
**C++26 反射层(双轨设计)**
34+
- `Reflection.h` — 特性检测 `HICAL_HAS_REFLECTION``RouteInfo`,类型萃取
35+
- `MetaJson.h` — 自动 JSON 序列化/反序列化(`toJson` / `fromJson` / `req.readJson<T>()`
36+
- `MetaRoutes.h` — 自动路由注册(`HICAL_HANDLER` / `HICAL_ROUTES` 宏 + `registerRoutes()`
37+
38+
**Cookie / Session / 静态文件 / 文件上传**
39+
- Cookie:RFC 6265 兼容解析(懒解析 + 缓存,first-wins 语义),`HttpResponse::setCookie` 含 CRLF 注入防护
40+
- 静态文件服务:`serveStatic` 工厂函数,27 种 MIME 类型、ETag/304 缓存、路径遍历防护、64 MB 大小限制
41+
- Multipart 文件上传:RFC 7578 `multipart/form-data` 解析,Part 数量上限 256(DoS 防护)
42+
- Session 会话管理:内存 `SessionManager`,懒 GC,128 位随机 ID,线程安全 `Session``makeSessionMiddleware` 中间件工厂
43+
- `HttpRequest` 请求级属性存储(`setAttribute` / `getAttribute<T>`
44+
- `HttpTypes.h` 新增 `hPayloadTooLarge = 413` 状态码
45+
46+
**工程**
47+
- GitHub Actions CI(GCC 14 / Clang 18 / MSYS2 MINGW64 / MSVC + vcpkg 四平台矩阵)
48+
- 232 个测试用例(GTest + CTest 集成),clang-format / clang-tidy 检查
49+
- MSVC + vcpkg 支持(`vcpkg.json` 清单)
50+
- 社区基础设施:`CONTRIBUTING.md``CODE_OF_CONDUCT.md``SECURITY.md`、PR/Issue 模板
51+
52+
### Security
53+
54+
- Cookie `Set-Cookie` 头 CRLF 注入防护
55+
- 静态文件路径遍历防护
56+
- Multipart Part 数量上限(DoS 防护)
57+
- Session ID 使用密码学安全的随机数生成
58+
59+
[Unreleased]: https://github.com/Hical61/Hical/compare/v1.0.0...HEAD
60+
[1.0.0]: https://github.com/Hical61/Hical/releases/tag/v1.0.0

CLAUDE.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Project Overview
66

7-
Hical is a modern C++20 high-performance web framework built on Boost.Asio/Beast, featuring PMR memory pools, coroutine-based async I/O (`asio::awaitable<T>`), C++20 Concepts for compile-time type safety, and a C++26 reflection layer (dual-track: native P2996 or C++20 macro fallback). Status: Work in Progress (v0.2.0).
7+
Hical is a modern C++20 high-performance web framework built on Boost.Asio/Beast, featuring PMR memory pools, coroutine-based async I/O (`asio::awaitable<T>`), C++20 Concepts for compile-time type safety, and a C++26 reflection layer (dual-track: native P2996 or C++20 macro fallback). Status: v1.0.0.
88

99
## Build Commands
1010

@@ -139,7 +139,7 @@ Core design principle: when `HICAL_HAS_REFLECTION == 1` (compiler supports P2996
139139

140140
## Test Structure
141141

142-
18 test executables in `tests/`, each linked against `hical_core` + `GTest::gtest_main`. Tests are registered via `gtest_discover_tests()` for CTest integration. On Windows, tests also link `ws2_32` and `mswsock`. Key test files:
142+
22 test executables in `tests/`, each linked against `hical_core` + `GTest::gtest_main`. Tests are registered via `gtest_discover_tests()` for CTest integration. On Windows, tests also link `ws2_32` and `mswsock`. Key test files:
143143
- `test_router.cpp` / `test_router_perf.cpp` — Route dispatch and performance
144144
- `test_memory_pool.cpp` — Three-tier PMR allocation
145145
- `test_http_server.cpp` / `test_integration.cpp` — Full HTTP request/response cycle
@@ -148,6 +148,10 @@ Core design principle: when `HICAL_HAS_REFLECTION == 1` (compiler supports P2996
148148
- `test_websocket.cpp` — WebSocket messaging
149149
- `test_concepts.cpp` — Compile-time concept verification
150150
- `test_reflection.cpp` — MetaJson + MetaRoutes reflection layer
151+
- `test_cookie.cpp` — Cookie parsing and Set-Cookie header
152+
- `test_static_files.cpp` — Static file serving, ETag, path traversal
153+
- `test_multipart.cpp` — multipart/form-data parsing
154+
- `test_session.cpp` — Session lifecycle and thread safety
151155

152156
## CI
153157

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Hical uses a tag-based release workflow. Pushing a tag triggers CI to build, tes
100100
4. GitHub Actions will: build → test → create Release with auto-generated notes
101101
5. Verify the [Releases page](https://github.com/Hical61/Hical/releases)
102102

103-
**Pre-release:** Use tags like `v0.2.0-alpha.1`, `v0.2.0-beta.1`, or `v0.2.0-rc.1` — they will be marked as pre-release automatically.
103+
**Pre-release:** Use tags like `v1.1.0-alpha.1`, `v1.1.0-beta.1`, or `v1.1.0-rc.1` — they will be marked as pre-release automatically.
104104

105105
### Reporting Issues
106106

@@ -204,7 +204,7 @@ Hical 使用基于 tag 的发布流程。推送 tag 后,CI 会自动构建、
204204
4. GitHub Actions 自动执行:构建 → 测试 → 创建 Release(附自动生成的变更日志)
205205
5.[Releases 页面](https://github.com/Hical61/Hical/releases) 确认发布结果
206206

207-
**预发布版本:** 使用 `v0.2.0-alpha.1``v0.2.0-beta.1``v0.2.0-rc.1` 格式的 tag,会自动标记为预发布。
207+
**预发布版本:** 使用 `v1.1.0-alpha.1``v1.1.0-beta.1``v1.1.0-rc.1` 格式的 tag,会自动标记为预发布。
208208

209209
### 提交 Issue
210210

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
Hical is a modern C++ web framework built on Boost.Asio/Beast, utilizing C++26 reflection and PMR memory pooling to achieve high performance.
1313

14-
> **Status:** Work in Progress
14+
> **v1.0.0** — C++20/26 dual-track reflection · PMR memory pool · coroutine async I/O · Cookie / Session / StaticFiles / Multipart built-in
1515
1616
English | [简体中文](README_CN.md)
1717

@@ -26,6 +26,10 @@ English | [简体中文](README_CN.md)
2626
- **WebSocket** — WebSocket upgrade and bidirectional communication
2727
- **Router & Middleware** — Middleware pipeline (logging, auth, rate limiting) with path parameter support
2828
- **HTTP Server** — Full HTTP/1.1 support via Boost.Beast (chunked transfer, keep-alive)
29+
- **Cookie Support** — RFC 6265 compliant parsing (first-wins semantics) + `Set-Cookie` with CRLF injection protection
30+
- **Static File Serving** — MIME auto-detection, ETag/304 caching, path traversal protection, 64 MB size limit
31+
- **Multipart File Upload** — RFC 7578 `multipart/form-data` parser with DoS protection (≤256 parts)
32+
- **Session Management** — In-memory `SessionManager` with lazy GC, 128-bit random IDs, thread-safe `Session` objects
2933

3034
## Why Hical?
3135

@@ -37,6 +41,9 @@ English | [简体中文](README_CN.md)
3741
| **HTTP Parser** | Boost.Beast | Custom (Trantor) | Custom |
3842
| **SSL** | Compile-time template branching | Runtime branch | Runtime branch |
3943
| **Backend Abstraction** | C++20 Concepts | N/A | N/A |
44+
| **Cookie / Session** | Built-in | Built-in | Limited |
45+
| **Static Files** | Built-in (ETag, DoS guard) | Built-in | Built-in |
46+
| **File Upload** | Built-in (part limit guard) | Built-in | Built-in |
4047

4148
## Quick Start
4249

README_CN.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22

33
[![CI](https://github.com/Hical61/Hical/actions/workflows/ci.yml/badge.svg)](https://github.com/Hical61/Hical/actions/workflows/ci.yml)
44
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
5-
[![C++20](https://img.shields.io/badge/C%2B%2B-20-blue.svg)](https://isocpp.org/)
5+
[![C++ Standard](https://img.shields.io/badge/C%2B%2B-20%20%7C%2026-blue.svg)](https://isocpp.org/)
66
[![Platform](https://img.shields.io/badge/Platform-Linux%20%7C%20Windows%20%7C%20macOS-green.svg)]()
77
[![Boost](https://img.shields.io/badge/Boost-%E2%89%A51.70-orange.svg)](https://www.boost.org/)
8+
[![GitHub release](https://img.shields.io/github/v/release/Hical61/Hical?include_prereleases&sort=semver)](https://github.com/Hical61/Hical/releases)
9+
[![GitHub stars](https://img.shields.io/github/stars/Hical61/Hical?style=flat)](https://github.com/Hical61/Hical/stargazers)
10+
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)
811

912
Hical 是一个基于 Boost.Asio/Beast,利用 C++26 反射和 PMR 内存池构建高性能的现代 C++ Web 框架。
1013

11-
> **状态:** 开发中
14+
> **v1.0.0** — C++20/26 双轨反射 · PMR 内存池 · 协程异步 I/O · Cookie / Session / 静态文件 / 文件上传 内置
1215
1316
[English](README.md) | 简体中文
1417

@@ -23,6 +26,10 @@ Hical 是一个基于 Boost.Asio/Beast,利用 C++26 反射和 PMR 内存池构
2326
- **WebSocket** — WebSocket 升级与双向通信
2427
- **路由 & 中间件** — 中间件管线(日志、认证、限流),支持路径参数
2528
- **HTTP 服务器** — 基于 Boost.Beast 的完整 HTTP/1.1 支持(分块传输、Keep-Alive)
29+
- **Cookie 支持** — RFC 6265 兼容解析(first-wins 语义)+ `Set-Cookie`(CRLF 注入防护)
30+
- **静态文件服务** — MIME 自动推断、ETag/304 缓存验证、路径遍历防护、64 MB 大小限制
31+
- **Multipart 文件上传** — RFC 7578 `multipart/form-data` 解析,含 DoS 防护(≤256 个 Part)
32+
- **Session 会话管理** — 内存 `SessionManager`,懒 GC,128 位随机 ID,线程安全 `Session` 对象
2633

2734
## 为什么选择 Hical?
2835

@@ -34,6 +41,9 @@ Hical 是一个基于 Boost.Asio/Beast,利用 C++26 反射和 PMR 内存池构
3441
| **HTTP 解析** | Boost.Beast | 自研 (Trantor) | 自研 |
3542
| **SSL** | 编译期模板分支 | 运行时分支 | 运行时分支 |
3643
| **后端抽象** | C++20 Concepts |||
44+
| **Cookie / Session** | 内置 | 内置 | 有限支持 |
45+
| **静态文件** | 内置(ETag、DoS 防护) | 内置 | 内置 |
46+
| **文件上传** | 内置(Part 数量限制) | 内置 | 内置 |
3747

3848
## 快速开始
3949

0 commit comments

Comments
 (0)