From 4767b6a4791400378fddd2e993299f55449d64cc Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 24 Aug 2026 19:06:14 +0000 Subject: [PATCH] chore: add LICENSE, .env.example, and bump dependency pins - Add MIT LICENSE file (README already referenced this license) - Add .env.example documenting all supported environment overrides - Bump PySide6, mysql-connector-python, python-dotenv to latest compatible patch/minor releases - Point README setup steps at the new .env.example file --- .env.example | 44 ++++++++++++++++++++++++++++++++++++++++++++ LICENSE | 21 +++++++++++++++++++++ README.md | 11 +++++++---- requirements.txt | 6 +++--- 4 files changed, 75 insertions(+), 7 deletions(-) create mode 100644 .env.example create mode 100644 LICENSE diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..156a600 --- /dev/null +++ b/.env.example @@ -0,0 +1,44 @@ +# CIIMS environment configuration reference. +# +# config.py already ships with safe, working defaults for every setting +# below, so CIIMS runs without a .env file. Copy this file to `.env` and +# uncomment/edit only the values you need to override: +# +# cp .env.example .env +# +# See config.example.py for the full list of supported settings. + +# ---- Database ---- +# DB_HOST=localhost +# DB_USER=root +# DB_PASSWORD=your_password +# DB_DATABASE=campus_system +# DB_CHARSET=utf8mb4 +# DB_POOL_SIZE=5 + +# ---- Face recognition (optional - module not bundled, see README) ---- +# FACE_RECOGNITION_MODEL_PATH=model/trainer.yml +# FACE_RECOGNITION_HAAR_CASCADE_PATH=haarcascade_frontalface_default.xml +# FACE_RECOGNITION_CONFIDENCE_THRESHOLD=50 +# FACE_RECOGNITION_PREDICTION_THRESHOLD=70 +# FACE_RECOGNITION_TIMEOUT_SECONDS=30 + +# ---- AI Assistant (optional - leave unset to disable) ---- +# OPENROUTER_API_KEY=your_api_key_here +# OPENROUTER_MODEL=deepseek/deepseek-chat +# OPENROUTER_BASE_URL=https://openrouter.ai/api/v1 +# CIIMS_PROXY_URL=http://127.0.0.1:7897 + +# ---- Application ---- +# APP_NAME=CIIMS +# APP_VERSION=1.0.0 +# DEBUG=False + +# ---- Logging ---- +# LOG_LEVEL=INFO +# LOG_DIR=logs +# LOG_MAX_BYTES=10485760 +# LOG_BACKUP_COUNT=5 + +# ---- Security ---- +# PASSWORD_HASH_ROUNDS=12 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..43b4321 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Bryte + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index e258b0d..ac5080d 100644 --- a/README.md +++ b/README.md @@ -50,8 +50,9 @@ pip install -r requirements.txt 4. Configuration ```bash # config.py already ships with safe, environment-driven defaults. -# Optionally create a .env file (see below) to override database and +# Optionally copy .env.example to .env to override database and # API settings without editing config.py directly. +cp .env.example .env ``` 5. Database setup @@ -114,6 +115,7 @@ ciims/ ├── scripts/ # Utility scripts (sample data generation, etc.) ├── config.py # Runtime configuration (env-driven, no secrets) ├── config.example.py # Reference/documentation for all config options +├── .env.example # Copy to .env to override config.py defaults └── main.py # Application entry point ``` @@ -124,7 +126,7 @@ above. ### License -This project is licensed under the MIT License. +This project is licensed under the [MIT License](LICENSE). --- @@ -178,8 +180,9 @@ pip install -r requirements.txt 4. 配置 ```bash # config.py 已内置基于环境变量的安全默认值,开箱即用。 -# 如需覆盖数据库或 API 设置,可创建 .env 文件(变量说明参见英文部分的 -# Configuration 小节,或直接查看 config.example.py)。 +# 如需覆盖数据库或 API 设置,可复制 .env.example 为 .env(变量说明参见 +# 英文部分的 Configuration 小节,或直接查看 config.example.py)。 +cp .env.example .env ``` 5. 数据库设置 diff --git a/requirements.txt b/requirements.txt index cc8be4b..0200f9d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -PySide6==6.10.3 -mysql-connector-python==9.4.0 -python-dotenv==1.1.1 +PySide6==6.11.2 +mysql-connector-python==9.7.0 +python-dotenv==1.2.3 httpx==0.28.1