service_name: gateway-service node_id: gateway-docker environment: local log: level: info format: json include_request_body: false include_response_body: false max_payload_bytes: 2048 http_addr: ":13000" cors: enabled: true allowed_origins: - "http://localhost:3000" - "http://127.0.0.1:3000" - "http://localhost:5173" - "http://127.0.0.1:5173" - "https://global-interaction.com" - "https://www.global-interaction.com" - "https://api.global-interaction.com" allowed_methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"] allowed_headers: - "Authorization" - "Content-Type" - "X-Request-ID" - "X-App-Code" - "X-HY-App-Code" - "X-App-Package" - "X-Package-Name" - "X-App-Bundle-ID" - "X-Bundle-ID" - "X-App-Platform" - "X-Platform" expose_headers: ["X-Request-ID"] allow_credentials: true max_age_sec: 600 jwt_secret: "dev-shared-secret" room_service_addr: "room-service:13001" user_service_addr: "user-service:13005" wallet_service_addr: "wallet-service:13004" activity_service_addr: "activity-service:13006" game_service_addr: "game-service:13008" grpc_client: # Docker 本地也使用生产同形态的 deadline、keepalive 和窄重试策略。 default_timeout: "5s" connect_timeout: "2s" keepalive_time: "30s" keepalive_timeout: "10s" retry_max_attempts: 2 retry_initial_backoff: "100ms" retry_max_backoff: "500ms" retry_backoff_multiplier: 2 retryable_status_codes: ["UNAVAILABLE"] app_config: # App 运行时配置由后台 APP配置写入 hyapp_admin,gateway 只读下发给 App。 mysql_dsn: "hyapp:hyapp@tcp(mysql:3306)/hyapp_admin?parseTime=true&charset=utf8mb4&loc=UTC" leaderboard: # 活动用户榜单只读 wallet_transactions 的送礼事实;时间窗口统一按 UTC 计算。 wallet_mysql_dsn: "hyapp:hyapp@tcp(mysql:3306)/hyapp_wallet?parseTime=true&charset=utf8mb4&loc=UTC" auth_rate_limit: # public auth 固定窗口频控;Redis 不可用时 gateway 启动失败,避免失去入口保护。 enabled: true redis_addr: "redis:6379" redis_password: "" redis_db: 0 key_prefix: "gateway:auth:rate:" window_sec: 60 ip_limit: 120 device_id_limit: 30 provider_ip_limit: 20 display_user_id_ip_limit: 10 display_user_id_limit: 50 session_id_ip_limit: 30 login_risk: enabled: true redis_addr: "redis:6379" redis_password: "" redis_db: 0 key_prefix: "login_risk:ip:" fast_guard: blocked_languages: [] blocked_language_primary_tags: [] blocked_timezones: [] blocked_timezone_prefixes: [] tencent_im: # Docker 本地联调腾讯云 IM UserSig;必须与 room-service 使用同一组应用配置。 sdk_app_id: 20036101 secret_key: "dcdf53135f27e7cf8541c4ae9798fb0cb2f0e4d6c5c20022dbaea053f35cbb8c" admin_identifier: "900100100" admin_user_sig_ttl: "24h" user_sig_ttl: "24h" endpoint: "adminapisgp.im.qcloud.com" request_timeout: "5s" callback_url: "" callback_auth_token: "" tencent_rtc: # Docker 本地联调腾讯 RTC UserSig;当前复用同一腾讯应用,后续可独立切换。 enabled: true sdk_app_id: 20036101 secret_key: "dcdf53135f27e7cf8541c4ae9798fb0cb2f0e4d6c5c20022dbaea053f35cbb8c" user_sig_ttl: "2h" room_id_type: "string" app_scene: "voice_chat_room" callback_url: "" callback_sign_key: "" tencent-cos: # Docker 本地联调 App 文件/头像上传;secret 只保存在 gateway 服务端配置。 enabled: true secret-id: "IKIDMchhZEfrsiNo472DAtTpzzmLjttkOnyu" secret-key: "nMkbLsGRO6ZqulSyJQJ0UjjU0KSKxOgl" bucket-name: "yumi-assets-1420526837" region: "me-saudi-arabia" access-url: "https://media.haiyihy.com"