# yaml-language-server: $schema=./values.schema.json
image:
  repository: docker.io/automaticrippingmachine/automatic-ripping-machine
  pullPolicy: IfNotPresent
  tag: 2.23.1@sha256:57b184902e2ac210387943d8b09977c2f8d0382baa478a4b0f46816ee553625c

securityContext:
  container:
    runAsNonRoot: false
    readOnlyRootFilesystem: false
    runAsUser: 0
    runAsGroup: 0
    allowPrivilegeEscalation: true

service:
  main:
    ports:
      main:
        protocol: http
        targetPort: 8080
        port: 10683

workload:
  main:
    podSpec:
      # force 568:568 for /home/arm & etc/arm/config
      initContainers:
        arm-perms:
          type: install
          enabled: true
          imageSelector: "image"
          command:
            - /bin/sh
          args:
            - -c
            - |
              echo "Setting ownership to {{ .Values.securityContext.container.PUID }}:{{ .Values.securityContext.pod.fsGroup }} on data directory [/home/arm] ..."
              chown {{ .Values.securityContext.container.PUID }}:{{ .Values.securityContext.pod.fsGroup }} /home/arm

              echo "Setting ownership to {{ .Values.securityContext.container.PUID }}:{{ .Values.securityContext.pod.fsGroup }} on data directory [/etc/arm/config] ..."
              chown {{ .Values.securityContext.container.PUID }}:{{ .Values.securityContext.pod.fsGroup }} /etc/arm/config

              echo "Finished."
      containers:
        main:
          env:
            # default media perms
            ARM_UID: "{{ .Values.securityContext.container.PUID }}"
            ARM_GID: "{{ .Values.securityContext.pod.fsGroup }}"

persistence:
  config:
    enabled: true
    mountPath: "/etc/arm/config"
    targetSelector:
      main:
        main: {}
        arm-perms: {}
  arm:
    enabled: true
    mountPath: "/home/arm"
    targetSelector:
      main:
        main: {}
        arm-perms: {}
