fix: bake test middleware config into image

This commit is contained in:
richjohnrambo
2026-09-14 23:28:07 +08:00
parent 7196d0c839
commit 40510a616e
2 changed files with 47 additions and 47 deletions
+1 -1
View File
@@ -202,7 +202,7 @@ You can specify the following environment variables when issuing `docker run` co
| `FCM_MEASUREMENT_ID` | string | | Google Analytics ID of the form `G-123ABCD789`. | | `FCM_MEASUREMENT_ID` | string | | Google Analytics ID of the form `G-123ABCD789`. |
| `FS_CORS_ORIGINS`[^2] | string | `["*"]` | Cors origins when media is served from the file system. See `AWS_CORS_ORIGINS` for details. | | `FS_CORS_ORIGINS`[^2] | string | `["*"]` | Cors origins when media is served from the file system. See `AWS_CORS_ORIGINS` for details. |
| `ICE_SERVERS_FILE`[^2] | string | | Path to JSON file with configuration of ICE servers to be used for video calls. | | `ICE_SERVERS_FILE`[^2] | string | | Path to JSON file with configuration of ICE servers to be used for video calls. |
| `MEDIA_HANDLER`[^2] | string | `fs` | Handler of large files, either `fs` or `s3`. | | `MEDIA_HANDLER`[^2] | string | `sys_config` | Legacy override for the large file handler. The generated runtime config uses `sys_config` so production can resolve `oss` from backend configuration. |
| `MYSQL_DSN`[^2] | string | <code>'root@tcp(mysql)/tinode?&#8203;parseTime=true&#8203;&collation=utf8mb4_0900_ai_ci'</code> | MySQL [DSN](https://github.com/go-sql-driver/mysql#dsn-data-source-name). | | `MYSQL_DSN`[^2] | string | <code>'root@tcp(mysql)/tinode?&#8203;parseTime=true&#8203;&collation=utf8mb4_0900_ai_ci'</code> | MySQL [DSN](https://github.com/go-sql-driver/mysql#dsn-data-source-name). |
| `PLUGIN_PYTHON_CHAT_BOT_ENABLED`[^2] | bool | `false` | Enable calling into the plugin provided by Python chatbot. | | `PLUGIN_PYTHON_CHAT_BOT_ENABLED`[^2] | bool | `false` | Enable calling into the plugin provided by Python chatbot. |
| `POSTGRES_DSN`[^2] | string | <code>'postgresql://postgres:postgres@&#8203;localhost:5432/tinode?&#8203;sslmode=disable&#8203;&connect_timeout=10'</code> | PostgreSQL [DSN](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING). | | `POSTGRES_DSN`[^2] | string | <code>'postgresql://postgres:postgres@&#8203;localhost:5432/tinode?&#8203;sslmode=disable&#8203;&connect_timeout=10'</code> | PostgreSQL [DSN](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING). |
+46 -46
View File
@@ -15,7 +15,7 @@
"default_country_code": "$DEFAULT_COUNTRY_CODE", "default_country_code": "$DEFAULT_COUNTRY_CODE",
"media": { "media": {
"use_handler": "$MEDIA_HANDLER", "use_handler": "sys_config",
"max_size": 33554432, "max_size": 33554432,
"gc_period": 60, "gc_period": 60,
"gc_block_size": 100, "gc_block_size": 100,
@@ -101,56 +101,56 @@
} }
}, },
"redis": { "redis": {
"addr": "$REDIS_ADDR", "addr": "redis.118im.com:30637",
"username": "$REDIS_USERNAME", "username": "",
"password": "$REDIS_PASSWORD", "password": "HMTJzkm.h>Y+E9ep",
"db": $REDIS_DB, "db": 0,
"key_prefix": "$REDIS_KEY_PREFIX", "key_prefix": "im",
"dial_timeout_ms": $REDIS_DIAL_TIMEOUT_MS, "dial_timeout_ms": 2000,
"read_timeout_ms": $REDIS_READ_TIMEOUT_MS, "read_timeout_ms": 2000,
"write_timeout_ms": $REDIS_WRITE_TIMEOUT_MS, "write_timeout_ms": 2000,
"pending_ttl_seconds": $REDIS_PENDING_TTL_SECONDS, "pending_ttl_seconds": 300,
"done_ttl_seconds": $REDIS_DONE_TTL_SECONDS, "done_ttl_seconds": 86400,
"failed_ttl_seconds": $REDIS_FAILED_TTL_SECONDS, "failed_ttl_seconds": 600,
"hot_message_ttl_seconds": $REDIS_HOT_MESSAGE_TTL_SECONDS, "hot_message_ttl_seconds": 86400,
"presence_ttl_seconds": $REDIS_PRESENCE_TTL_SECONDS, "presence_ttl_seconds": 120,
"cache_ttl_seconds": $REDIS_CACHE_TTL_SECONDS, "cache_ttl_seconds": 300,
"short_state_ttl_seconds": $REDIS_SHORT_STATE_TTL_SECONDS, "short_state_ttl_seconds": 600,
"group_fanout_enabled": $REDIS_GROUP_FANOUT_ENABLED "group_fanout_enabled": true
} }
}, },
"kafka": { "kafka": {
"enabled": $KAFKA_ENABLED, "enabled": true,
"brokers": $KAFKA_BROKERS_JSON, "brokers": ["kafka.118im.com:30835"],
"client_id": "$KAFKA_CLIENT_ID", "client_id": "im-server",
"consumer_group": "$KAFKA_CONSUMER_GROUP", "consumer_group": "im-server",
"dial_timeout_ms": $KAFKA_DIAL_TIMEOUT_MS, "dial_timeout_ms": 3000,
"write_timeout_ms": $KAFKA_WRITE_TIMEOUT_MS, "write_timeout_ms": 3000,
"read_timeout_ms": $KAFKA_READ_TIMEOUT_MS, "read_timeout_ms": 3000,
"batch_timeout_ms": $KAFKA_BATCH_TIMEOUT_MS, "batch_timeout_ms": 10,
"required_acks": $KAFKA_REQUIRED_ACKS, "required_acks": 1,
"allow_auto_topic_creation": $KAFKA_ALLOW_AUTO_TOPIC_CREATION, "allow_auto_topic_creation": false,
"tls_enabled": $KAFKA_TLS_ENABLED, "tls_enabled": false,
"sasl_enabled": $KAFKA_SASL_ENABLED, "sasl_enabled": true,
"sasl_mechanism": "$KAFKA_SASL_MECHANISM", "sasl_mechanism": "SCRAM-SHA-512",
"sasl_username": "$KAFKA_SASL_USERNAME", "sasl_username": "kafka-external",
"sasl_password": "$KAFKA_SASL_PASSWORD", "sasl_password": "gr58tNnlZOVGW3AmMbL2",
"max_retry_count": $KAFKA_MAX_RETRY_COUNT, "max_retry_count": 3,
"retry_backoff_ms": $KAFKA_RETRY_BACKOFF_MS, "retry_backoff_ms": [10000, 30000, 60000, 300000, 900000],
"dead_letter_retention_seconds": $KAFKA_DEAD_LETTER_RETENTION_SECONDS, "dead_letter_retention_seconds": 7776000,
"topics": { "topics": {
"admin_command": "$KAFKA_TOPIC_ADMIN_COMMAND", "admin_command": "im.admin.command",
"admin_command_result": "$KAFKA_TOPIC_ADMIN_COMMAND_RESULT", "admin_command_result": "im.admin.command.result",
"config_event": "$KAFKA_TOPIC_CONFIG_EVENT", "config_event": "im.config.event",
"business_event": "$KAFKA_TOPIC_BUSINESS_EVENT", "business_event": "im.business.event",
"message_persist": "$KAFKA_TOPIC_MESSAGE_PERSIST", "message_persist": "im.message.persist",
"group_message_persist": "$KAFKA_TOPIC_GROUP_MESSAGE_PERSIST", "group_message_persist": "im.group.message.persist",
"message_push": "$KAFKA_TOPIC_MESSAGE_PUSH", "message_push": "im.message.push",
"file_security": "$KAFKA_TOPIC_FILE_SECURITY", "file_security": "im.file.security",
"cache_invalidate": "$KAFKA_TOPIC_CACHE_INVALIDATE", "cache_invalidate": "im.cache.invalidate",
"audit_event": "$KAFKA_TOPIC_AUDIT_EVENT", "audit_event": "im.audit.event",
"dead_letter": "$KAFKA_TOPIC_DEAD_LETTER" "dead_letter": "im.dead.letter"
} }
}, },
"internal_api": { "internal_api": {