Skip to content

Commit 530d15d

Browse files
committed
add clickhouse, mongodb, fix env vars and rate limiting config
1 parent 332a979 commit 530d15d

6 files changed

Lines changed: 197 additions & 16 deletions

File tree

charts/logtide/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: logtide
33
description: A Helm chart for LogTide - Open-source log management and SIEM platform
44
type: application
5-
version: 2.0.8
5+
version: 2.1.0
66
appVersion: "0.8.4"
77

88
home: https://logtide.dev

charts/logtide/templates/backend-deployment.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,28 @@ spec:
8080
- name: REDIS_URL
8181
value: "redis://$(REDIS_HOST):$(REDIS_PORT)"
8282
{{- end }}
83+
{{- if eq .Values.config.storageEngine "clickhouse" }}
84+
- name: CLICKHOUSE_PASSWORD
85+
valueFrom:
86+
secretKeyRef:
87+
name: {{ if .Values.clickhouse.existingSecret }}{{ .Values.clickhouse.existingSecret }}{{ else }}{{ include "logtide.fullname" . }}-clickhouse{{ end }}
88+
key: {{ .Values.clickhouse.existingSecretPasswordKey }}
89+
{{- end }}
90+
{{- if eq .Values.config.storageEngine "mongodb" }}
91+
{{- if .Values.mongodb.uri }}
92+
- name: MONGODB_URI
93+
valueFrom:
94+
secretKeyRef:
95+
name: {{ if .Values.mongodb.existingSecret }}{{ .Values.mongodb.existingSecret }}{{ else }}{{ include "logtide.fullname" . }}-mongodb{{ end }}
96+
key: {{ if .Values.mongodb.existingSecret }}{{ .Values.mongodb.existingSecretPasswordKey }}{{ else }}uri{{ end }}
97+
{{- else }}
98+
- name: MONGODB_PASSWORD
99+
valueFrom:
100+
secretKeyRef:
101+
name: {{ if .Values.mongodb.existingSecret }}{{ .Values.mongodb.existingSecret }}{{ else }}{{ include "logtide.fullname" . }}-mongodb{{ end }}
102+
key: {{ .Values.mongodb.existingSecretPasswordKey }}
103+
{{- end }}
104+
{{- end }}
83105
{{- if .Values.backend.livenessProbe.enabled }}
84106
livenessProbe:
85107
httpGet:

charts/logtide/templates/configmap.yaml

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ data:
88
NODE_ENV: {{ .Values.config.nodeEnv | quote }}
99
LOG_LEVEL: {{ .Values.config.logLevel | quote }}
1010

11-
# Rate Limiting
12-
RATE_LIMIT_AUTH: {{ .Values.config.rateLimit.auth | quote }}
13-
RATE_LIMIT_INGESTION: {{ .Values.config.rateLimit.ingestion | quote }}
11+
# Storage engine
12+
STORAGE_ENGINE: {{ .Values.config.storageEngine | quote }}
1413

15-
# Retention
16-
RETENTION_LOGS_DAYS: {{ .Values.config.retention.logs | quote }}
17-
RETENTION_ALERTS_DAYS: {{ .Values.config.retention.alerts | quote }}
18-
RETENTION_INCIDENTS_DAYS: {{ .Values.config.retention.incidents | quote }}
14+
# Proxy & URLs
15+
TRUST_PROXY: {{ .Values.config.trustProxy | quote }}
16+
{{- if .Values.config.frontendUrl }}
17+
FRONTEND_URL: {{ .Values.config.frontendUrl | quote }}
18+
{{- else if .Values.ingress.enabled }}
19+
FRONTEND_URL: "https://{{ (index .Values.ingress.hosts 0).host }}"
20+
{{- end }}
1921

2022
# CORS
2123
{{- if .Values.config.corsOrigins }}
@@ -24,6 +26,24 @@ data:
2426
CORS_ORIGINS: "https://{{ (index .Values.ingress.hosts 0).host }}"
2527
{{- end }}
2628

29+
# Caching
30+
CACHE_ENABLED: {{ .Values.config.cache.enabled | quote }}
31+
CACHE_TTL: {{ .Values.config.cache.ttl | quote }}
32+
33+
# General rate limiting
34+
RATE_LIMIT_MAX: {{ .Values.config.rateLimit.max | quote }}
35+
RATE_LIMIT_WINDOW: {{ .Values.config.rateLimit.window | quote }}
36+
37+
# Auth rate limiting
38+
AUTH_RATE_LIMIT_REGISTER: {{ .Values.config.authRateLimit.register | quote }}
39+
AUTH_RATE_LIMIT_LOGIN: {{ .Values.config.authRateLimit.login | quote }}
40+
AUTH_RATE_LIMIT_WINDOW: {{ .Values.config.authRateLimit.window | quote }}
41+
42+
# Retention
43+
RETENTION_LOGS_DAYS: {{ .Values.config.retention.logs | quote }}
44+
RETENTION_ALERTS_DAYS: {{ .Values.config.retention.alerts | quote }}
45+
RETENTION_INCIDENTS_DAYS: {{ .Values.config.retention.incidents | quote }}
46+
2747
# SMTP Configuration
2848
{{- if .Values.config.smtp.enabled }}
2949
SMTP_ENABLED: "true"
@@ -32,3 +52,24 @@ data:
3252
SMTP_SECURE: {{ .Values.config.smtp.secure | quote }}
3353
SMTP_FROM: {{ .Values.config.smtp.from | quote }}
3454
{{- end }}
55+
56+
# ClickHouse (when storageEngine: clickhouse)
57+
{{- if eq .Values.config.storageEngine "clickhouse" }}
58+
CLICKHOUSE_HOST: {{ .Values.clickhouse.host | quote }}
59+
CLICKHOUSE_PORT: {{ .Values.clickhouse.port | quote }}
60+
CLICKHOUSE_DATABASE: {{ .Values.clickhouse.database | quote }}
61+
CLICKHOUSE_USERNAME: {{ .Values.clickhouse.username | quote }}
62+
{{- end }}
63+
64+
# MongoDB (when storageEngine: mongodb)
65+
{{- if eq .Values.config.storageEngine "mongodb" }}
66+
{{- if not .Values.mongodb.uri }}
67+
MONGODB_HOST: {{ .Values.mongodb.host | quote }}
68+
MONGODB_PORT: {{ .Values.mongodb.port | quote }}
69+
MONGODB_DATABASE: {{ .Values.mongodb.database | quote }}
70+
MONGODB_USERNAME: {{ .Values.mongodb.username | quote }}
71+
{{- if .Values.mongodb.authSource }}
72+
MONGODB_AUTH_SOURCE: {{ .Values.mongodb.authSource | quote }}
73+
{{- end }}
74+
{{- end }}
75+
{{- end }}

charts/logtide/templates/secrets.yaml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ data:
1414
API_KEY_SECRET: {{ $apiKeySecret | b64enc | quote }}
1515
{{- if and .Values.config.smtp.enabled (not .Values.config.smtp.existingSecret) }}
1616
SMTP_USER: {{ .Values.config.smtp.user | b64enc | quote }}
17-
SMTP_PASSWORD: {{ .Values.config.smtp.password | b64enc | quote }}
17+
SMTP_PASS: {{ .Values.config.smtp.pass | b64enc | quote }}
18+
{{- end }}
19+
{{- if .Values.config.initialAdmin.email }}
20+
INITIAL_ADMIN_EMAIL: {{ .Values.config.initialAdmin.email | b64enc | quote }}
21+
INITIAL_ADMIN_PASSWORD: {{ .Values.config.initialAdmin.password | b64enc | quote }}
22+
INITIAL_ADMIN_NAME: {{ .Values.config.initialAdmin.name | b64enc | quote }}
1823
{{- end }}
1924
---
2025
{{- if .Values.timescaledb.enabled }}
@@ -68,3 +73,31 @@ type: Opaque
6873
data:
6974
password: {{ .Values.externalRedis.password | b64enc | quote }}
7075
{{- end }}
76+
---
77+
{{- if and (eq .Values.config.storageEngine "clickhouse") (not .Values.clickhouse.existingSecret) .Values.clickhouse.host }}
78+
apiVersion: v1
79+
kind: Secret
80+
metadata:
81+
name: {{ include "logtide.fullname" . }}-clickhouse
82+
labels:
83+
{{- include "logtide.labels" . | nindent 4 }}
84+
type: Opaque
85+
data:
86+
password: {{ .Values.clickhouse.password | b64enc | quote }}
87+
{{- end }}
88+
---
89+
{{- if and (eq .Values.config.storageEngine "mongodb") (not .Values.mongodb.existingSecret) }}
90+
apiVersion: v1
91+
kind: Secret
92+
metadata:
93+
name: {{ include "logtide.fullname" . }}-mongodb
94+
labels:
95+
{{- include "logtide.labels" . | nindent 4 }}
96+
type: Opaque
97+
data:
98+
{{- if .Values.mongodb.uri }}
99+
uri: {{ .Values.mongodb.uri | b64enc | quote }}
100+
{{- else }}
101+
password: {{ .Values.mongodb.password | b64enc | quote }}
102+
{{- end }}
103+
{{- end }}

charts/logtide/templates/worker-deployment.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,28 @@ spec:
8484
- name: REDIS_URL
8585
value: "redis://$(REDIS_HOST):$(REDIS_PORT)"
8686
{{- end }}
87+
{{- if eq .Values.config.storageEngine "clickhouse" }}
88+
- name: CLICKHOUSE_PASSWORD
89+
valueFrom:
90+
secretKeyRef:
91+
name: {{ if .Values.clickhouse.existingSecret }}{{ .Values.clickhouse.existingSecret }}{{ else }}{{ include "logtide.fullname" . }}-clickhouse{{ end }}
92+
key: {{ .Values.clickhouse.existingSecretPasswordKey }}
93+
{{- end }}
94+
{{- if eq .Values.config.storageEngine "mongodb" }}
95+
{{- if .Values.mongodb.uri }}
96+
- name: MONGODB_URI
97+
valueFrom:
98+
secretKeyRef:
99+
name: {{ if .Values.mongodb.existingSecret }}{{ .Values.mongodb.existingSecret }}{{ else }}{{ include "logtide.fullname" . }}-mongodb{{ end }}
100+
key: {{ if .Values.mongodb.existingSecret }}{{ .Values.mongodb.existingSecretPasswordKey }}{{ else }}uri{{ end }}
101+
{{- else }}
102+
- name: MONGODB_PASSWORD
103+
valueFrom:
104+
secretKeyRef:
105+
name: {{ if .Values.mongodb.existingSecret }}{{ .Values.mongodb.existingSecret }}{{ else }}{{ include "logtide.fullname" . }}-mongodb{{ end }}
106+
key: {{ .Values.mongodb.existingSecretPasswordKey }}
107+
{{- end }}
108+
{{- end }}
87109
resources:
88110
{{- toYaml .Values.worker.resources | nindent 12 }}
89111
{{- with .Values.worker.nodeSelector }}

charts/logtide/values.yaml

Lines changed: 70 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ ingress:
188188
# - logtide.example.com
189189

190190
# =============================================================================
191-
# TIMESCALEDB CONFIGURATION
191+
# TIMESCALEDB CONFIGURATION (embedded - used when storageEngine: timescale)
192192
# =============================================================================
193193
timescaledb:
194194
# Use embedded TimescaleDB StatefulSet
@@ -232,7 +232,7 @@ timescaledb:
232232
tolerations: []
233233
affinity: {}
234234

235-
# External database (if timescaledb.enabled: false)
235+
# External PostgreSQL/TimescaleDB (if timescaledb.enabled: false)
236236
externalDatabase:
237237
host: ""
238238
port: 5432
@@ -243,6 +243,38 @@ externalDatabase:
243243
existingSecret: ""
244244
existingSecretPasswordKey: "password"
245245

246+
# =============================================================================
247+
# CLICKHOUSE CONFIGURATION (used when storageEngine: clickhouse)
248+
# =============================================================================
249+
clickhouse:
250+
# Connection to an external ClickHouse instance
251+
host: ""
252+
port: 8123
253+
database: logtide
254+
username: default
255+
password: ""
256+
# Use existing secret for the password
257+
existingSecret: ""
258+
existingSecretPasswordKey: "password"
259+
260+
# =============================================================================
261+
# MONGODB CONFIGURATION (used when storageEngine: mongodb)
262+
# =============================================================================
263+
mongodb:
264+
# Option 1: full connection URI (takes precedence over individual settings)
265+
# e.g. "mongodb://user:pass@host:27017/logtide?authSource=admin"
266+
uri: ""
267+
# Option 2: individual connection settings
268+
host: ""
269+
port: 27017
270+
database: logtide
271+
username: ""
272+
password: ""
273+
authSource: ""
274+
# Use existing secret for uri or password
275+
existingSecret: ""
276+
existingSecretPasswordKey: "password"
277+
246278
# =============================================================================
247279
# REDIS CONFIGURATION
248280
# =============================================================================
@@ -295,6 +327,20 @@ config:
295327
# Log level (debug, info, warn, error)
296328
logLevel: info
297329

330+
# Storage engine: timescale | clickhouse | mongodb
331+
# - timescale: uses the embedded or external TimescaleDB (default)
332+
# - clickhouse: uses external ClickHouse (configure clickhouse section)
333+
# - mongodb: uses external MongoDB (configure mongodb section)
334+
storageEngine: timescale
335+
336+
# Trust reverse proxy headers (X-Forwarded-For, X-Forwarded-Proto)
337+
# Set to true when running behind nginx/traefik ingress
338+
trustProxy: true
339+
340+
# Frontend URL for OIDC redirects
341+
# Defaults to https://{ingress-host} when ingress is enabled
342+
frontendUrl: ""
343+
298344
# JWT secret for authentication (auto-generated if empty)
299345
jwtSecret: ""
300346

@@ -305,13 +351,24 @@ config:
305351
# Used to encrypt API keys at rest. Must be at least 32 characters.
306352
apiKeySecret: ""
307353

308-
# CORS origins (comma-separated)
354+
# CORS origins (comma-separated). Defaults to ingress host when enabled.
309355
corsOrigins: ""
310356

311-
# Rate limiting
357+
# Response caching
358+
cache:
359+
enabled: true
360+
ttl: 60 # seconds
361+
362+
# General rate limiting
312363
rateLimit:
313-
auth: 10 # requests per 15 minutes
314-
ingestion: 200 # requests per minute
364+
max: 1000 # requests per window
365+
window: 60000 # window in ms (1 minute)
366+
367+
# Auth-specific rate limiting
368+
authRateLimit:
369+
register: 10 # registrations per window
370+
login: 20 # login attempts per window
371+
window: 900000 # window in ms (15 minutes)
315372

316373
# Retention policy (days)
317374
retention:
@@ -326,11 +383,17 @@ config:
326383
port: 587
327384
secure: false
328385
user: ""
329-
password: ""
386+
pass: ""
330387
from: "noreply@logtide.dev"
331388
# Use existing secret for SMTP credentials
332389
existingSecret: ""
333390

391+
# Initial admin user (created on first deployment if no users exist)
392+
initialAdmin:
393+
email: ""
394+
password: ""
395+
name: ""
396+
334397
# =============================================================================
335398
# MONITORING & OBSERVABILITY
336399
# =============================================================================

0 commit comments

Comments
 (0)