image:
  repository: tccr.io/truecharts/umami
  tag: 1.40.0@sha256:ea8ec5f2e91ffb6f7033c47769366c572d88058919a9a64d539eab4fef9c1497
  pullPolicy: IfNotPresent

securityContext:
  readOnlyRootFilesystem: false

podSecurityContext:
  runAsUser: 1001
  runAsGroup: 1001

envFrom:
  - secretRef:
      name: '{{ include "tc.common.names.fullname" . }}-secret'

umami:
  force_ssl: true
  hostname: ""
  client_ip_header: ""
  remove_trailing_slash: true
  tracker_script_name: umami
  collect_api_endpoint: /api/collect
  disable_updates: true
  disable_login: false
  disable_telemetry: true
  ignore_ip:
    - "1.1.1.1"
    - "2.2.2.2"

env:
  PORT: "{{ .Values.service.main.ports.main.port }}"
  DATABASE_TYPE: postgresql
  DATABASE_URL:
    secretKeyRef:
      name: dbcreds
      key: url
  FORCE_SSL: '{{ ternary "1" "0" .Values.umami.force_ssl }}'
  HOSTNAME: "{{ .Values.umami.hostname }}"
  CLIENT_IP_HEADER: "{{ .Values.umami.client_ip_header }}"
  REMOVE_TRAILING_SLASH: '{{ ternary "1" "0" .Values.umami.remove_trailing_slash }}'
  TRACKER_SCRIPT_NAME: "{{ .Values.umami.tracker_script_name }}"
  COLLECT_API_ENDPOINT: "{{ .Values.umami.collect_api_endpoint }}"
  DISABLE_UPDATES: '{{ ternary "1" "0" .Values.umami.disable_updates }}'
  DISABLE_LOGIN: '{{ ternary "1" "0" .Values.umami.disable_login }}'
  DISABLE_TELEMETRY: '{{ ternary "1" "0" .Values.umami.disable_telemetry }}'
  IGNORE_IP: '{{ join "," .Values.umami.ignore_ip }}'

service:
  main:
    ports:
      main:
        port: 10381
        protocol: HTTP

postgresql:
  enabled: true
  existingSecret: "dbcreds"
  postgresqlUsername: umami
  postgresqlDatabase: umami

portal:
  enabled: true
