refactor: 启用 conf.UseEnv 并将 etc 配置统一为 env 占位

This commit is contained in:
zetaloop
2026-05-03 07:14:28 +08:00
parent 87bf86a410
commit 429a1df32a
45 changed files with 181 additions and 435 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ func main() {
flag.Parse()
var c config.Config
conf.MustLoad(*configFile, &c)
conf.MustLoad(*configFile, &c, conf.UseEnv())
server := rest.MustNewServer(c.RestConf)
server.Use(middlewares.NewHeaderExtractorMiddleware().Handle)
+8 -4
View File
@@ -7,13 +7,17 @@ Prometheus:
Port: 4001
Path: /metrics
# ===== DEV CONFIG =====
DisputeRpcConf:
Endpoints:
- dispute-rpc:8080
- "${DISPUTE_RPC_TARGET}"
OrderRpcConf:
Endpoints:
- order-rpc:8080
- "${ORDER_RPC_TARGET}"
PlayerRpcConf:
Endpoints:
- player-rpc:8080
- "${PLAYER_RPC_TARGET}"
Log:
Level: debug
+4 -4
View File
@@ -6,18 +6,18 @@ Prometheus:
Port: 4001
Path: /metrics
# ===== DEV CONF =====
SnowflakeRpcConf:
Endpoints:
- snowflake:8080
- "${SNOWFLAKE_RPC_TARGET}"
DB:
Master: "postgresql://${PD_USERNAME}:${DB_PASSWORD}@postgres:${DB_PORT}/${DB_NAME}?sslmode=disable"
Slaves: "postgresql://${PD_USERNAME}:${DB_PASSWORD}@postgres:${DB_PORT}/${DB_NAME}?sslmode=disable"
Master: "postgresql://${PD_USERNAME}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}?sslmode=disable"
Slaves: "postgresql://${PD_USERNAME}:${DB_PASSWORD}@${DB_HOST_RO}:${DB_PORT}/${DB_NAME}?sslmode=disable"
CacheConf:
- Host: "${REDIS_HOST}:${REDIS_PORT}"
Type: node
Pass: "${REDIS_PASSWORD}"
Log:
Level: debug