2026-07-12 14:17:45 +08:00

158 lines
4.9 KiB
YAML
Raw Permalink 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.

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:
- "*"
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"
- "X-App-Version"
- "X-App-Build-Number"
- "X-Device-Model"
- "X-Device-Manufacturer"
- "X-OS-Version"
- "X-Device-IMEI"
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"
lucky_gift_service_addr: "lucky-gift-service:13013"
game_service_addr: "game-service:13008"
statistics:
base_url: "http://statistics-service:13010"
timeout: "2s"
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_admingateway 只读下发给 App。
mysql_dsn: "hyapp:hyapp@tcp(mysql:3306)/hyapp_admin?parseTime=true&charset=utf8mb4&loc=UTC"
# 房间白名单等低频配置用 Redis 缓存 5 分钟,避免每次列表请求查后台库。
redis_addr: "redis:6379"
redis_password: ""
redis_db: 0
key_prefix: "gateway:app_config:"
cache_ttl: "5m"
finance_notifications:
dingtalk:
enabled: true
webhook_url: "https://oapi.dingtalk.com/robot/send?access_token=08ab491397880d167bb86168749eea5fff35aaf83eac9d033157ea2a7c96573c"
secret: "SEC893f814c59c7dde7916086d7b2a694ebc6796448c622c804ffa2c784c69adc03"
at_mobiles: []
at_all: false
request_timeout: "3s"
leaderboard:
# 活动用户榜单只读 activity-service 写入的 Redis 聚合结果;时间窗口统一按 UTC 计算。
redis_addr: "redis:6379"
redis_password: ""
redis_db: 0
key_prefix: "activity:user_leaderboard"
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
gift_capacity_limit:
# Docker 多 gateway 副本共享 Redis各聚合层在自己的 Cluster slot 内原子扣减,用户层同时占用在途槽。
enabled: true
redis_addr: "redis:6379"
redis_password: ""
redis_db: 0
key_prefix: "gateway:gift:capacity:"
user_bucket_capacity: 5000
user_refill_tokens_per_second: 500
room_bucket_capacity: 20000
room_refill_tokens_per_second: 5000
app_bucket_capacity: 100000
app_refill_tokens_per_second: 25000
max_targets_per_request: 30
max_gift_count_per_request: 999
max_gift_units_per_request: 5000
max_in_flight: 2
in_flight_lease: "10s"
redis_operation_timeout: "500ms"
request_timeout: "5s"
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: 20040101
secret_key: "2f6a5ec58cccf79647557a96c15e6efe89ba5a44c474096bde2589a633fcd45e"
admin_identifier: "administrator"
admin_user_sig_ttl: "24h"
user_sig_ttl: "24h"
endpoint: "adminapisgp.im.qcloud.com"
request_timeout: "5s"
group_id_prefix: "test_"
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: "IKID8OgrsumTzIRO9j8LemiT3eAUceWGslW4"
secret-key: "ZQ5XyJSTJ9sPxLXMD2aFoBOQIzXv9C8s"
bucket-name: "yumi-assets-1420526837"
region: "me-saudi-arabia"
access-url: "https://media.haiyihy.com"