diff --git a/AGENTS.md b/AGENTS.md index 7262c62..e4e1192 100644 --- a/AGENTS.md +++ b/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` 字段**(已移除)。 + --- ## 数据库 diff --git a/Cargo.lock b/Cargo.lock index 49534c0..b452df1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1960,7 +1960,7 @@ dependencies = [ [[package]] name = "rust-backend" -version = "0.1.0" +version = "0.3.0" dependencies = [ "actix-files", "actix-web", diff --git a/config/default.toml b/config/default.toml new file mode 100644 index 0000000..6c60aea --- /dev/null +++ b/config/default.toml @@ -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] \ No newline at end of file diff --git a/config/development.toml b/config/development.toml new file mode 100644 index 0000000..6419f75 --- /dev/null +++ b/config/development.toml @@ -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] \ No newline at end of file diff --git a/config/production.toml b/config/production.toml new file mode 100644 index 0000000..022882c --- /dev/null +++ b/config/production.toml @@ -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] \ No newline at end of file