From 67c1b2e5137c6ba91358db7a4c0537fffe13318a Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Mon, 31 Jul 2023 18:17:29 +0300 Subject: [PATCH] initial work invoice-ninja (needs mysql) --- .../ix-dev/community/invoice-ninja/Chart.yaml | 28 ++ .../ix-dev/community/invoice-ninja/README.md | 8 + .../community/invoice-ninja/app-readme.md | 8 + .../invoice-ninja/ci/basic-values.yaml | 11 + .../invoice-ninja/ci/extra-values.yaml | 21 ++ .../invoice-ninja/ci/hostNet-values.yaml | 8 + .../ix-dev/community/invoice-ninja/item.yaml | 10 + .../community/invoice-ninja/metadata.yaml | 8 + .../community/invoice-ninja/questions.yaml | 240 ++++++++++++++++++ .../invoice-ninja/templates/NOTES.txt | 1 + .../invoice-ninja/templates/_configmap.tpl | 35 +++ .../invoice-ninja/templates/_invoiceNinja.tpl | 50 ++++ .../invoice-ninja/templates/_nginx.tpl | 32 +++ .../invoice-ninja/templates/_persistence.tpl | 45 ++++ .../invoice-ninja/templates/_portal.tpl | 12 + .../invoice-ninja/templates/_secret.tpl | 13 + .../invoice-ninja/templates/_service.tpl | 15 ++ .../invoice-ninja/templates/common.yaml | 14 + .../community/invoice-ninja/upgrade_info.json | 1 + .../community/invoice-ninja/upgrade_strategy | 31 +++ .../community/invoice-ninja/values.yaml | 23 ++ 21 files changed, 614 insertions(+) create mode 100644 library/ix-dev/community/invoice-ninja/Chart.yaml create mode 100644 library/ix-dev/community/invoice-ninja/README.md create mode 100644 library/ix-dev/community/invoice-ninja/app-readme.md create mode 100644 library/ix-dev/community/invoice-ninja/ci/basic-values.yaml create mode 100644 library/ix-dev/community/invoice-ninja/ci/extra-values.yaml create mode 100644 library/ix-dev/community/invoice-ninja/ci/hostNet-values.yaml create mode 100644 library/ix-dev/community/invoice-ninja/item.yaml create mode 100644 library/ix-dev/community/invoice-ninja/metadata.yaml create mode 100644 library/ix-dev/community/invoice-ninja/questions.yaml create mode 100644 library/ix-dev/community/invoice-ninja/templates/NOTES.txt create mode 100644 library/ix-dev/community/invoice-ninja/templates/_configmap.tpl create mode 100644 library/ix-dev/community/invoice-ninja/templates/_invoiceNinja.tpl create mode 100644 library/ix-dev/community/invoice-ninja/templates/_nginx.tpl create mode 100644 library/ix-dev/community/invoice-ninja/templates/_persistence.tpl create mode 100644 library/ix-dev/community/invoice-ninja/templates/_portal.tpl create mode 100644 library/ix-dev/community/invoice-ninja/templates/_secret.tpl create mode 100644 library/ix-dev/community/invoice-ninja/templates/_service.tpl create mode 100644 library/ix-dev/community/invoice-ninja/templates/common.yaml create mode 100644 library/ix-dev/community/invoice-ninja/upgrade_info.json create mode 100755 library/ix-dev/community/invoice-ninja/upgrade_strategy create mode 100644 library/ix-dev/community/invoice-ninja/values.yaml diff --git a/library/ix-dev/community/invoice-ninja/Chart.yaml b/library/ix-dev/community/invoice-ninja/Chart.yaml new file mode 100644 index 0000000000..2b9ef4587d --- /dev/null +++ b/library/ix-dev/community/invoice-ninja/Chart.yaml @@ -0,0 +1,28 @@ +name: invoice-ninja +description: Readarr is an ebook and audiobook collection manager for Usenet and BitTorrent + users. +annotations: + title: Invoice Ninja +type: application +version: 1.0.7 +apiVersion: v2 +appVersion: 0.3.0.2091 +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/Readarr/Readarr +icon: https://raw.githubusercontent.com/Readarr/Readarr/develop/Logo/256.png +sources: + - https://github.com/onedr0p/containers/tree/main/apps/readarr + - https://github.com/truenas/charts/tree/master/library/ix-dev/community/readarr + - https://github.com/Readarr/Readarr +keywords: + - media + - ebook + - audiobook diff --git a/library/ix-dev/community/invoice-ninja/README.md b/library/ix-dev/community/invoice-ninja/README.md new file mode 100644 index 0000000000..5cc2f44111 --- /dev/null +++ b/library/ix-dev/community/invoice-ninja/README.md @@ -0,0 +1,8 @@ +# Readarr + +[Readarr](https://github.com/Readarr/Readarr) is an ebook and audiobook collection manager for Usenet and BitTorrent users. + +> When application is installed, a container will be launched with **root** privileges. +> This is required in order to apply the correct permissions to the `Readarr` directories. +> Afterward, the `Readarr` 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/library/ix-dev/community/invoice-ninja/app-readme.md b/library/ix-dev/community/invoice-ninja/app-readme.md new file mode 100644 index 0000000000..5cc2f44111 --- /dev/null +++ b/library/ix-dev/community/invoice-ninja/app-readme.md @@ -0,0 +1,8 @@ +# Readarr + +[Readarr](https://github.com/Readarr/Readarr) is an ebook and audiobook collection manager for Usenet and BitTorrent users. + +> When application is installed, a container will be launched with **root** privileges. +> This is required in order to apply the correct permissions to the `Readarr` directories. +> Afterward, the `Readarr` 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/library/ix-dev/community/invoice-ninja/ci/basic-values.yaml b/library/ix-dev/community/invoice-ninja/ci/basic-values.yaml new file mode 100644 index 0000000000..d7a56366e6 --- /dev/null +++ b/library/ix-dev/community/invoice-ninja/ci/basic-values.yaml @@ -0,0 +1,11 @@ +readarrNetwork: + webPort: 31000 + +readarrRunAs: + user: 1000 + group: 1000 + +readarrStorage: + config: + type: hostPath + hostPath: /mnt/{{ .Release.Namespace }}/config diff --git a/library/ix-dev/community/invoice-ninja/ci/extra-values.yaml b/library/ix-dev/community/invoice-ninja/ci/extra-values.yaml new file mode 100644 index 0000000000..cd011c60cb --- /dev/null +++ b/library/ix-dev/community/invoice-ninja/ci/extra-values.yaml @@ -0,0 +1,21 @@ +readarrConfig: + additionalEnvs: + - name: READARR__API_KEY + value: some-long-api-key + - name: READARR__LOG_LEVEL + value: error + +readarrNetwork: + webPort: 31000 + +readarrStorage: + config: + type: hostPath + hostPath: /mnt/{{ .Release.Namespace }}/config + additionalStorages: + - type: hostPath + hostPath: /mnt/{{ .Release.Namespace }}/pop_music + mountPath: /pop_music + - type: hostPath + hostPath: /mnt/{{ .Release.Namespace }}/country_music + mountPath: /country_music diff --git a/library/ix-dev/community/invoice-ninja/ci/hostNet-values.yaml b/library/ix-dev/community/invoice-ninja/ci/hostNet-values.yaml new file mode 100644 index 0000000000..d05f6099bc --- /dev/null +++ b/library/ix-dev/community/invoice-ninja/ci/hostNet-values.yaml @@ -0,0 +1,8 @@ +readarrNetwork: + webPort: 30000 + hostNetwork: true + +readarrStorage: + config: + type: hostPath + hostPath: /mnt/{{ .Release.Namespace }}/config diff --git a/library/ix-dev/community/invoice-ninja/item.yaml b/library/ix-dev/community/invoice-ninja/item.yaml new file mode 100644 index 0000000000..84aaf29d0c --- /dev/null +++ b/library/ix-dev/community/invoice-ninja/item.yaml @@ -0,0 +1,10 @@ +icon_url: https://raw.githubusercontent.com/Readarr/Readarr/develop/Logo/256.png +categories: + - media +screenshots: + - https://readarr.com/img/features/manualsearch.png + - https://readarr.com/img/features/calibre.png + - https://readarr.com/img/features/calendar.png +tags: + - ebook + - audiobook diff --git a/library/ix-dev/community/invoice-ninja/metadata.yaml b/library/ix-dev/community/invoice-ninja/metadata.yaml new file mode 100644 index 0000000000..02724e1d52 --- /dev/null +++ b/library/ix-dev/community/invoice-ninja/metadata.yaml @@ -0,0 +1,8 @@ +runAsContext: + - userName: readarr + groupName: readarr + gid: 568 + uid: 568 + description: Readarr can run as any non-root user. +capabilities: [] +hostMounts: [] diff --git a/library/ix-dev/community/invoice-ninja/questions.yaml b/library/ix-dev/community/invoice-ninja/questions.yaml new file mode 100644 index 0000000000..56cd30bb0c --- /dev/null +++ b/library/ix-dev/community/invoice-ninja/questions.yaml @@ -0,0 +1,240 @@ +# groups: +# - name: Readarr Configuration +# description: Configure Readarr +# - name: User and Group Configuration +# description: Configure User and Group for Readarr +# - name: Network Configuration +# description: Configure Network for Readarr +# - name: Storage Configuration +# description: Configure Storage for Readarr +# - name: Resources Configuration +# description: Configure Resources for Readarr + +# 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: readarrConfig +# label: "" +# group: Readarr Configuration +# schema: +# type: dict +# attrs: +# - variable: instanceName +# label: Instance Name +# description: The name of the Readarr instance. +# schema: +# type: string +# default: "Readarr" +# required: true +# - variable: additionalEnvs +# label: Additional Environment Variables +# description: Configure additional environment variables for Readarr. +# 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: readarrRunAs +# label: "" +# group: User and Group Configuration +# schema: +# type: dict +# attrs: +# - variable: user +# label: User ID +# description: The user id that Readarr will run as. +# schema: +# type: int +# min: 2 +# default: 568 +# required: true +# - variable: group +# label: Group ID +# description: The group id that Readarr will run as. +# schema: +# type: int +# min: 2 +# default: 568 +# required: true + +# - variable: readarrNetwork +# label: "" +# group: Network Configuration +# schema: +# type: dict +# attrs: +# - variable: webPort +# label: Web Port +# description: The port for the Readarr Web UI. +# schema: +# type: int +# default: 30045 +# 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: readarrStorage +# label: "" +# group: Storage Configuration +# schema: +# type: dict +# attrs: +# - variable: config +# label: Readarr Config Storage +# description: The path to store Readarr 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 Readarr. +# 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 Readarr. +# 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 Readarr. +# 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/library/ix-dev/community/invoice-ninja/templates/NOTES.txt b/library/ix-dev/community/invoice-ninja/templates/NOTES.txt new file mode 100644 index 0000000000..ba4e01146c --- /dev/null +++ b/library/ix-dev/community/invoice-ninja/templates/NOTES.txt @@ -0,0 +1 @@ +{{ include "ix.v1.common.lib.chart.notes" $ }} diff --git a/library/ix-dev/community/invoice-ninja/templates/_configmap.tpl b/library/ix-dev/community/invoice-ninja/templates/_configmap.tpl new file mode 100644 index 0000000000..0ccdbad983 --- /dev/null +++ b/library/ix-dev/community/invoice-ninja/templates/_configmap.tpl @@ -0,0 +1,35 @@ +{{- define "ninja.configmap" -}} +configmap: + nginx-config: + enabled: true + data: + nginx.conf: | + server { + listen {{ .Values.ninjaNetwork.webPort }} default_server; + server_name _; + + root /app; + index index.php; + + location / { + try_files $uri $uri/ /index.php?$query_string; + } + + location = /favicon.ico { access_log off; log_not_found off; } + location = /robots.txt { access_log off; log_not_found off; } + + location ~ \.php$ { + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass {{ include "ix.v1.common.lib.chart.names.fullname" $ }}:9000; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME /var/www/app/public$fastcgi_script_name; + fastcgi_buffer_size 16k; + fastcgi_buffers 4 16k; + } + } + ninja: + enabled: true + data: + DB_TYPE: +{{- end -}} diff --git a/library/ix-dev/community/invoice-ninja/templates/_invoiceNinja.tpl b/library/ix-dev/community/invoice-ninja/templates/_invoiceNinja.tpl new file mode 100644 index 0000000000..7613fa9bfe --- /dev/null +++ b/library/ix-dev/community/invoice-ninja/templates/_invoiceNinja.tpl @@ -0,0 +1,50 @@ +{{- define "ninja.workload" -}} +workload: + ninja: + enabled: true + primary: true + type: Deployment + podSpec: + securityContext: + fsGroup: 1500 + hostNetwork: {{ .Values.ninjaNetwork.hostNetwork }} + containers: + ninja: + enabled: true + primary: true + imageSelector: image + securityContext: + runAsUser: 1500 + runAsGroup: 1500 + env: + APP_ENV: production + envFrom: + - secretRef: + name: ninja-creds + {{ with .Values.ninjaConfig.additionalEnvs }} + envList: + {{ range $env := . }} + - name: {{ $env.name }} + value: {{ $env.value }} + {{ end }} + {{ end }} + probes: + liveness: + enabled: true + type: tcp + port: 9000 + readiness: + enabled: true + type: tcp + port: 9000 + startup: + enabled: true + type: tcp + port: 9000 + initContainers: + {{- include "ix.v1.common.app.permissions" (dict "containerName" "01-permissions" + "UID" 1500 + "GID" 1500 + "mode" "check" + "type" "init") | nindent 8 }} +{{- end -}} diff --git a/library/ix-dev/community/invoice-ninja/templates/_nginx.tpl b/library/ix-dev/community/invoice-ninja/templates/_nginx.tpl new file mode 100644 index 0000000000..2d279e0c1e --- /dev/null +++ b/library/ix-dev/community/invoice-ninja/templates/_nginx.tpl @@ -0,0 +1,32 @@ +{{- define "ninja.workload" -}} +workload: + nginx: + enabled: true + type: Deployment + podSpec: + securityContext: + fsGroup: 1500 + hostNetwork: {{ .Values.ninjaNetwork.hostNetwork }} + containers: + nginx: + enabled: true + primary: true + imageSelector: image + securityContext: + runAsUser: 1500 + runAsGroup: 1500 + probes: + liveness: + enabled: true + type: tcp + port: {{ .Values.ninjaNetwork.webPort }} + readiness: + enabled: true + type: tcp + port: {{ .Values.ninjaNetwork.webPort }} + startup: + enabled: true + type: tcp + port: {{ .Values.ninjaNetwork.webPort }} + # initContainer: # TODO: wait for ninja +{{- end -}} diff --git a/library/ix-dev/community/invoice-ninja/templates/_persistence.tpl b/library/ix-dev/community/invoice-ninja/templates/_persistence.tpl new file mode 100644 index 0000000000..d85ada81a9 --- /dev/null +++ b/library/ix-dev/community/invoice-ninja/templates/_persistence.tpl @@ -0,0 +1,45 @@ +{{- define "ninja.persistence" -}} +persistence: + public: + enabled: true + type: {{ .Values.ninjaStorage.public.type }} + datasetName: {{ .Values.ninjaStorage.public.datasetName | default "" }} + hostPath: {{ .Values.ninjaStorage.public.hostPath | default "" }} + targetSelector: + ninja: + readarr: + mountPath: /var/www/app/public + 01-permissions: + mountPath: /mnt/directories/public + storage: + enabled: true + type: {{ .Values.ninjaStorage.storage.type }} + datasetName: {{ .Values.ninjaStorage.storage.datasetName | default "" }} + hostPath: {{ .Values.ninjaStorage.storage.hostPath | default "" }} + targetSelector: + ninja: + readarr: + mountPath: /var/www/app/storage + 01-permissions: + mountPath: /mnt/directories/storage + tmp: + enabled: true + type: emptyDir + targetSelector: + readarr: + readarr: + mountPath: /tmp + {{- range $idx, $storage := .Values.readarrStorage.additionalStorages }} + {{ printf "readarr-%v" (int $idx) }}: + enabled: true + type: {{ $storage.type }} + datasetName: {{ $storage.datasetName | default "" }} + hostPath: {{ $storage.hostPath | default "" }} + targetSelector: + readarr: + readarr: + mountPath: {{ $storage.mountPath }} + 01-permissions: + mountPath: /mnt/directories{{ $storage.mountPath }} + {{- end }} +{{- end -}} diff --git a/library/ix-dev/community/invoice-ninja/templates/_portal.tpl b/library/ix-dev/community/invoice-ninja/templates/_portal.tpl new file mode 100644 index 0000000000..152f02a191 --- /dev/null +++ b/library/ix-dev/community/invoice-ninja/templates/_portal.tpl @@ -0,0 +1,12 @@ +{{- define "ninja.portal" -}} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: portal +data: + path: "/" + port: {{ .Values.ninjaNetwork.webPort | quote }} + protocol: http + host: $node_ip +{{- end -}} diff --git a/library/ix-dev/community/invoice-ninja/templates/_secret.tpl b/library/ix-dev/community/invoice-ninja/templates/_secret.tpl new file mode 100644 index 0000000000..ef6a44ee73 --- /dev/null +++ b/library/ix-dev/community/invoice-ninja/templates/_secret.tpl @@ -0,0 +1,13 @@ +{{- define "ninja.secret" -}} + {{- $fullname := (include "ix.v1.common.lib.chart.names.fullname" $) -}} + + {{- $appKey := randAlphaNum 32 -}} + {{- with (lookup "v1" "Secret" .Release.Namespace (printf "%s-ninja-creds" $fullname)) -}} + {{- $appKey = ((index .data "APP_KEY") | b64dec) -}} + {{- end }} +secret: + ninja-creds: + enabled: true + data: + APP_KEY: {{ $appKey }} +{{- end -}} diff --git a/library/ix-dev/community/invoice-ninja/templates/_service.tpl b/library/ix-dev/community/invoice-ninja/templates/_service.tpl new file mode 100644 index 0000000000..b096d92a01 --- /dev/null +++ b/library/ix-dev/community/invoice-ninja/templates/_service.tpl @@ -0,0 +1,15 @@ +{{- define "ninja.service" -}} +service: + readarr: + enabled: true + primary: true + type: NodePort + targetSelector: readarr + ports: + webui: + enabled: true + primary: true + port: {{ .Values.readarrNetwork.webPort }} + nodePort: {{ .Values.readarrNetwork.webPort }} + targetSelector: readarr +{{- end -}} diff --git a/library/ix-dev/community/invoice-ninja/templates/common.yaml b/library/ix-dev/community/invoice-ninja/templates/common.yaml new file mode 100644 index 0000000000..fe37713e97 --- /dev/null +++ b/library/ix-dev/community/invoice-ninja/templates/common.yaml @@ -0,0 +1,14 @@ +{{- include "ix.v1.common.loader.init" . -}} + +{{/* Merge the templates with Values */}} +{{- $_ := mustMergeOverwrite .Values (include "ninja.secret" $ | fromYaml) -}} +{{- $_ := mustMergeOverwrite .Values (include "ninja.configmap" $ | fromYaml) -}} +{{- $_ := mustMergeOverwrite .Values (include "ninja.workload" $ | fromYaml) -}} +{{- $_ := mustMergeOverwrite .Values (include "ninja.nginx" $ | fromYaml) -}} +{{- $_ := mustMergeOverwrite .Values (include "ninja.service" $ | fromYaml) -}} +{{- $_ := mustMergeOverwrite .Values (include "ninja.persistence" $ | fromYaml) -}} + +{{/* Create the configmap for portal manually*/}} +{{- include "ninja.portal" $ -}} + +{{- include "ix.v1.common.loader.apply" . -}} diff --git a/library/ix-dev/community/invoice-ninja/upgrade_info.json b/library/ix-dev/community/invoice-ninja/upgrade_info.json new file mode 100644 index 0000000000..767388094a --- /dev/null +++ b/library/ix-dev/community/invoice-ninja/upgrade_info.json @@ -0,0 +1 @@ +{"filename": "values.yaml", "keys": ["image"]} diff --git a/library/ix-dev/community/invoice-ninja/upgrade_strategy b/library/ix-dev/community/invoice-ninja/upgrade_strategy new file mode 100755 index 0000000000..af685230a1 --- /dev/null +++ b/library/ix-dev/community/invoice-ninja/upgrade_strategy @@ -0,0 +1,31 @@ +#!/usr/bin/python3 +import json +import re +import sys + +from catalog_update.upgrade_strategy import semantic_versioning + + +RE_STABLE_VERSION = re.compile(r'\d+\.\d+\.\d+') + + +def newer_mapping(image_tags): + key = list(image_tags.keys())[0] + tags = {t: t for t in image_tags[key] if RE_STABLE_VERSION.fullmatch(t)} + version = semantic_versioning(list(tags)) + if not version: + return {} + + return { + 'tags': {key: tags[version]}, + 'app_version': version, + } + + +if __name__ == '__main__': + try: + versions_json = json.loads(sys.stdin.read()) + except ValueError: + raise ValueError('Invalid json specified') + + print(json.dumps(newer_mapping(versions_json))) diff --git a/library/ix-dev/community/invoice-ninja/values.yaml b/library/ix-dev/community/invoice-ninja/values.yaml new file mode 100644 index 0000000000..ade66dfa23 --- /dev/null +++ b/library/ix-dev/community/invoice-ninja/values.yaml @@ -0,0 +1,23 @@ +image: + repository: invoiceninja/invoiceninja + pullPolicy: IfNotPresent + tag: 5.6.23 + +resources: + limits: + cpu: 4000m + memory: 8Gi + +ninjaConfig: + additionalEnvs: [] +ninjaNetwork: + webPort: 30045 + hostNetwork: false +# ninjaRunAs: +# user: 568 +# group: 568 +# ninjaStorage: +# config: +# type: ixVolume +# datasetName: config +# additionalStorages: []