上传文件至「/」
This commit is contained in:
@@ -0,0 +1,56 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [2.0.1] - 2025-04-08
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- `JsonDumpsEncoder` now handles `NaTType` (pandas NaT) without throwing TypeError
|
||||||
|
- CORS `Access-Control-Allow-Origin` now defaults to `"*"` instead of echoing the request Origin header (security fix)
|
||||||
|
- `RbacUser.can()` correctly handles empty permission list
|
||||||
|
- Fixed race condition in `aio_pool.py` when task queue is full under high concurrency
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Refactored `config.py` — `get_config()` now consistently returns `None` instead of raising on missing optional keys (use `default` parameter for fallback)
|
||||||
|
- Upgraded minimum Python version from 3.9 to 3.11
|
||||||
|
- `pyproject.toml` dependencies cleaned up — core dependencies slimmed down; pandas/numpy/matplotlib/opencv moved to `[project.optional-dependencies]`
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
- Deprecated `web/legacy_session.py` — use JWT-based `@auth_token` decorator instead
|
||||||
|
|
||||||
|
## [2.0.0] - 2025-03-15
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- **Swagger UI auto-generation** (`ApplicationSwagger`) — fully inferred from handler route patterns and decorators
|
||||||
|
- **Redis StreamActor** — consumer-group-based message processing with automatic zombie task recovery
|
||||||
|
- **ParamAwareUIModule** — async data pre-loading for Tornado UIModules
|
||||||
|
- **RBAC with dynamic rules** — rules are serialized Python classes stored in DB, supporting time-based, IP-based, and custom rule chains
|
||||||
|
- **Snowflake ID generator** (`snow_id.py`) — thread-safe, no external dependency, 10K+ IDs/sec
|
||||||
|
- **Auto-loading handlers** — `Application.load_handlers()` discovers all handlers in a package via `route_pattern` attribute
|
||||||
|
- **BaseX encoder/decoder** (`encoder.py`) — auto-detect Base16/32/64/85 + zlib decompression
|
||||||
|
- **Async DB engine** — SQLAlchemy async session factory with `aiomysql` / `aiosqlite` support
|
||||||
|
- **Task service with daemonization** — `TaskService` with PID file, start/stop/status commands, and graceful shutdown
|
||||||
|
- **5 complete examples** under `examples/` — HelloWorld, background tasks, Redis streams, scheduled services, model generation
|
||||||
|
- **pytest test suite** — unit tests (mocked) + integration tests for DB, Redis, RBAC
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Complete project restructuring: introduced `web/`, `core/`, `db/`, `rbac/`, `util/`, `service/` package layout
|
||||||
|
- `Application` now inherits from `tornado.web.Application` — backward-incompatible refactor from v1.x
|
||||||
|
- `RequestHandler.response_ok()` and `response_error()` now use `JsonDumpsEncoder` by default
|
||||||
|
- Logging system rewritten — supports rotating file handlers, per-module loggers, console output
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
- All v1.x code — this is a ground-up rewrite
|
||||||
|
|
||||||
|
## [1.0.0] - 2024-01-01
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Initial release with basic Tornado wrapper
|
||||||
|
- Basic JWT auth and password hashing
|
||||||
|
- Simple `config.json` loader
|
||||||
|
- Minimal utility functions
|
||||||
|
|
||||||
|
> ⚠️ **Note:** v1.0.0 is deprecated and no longer maintained. Please upgrade to v2.0.0+.
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
# Contribution Guidelines
|
||||||
|
|
||||||
|
Thank you for considering contributing to this project! Your involvement helps make this project better for everyone.
|
||||||
|
|
||||||
|
## How to Contribute
|
||||||
|
|
||||||
|
1. **Fork the repository**
|
||||||
|
2. **Create a new feature branch**
|
||||||
|
```bash
|
||||||
|
git checkout -b feature/your-feature-name
|
||||||
|
```
|
||||||
|
3. **Make your changes**
|
||||||
|
Write clean, well-documented code. Follow the project’s coding standards.
|
||||||
|
4. **Add tests**
|
||||||
|
All new features or bug fixes must include appropriate unit or integration tests.
|
||||||
|
5. **Commit your changes**
|
||||||
|
Use descriptive commit messages following [Conventional Commits](https://www.conventionalcommits.org/).
|
||||||
|
6. **Push to your fork**
|
||||||
|
```bash
|
||||||
|
git push origin feature/your-feature-name
|
||||||
|
```
|
||||||
|
7. **Open a Pull Request**
|
||||||
|
Clearly describe what you changed, why, and how it affects the project.
|
||||||
|
|
||||||
|
## Code Style & Standards
|
||||||
|
|
||||||
|
- Follow the project’s linter rules (e.g., PEP8 for Python, ESLint for JavaScript)
|
||||||
|
- Keep functions small and focused
|
||||||
|
- Document public APIs with docstrings or comments
|
||||||
|
- Never commit secrets or environment files
|
||||||
|
|
||||||
|
## Reporting Issues
|
||||||
|
|
||||||
|
If you find a bug or have a feature request, please open an [Issue](https://github.com/your-repo/issues) with:
|
||||||
|
- A clear title
|
||||||
|
- Steps to reproduce (for bugs)
|
||||||
|
- Expected vs actual behavior
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
By contributing, you agree that your contributions will be licensed under the MIT License.
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
# environment.yml
|
||||||
|
name: paste-env
|
||||||
|
channels:
|
||||||
|
- conda-forge
|
||||||
|
- defaults
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
- python=3.11
|
||||||
|
- aiohttp>=3.13.0
|
||||||
|
- aiomysql>=0.2.0
|
||||||
|
- aioquic>=1.2.0
|
||||||
|
- aiosqlite>0.21.0
|
||||||
|
- aiofiles>=23.0.0
|
||||||
|
- cryptography==46.0.3
|
||||||
|
- matplotlib>=3.10.1
|
||||||
|
- matplotlib-inline>=0.1.7
|
||||||
|
- numpy>=1.24.0
|
||||||
|
- openpyxl>=3.1.5
|
||||||
|
- pandas>=2.0.0
|
||||||
|
- pillow>=10.0.0
|
||||||
|
- psutil>=5.9.0
|
||||||
|
- PyJWT>=1.7.1
|
||||||
|
- PyMySQL>=1.1.0
|
||||||
|
- pyOpenSSL>=24.3.0
|
||||||
|
- pytest>=8.0.0
|
||||||
|
- pytest-asyncio>=0.23.0
|
||||||
|
- pytest-cov>=4.0.0
|
||||||
|
- PyYAML>=6.0.2
|
||||||
|
- requests>=2.32.5
|
||||||
|
- selenium>=4.38.0
|
||||||
|
- scipy>=1.14.0
|
||||||
|
- sqlalchemy==2.0.49
|
||||||
|
- svgwrite>=1.4.2
|
||||||
|
- tabulate>=0.9.0
|
||||||
|
- tinycss2>=1.4.0
|
||||||
|
- tinyhtml5>=2.0.0
|
||||||
|
- tornado>=6.4
|
||||||
|
- weasyprint>=64.1
|
||||||
|
- WTForms>=3.2.1
|
||||||
|
- pip
|
||||||
|
- pip:
|
||||||
|
- javaobj-py3>=0.4.4
|
||||||
|
- jieba>=0.42.1
|
||||||
|
- jpush>=3.3.9
|
||||||
|
- redis>=5.2.1
|
||||||
|
- opencv-python>=4.11.0.86
|
||||||
|
- pypinyin>=0.55.0
|
||||||
|
- seaborn>=0.13.2
|
||||||
|
- tornado-swagger>=1.4.5
|
||||||
|
- tornado-wtforms>=0.0.1
|
||||||
Reference in New Issue
Block a user