diff --git a/library/ix-dev/community/homebridge/Chart.lock b/library/ix-dev/community/homebridge/Chart.lock new file mode 100644 index 00000000000..d2d8644ed3b --- /dev/null +++ b/library/ix-dev/community/homebridge/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: common + repository: file://../../../common + version: 1.0.0 +digest: sha256:f90dc95623b075f1d9ec4c4ba12464e2e789176ce7282a3aede37222201763b6 +generated: "2023-03-16T16:56:09.526562427+02:00" diff --git a/library/ix-dev/community/homebridge/Chart.yaml b/library/ix-dev/community/homebridge/Chart.yaml new file mode 100644 index 00000000000..aea77142b39 --- /dev/null +++ b/library/ix-dev/community/homebridge/Chart.yaml @@ -0,0 +1,25 @@ +name: homebridge +description: Homebridge is a lightweight NodeJS server you can run on your home network that emulates the iOS HomeKit API. +annotations: + title: Homebridge +type: application +version: 1.0.0 +apiVersion: v2 +appVersion: '2023-01-08' +kubeVersion: '>=1.16.0-0' +maintainers: + - name: truenas + url: https://www.truenas.com/ +dependencies: +- name: common + repository: file://../../../common + version: 1.0.0 +home: https://github.com/homebridge/homebridge +icon: https://raw.githubusercontent.com/homebridge/branding/master/logos/homebridge-color-round-stylized.png +sources: +- https://github.com/oznu/docker-homebridge +- https://github.com/truenas/charts/tree/master/library/ix-dev/community/homebridge +- https://github.com/homebridge/homebridge +keywords: +- homekit +- homebridge diff --git a/library/ix-dev/community/homebridge/README.md b/library/ix-dev/community/homebridge/README.md new file mode 100644 index 00000000000..63b9916a720 --- /dev/null +++ b/library/ix-dev/community/homebridge/README.md @@ -0,0 +1,4 @@ +# Homebridge + +- This container runs as `root` user. +- HostNetwork is always enabled. diff --git a/library/ix-dev/community/homebridge/app-readme.md b/library/ix-dev/community/homebridge/app-readme.md new file mode 100644 index 00000000000..63b9916a720 --- /dev/null +++ b/library/ix-dev/community/homebridge/app-readme.md @@ -0,0 +1,4 @@ +# Homebridge + +- This container runs as `root` user. +- HostNetwork is always enabled. diff --git a/library/ix-dev/community/homebridge/charts/common-1.0.0.tgz b/library/ix-dev/community/homebridge/charts/common-1.0.0.tgz new file mode 100644 index 00000000000..eb5d946765a Binary files /dev/null and b/library/ix-dev/community/homebridge/charts/common-1.0.0.tgz differ diff --git a/library/ix-dev/community/homebridge/ci/basic-values.yaml b/library/ix-dev/community/homebridge/ci/basic-values.yaml new file mode 100644 index 00000000000..4044e23dc5e --- /dev/null +++ b/library/ix-dev/community/homebridge/ci/basic-values.yaml @@ -0,0 +1,7 @@ +hbStorage: + data: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/data + +hbNetwork: + webPort: 38000 diff --git a/library/ix-dev/community/homebridge/item.yaml b/library/ix-dev/community/homebridge/item.yaml new file mode 100644 index 00000000000..719f8b37d54 --- /dev/null +++ b/library/ix-dev/community/homebridge/item.yaml @@ -0,0 +1,4 @@ +icon: https://raw.githubusercontent.com/homebridge/branding/master/logos/homebridge-color-round-stylized.png +categories: +- homekit +- homebridge diff --git a/library/ix-dev/community/homebridge/questions.yaml b/library/ix-dev/community/homebridge/questions.yaml new file mode 100644 index 00000000000..e7ad19087ce --- /dev/null +++ b/library/ix-dev/community/homebridge/questions.yaml @@ -0,0 +1,135 @@ +groups: + - name: Homebridge Configuration + description: Configure Homebridge + - name: Network Configuration + description: Configure Network for Homebridge + - name: Storage Configuration + description: Configure Storage for Homebridge + - name: Resources Configuration + description: Configure Resources for Homebridge + +questions: + + - variable: TZ + group: Homebridge Configuration + label: Timezone + schema: + type: string + default: Etc/UTC + required: true + $ref: + - definitions/timezone + + - variable: hbConfig + label: "" + group: Homebridge Configuration + schema: + type: dict + attrs: + - variable: enableAvahi + label: Enable Avahi + description: Enable Avahi for Homebridge. + schema: + type: boolean + default: true + - variable: additionalEnvs + label: Additional Environment Variables + description: Configure additional environment variables for Homebridge. + 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: hbNetwork + group: Network Configuration + label: "" + schema: + type: dict + attrs: + - variable: webPort + label: Web UI Port + schema: + type: int + min: 9000 + max: 65535 + required: true + default: 30000 + + - variable: hbStorage + group: Storage Configuration + label: "" + schema: + type: dict + attrs: + - variable: data + label: Data + schema: + type: dict + attrs: + - variable: type + label: Type + schema: + type: string + default: ixVolume + required: true + enum: + - value: ixVolume + description: ixVolume + - value: hostPath + description: hostPath + - variable: hostPath + label: Host Path + schema: + type: hostpath + show_if: [["type", "=", "hostPath"]] + default: "" + - variable: datasetName + label: Dataset Name + schema: + type: string + default: data + show_if: [["type", "=", "ixVolume"]] + hidden: true + $ref: + - "normalize/ixVolume" + + - variable: resources + label: "" + group: Resources Configuration + schema: + type: dict + attrs: + - variable: limits + label: Limits + schema: + type: dict + attrs: + - variable: cpu + label: CPU + description: CPU limit for qBittorrent. + schema: + type: string + default: 4000m + required: true + - variable: memory + label: Memory + description: Memory limit for qBittorrent. + schema: + type: string + default: 8Gi + required: true diff --git a/library/ix-dev/community/homebridge/templates/NOTES.txt b/library/ix-dev/community/homebridge/templates/NOTES.txt new file mode 100644 index 00000000000..ba4e01146c0 --- /dev/null +++ b/library/ix-dev/community/homebridge/templates/NOTES.txt @@ -0,0 +1 @@ +{{ include "ix.v1.common.lib.chart.notes" $ }} diff --git a/library/ix-dev/community/homebridge/templates/_homebridge.tpl b/library/ix-dev/community/homebridge/templates/_homebridge.tpl new file mode 100644 index 00000000000..2fcbc56a4bf --- /dev/null +++ b/library/ix-dev/community/homebridge/templates/_homebridge.tpl @@ -0,0 +1,79 @@ +{{- define "homebridge.workload" -}} +workload: + homebridge: + enabled: true + primary: true + type: Deployment + podSpec: + hostNetwork: true + containers: + homebridge: + enabled: true + primary: true + imageSelector: image + securityContext: + runAsUser: 0 + runAsGroup: 0 + runAsNonRoot: false + readOnlyRootFilesystem: false + capabilities: + add: + - SETGID + - SETUID + drop: + - NET_ADMIN + - NET_RAW + - CHOWN + # - DAC_OVERRIDE + env: + HOMEBRIDGE_CONFIG_UI_PORT: {{ .Values.hbNetwork.webPort }} + ENABLE_AVAHI: {{ ternary "1" "0" .Values.hbConfig.enableAvahi | quote }} + {{ with .Values.hbConfig.additionalEnvs }} + {{ range $env := . }} + {{ $env.name }}: {{ $env.value }} + {{ end }} + {{ end }} + probes: + liveness: + enabled: true + type: http + port: {{ .Values.hbNetwork.webPort }} + path: / + readiness: + enabled: true + type: http + port: {{ .Values.hbNetwork.webPort }} + path: / + startup: + enabled: true + type: http + port: {{ .Values.hbNetwork.webPort }} + path: / + +{{/* Service */}} +service: + homebridge: + enabled: true + primary: true + type: NodePort + targetSelector: homebridge + ports: + homebridge: + enabled: true + primary: true + port: {{ .Values.hbNetwork.webPort }} + nodePort: {{ .Values.hbNetwork.webPort }} + targetSelector: homebridge + +{{/* Persistence */}} +persistence: + data: + enabled: true + type: {{ .Values.hbStorage.data.type }} + datasetName: {{ .Values.hbStorage.data.datasetName | default "" }} + hostPath: {{ .Values.hbStorage.data.hostPath | default "" }} + targetSelector: + homebridge: + homebridge: + mountPath: /homebridge +{{- end -}} diff --git a/library/ix-dev/community/homebridge/templates/_portal.tpl b/library/ix-dev/community/homebridge/templates/_portal.tpl new file mode 100644 index 00000000000..f6775756007 --- /dev/null +++ b/library/ix-dev/community/homebridge/templates/_portal.tpl @@ -0,0 +1,12 @@ +{{- define "homebridge.portal" -}} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: portal +data: + path: "/" + port: {{ .Values.hbNetwork.webPort | quote }} + protocol: http + host: $node_ip +{{- end -}} diff --git a/library/ix-dev/community/homebridge/templates/common.yaml b/library/ix-dev/community/homebridge/templates/common.yaml new file mode 100644 index 00000000000..606ddc3c771 --- /dev/null +++ b/library/ix-dev/community/homebridge/templates/common.yaml @@ -0,0 +1,9 @@ +{{- include "ix.v1.common.loader.init" . -}} + +{{/* Merge the templates with Values */}} +{{- $_ := mustMergeOverwrite .Values (include "homebridge.workload" $ | fromYaml) -}} + +{{/* Create the configmap for portal manually*/}} +{{- include "homebridge.portal" $ -}} + +{{- include "ix.v1.common.loader.apply" . -}} diff --git a/library/ix-dev/community/homebridge/values.yaml b/library/ix-dev/community/homebridge/values.yaml new file mode 100644 index 00000000000..95bf86471a0 --- /dev/null +++ b/library/ix-dev/community/homebridge/values.yaml @@ -0,0 +1,22 @@ +image: + repository: oznu/homebridge + tag: "2023-01-08" + pullPolicy: IfNotPresent + +resources: + limits: + cpu: 4000m + memory: 8Gi + +hbStorage: + data: + type: ixVolume + hostPath: "" + datasetName: data + +hbNetwork: + webPort: 30000 + +hbConfig: + enableAvahi: true + additionalEnvs: []