diff --git a/community/plex-auto-languages/1.0.0/Chart.lock b/community/plex-auto-languages/1.0.0/Chart.lock new file mode 100644 index 0000000000..79f595642b --- /dev/null +++ b/community/plex-auto-languages/1.0.0/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: common + repository: file://../../../common + version: 1.0.12 +digest: sha256:debd30721d09ae8293b1cbdd9d0115981d40b47908be3035fc3cf657c9d5eedb +generated: "2023-07-15T23:17:26.4027475+03:00" diff --git a/community/plex-auto-languages/1.0.0/Chart.yaml b/community/plex-auto-languages/1.0.0/Chart.yaml new file mode 100644 index 0000000000..3b1db094b0 --- /dev/null +++ b/community/plex-auto-languages/1.0.0/Chart.yaml @@ -0,0 +1,26 @@ +name: plex-auto-languages +description: Plex Auto Languages offer automated language selection for Plex TV Shows +annotations: + title: Plex Auto Languages +type: application +version: 1.0.0 +apiVersion: v2 +appVersion: '1.2.2' +kubeVersion: '>=1.16.0-0' +maintainers: + - name: truenas + url: https://www.truenas.com/ + email: dev@ixsystems.com +dependencies: + - name: common + repository: file://../../../common + version: 1.0.12 +home: https://github.com/RemiRigal/Plex-Auto-Languages +icon: https://localhost/no-icon +sources: + - https://github.com/RemiRigal/Plex-Auto-Languages + - https://github.com/truenas/charts/tree/master/community/plex-auto-languages + - https://hub.docker.com/r/remirigal/plex-auto-languages +keywords: + - plex + - languages diff --git a/community/plex-auto-languages/1.0.0/README.md b/community/plex-auto-languages/1.0.0/README.md new file mode 100644 index 0000000000..e5d985ed38 --- /dev/null +++ b/community/plex-auto-languages/1.0.0/README.md @@ -0,0 +1,8 @@ +# Plex Auto Languages + +[Plex Auto Languages](https://github.com/RemiRigal/Plex-Auto-Languages) offer automated language selection for Plex TV Shows + +> When application is installed, a container will be launched with **root** privileges. +> This is required in order to apply the correct permissions to the `Plex Auto Languages` directories. +> Afterward, the `Plex Auto Languages` container will run as a **non**-root user (Default: `568`). +> All mounted storage(s) will be `chown`ed only if the parent directory does not match the configured user. diff --git a/community/plex-auto-languages/1.0.0/app-readme.md b/community/plex-auto-languages/1.0.0/app-readme.md new file mode 100644 index 0000000000..e5d985ed38 --- /dev/null +++ b/community/plex-auto-languages/1.0.0/app-readme.md @@ -0,0 +1,8 @@ +# Plex Auto Languages + +[Plex Auto Languages](https://github.com/RemiRigal/Plex-Auto-Languages) offer automated language selection for Plex TV Shows + +> When application is installed, a container will be launched with **root** privileges. +> This is required in order to apply the correct permissions to the `Plex Auto Languages` directories. +> Afterward, the `Plex Auto Languages` container will run as a **non**-root user (Default: `568`). +> All mounted storage(s) will be `chown`ed only if the parent directory does not match the configured user. diff --git a/community/plex-auto-languages/1.0.0/charts/common-1.0.12.tgz b/community/plex-auto-languages/1.0.0/charts/common-1.0.12.tgz new file mode 100644 index 0000000000..1890c10a1b Binary files /dev/null and b/community/plex-auto-languages/1.0.0/charts/common-1.0.12.tgz differ diff --git a/community/plex-auto-languages/1.0.0/ci/basic-values.yaml b/community/plex-auto-languages/1.0.0/ci/basic-values.yaml new file mode 100644 index 0000000000..22bec45d84 --- /dev/null +++ b/community/plex-auto-languages/1.0.0/ci/basic-values.yaml @@ -0,0 +1,14 @@ +ci: true + +palRunAs: + user: 1000 + group: 1000 + +palConfig: + plexURL: http://plex:32400 + plexToken: some-token + +palStorage: + config: + type: hostPath + hostPath: /mnt/{{ .Release.Namespace }}/config diff --git a/community/plex-auto-languages/1.0.0/ci/extra-values.yaml b/community/plex-auto-languages/1.0.0/ci/extra-values.yaml new file mode 100644 index 0000000000..ad43bbcf4b --- /dev/null +++ b/community/plex-auto-languages/1.0.0/ci/extra-values.yaml @@ -0,0 +1,17 @@ +ci: true + +palConfig: + plexURL: http://plex:32400 + plexToken: some-token + +palStorage: + config: + type: hostPath + hostPath: /mnt/{{ .Release.Namespace }}/config + additionalStorages: + - type: hostPath + hostPath: /mnt/{{ .Release.Namespace }}/data1 + mountPath: /data1 + - type: hostPath + hostPath: /mnt/{{ .Release.Namespace }}/data2 + mountPath: /data2 diff --git a/community/plex-auto-languages/1.0.0/ix_values.yaml b/community/plex-auto-languages/1.0.0/ix_values.yaml new file mode 100644 index 0000000000..e86af4b1d4 --- /dev/null +++ b/community/plex-auto-languages/1.0.0/ix_values.yaml @@ -0,0 +1,26 @@ +image: + repository: remirigal/plex-auto-languages + pullPolicy: IfNotPresent + tag: 'v1.2.2' + +ci: false + +resources: + limits: + cpu: 4000m + memory: 8Gi + +palConfig: + plexURL: '' + plexToken: '' + additionalEnvs: [] + +palRunAs: + user: 568 + group: 568 + +palStorage: + config: + type: ixVolume + datasetName: config + additionalStorages: [] diff --git a/community/plex-auto-languages/1.0.0/metadata.yaml b/community/plex-auto-languages/1.0.0/metadata.yaml new file mode 100644 index 0000000000..38aba0b44e --- /dev/null +++ b/community/plex-auto-languages/1.0.0/metadata.yaml @@ -0,0 +1,8 @@ +runAsContext: + - userName: plex-auto-languages + groupName: plex-auto-languages + gid: 568 + uid: 568 + description: Plex Auto Languages can run as any non-root user. +capabilities: [] +hostMounts: [] diff --git a/community/plex-auto-languages/1.0.0/questions.yaml b/community/plex-auto-languages/1.0.0/questions.yaml new file mode 100644 index 0000000000..0708a9a440 --- /dev/null +++ b/community/plex-auto-languages/1.0.0/questions.yaml @@ -0,0 +1,223 @@ +groups: + - name: Plex Auto Language Configuration + description: Configure Plex Auto Language + - name: User and Group Configuration + description: Configure User and Group for Plex Auto Language + - name: Storage Configuration + description: Configure Storage for Plex Auto Language + - name: Resources Configuration + description: Configure Resources for Plex Auto Language + +questions: + - variable: TZ + group: Plex Auto Language Configuration + label: Timezone + schema: + type: string + default: Etc/UTC + required: true + $ref: + - definitions/timezone + + - variable: palConfig + label: "" + group: Plex Auto Language Configuration + schema: + type: dict + attrs: + - variable: plexURL + label: Plex URL + description: The URL to your Plex server. + schema: + type: string + required: true + - variable: plexToken + label: Plex Token + description: | + The token to your Plex server.
+ More information on how to get your + token can be found here https://github.com/RemiRigal/Plex-Auto-Languages#getting-started + schema: + type: string + required: true + - variable: additionalEnvs + label: Additional Environment Variables + description: Configure additional environment variables for Plex Auto Language. + schema: + type: list + default: [] + items: + - variable: env + label: Environment Variable + schema: + type: dict + attrs: + - variable: name + label: Name + schema: + type: string + required: true + - variable: value + label: Value + schema: + type: string + required: true + + - variable: palRunAs + label: "" + group: User and Group Configuration + schema: + type: dict + attrs: + - variable: user + label: User ID + description: The user id that Plex Auto Language will run as. + schema: + type: int + min: 2 + default: 568 + required: true + - variable: group + label: Group ID + description: The group id that Plex Auto Language will run as. + schema: + type: int + min: 2 + default: 568 + required: true + + - variable: palStorage + label: "" + group: Storage Configuration + schema: + type: dict + attrs: + - variable: config + label: Plex Auto Language Config Storage + description: The path to store Plex Auto Language Configuration. + schema: + type: dict + attrs: + - variable: type + label: Type + description: | + ixVolume: Is dataset created automatically by the system.
+ Host Path: Is a path that already exists on the system. + schema: + type: string + required: true + default: "ixVolume" + enum: + - value: "hostPath" + description: Host Path (Path that already exists on the system) + - value: "ixVolume" + description: ixVolume (Dataset created automatically by the system) + - variable: datasetName + label: Dataset Name + schema: + type: string + show_if: [["type", "=", "ixVolume"]] + required: true + hidden: true + immutable: true + default: "config" + $ref: + - "normalize/ixVolume" + - variable: hostPath + label: Host Path + schema: + type: hostpath + show_if: [["type", "=", "hostPath"]] + immutable: true + required: true + - variable: additionalStorages + label: Additional Storage + description: Additional storage for Plex Auto Language. + schema: + type: list + default: [] + items: + - variable: storageEntry + label: Storage Entry + schema: + type: dict + attrs: + - variable: type + label: Type + description: | + ixVolume: Is dataset created automatically by the system.
+ Host Path: Is a path that already exists on the system. + schema: + type: string + required: true + default: "ixVolume" + enum: + - value: "hostPath" + description: Host Path (Path that already exists on the system) + - value: "ixVolume" + description: ixVolume (Dataset created automatically by the system) + - variable: mountPath + label: Mount Path + description: The path inside the container to mount the storage. + schema: + type: path + required: true + - variable: hostPath + label: Host Path + description: The host path to use for storage. + schema: + type: hostpath + show_if: [["type", "=", "hostPath"]] + required: true + - variable: datasetName + label: Dataset Name + description: The name of the dataset to use for storage. + schema: + type: string + show_if: [["type", "=", "ixVolume"]] + required: true + immutable: true + default: "storage_entry" + $ref: + - "normalize/ixVolume" + + - variable: resources + group: Resources Configuration + label: "" + schema: + type: dict + attrs: + - variable: limits + label: Limits + schema: + type: dict + attrs: + - variable: cpu + label: CPU + description: CPU limit for Plex Auto Language. + schema: + type: string + max_length: 6 + valid_chars: '^(0\.[1-9]|[1-9][0-9]*)(\.[0-9]|m?)$' + valid_chars_error: | + Valid CPU limit formats are
+ - Plain Integer - eg. 1
+ - Float - eg. 0.5
+ - Milicpu - eg. 500m + default: "4000m" + required: true + - variable: memory + label: Memory + description: Memory limit for Plex Auto Language. + schema: + type: string + max_length: 12 + valid_chars: '^[1-9][0-9]*([EPTGMK]i?|e[0-9]+)?$' + valid_chars_error: | + Valid Memory limit formats are
+ - Suffixed with E/P/T/G/M/K - eg. 1G
+ - Suffixed with Ei/Pi/Ti/Gi/Mi/Ki - eg. 1Gi
+ - Plain Integer in bytes - eg. 1024
+ - Exponent - eg. 134e6 + default: "8Gi" + required: true diff --git a/community/plex-auto-languages/1.0.0/templates/NOTES.txt b/community/plex-auto-languages/1.0.0/templates/NOTES.txt new file mode 100644 index 0000000000..ba4e01146c --- /dev/null +++ b/community/plex-auto-languages/1.0.0/templates/NOTES.txt @@ -0,0 +1 @@ +{{ include "ix.v1.common.lib.chart.notes" $ }} diff --git a/community/plex-auto-languages/1.0.0/templates/_persistence.tpl b/community/plex-auto-languages/1.0.0/templates/_persistence.tpl new file mode 100644 index 0000000000..b7ef43ae85 --- /dev/null +++ b/community/plex-auto-languages/1.0.0/templates/_persistence.tpl @@ -0,0 +1,34 @@ +{{- define "pal.persistence" -}} +persistence: + config: + enabled: true + type: {{ .Values.palStorage.config.type }} + datasetName: {{ .Values.palStorage.config.datasetName | default "" }} + hostPath: {{ .Values.palStorage.config.hostPath | default "" }} + targetSelector: + pal: + pal: + mountPath: /config + 01-permissions: + mountPath: /mnt/directories/config + tmp: + enabled: true + type: emptyDir + targetSelector: + pal: + pal: + mountPath: /tmp + {{- range $idx, $storage := .Values.palStorage.additionalStorages }} + {{ printf "pal-%v" (int $idx) }}: + enabled: true + type: {{ $storage.type }} + datasetName: {{ $storage.datasetName | default "" }} + hostPath: {{ $storage.hostPath | default "" }} + targetSelector: + pal: + pal: + mountPath: {{ $storage.mountPath }} + 01-permissions: + mountPath: /mnt/directories{{ $storage.mountPath }} + {{- end }} +{{- end -}} diff --git a/community/plex-auto-languages/1.0.0/templates/_plexAutoLang.tpl b/community/plex-auto-languages/1.0.0/templates/_plexAutoLang.tpl new file mode 100644 index 0000000000..7071ad74fe --- /dev/null +++ b/community/plex-auto-languages/1.0.0/templates/_plexAutoLang.tpl @@ -0,0 +1,52 @@ +{{- define "pal.workload" -}} +workload: + pal: + enabled: true + primary: true + type: Deployment + podSpec: + hostNetwork: false + containers: + pal: + enabled: true + primary: true + imageSelector: image + securityContext: + runAsUser: {{ .Values.palRunAs.user }} + runAsGroup: {{ .Values.palRunAs.group }} + env: + PLEX_URL: {{ .Values.palConfig.plexURL }} + PLEX_TOKEN: {{ .Values.palConfig.plexToken }} + CONTAINERIZED: "true" + {{ with .Values.palConfig.additionalEnvs }} + envList: + {{ range $env := . }} + - name: {{ $env.name }} + value: {{ $env.value }} + {{ end }} + {{ end }} + # Port is only for health checks + # No web interface is available. + probes: + liveness: + enabled: {{ not .Values.ci }} + type: http + port: 9880 + path: /health + readiness: + enabled: {{ not .Values.ci }} + type: http + port: 9880 + path: /health + startup: + enabled: {{ not .Values.ci }} + type: http + port: 9880 + path: /health + initContainers: + {{- include "ix.v1.common.app.permissions" (dict "containerName" "01-permissions" + "UID" .Values.palRunAs.user + "GID" .Values.palRunAs.group + "mode" "check" + "type" "init") | nindent 8 }} +{{- end -}} diff --git a/community/plex-auto-languages/1.0.0/templates/common.yaml b/community/plex-auto-languages/1.0.0/templates/common.yaml new file mode 100644 index 0000000000..ff27c5da81 --- /dev/null +++ b/community/plex-auto-languages/1.0.0/templates/common.yaml @@ -0,0 +1,7 @@ +{{- include "ix.v1.common.loader.init" . -}} + +{{/* Merge the templates with Values */}} +{{- $_ := mustMergeOverwrite .Values (include "pal.workload" $ | fromYaml) -}} +{{- $_ := mustMergeOverwrite .Values (include "pal.persistence" $ | fromYaml) -}} + +{{- include "ix.v1.common.loader.apply" . -}} diff --git a/community/plex-auto-languages/item.yaml b/community/plex-auto-languages/item.yaml new file mode 100644 index 0000000000..4dfd84fa22 --- /dev/null +++ b/community/plex-auto-languages/item.yaml @@ -0,0 +1,7 @@ +icon_url: https://localhost/no-icon +categories: + - media +screenshots: [] +tags: + - plex + - languages