feat(config): integrate etcd-based configuration management

- Add etcd-client dependency with TLS support
- Implement EtcdConfig struct for reading config values with priority: etcd > env > default
- Add ServiceRegistry for service discovery registration in etcd
- Create from_etcd method in AppConfig for loading SMTP configuration
- Update main.rs to use etcd-based config loading with fallback mechanism
- Add etcd module with client connection and key-value operations
- Modify Dockerfile to use cargo-chef for faster builds
- Add docker-compose.yaml for emailks service deployment
- Include AGENTS.md with development guidelines and best practices
- Add build.sh script for podman-based container building
- Update dependencies in Cargo.toml and Cargo.lock
This commit is contained in:
zhenyi
2026-06-12 16:21:04 +08:00
parent c4824ef261
commit 7b8d0714e7
10 changed files with 759 additions and 51 deletions
+4
View File
@@ -12,9 +12,12 @@ name = "emailks"
path = "main.rs"
[dependencies]
dotenvy = "0.15"
etcd-client = { version = "0.18", features = ["tls"] }
lettre = { version = "0.11", features = ["tokio1-native-tls"] }
prost = "0.14"
prost-types = "0.14"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tokio = { version = "1", features = ["rt-multi-thread", "macros", "sync", "signal"] }
tokio-stream = { version = "0.1", features = ["sync"] }
tonic = "0.14"
@@ -22,6 +25,7 @@ tonic-health = "0.14"
tonic-prost = "0.14"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
uuid = { version = "1", features = ["v7"] }
[build-dependencies]
tonic-prost-build = "0.14"