修复日志持久化可靠性与数据库安全默认值

This commit is contained in:
2026-07-13 11:27:34 +08:00
parent db325ec413
commit 6f37165256
10 changed files with 612 additions and 75 deletions
+10 -2
View File
@@ -32,8 +32,16 @@ func TestComposeUsesSafeDeploymentDefaults(t *testing.T) {
t.Fatal("compose.yml is missing the thief_clickhouse service")
}
clickhouseService := compose[serviceStart:]
if strings.Contains(clickhouseService, "\n ports:") {
t.Error("ClickHouse must not publish host ports by default")
for _, port := range []string{
`${CLICKHOUSE_LISTEN_IP:-127.0.0.1}:${CLICKHOUSE_HTTP_PORT:-8123}:8123`,
`${CLICKHOUSE_LISTEN_IP:-127.0.0.1}:${CLICKHOUSE_NATIVE_PORT:-9000}:9000`,
} {
if !strings.Contains(clickhouseService, port) {
t.Errorf("ClickHouse port must bind to loopback by default with %q", port)
}
}
if !strings.Contains(envExample, "CLICKHOUSE_LISTEN_IP=127.0.0.1\n") {
t.Error(".env.example must bind ClickHouse to loopback by default")
}
for _, emptySecret := range []string{"CLICKHOUSE_URL=\n", "CLICKHOUSE_PASSWORD=\n"} {