Files
imks/.env.example
T
zhenyi e72866db8d feat(config): integrate etcd for service discovery and config management
- Add etcd-client dependency for distributed configuration storage
- Implement EtcdConfig with priority: etcd > environment variables > defaults
- Add ServiceRegistry for service registration with lease keep-alive
- Integrate etcd-based service discovery for appks gRPC connections
- Add service watcher for real-time service instance updates
- Migrate Redis configuration from single URL to cluster node list
- Update Dockerfile with default IMKS_HOST and IMKS_PORT environment variables
- Add etcd bootstrap configuration through environment variables
- Implement Redis cluster URL building with optional authentication
2026-06-11 16:22:23 +08:00

57 lines
1.6 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# =============================================================================
# imks — IM 实时消息服务 环境变量配置
# 复制此文件为 .env 并修改相应值
#
# 配置优先级: etcd > 环境变量 > 默认值
# =============================================================================
# --- etcd 连接(启动引导,必须从环境变量读取)---
ETCD_ENDPOINTS=http://localhost:2379
ETCD_KEY_PREFIX=/appks/
# --- 服务自身 ---
# 注册到 etcd 的地址
# IMKS_ADDR=0.0.0.0:3000
# --- 部署模式 ---
# Adapter: "local" (单节点) | "redis" | "nats"
IMKS_ADAPTER=redis
# 当前节点唯一标识
# IMKS_SERVER_ID=imks-node-1
# Redis Cluster 节点列表(逗号分隔 host:port)
IMKS_REDIS_CLUSTER_NODES=localhost:6379,localhost:6380,localhost:6381,localhost:6382,localhost:6383,localhost:6384
# Redis 密码(可选)
# IMKS_REDIS_PASSWORD=
# NATS 连接(IMKS_ADAPTER=nats 时使用)
# IMKS_NATS_URL=nats://localhost:4222
# --- WebTransport (QUIC) ---
# IMKS_WT_ENABLED=false
# IMKS_WT_PORT=3001
# IMKS_WT_CERT_PATH=/etc/imks/cert.pem
# IMKS_WT_KEY_PATH=/etc/imks/key.pem
# --- 数据库 ---
# DATABASE_URL=postgres://imks:password@localhost:5432/imks
DATABASE_URL=postgres://localhost/imks
# DATABASE_MAX_CONNECTIONS=10
# DATABASE_MIN_CONNECTIONS=2
# --- appks gRPC 连接 ---
# fallbackimks 优先通过 etcd 发现 appks 地址
# APPKS_GRPC_ADDR=http://localhost:50051
# APPKS_GRPC_TIMEOUT=10
# --- OpenTelemetry 可观测性 ---
# OTEL_SERVICE_NAME=imks
# OTEL_SERVICE_VERSION=0.1.0
# OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
# --- 日志 ---
RUST_LOG=info