feat(blocky): add support for more query logging options, including postgresql (#7760)
* feat(blocky): add support for more query logging options, including postgresql * std fix * handle database differently
This commit is contained in:
@@ -3,11 +3,11 @@ appVersion: "0.20.0"
|
||||
dependencies:
|
||||
- name: common
|
||||
repository: https://library-charts.truecharts.org
|
||||
version: 12.2.20
|
||||
version: 12.2.22
|
||||
- condition: redis.enabled
|
||||
name: redis
|
||||
repository: https://deps.truecharts.org
|
||||
version: 6.0.11
|
||||
version: 6.0.13
|
||||
description: Blocky is a DNS proxy, DNS enhancer and ad-blocker for the local network written in Go
|
||||
home: https://truecharts.org/charts/enterprise/blocky
|
||||
icon: https://truecharts.org/img/hotlink-ok/chart-icons/blocky.png
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
queryLog:
|
||||
# optional one of: mysql, postgresql, csv, csv-client. If empty, log to console
|
||||
type: "postgresql"
|
||||
@@ -547,6 +547,48 @@ questions:
|
||||
schema:
|
||||
type: string
|
||||
default: 30m
|
||||
- variable: queryLog
|
||||
group: App Configuration
|
||||
label: Query Logging configuration
|
||||
schema:
|
||||
additional_attrs: true
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: type
|
||||
label: Type
|
||||
schema:
|
||||
type: string
|
||||
default: ""
|
||||
enum:
|
||||
- value: ""
|
||||
description: Console
|
||||
- value: postgresql
|
||||
description: postgresql
|
||||
- value: csv
|
||||
description: csv
|
||||
- value: csv-client
|
||||
description: csv-client
|
||||
- variable: target
|
||||
label: Target
|
||||
schema:
|
||||
type: string
|
||||
show_if: [["type", "!=", "postgresql"]]
|
||||
default: "/var/log/something"
|
||||
- variable: logRetentionDays
|
||||
label: Log Retention Days
|
||||
schema:
|
||||
type: int
|
||||
default: 0
|
||||
- variable: creationAttempts
|
||||
label: Creation Attempts
|
||||
schema:
|
||||
type: int
|
||||
default: 3
|
||||
- variable: creationCooldown
|
||||
label: Creation Cooldown
|
||||
schema:
|
||||
type: string
|
||||
default: 2s
|
||||
- variable: k8sgateway
|
||||
group: App Configuration
|
||||
label: k8s-Gateway Configuration
|
||||
|
||||
@@ -24,7 +24,7 @@ queryLog:
|
||||
# directory (should be mounted as volume in docker) for csv, db connection string for mysql/postgresql
|
||||
#postgresql target: postgres://user:password@db_host_or_ip:5432/db_name
|
||||
{{- if eq .Values.queryLog.type "postgresql" }}
|
||||
target: {{ .Values.cnpg.creds.std }}
|
||||
target: {{ .Values.cnpg.main.creds.std }}
|
||||
{{- else }}
|
||||
target: {{ .Values.queryLog.target }}
|
||||
{{- end }}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
{{/* Make sure all variables are set properly */}}
|
||||
{{- if eq .Values.queryLog.type "postgresql" -}}
|
||||
{{- $_ := set .Values.cnpg.main "enabled" true -}}
|
||||
{{- end }}
|
||||
{{- include "tc.v1.common.loader.init" . }}
|
||||
|
||||
|
||||
|
||||
@@ -350,7 +350,7 @@ redis:
|
||||
queryLog:
|
||||
# optional one of: mysql, postgresql, csv, csv-client. If empty, log to console
|
||||
type: ""
|
||||
# directory (should be mounted as volume in docker) for csv, db connection string for mysql/postgresql
|
||||
# directory (should be mounted as volume in docker) for csv, db connection string for mysql, ignored for included postgresql
|
||||
# target: /var/log/something
|
||||
# postgresql target: postgres://user:password@db_host_or_ip:5432/db_name
|
||||
# if > 0, deletes log files which are older than ... days
|
||||
@@ -362,6 +362,6 @@ queryLog:
|
||||
|
||||
cnpg:
|
||||
main:
|
||||
enabled: true
|
||||
enabled: false
|
||||
user: blocky
|
||||
database: blocky
|
||||
|
||||
Reference in New Issue
Block a user