#
# IMPORTANT NOTE
#
# This chart inherits from our common library chart. You can check the default values/options here:
# https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common/values.yaml
#

image:
  # -- image repository
  repository: klutchell/dnscrypt-proxy
  # -- image tag. Use "main" if you want to be able to use DNS probes
  # @default -- chart.appVersion
  tag:
  # -- image pull policy. Set to Slways if you used "main" as tag
  pullPolicy: IfNotPresent

# -- environment variables. See more environment variables in the [dnscrypt-proxy documentation](https://dnscrypt-proxy.org/docs).
# @default -- See below
env:
  # -- Set the container timezone
  TZ: UTC

# -- Configures service settings for the chart.
# @default -- See values.yaml
service:
  main:
    enabled: false
  dns-udp:
    enabled: true
    type: ClusterIP
    ports:
      dns-udp:
        enabled: true
        port: 53
        targetPort: 5353
        protocol: UDP
  dns-tcp:
    enabled: true
    type: ClusterIP
    primary: true
    ports:
      dns-tcp:
        enabled: true
        port: 53
        targetPort: 5353
        protocol: TCP
        primary: true

probes:
  readiness:
    custom: true
    spec:
      timeoutSeconds: 1
      failureThreshold: 1
      periodSeconds: 5
      exec:
        command:
          - /usr/local/bin/dnsprobe
          - google.com
          - 127.0.0.1:5353
  liveness:
    custom: true
    spec:
      timeoutSeconds: 3
      failureThreshold: 3
      periodSeconds: 5
      initialDelaySeconds: 30
      exec:
        command:
          - /usr/local/bin/dnsprobe
          - google.com
          - 127.0.0.1:5353
  startup:
    custom: true
    spec:
      timeoutSeconds: 3
      failureThreshold: 10
      periodSeconds: 5
      initialDelaySeconds: 10
      exec:
        command:
          - /usr/local/bin/dnsprobe
          - google.com
          - 127.0.0.1:5353

ingress:
  # -- Enable and configure ingress settings for the chart under this key.
  # @default -- See values.yaml
  main:
    enabled: false

# -- Configure persistence settings for the chart under this key.
# @default -- See values.yaml
persistence:
  {}
  # data:
  #   enabled: false
  #   mountPath: /data

controller:
  replicas: 1

# -- Configure configMaps for the chart here.
# Additional configMaps can be added by adding a dictionary key similar to the 'config' object.
# @default -- See below
configmap:
  config:
    # -- Enables or disables the configMap
    enabled: false
    # -- Labels to add to the configMap
    labels: {}
    # -- Annotations to add to the configMap
    annotations: {}
    # -- configMap data content. Helm template enabled.
    data:
      # -- Configuration
      # This is a simple configuration. You can find a sample config here :
      # https://github.com/DNSCrypt/dnscrypt-proxy/blob/master/dnscrypt-proxy/example-dnscrypt-proxy.toml
      # And the manual : https://github.com/DNSCrypt/dnscrypt-proxy/wiki
      dnscrypt-proxy.toml: |
        listen_addresses = ['0.0.0.0:5353']
        log_level = 1

        ipv4_servers = true
        ipv6_servers = false
        dnscrypt_servers = true
        doh_servers = false
        odoh_servers = false
        bootstrap_resolvers = ['9.9.9.11:53', '8.8.8.8:53']
        lb_strategy = 'p2'

        require_nolog = true
        require_nofilter = true

        [sources]
          [sources.public-resolvers]
            urls = ['https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/public-resolvers.md', 'https://download.dnscrypt.info/resolvers-list/v3/public-resolvers.md', 'https://ipv6.download.dnscrypt.info/resolvers-list/v3/public-resolvers.md']
            cache_file = 'public-resolvers.md'
            minisign_key = 'RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3'
            refresh_delay = 72
            prefix = ''
