refactor(config): 统一版本管理,移除冗余的 app_version 字段
- 移除 config/*.toml 中的 app_version 字段(代码中未使用) - 版本号统一由 Cargo.toml 管理 - Cargo.lock 自动同步更新 - 更新 AGENTS.md 添加版本管理说明
This commit is contained in:
13
AGENTS.md
13
AGENTS.md
@@ -118,6 +118,19 @@ APP_WECHAT_APPID=wx...
|
||||
|
||||
`环境变量 > production.toml > development.toml > default.toml`
|
||||
|
||||
### 版本管理
|
||||
|
||||
**版本号统一在 `Cargo.toml` 中管理**:
|
||||
|
||||
```toml
|
||||
[package]
|
||||
name = "rust-backend"
|
||||
version = "0.3.0" # 唯一版本定义
|
||||
edition = "2024"
|
||||
```
|
||||
|
||||
**不再使用 `app_version` 字段**(已移除)。
|
||||
|
||||
---
|
||||
|
||||
## 数据库
|
||||
|
||||
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -1960,7 +1960,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rust-backend"
|
||||
version = "0.1.0"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"actix-files",
|
||||
"actix-web",
|
||||
|
||||
11
config/default.toml
Normal file
11
config/default.toml
Normal file
@@ -0,0 +1,11 @@
|
||||
database_url = "postgres://milkydata:password@localhost:5432/milkydata_dev"
|
||||
wechat_appid = "wx_test_appid"
|
||||
wechat_secret = "test_secret"
|
||||
jwt_secret = "dev-only-secret-change-in-production"
|
||||
ssl_key_path = ""
|
||||
ssl_cert_path = ""
|
||||
rust_log = "debug"
|
||||
environment = "development"
|
||||
free_user_data_limit = 100
|
||||
server_host = "0.0.0.0"
|
||||
server_ports = [8080, 3000, 8000, 8888]
|
||||
11
config/development.toml
Normal file
11
config/development.toml
Normal file
@@ -0,0 +1,11 @@
|
||||
database_url = "postgres://milkydata:44n6FdB8CdDAk5rk@127.0.0.1:5432/milkydata_dev"
|
||||
wechat_appid = "wx5b00eb90621802f7"
|
||||
wechat_secret = "494efc513faa310bfba588bda2849bfd"
|
||||
jwt_secret = "dev-only-secret-change-in-production"
|
||||
ssl_key_path = ""
|
||||
ssl_cert_path = ""
|
||||
rust_log = "debug"
|
||||
environment = "development"
|
||||
free_user_data_limit = 100
|
||||
server_host = "0.0.0.0"
|
||||
server_ports = [8080, 3000, 8000, 8888]
|
||||
11
config/production.toml
Normal file
11
config/production.toml
Normal file
@@ -0,0 +1,11 @@
|
||||
database_url = "postgres://milkydata:44n6FdB8CdDAk5rk@154.37.213.24:5432/milkydata"
|
||||
wechat_appid = "wx5b00eb90621802f7"
|
||||
wechat_secret = "494efc513faa310bfba588bda2849bfd"
|
||||
jwt_secret = "your_super_secret_key"
|
||||
ssl_key_path = "/etc/ssl/private/private.key"
|
||||
ssl_cert_path = "/etc/ssl/certs/full_chain.pem"
|
||||
rust_log = "info"
|
||||
environment = "production"
|
||||
free_user_data_limit = 20
|
||||
server_host = "0.0.0.0"
|
||||
server_ports = [4433, 8443, 8080, 3000, 8000, 8888]
|
||||
Reference in New Issue
Block a user