file:
  /bitnami/mediawiki:
    exists: true
    filetype: directory
    mode: "2775"
    owner: root
  /etc/hosts:
    exists: true
    filetype: file
    contains:
    {{ range .Vars.hostAliases }}
    {{ $ip := .ip }}
    {{ range $host := .hostnames }}
      - /{{ $ip }}.*{{ $host }}/
    {{ end }}
    {{ end }}
http:
  https://mediawiki:{{ .Vars.service.ports.https }}:
    ## Only checking for status code 301 to avoid the automatic redirect to the domain.
    status: 301
    no-follow-redirects: true
    allow-insecure: true
command:
  {{- $uid := .Vars.containerSecurityContext.runAsUser }}
  {{- $gid := .Vars.podSecurityContext.fsGroup }}
  check-user-info:
    # The UID and GID should always be either the one specified as vars (always a bigger number that the default)
    # or the one randomly defined by openshift (larger values). Otherwise, the chart is still using the default value.
    exec: if [ $(id -u) -lt {{ $uid }} ] || [ $(id -G | awk '{print $2}') -lt {{ $gid }} ]; then exit 1; fi
    exit-status: 0
  check-db-credentials:
    exec: env
    exit-status: 0
    stdout:
      - /MEDIAWIKI_DATABASE_NAME.*{{ .Vars.mariadb.auth.database }}/
      - /MEDIAWIKI_DATABASE_USER.*{{ .Vars.mariadb.auth.username }}/
      - /MEDIAWIKI_DATABASE_PASSWORD.*{{ .Vars.mariadb.auth.password }}/
