diff --git a/community/audiobookshelf/1.0.0/Chart.lock b/community/audiobookshelf/1.0.0/Chart.lock new file mode 100644 index 0000000000..28eedade4a --- /dev/null +++ b/community/audiobookshelf/1.0.0/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: common + repository: file://../../../common + version: 1.2.9 +digest: sha256:af1a9a1f87e3e48453c9f25f909f5ebcd7fa6e25162b7b425448ba752bcdbc5c +generated: "2024-03-25T09:44:39.2606429-05:00" diff --git a/community/audiobookshelf/1.0.0/Chart.yaml b/community/audiobookshelf/1.0.0/Chart.yaml new file mode 100644 index 0000000000..64b2fa94a9 --- /dev/null +++ b/community/audiobookshelf/1.0.0/Chart.yaml @@ -0,0 +1,26 @@ +name: audiobookshelf +description: Audiobookshelf is a self-hosted audiobook and podcast server +annotations: + title: Audiobookshelf +type: application +version: 1.0.0 +apiVersion: v2 +appVersion: 2.8.1 +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.2.9 +home: https://www.audiobookshelf.org/ +icon: https://media.sys.truenas.net/apps/audiobookshelf/icons/icon.svg +sources: + - https://ghcr.io/advplyr/audiobookshelf + - https://github.com/truenas/charts/tree/master/library/ix-dev/community/audiobookshelf + - https://github.com/advplyr/audiobookshelf +keywords: + - media + - audiobook diff --git a/community/audiobookshelf/1.0.0/README.md b/community/audiobookshelf/1.0.0/README.md new file mode 100644 index 0000000000..7108a0a0bf --- /dev/null +++ b/community/audiobookshelf/1.0.0/README.md @@ -0,0 +1,9 @@ +# Audiobookshelf + +[Audiobookshelf](https://www.audiobookshelf.org/) is a self-hosted audiobook and podcast server. + +> The following applies only when the storage type is set to **ixVolume** +> When application is installed, a container will be launched with **root** privileges. +> This is required in order to apply the correct permissions to the `Audiobookshelf` directories. +> Afterward, the `Audiobookshelf` 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/audiobookshelf/1.0.0/app-readme.md b/community/audiobookshelf/1.0.0/app-readme.md new file mode 100644 index 0000000000..7108a0a0bf --- /dev/null +++ b/community/audiobookshelf/1.0.0/app-readme.md @@ -0,0 +1,9 @@ +# Audiobookshelf + +[Audiobookshelf](https://www.audiobookshelf.org/) is a self-hosted audiobook and podcast server. + +> The following applies only when the storage type is set to **ixVolume** +> When application is installed, a container will be launched with **root** privileges. +> This is required in order to apply the correct permissions to the `Audiobookshelf` directories. +> Afterward, the `Audiobookshelf` 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/audiobookshelf/1.0.0/charts/common-1.2.9.tgz b/community/audiobookshelf/1.0.0/charts/common-1.2.9.tgz new file mode 100644 index 0000000000..50067b29c2 Binary files /dev/null and b/community/audiobookshelf/1.0.0/charts/common-1.2.9.tgz differ diff --git a/community/audiobookshelf/1.0.0/ci/basic-values.yaml b/community/audiobookshelf/1.0.0/ci/basic-values.yaml new file mode 100644 index 0000000000..ac5bfa27c3 --- /dev/null +++ b/community/audiobookshelf/1.0.0/ci/basic-values.yaml @@ -0,0 +1,12 @@ +audiobookshelfNetwork: + webPort: 31000 + +audiobookshelfRunAs: + user: 1000 + group: 1000 + +audiobookshelfStorage: + config: + type: pvc + metadata: + type: pvc diff --git a/community/audiobookshelf/1.0.0/ci/extra-values.yaml b/community/audiobookshelf/1.0.0/ci/extra-values.yaml new file mode 100644 index 0000000000..8aff8de742 --- /dev/null +++ b/community/audiobookshelf/1.0.0/ci/extra-values.yaml @@ -0,0 +1,13 @@ +audiobookshelfNetwork: + webPort: 31000 + +audiobookshelfStorage: + config: + type: pvc + metadata: + type: pvc + additionalStorages: + - type: pvc + mountPath: /data1 + - type: pvc + mountPath: /data2 diff --git a/community/audiobookshelf/1.0.0/ix_values.yaml b/community/audiobookshelf/1.0.0/ix_values.yaml new file mode 100644 index 0000000000..ed8eb7e63d --- /dev/null +++ b/community/audiobookshelf/1.0.0/ix_values.yaml @@ -0,0 +1,28 @@ +image: + repository: ghcr.io/advplyr/audiobookshelf + pullPolicy: IfNotPresent + tag: 2.8.1 + +resources: + limits: + cpu: 4000m + memory: 8Gi + +audiobookshelfConfig: + additionalEnvs: [] +audiobookshelfNetwork: + webPort: 30067 + hostNetwork: false +audiobookshelfRunAs: + user: 568 + group: 568 +audiobookshelfStorage: + config: + type: ixVolume + ixVolumeConfig: + datasetName: config + metadata: + type: ixVolume + ixVolumeConfig: + datasetName: metadata + additionalStorages: [] diff --git a/community/audiobookshelf/1.0.0/metadata.yaml b/community/audiobookshelf/1.0.0/metadata.yaml new file mode 100644 index 0000000000..4f26836b34 --- /dev/null +++ b/community/audiobookshelf/1.0.0/metadata.yaml @@ -0,0 +1,8 @@ +runAsContext: + - userName: audiobookshelf + groupName: audiobookshelf + gid: 568 + uid: 568 + description: Audiobookshelf can run as any non-root user. +capabilities: [] +hostMounts: [] diff --git a/community/audiobookshelf/1.0.0/questions.yaml b/community/audiobookshelf/1.0.0/questions.yaml new file mode 100644 index 0000000000..9abcb074ce --- /dev/null +++ b/community/audiobookshelf/1.0.0/questions.yaml @@ -0,0 +1,456 @@ +groups: + - name: Audiobookshelf Configuration + description: Configure Audiobookshelf + - name: User and Group Configuration + description: Configure User and Group for Audiobookshelf + - name: Network Configuration + description: Configure Network for Audiobookshelf + - name: Storage Configuration + description: Configure Storage for Audiobookshelf + - name: Resources Configuration + description: Configure Resources for Audiobookshelf + +portals: + web_portal: + protocols: + - "$kubernetes-resource_configmap_portal_protocol" + host: + - "$kubernetes-resource_configmap_portal_host" + ports: + - "$kubernetes-resource_configmap_portal_port" + path: "$kubernetes-resource_configmap_portal_path" + +questions: + - variable: TZ + group: Audiobookshelf Configuration + label: Timezone + schema: + type: string + default: Etc/UTC + required: true + $ref: + - definitions/timezone + + - variable: audiobookshelfConfig + label: "" + group: Audiobookshelf Configuration + schema: + type: dict + attrs: + - variable: additionalEnvs + label: Additional Environment Variables + description: Configure additional environment variables for Audiobookshelf. + 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: audiobookshelfRunAs + label: "" + group: User and Group Configuration + schema: + type: dict + attrs: + - variable: user + label: User ID + description: The user id that Audiobookshelf will run as. + schema: + type: int + min: 2 + default: 568 + required: true + - variable: group + label: Group ID + description: The group id that Audiobookshelf will run as. + schema: + type: int + min: 2 + default: 568 + required: true + + - variable: audiobookshelfNetwork + label: "" + group: Network Configuration + schema: + type: dict + attrs: + - variable: webPort + label: Web Port + description: The port for the Audiobookshelf Web UI. + schema: + type: int + default: 30067 + min: 9000 + max: 65535 + required: true + - variable: hostNetwork + label: Host Network + description: | + Bind to the host network. It's recommended to keep this disabled.
+ schema: + type: boolean + default: false + + - variable: audiobookshelfStorage + label: "" + group: Storage Configuration + schema: + type: dict + attrs: + - variable: config + label: Audiobookshelf Config Storage + description: The path to store Audiobookshelf Configuration and Database. + 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 + immutable: 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: ixVolumeConfig + label: ixVolume Configuration + description: The configuration for the ixVolume dataset. + schema: + type: dict + show_if: [["type", "=", "ixVolume"]] + $ref: + - "normalize/ixVolume" + attrs: + - variable: aclEnable + label: Enable ACL + description: Enable ACL for the dataset. + schema: + type: boolean + default: false + - variable: datasetName + label: Dataset Name + description: The name of the dataset to use for storage. + schema: + type: string + required: true + immutable: true + hidden: true + default: "config" + - variable: aclEntries + label: ACL Configuration + schema: + type: dict + show_if: [["aclEnable", "=", true]] + attrs: [] + - variable: hostPathConfig + label: Host Path Configuration + schema: + type: dict + show_if: [["type", "=", "hostPath"]] + attrs: + - variable: aclEnable + label: Enable ACL + description: Enable ACL for the dataset. + schema: + type: boolean + default: false + - variable: acl + label: ACL Configuration + schema: + type: dict + show_if: [["aclEnable", "=", true]] + attrs: [] + $ref: + - "normalize/acl" + - variable: hostPath + label: Host Path + description: The host path to use for storage. + schema: + type: hostpath + show_if: [["aclEnable", "=", false]] + required: true + + - variable: metadata + label: Audiobookshelf Metadata Storage + description: The path to store Audiobookshelf cache, streams, covers, downloads, backups and logs. + 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 + immutable: 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: ixVolumeConfig + label: ixVolume Configuration + description: The configuration for the ixVolume dataset. + schema: + type: dict + show_if: [["type", "=", "ixVolume"]] + $ref: + - "normalize/ixVolume" + attrs: + - variable: aclEnable + label: Enable ACL + description: Enable ACL for the dataset. + schema: + type: boolean + default: false + - variable: datasetName + label: Dataset Name + description: The name of the dataset to use for storage. + schema: + type: string + required: true + immutable: true + hidden: true + default: "metadata" + - variable: aclEntries + label: ACL Configuration + schema: + type: dict + show_if: [["aclEnable", "=", true]] + attrs: [] + - variable: hostPathConfig + label: Host Path Configuration + schema: + type: dict + show_if: [["type", "=", "hostPath"]] + attrs: + - variable: aclEnable + label: Enable ACL + description: Enable ACL for the dataset. + schema: + type: boolean + default: false + - variable: acl + label: ACL Configuration + schema: + type: dict + show_if: [["aclEnable", "=", true]] + attrs: [] + $ref: + - "normalize/acl" + - variable: hostPath + label: Host Path + description: The host path to use for storage. + schema: + type: hostpath + show_if: [["aclEnable", "=", false]] + required: true + + - variable: additionalStorages + label: Additional Storage + description: Additional storage for Audiobookshelf. + 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.
+ SMB Share: Is a SMB share that is mounted to a persistent volume claim. + schema: + type: string + required: true + default: "ixVolume" + immutable: true + enum: + - value: "hostPath" + description: Host Path (Path that already exists on the system) + - value: "ixVolume" + description: ixVolume (Dataset created automatically by the system) + - value: "smb-pv-pvc" + description: SMB Share (Mounts a persistent volume claim to a SMB share) + - variable: readOnly + label: Read Only + description: Mount the volume as read only. + schema: + type: boolean + default: false + - variable: mountPath + label: Mount Path + description: The path inside the container to mount the storage. + schema: + type: path + required: true + - variable: hostPathConfig + label: Host Path Configuration + schema: + type: dict + show_if: [["type", "=", "hostPath"]] + attrs: + - variable: aclEnable + label: Enable ACL + description: Enable ACL for the dataset. + schema: + type: boolean + default: false + - variable: acl + label: ACL Configuration + schema: + type: dict + show_if: [["aclEnable", "=", true]] + attrs: [] + $ref: + - "normalize/acl" + - variable: hostPath + label: Host Path + description: The host path to use for storage. + schema: + type: hostpath + show_if: [["aclEnable", "=", false]] + required: true + - variable: ixVolumeConfig + label: ixVolume Configuration + description: The configuration for the ixVolume dataset. + schema: + type: dict + show_if: [["type", "=", "ixVolume"]] + $ref: + - "normalize/ixVolume" + attrs: + - variable: aclEnable + label: Enable ACL + description: Enable ACL for the dataset. + schema: + type: boolean + default: false + - variable: datasetName + label: Dataset Name + description: The name of the dataset to use for storage. + schema: + type: string + required: true + immutable: true + default: "storage_entry" + - variable: aclEntries + label: ACL Configuration + schema: + type: dict + show_if: [["aclEnable", "=", true]] + attrs: [] + - variable: smbConfig + label: SMB Share Configuration + description: The configuration for the SMB Share. + schema: + type: dict + show_if: [["type", "=", "smb-pv-pvc"]] + attrs: + - variable: server + label: Server + description: The server for the SMB share. + schema: + type: string + required: true + - variable: share + label: Share + description: The share name for the SMB share. + schema: + type: string + required: true + - variable: domain + label: Domain (Optional) + description: The domain for the SMB share. + schema: + type: string + - variable: username + label: Username + description: The username for the SMB share. + schema: + type: string + required: true + - variable: password + label: Password + description: The password for the SMB share. + schema: + type: string + required: true + private: true + - variable: size + label: Size (in Gi) + description: The size of the volume quota. + schema: + type: int + required: true + min: 1 + default: 1 + + - 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 Audiobookshelf. + 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 Audiobookshelf. + 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/audiobookshelf/1.0.0/templates/NOTES.txt b/community/audiobookshelf/1.0.0/templates/NOTES.txt new file mode 100644 index 0000000000..ba4e01146c --- /dev/null +++ b/community/audiobookshelf/1.0.0/templates/NOTES.txt @@ -0,0 +1 @@ +{{ include "ix.v1.common.lib.chart.notes" $ }} diff --git a/community/audiobookshelf/1.0.0/templates/_audiobookshelf.tpl b/community/audiobookshelf/1.0.0/templates/_audiobookshelf.tpl new file mode 100644 index 0000000000..7ceef729b5 --- /dev/null +++ b/community/audiobookshelf/1.0.0/templates/_audiobookshelf.tpl @@ -0,0 +1,50 @@ +{{- define "audiobookshelf.workload" -}} +workload: + audiobookshelf: + enabled: true + primary: true + type: Deployment + podSpec: + hostNetwork: {{ .Values.audiobookshelfNetwork.hostNetwork }} + containers: + audiobookshelf: + enabled: true + primary: true + imageSelector: image + securityContext: + runAsUser: {{ .Values.audiobookshelfRunAs.user }} + runAsGroup: {{ .Values.audiobookshelfRunAs.group }} + env: + PORT: {{ .Values.audiobookshelfNetwork.webPort }} + CONFIG_PATH: /config + METADATA_PATH: /metadata + {{ with .Values.audiobookshelfConfig.additionalEnvs }} + envList: + {{ range $env := . }} + - name: {{ $env.name }} + value: {{ $env.value }} + {{ end }} + {{ end }} + probes: + liveness: + enabled: true + type: http + port: "{{ .Values.audiobookshelfNetwork.webPort }}" + path: /healthcheck + readiness: + enabled: true + type: http + port: "{{ .Values.audiobookshelfNetwork.webPort }}" + path: /healthcheck + startup: + enabled: true + type: http + port: "{{ .Values.audiobookshelfNetwork.webPort }}" + path: /healthcheck + initContainers: + {{- include "ix.v1.common.app.permissions" (dict "containerName" "01-permissions" + "UID" .Values.audiobookshelfRunAs.user + "GID" .Values.audiobookshelfRunAs.group + "mode" "check" + "type" "install") | nindent 8 }} +{{- end -}} diff --git a/community/audiobookshelf/1.0.0/templates/_persistence.tpl b/community/audiobookshelf/1.0.0/templates/_persistence.tpl new file mode 100644 index 0000000000..1d3f5c1b99 --- /dev/null +++ b/community/audiobookshelf/1.0.0/templates/_persistence.tpl @@ -0,0 +1,40 @@ +{{- define "audiobookshelf.persistence" -}} +persistence: + config: + enabled: true + {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.audiobookshelfStorage.config) | nindent 4 }} + targetSelector: + audiobookshelf: + audiobookshelf: + mountPath: /config + {{- if and (eq .Values.audiobookshelfStorage.config.type "ixVolume") + (not (.Values.audiobookshelfStorage.config.ixVolumeConfig | default dict).aclEnable) }} + 01-permissions: + mountPath: /mnt/directories/config + {{- end }} + metadata: + enabled: true + {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.audiobookshelfStorage.metadata) | nindent 4 }} + targetSelector: + audiobookshelf: + audiobookshelf: + mountPath: /metadata + {{- if and (eq .Values.audiobookshelfStorage.metadata.type "ixVolume") + (not (.Values.audiobookshelfStorage.metadata.ixVolumeConfig | default dict).aclEnable) }} + 01-permissions: + mountPath: /mnt/directories/metadata + {{- end }} + {{- range $idx, $storage := .Values.audiobookshelfStorage.additionalStorages }} + {{ printf "audiobookshelf-%v:" (int $idx) }} + enabled: true + {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }} + targetSelector: + audiobookshelf: + audiobookshelf: + mountPath: {{ $storage.mountPath }} + {{- if and (eq $storage.type "ixVolume") (not ($storage.ixVolumeConfig | default dict).aclEnable) }} + 01-permissions: + mountPath: /mnt/directories{{ $storage.mountPath }} + {{- end }} + {{- end }} +{{- end -}} diff --git a/community/audiobookshelf/1.0.0/templates/_portal.tpl b/community/audiobookshelf/1.0.0/templates/_portal.tpl new file mode 100644 index 0000000000..15a203ed5b --- /dev/null +++ b/community/audiobookshelf/1.0.0/templates/_portal.tpl @@ -0,0 +1,12 @@ +{{- define "audiobookshelf.portal" -}} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: portal +data: + path: "/" + port: {{ .Values.audiobookshelfNetwork.webPort | quote }} + protocol: http + host: $node_ip +{{- end -}} diff --git a/community/audiobookshelf/1.0.0/templates/_service.tpl b/community/audiobookshelf/1.0.0/templates/_service.tpl new file mode 100644 index 0000000000..a36a1fd023 --- /dev/null +++ b/community/audiobookshelf/1.0.0/templates/_service.tpl @@ -0,0 +1,15 @@ +{{- define "audiobookshelf.service" -}} +service: + audiobookshelf: + enabled: true + primary: true + type: NodePort + targetSelector: audiobookshelf + ports: + webui: + enabled: true + primary: true + port: {{ .Values.audiobookshelfNetwork.webPort }} + nodePort: {{ .Values.audiobookshelfNetwork.webPort }} + targetSelector: audiobookshelf +{{- end -}} diff --git a/community/audiobookshelf/1.0.0/templates/common.yaml b/community/audiobookshelf/1.0.0/templates/common.yaml new file mode 100644 index 0000000000..43e4110a0d --- /dev/null +++ b/community/audiobookshelf/1.0.0/templates/common.yaml @@ -0,0 +1,11 @@ +{{- include "ix.v1.common.loader.init" . -}} + +{{/* Merge the templates with Values */}} +{{- $_ := mustMergeOverwrite .Values (include "audiobookshelf.workload" $ | fromYaml) -}} +{{- $_ := mustMergeOverwrite .Values (include "audiobookshelf.service" $ | fromYaml) -}} +{{- $_ := mustMergeOverwrite .Values (include "audiobookshelf.persistence" $ | fromYaml) -}} + +{{/* Create the configmap for portal manually*/}} +{{- include "audiobookshelf.portal" $ -}} + +{{- include "ix.v1.common.loader.apply" . -}} diff --git a/community/audiobookshelf/item.yaml b/community/audiobookshelf/item.yaml new file mode 100644 index 0000000000..e82236c1d0 --- /dev/null +++ b/community/audiobookshelf/item.yaml @@ -0,0 +1,10 @@ +icon_url: https://media.sys.truenas.net/apps/audiobookshelf/icons/icon.svg +screenshots: + - https://media.sys.truenas.net/apps/audiobookshelf/screenshots/screenshot1.png + - https://media.sys.truenas.net/apps/audiobookshelf/screenshots/screenshot2.png + - https://media.sys.truenas.net/apps/audiobookshelf/screenshots/screenshot3.png + - https://media.sys.truenas.net/apps/audiobookshelf/screenshots/screenshot4.jpg +categories: + - media +tags: + - audiobook