#
# 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: jacobalberty/unifi
  # @default -- chart.appVersion
  tag:
  # -- image pull policy
  pullPolicy: IfNotPresent

# -- environment variables. See more environment variables in the [image documentation](https://github.com/jacobalberty/unifi-docker#environment-variables).
# @default -- See below
env:
  # -- Set the container timezone
  TZ: UTC
  # -- Run UniFi as root
  RUNAS_UID0: "false"
  # -- Specify the user ID the application will run as
  UNIFI_UID: "999"
  # -- Specify the group ID the application will run as
  UNIFI_GID: "999"
  # -- Java Virtual Machine (JVM) initial, and minimum, heap size
  # Unset value means there is no lower limit
  JVM_INIT_HEAP_SIZE:
  # -- Java Virtual Machine (JVM) maximum heap size
  # For larger installations a larger value is recommended.
  # For memory constrained system this value can be lowered.
  JVM_MAX_HEAP_SIZE: 1024M
  # # -- External MongoDB URI
  # DB_URI:  # mongodb://unifi-mongodb:27017/unifi
  # STATDB_URI:  # mongodb://unifi-mongodb:27017/unifi_stat
  # DB_NAME:  # unifi

# -- pod security context.
# @default -- See below
podSecurityContext:
  fsGroup: 999

# -- Configures service settings for the chart.
# @default -- See values.yaml
service:
  main:
    ports:
      # -- Configure Web interface + API port
      # @default -- See values.yaml
      http:
        port: 8443
        protocol: HTTPS
      # -- Configure Controller port used for device command/control
      # @default -- See values.yaml
      controller:
        enabled: true
        port: 8080
        protocol: TCP
      # -- Configure Captive Portal HTTP port
      # @default -- See values.yaml
      portal-http:
        enabled: false
        port: 8880
        protocol: HTTP
      # -- Configure Captive Portal HTTPS port
      # @default -- See values.yaml
      portal-https:
        enabled: false
        port: 8843
        protocol: HTTPS
      # -- Configure Speedtest port (used for UniFi mobile speed test)
      # @default -- See values.yaml
      speedtest:
        enabled: true
        port: 6789
        protocol: TCP
      # -- Configure STUN port
      # @default -- See values.yaml
      stun:
        enabled: true
        port: 3478
        protocol: UDP
      # -- Configure remote syslog port
      # @default -- See values.yaml
      syslog:
        enabled: true
        port: 5514
        protocol: UDP
      # -- Configure device discovery port
      # @default -- See values.yaml
      discovery:
        enabled: true
        port: 10001
        protocol: UDP

ingress:
  # -- Enable and configure ingress settings for the chart under this key.
  # @default -- See values.yaml
  main:
    enabled: false
    annotations:
      nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"

  # -- Enable and configure settings for the captive portal ingress under this key.
  # @default -- See values.yaml
  portal:
    enabled: false
    annotations:
      nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"

    ingressClassName:  # "nginx"

    hosts:
      -  ## Host address. Helm template can be passed.
        host:
        ## Configure the paths for the host
        paths:
          -  ## Path. Helm template can be passed.
            path: /
            ## Ignored if not kubeVersion >= 1.14-0
            pathType: Prefix
            service:
              ## Overrides the service name reference for this path
              name: main
              ## Overrides the service port reference for this path
              port: portal-https

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

# -- Enable and configure mongodb database subchart under this key.
#    For more options see [mongodb chart documentation](https://github.com/bitnami/charts/tree/master/bitnami/mongodb)
# @default -- See values.yaml
mongodb:
  enabled: false
  architecture: standalone
  auth:
    enabled: false
  persistence:
    enabled: false
    # storageClass: ""
    # size: 8Gi
