From 79dd59bed73da0c10b0db61e6f13b50cd11711b1 Mon Sep 17 00:00:00 2001 From: "M. Rehan" Date: Sat, 23 Apr 2022 17:51:32 +0500 Subject: [PATCH 1/3] Add syncthing application --- test/syncthing/.helmignore | 2 + test/syncthing/1.0.0/Chart.yaml | 14 ++ test/syncthing/1.0.0/README.md | 5 + test/syncthing/1.0.0/app-readme.md | 5 + .../1.0.0/charts/common-2112.0.0.tgz | Bin 0 -> 4467 bytes test/syncthing/1.0.0/ix_values.yaml | 4 + test/syncthing/1.0.0/questions.yaml | 187 ++++++++++++++++++ .../syncthing/1.0.0/templates/deployment.yaml | 56 ++++++ .../1.0.0/templates/pre-install-job.yaml | 32 +++ test/syncthing/1.0.0/templates/service.yaml | 11 ++ .../templates/tests/deployment-check.yaml | 21 ++ test/syncthing/1.0.0/test_values.yaml | 20 ++ test/syncthing/item.yaml | 4 + test/syncthing/upgrade_info.json | 1 + test/syncthing/upgrade_strategy | 25 +++ 15 files changed, 387 insertions(+) create mode 100644 test/syncthing/.helmignore create mode 100644 test/syncthing/1.0.0/Chart.yaml create mode 100644 test/syncthing/1.0.0/README.md create mode 100644 test/syncthing/1.0.0/app-readme.md create mode 100644 test/syncthing/1.0.0/charts/common-2112.0.0.tgz create mode 100644 test/syncthing/1.0.0/ix_values.yaml create mode 100644 test/syncthing/1.0.0/questions.yaml create mode 100644 test/syncthing/1.0.0/templates/deployment.yaml create mode 100644 test/syncthing/1.0.0/templates/pre-install-job.yaml create mode 100644 test/syncthing/1.0.0/templates/service.yaml create mode 100644 test/syncthing/1.0.0/templates/tests/deployment-check.yaml create mode 100644 test/syncthing/1.0.0/test_values.yaml create mode 100644 test/syncthing/item.yaml create mode 100644 test/syncthing/upgrade_info.json create mode 100755 test/syncthing/upgrade_strategy diff --git a/test/syncthing/.helmignore b/test/syncthing/.helmignore new file mode 100644 index 0000000000..c1347c2c27 --- /dev/null +++ b/test/syncthing/.helmignore @@ -0,0 +1,2 @@ +# Patterns to ignore when building packages. +*.png diff --git a/test/syncthing/1.0.0/Chart.yaml b/test/syncthing/1.0.0/Chart.yaml new file mode 100644 index 0000000000..3b29762d50 --- /dev/null +++ b/test/syncthing/1.0.0/Chart.yaml @@ -0,0 +1,14 @@ +apiVersion: v2 +appVersion: 1.19.2 +icon: https://truecharts.org/_static/img/appicons/syncthing.png +description: Syncthing is a continuous file synchronization program. +name: syncthing +version: 1.0.0 +dependencies: +- name: common + repository: file://../../../library/common/2112.0.0 + version: 2112.0.0 +home: https://syncthing.net/ +keywords: +- storage +- backup diff --git a/test/syncthing/1.0.0/README.md b/test/syncthing/1.0.0/README.md new file mode 100644 index 0000000000..ea0896841d --- /dev/null +++ b/test/syncthing/1.0.0/README.md @@ -0,0 +1,5 @@ +# Syncthing + +[syncthing](https://syncthing.net/) is a continuous file synchronization program. It synchronizes files between two or +more computers in real time, safely protected from prying eyes. Your data is your data alone and you deserve to choose +where it is stored, whether it is shared with some third party, and how it's transmitted over the internet. diff --git a/test/syncthing/1.0.0/app-readme.md b/test/syncthing/1.0.0/app-readme.md new file mode 100644 index 0000000000..ea0896841d --- /dev/null +++ b/test/syncthing/1.0.0/app-readme.md @@ -0,0 +1,5 @@ +# Syncthing + +[syncthing](https://syncthing.net/) is a continuous file synchronization program. It synchronizes files between two or +more computers in real time, safely protected from prying eyes. Your data is your data alone and you deserve to choose +where it is stored, whether it is shared with some third party, and how it's transmitted over the internet. diff --git a/test/syncthing/1.0.0/charts/common-2112.0.0.tgz b/test/syncthing/1.0.0/charts/common-2112.0.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..62c214e1c86f187b4288c35d834eba8b277fc364 GIT binary patch literal 4467 zcmV-(5sdC1iwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PH<$Z`-(*^Vz@RtlGhiyA$~lCs_m-V6#c?OwdjmG}+!eSS$is zqHQ)ZsgjgaZzlWOFZhzEhaYJgx1BLRw3b939g^pza}G};Hk~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J!@^amVWI}iU%pjB3R&}Ju@yCpC z9NUyBwa=7E5LgDK@qTU7yxMhhN$4l0nUYVATI^mv={;!H^o|%wB<$g#%3EH}SaPah z9Q_Oimfu;giFdtk*_c99xPhxHfjYui-cQ(JETlTVh&pSAw){-9sa|JmmMZKRcb(@L3YU10nSyU;Z5{`G0S}`u86X4!8BcHqu_eC6W?zsvUiX0^n|f zDGW1`#DtC^MbRx9V-dDqfG&<={~(M2F~La!jl_qmG4ikASPV2 z!ZDE@{jWj46%PN8cl5vR#$?=4|F}yrqn!fK5Jk6H3L~PAdxzpKZM_PI=(hDLlvDMa zaWZbb`v2Aoc#k+?nSk@tGtmlD&OYEswn7qP)G^&T`_Kw!B4RP_eB-RIo8|v^XUC_% zorTl*Io`1{{?o1Te|KB|do%3?ys>}O^<>!}byfFthgR#=tA8B7yEwo2pJ zUyt8i!}%3lyuF6s&W9|U=F^fb;vXn&HG*w-1bonmPd7=8WLpYaz6Od*+WkTmEs40v& z%Tgu0+@GLhV-mp-%R7us@$1|F5dS%0Q(HGogwSeT5gK7YkT4znFb`nFl7!vqF+!OK zPB`fjd+smd-XWm{rc_dt<2Z{jOc9|HQ>1`KOvg@&*IVHFujge#SKHGi82KDfG||Qw zf-ysh!eofmR8HUh9=2L9Ucfn(oW+?A+1Ld&#m{VHMz~q$$)XdSq?il1n~-P%5u$lj zKgl4*Gn}v#D86%OWjfrXH>kEHZKn{xl*Q%Y_aNuCZQHhO+qSLT{uKZK|NkRSd{h8{ F0054o)rkNA literal 0 HcmV?d00001 diff --git a/test/syncthing/1.0.0/ix_values.yaml b/test/syncthing/1.0.0/ix_values.yaml new file mode 100644 index 0000000000..42d42081e0 --- /dev/null +++ b/test/syncthing/1.0.0/ix_values.yaml @@ -0,0 +1,4 @@ +image: + pullPolicy: IfNotPresent + repository: syncthing/syncthing + tag: 1.19.2 diff --git a/test/syncthing/1.0.0/questions.yaml b/test/syncthing/1.0.0/questions.yaml new file mode 100644 index 0000000000..14d2bdb31b --- /dev/null +++ b/test/syncthing/1.0.0/questions.yaml @@ -0,0 +1,187 @@ +groups: + - name: "Configuration" + description: "Syncthing application configuration" + - name: "Storage" + description: "Configure storage for syncthing" + - name: "Networking" + description: "Networking Configuration for syncthing" + - name: "Advanced DNS Settings" + description: "Configure DNS settings" + +portals: + web_portal: + protocols: + - "http" + host: + - "$node_ip" + ports: + - "$variable-web_port" + path: "/" + +questions: + - variable: web_port + label: "Web Port for syncthing" + group: Networking + schema: + type: int + min: 8000 + max: 65535 + default: 20910 + required: true + - variable: tcp_port + label: "TCP Port for syncthing" + group: Networking + schema: + type: int + min: 8000 + max: 65535 + default: 20978 + required: true + - variable: udp_port + label: "UDP Port for syncthing" + group: Networking + schema: + type: int + min: 8000 + max: 65535 + default: 20979 + required: true + - variable: hostNetwork + label: "Host Network" + group: Networking + schema: + type: boolean + default: false + + - variable: dnsConfig + label: "DNS Configuration" + group: "Advanced DNS Settings" + schema: + type: dict + attrs: + - variable: options + label: "DNS Options" + schema: + type: list + items: + - variable: optionsEntry + label: "Option Entry Configuration" + schema: + type: dict + attrs: + - variable: name + label: "Option Name" + schema: + type: string + required: true + - variable: value + label: "Option Value" + schema: + type: string + required: true + + - variable: ownerUID + label: "Owner User ID" + group: Configuration + schema: + type: int + default: 568 + min: 1 + max: 65535 + + - variable: ownerGID + label: "Owner Group ID" + group: Configuration + schema: + type: int + default: 568 + min: 1 + max: 65535 + + - variable: environmentVariables + label: "Syncthing environment" + group: "Configuration" + schema: + type: list + default: [ ] + items: + - variable: environmentVariable + label: "Environment Variable" + schema: + type: dict + attrs: + - variable: name + label: "Name" + schema: + type: string + - variable: value + label: "Value" + schema: + type: string + + - variable: appVolumeMounts + label: "Syncthing Storage" + group: "Storage" + schema: + type: dict + attrs: + - variable: config + label: "Configuration Volume" + schema: + type: dict + attrs: + - variable: datasetName + label: "Configuration Volume Dataset Name" + schema: + type: string + hidden: true + $ref: + - "normalize/ixVolume" + show_if: [["hostPathEnabled", "=", false]] + default: "ix-syncthing_config" + editable: false + - variable: mountPath + label: "Configuration Mount Path" + description: "Path where the volume will be mounted inside the pod" + schema: + type: path + hidden: true + editable: true + default: "/var/syncthing" + - variable: hostPathEnabled + label: "Enable Custom Host Path for Syncthing Configuration Volume" + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: hostPath + label: "Host Path for Syncthing Configuration Volume" + schema: + type: hostpath + required: true + + - variable: extraAppVolumeMounts + label: "Extra Host Path Volumes" + group: "Storage" + schema: + type: list + items: + - variable: extraAppVolume + label: "Host Path Volume" + description: "Add an extra host path volume for Syncthing application" + schema: + type: dict + attrs: + - variable: mountPath + label: "Mount Path in Pod" + description: "Path where the volume will be mounted inside the pod" + schema: + type: path + required: true + - variable: hostPath + label: "Host Path" + description: "Host path" + schema: + type: hostpath + required: true \ No newline at end of file diff --git a/test/syncthing/1.0.0/templates/deployment.yaml b/test/syncthing/1.0.0/templates/deployment.yaml new file mode 100644 index 0000000000..d62171d17b --- /dev/null +++ b/test/syncthing/1.0.0/templates/deployment.yaml @@ -0,0 +1,56 @@ +apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }} +kind: Deployment +metadata: + name: {{ template "common.names.fullname" . }} + labels: + app: {{ template "common.names.name" . }} + chart: {{ template "common.names.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + annotations: + rollme: {{ randAlphaNum 5 | quote }} +spec: + replicas: {{ (default 1 .Values.replicas) }} + strategy: + type: "Recreate" + selector: + matchLabels: + app: {{ template "common.names.name" . }} + release: {{ .Release.Name }} + template: + metadata: + name: {{ template "common.names.fullname" . }} + labels: + app: {{ template "common.names.name" . }} + release: {{ .Release.Name }} + {{- include "common.labels.selectorLabels" . | nindent 8 }} + annotations: {{ include "common.annotations" . | nindent 8 }} + spec: + hostNetwork: {{ .Values.hostNetwork }} + hostname: {{ .Release.Name }} + containers: + - name: {{ .Chart.Name }} + {{ include "common.containers.imageConfig" .Values.image | nindent 10 }} + volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }} + ports: + - name: web + containerPort: 8384 + - name: tcp + containerPort: 22000 + protocol: TCP + - name: udp + containerPort: 22000 + protocol: UDP + env: + {{ $envList := (default list .Values.environmentVariables) }} + {{ $envList = mustAppend $envList (dict "name" "PUID" "value" (printf "%d" (.Values.ownerUID | int))) }} + {{ $envList = mustAppend $envList (dict "name" "PGID" "value" (printf "%d" (.Values.ownerGID | int))) }} + {{ $envList = mustAppend $envList (dict "name" "STGUIADDRESS" "value" "0.0.0.0:8384") }} + {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }} +{{ include "common.networking.dnsConfiguration" .Values | nindent 6 }} + volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }} + {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }} + - name: extrappvolume-{{ $index }} + hostPath: + path: {{ $hostPathConfiguration.hostPath }} + {{ end }} diff --git a/test/syncthing/1.0.0/templates/pre-install-job.yaml b/test/syncthing/1.0.0/templates/pre-install-job.yaml new file mode 100644 index 0000000000..33c4cfb113 --- /dev/null +++ b/test/syncthing/1.0.0/templates/pre-install-job.yaml @@ -0,0 +1,32 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: "{{ template "common.names.fullname" . }}-preinstall-job" + labels: + app.kubernetes.io/managed-by: {{ .Release.Service | quote }} + app.kubernetes.io/instance: {{ .Release.Name | quote }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + helm.sh/chart: {{ template "common.names.chart" . }} + annotations: + "helm.sh/hook": pre-install + "helm.sh/hook-delete-policy": hook-succeeded +spec: + template: + metadata: + name: "{{ template "common.names.fullname" . }}-preinstall-hook" + labels: + app.kubernetes.io/managed-by: {{ .Release.Service | quote }} + app.kubernetes.io/instance: {{ .Release.Name | quote }} + helm.sh/chart: {{ template "common.names.chart" . }} + spec: + restartPolicy: Never + containers: + - name: pre-install-job + image: "alpine:latest" + command: + - "chown" + - "-R" + - "{{ .Values.ownerUID }}:{{ .Values.ownerGID }}" + - "{{ .Values.appVolumeMounts.config.mountPath }}" + volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }} + volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }} diff --git a/test/syncthing/1.0.0/templates/service.yaml b/test/syncthing/1.0.0/templates/service.yaml new file mode 100644 index 0000000000..a35d1ffe18 --- /dev/null +++ b/test/syncthing/1.0.0/templates/service.yaml @@ -0,0 +1,11 @@ +{{ $selectors := list }} +{{ $selectors = mustAppend $selectors (dict "key" "app" "value" (include "common.names.name" .) ) }} +{{ $selectors = mustAppend $selectors (dict "key" "release" "value" .Release.Name ) }} +{{ $ports := list }} +{{ $ports = mustAppend $ports (dict "name" "web" "port" .Values.web_port "nodePort" .Values.web_port "targetPort" 8384) }} +{{ $ports = mustAppend $ports (dict "name" "tcp" "port" .Values.tcp_port "nodePort" .Values.tcp_port "targetPort" 22000) }} +{{ $ports = mustAppend $ports (dict "name" "udp" "port" .Values.udp_port "nodePort" .Values.udp_port "targetPort" 22000 "protocol" "UDP") }} +{{ $params := . }} +{{ $_ := set $params "commonService" (dict "type" "NodePort" "ports" $ports ) }} +{{ $_1 := set .Values "extraSelectorLabels" $selectors }} +{{ include "common.classes.service" $params }} diff --git a/test/syncthing/1.0.0/templates/tests/deployment-check.yaml b/test/syncthing/1.0.0/templates/tests/deployment-check.yaml new file mode 100644 index 0000000000..64ebf08fa3 --- /dev/null +++ b/test/syncthing/1.0.0/templates/tests/deployment-check.yaml @@ -0,0 +1,21 @@ +{{- $serviceName := (include "common.names.fullname" .) -}} +apiVersion: v1 +kind: Pod +metadata: + name: {{ .Release.Name }}-syncthing + labels: + app: {{ .Release.Name }} + release: {{ .Release.Name }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: test-curl + image: alpine/curl + imagePullPolicy: "IfNotPresent" + command: + - /bin/sh + - -ec + - | + curl --connect-timeout 5 --max-time 10 --retry 5 --retry-delay 15 --retry-max-time 90 --retry-all-errors -ksf http://{{ $serviceName }}:{{.Values.web_port}}/ + restartPolicy: Never diff --git a/test/syncthing/1.0.0/test_values.yaml b/test/syncthing/1.0.0/test_values.yaml new file mode 100644 index 0000000000..5cc96cc537 --- /dev/null +++ b/test/syncthing/1.0.0/test_values.yaml @@ -0,0 +1,20 @@ +image: + pullPolicy: IfNotPresent + repository: syncthing/syncthing + tag: 1.19.2 +ownerUID: 568 +ownerGID: 568 +timezone: Europe/London +environmentVariables: [] +extraAppVolumeMounts: [] +web_port: 32000 +tcp_port: 32001 +udp_port: 32002 +dnsConfig: + options: [] +emptyDirVolumes: true +appVolumeMounts: + config: + emptyDir: true + mountPath: /config +hostNetwork: false diff --git a/test/syncthing/item.yaml b/test/syncthing/item.yaml new file mode 100644 index 0000000000..2b19477d9f --- /dev/null +++ b/test/syncthing/item.yaml @@ -0,0 +1,4 @@ +icon_url: https://truecharts.org/_static/img/appicons/syncthing.png +categories: +- backup +- storage diff --git a/test/syncthing/upgrade_info.json b/test/syncthing/upgrade_info.json new file mode 100644 index 0000000000..5bf84fb901 --- /dev/null +++ b/test/syncthing/upgrade_info.json @@ -0,0 +1 @@ +{"filename": "ix_values.yaml", "keys": ["image"]} diff --git a/test/syncthing/upgrade_strategy b/test/syncthing/upgrade_strategy new file mode 100755 index 0000000000..7b17b7c084 --- /dev/null +++ b/test/syncthing/upgrade_strategy @@ -0,0 +1,25 @@ +#!/usr/bin/python3 +import json +import sys + +from catalog_update.upgrade_strategy import semantic_versioning + + +def newer_mapping(image_tags): + key = list(image_tags.keys())[0] + tags = {t: t for t in image_tags[key]} + version = semantic_versioning(list(tags)) + if not version: + return {} + + return { + 'tags': {key: tags[version]}, + 'app_version': version, + } + + +if __name__ == '__main__': + if len(sys.argv) != 2: + exit(1) + + print(json.dumps(newer_mapping(json.loads(sys.argv[1])))) From 91166906a8e6e6f525a66a0f699f4f8a4c33bd25 Mon Sep 17 00:00:00 2001 From: sonicaj Date: Mon, 2 May 2022 21:22:33 +0500 Subject: [PATCH 2/3] Update readme to reflect contents warning --- test/syncthing/1.0.0/app-readme.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/syncthing/1.0.0/app-readme.md b/test/syncthing/1.0.0/app-readme.md index ea0896841d..9f0f625bcf 100644 --- a/test/syncthing/1.0.0/app-readme.md +++ b/test/syncthing/1.0.0/app-readme.md @@ -1,5 +1,6 @@ # Syncthing [syncthing](https://syncthing.net/) is a continuous file synchronization program. It synchronizes files between two or -more computers in real time, safely protected from prying eyes. Your data is your data alone and you deserve to choose -where it is stored, whether it is shared with some third party, and how it's transmitted over the internet. +more computers in real time, safely protected from prying eyes. + +> **WARNING** Do check out https://docs.syncthing.net/users/faq.html#what-things-are-synced to see what is synced. From 2e9c315d60a907d25256c4f9f47e5878e50e0e18 Mon Sep 17 00:00:00 2001 From: sonicaj Date: Mon, 2 May 2022 21:22:46 +0500 Subject: [PATCH 3/3] Update stable train from test train --- charts/syncthing/.helmignore | 2 + charts/syncthing/1.0.0/Chart.yaml | 14 ++ charts/syncthing/1.0.0/README.md | 5 + charts/syncthing/1.0.0/app-readme.md | 6 + .../1.0.0/charts/common-2112.0.0.tgz | Bin 0 -> 4467 bytes charts/syncthing/1.0.0/ix_values.yaml | 4 + charts/syncthing/1.0.0/questions.yaml | 187 ++++++++++++++++++ .../syncthing/1.0.0/templates/deployment.yaml | 56 ++++++ .../1.0.0/templates/pre-install-job.yaml | 32 +++ charts/syncthing/1.0.0/templates/service.yaml | 11 ++ .../templates/tests/deployment-check.yaml | 21 ++ charts/syncthing/1.0.0/test_values.yaml | 20 ++ charts/syncthing/item.yaml | 4 + charts/syncthing/upgrade_info.json | 1 + charts/syncthing/upgrade_strategy | 25 +++ 15 files changed, 388 insertions(+) create mode 100644 charts/syncthing/.helmignore create mode 100644 charts/syncthing/1.0.0/Chart.yaml create mode 100644 charts/syncthing/1.0.0/README.md create mode 100644 charts/syncthing/1.0.0/app-readme.md create mode 100644 charts/syncthing/1.0.0/charts/common-2112.0.0.tgz create mode 100644 charts/syncthing/1.0.0/ix_values.yaml create mode 100644 charts/syncthing/1.0.0/questions.yaml create mode 100644 charts/syncthing/1.0.0/templates/deployment.yaml create mode 100644 charts/syncthing/1.0.0/templates/pre-install-job.yaml create mode 100644 charts/syncthing/1.0.0/templates/service.yaml create mode 100644 charts/syncthing/1.0.0/templates/tests/deployment-check.yaml create mode 100644 charts/syncthing/1.0.0/test_values.yaml create mode 100644 charts/syncthing/item.yaml create mode 100644 charts/syncthing/upgrade_info.json create mode 100755 charts/syncthing/upgrade_strategy diff --git a/charts/syncthing/.helmignore b/charts/syncthing/.helmignore new file mode 100644 index 0000000000..c1347c2c27 --- /dev/null +++ b/charts/syncthing/.helmignore @@ -0,0 +1,2 @@ +# Patterns to ignore when building packages. +*.png diff --git a/charts/syncthing/1.0.0/Chart.yaml b/charts/syncthing/1.0.0/Chart.yaml new file mode 100644 index 0000000000..3b29762d50 --- /dev/null +++ b/charts/syncthing/1.0.0/Chart.yaml @@ -0,0 +1,14 @@ +apiVersion: v2 +appVersion: 1.19.2 +icon: https://truecharts.org/_static/img/appicons/syncthing.png +description: Syncthing is a continuous file synchronization program. +name: syncthing +version: 1.0.0 +dependencies: +- name: common + repository: file://../../../library/common/2112.0.0 + version: 2112.0.0 +home: https://syncthing.net/ +keywords: +- storage +- backup diff --git a/charts/syncthing/1.0.0/README.md b/charts/syncthing/1.0.0/README.md new file mode 100644 index 0000000000..ea0896841d --- /dev/null +++ b/charts/syncthing/1.0.0/README.md @@ -0,0 +1,5 @@ +# Syncthing + +[syncthing](https://syncthing.net/) is a continuous file synchronization program. It synchronizes files between two or +more computers in real time, safely protected from prying eyes. Your data is your data alone and you deserve to choose +where it is stored, whether it is shared with some third party, and how it's transmitted over the internet. diff --git a/charts/syncthing/1.0.0/app-readme.md b/charts/syncthing/1.0.0/app-readme.md new file mode 100644 index 0000000000..9f0f625bcf --- /dev/null +++ b/charts/syncthing/1.0.0/app-readme.md @@ -0,0 +1,6 @@ +# Syncthing + +[syncthing](https://syncthing.net/) is a continuous file synchronization program. It synchronizes files between two or +more computers in real time, safely protected from prying eyes. + +> **WARNING** Do check out https://docs.syncthing.net/users/faq.html#what-things-are-synced to see what is synced. diff --git a/charts/syncthing/1.0.0/charts/common-2112.0.0.tgz b/charts/syncthing/1.0.0/charts/common-2112.0.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..62c214e1c86f187b4288c35d834eba8b277fc364 GIT binary patch literal 4467 zcmV-(5sdC1iwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PH<$Z`-(*^Vz@RtlGhiyA$~lCs_m-V6#c?OwdjmG}+!eSS$is zqHQ)ZsgjgaZzlWOFZhzEhaYJgx1BLRw3b939g^pza}G};Hk~rsIhi0X!#SEJKYaPt z?RL8dgMt3P+wE5W@AkXhA9{n{{@!43zdJbmq1)>Z_78u6?la(0YnhOU|ImH%yQ-7> zP8v$dd&~u4^ay7C7E06Nve$~Sh&V~5zCMP83_0R+h!nNJh;bnQgtwy+i3m#I1WA;z zaf_lUJ_18nEjdr|ksH{WIoSPPuOD{9ZtH8$|F7OG|4Teg6C|{a;xV6eC4|BbZ!`_8M@i6#QDI}dj2Tdz6~53T$AU5N3BPz-?~mat4A z0qj0Jv`TWM*SaM%K7uRL@z}zfVu@lT(NPP)2#Nc9AT&y{xB#vm2=@v*@&Zk903rMV zA2TK~JUmzkB1Mq_6TZUVZt)%ZV3kPx06_yPi81^@R4{Xv!g_j_CZ-$>K^e?1`r90_PKfCV4{ z2!=_9Q%yRnCrAR~7$T05#BuA6$O)k!C)nBmPWy)o1&XCP$Mr$Z zY%gah$*_Q}hnf0YW__y5v5EbWny}OcR`WS;y&Ju zqY5q!v#228Ux^e)M+H(ljKdE8SZq*ml4L?+etsFWVFyoBInN)q+XkMoar2J#DMs#* z>7QSk{c7%Xe~)QgEM6k8f>=WBg2nifaT)k%XbP}B%ER-k5h4i$Z)q|wkO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vg@&*IVHFujge#SKHGi82KDfG||Qw zf-ysh!eofmR8HUh9=2L9Ucfn(oW+?A+1Ld&#m{VHMz~q$$)XdSq?il1n~-P%5u$lj zKgl4*Gn}v#D86%OWjfrXH>kEHZKn{xl*Q%Y_aNuCZQHhO+qSLT{uKZK|NkRSd{h8{ F0054o)rkNA literal 0 HcmV?d00001 diff --git a/charts/syncthing/1.0.0/ix_values.yaml b/charts/syncthing/1.0.0/ix_values.yaml new file mode 100644 index 0000000000..42d42081e0 --- /dev/null +++ b/charts/syncthing/1.0.0/ix_values.yaml @@ -0,0 +1,4 @@ +image: + pullPolicy: IfNotPresent + repository: syncthing/syncthing + tag: 1.19.2 diff --git a/charts/syncthing/1.0.0/questions.yaml b/charts/syncthing/1.0.0/questions.yaml new file mode 100644 index 0000000000..14d2bdb31b --- /dev/null +++ b/charts/syncthing/1.0.0/questions.yaml @@ -0,0 +1,187 @@ +groups: + - name: "Configuration" + description: "Syncthing application configuration" + - name: "Storage" + description: "Configure storage for syncthing" + - name: "Networking" + description: "Networking Configuration for syncthing" + - name: "Advanced DNS Settings" + description: "Configure DNS settings" + +portals: + web_portal: + protocols: + - "http" + host: + - "$node_ip" + ports: + - "$variable-web_port" + path: "/" + +questions: + - variable: web_port + label: "Web Port for syncthing" + group: Networking + schema: + type: int + min: 8000 + max: 65535 + default: 20910 + required: true + - variable: tcp_port + label: "TCP Port for syncthing" + group: Networking + schema: + type: int + min: 8000 + max: 65535 + default: 20978 + required: true + - variable: udp_port + label: "UDP Port for syncthing" + group: Networking + schema: + type: int + min: 8000 + max: 65535 + default: 20979 + required: true + - variable: hostNetwork + label: "Host Network" + group: Networking + schema: + type: boolean + default: false + + - variable: dnsConfig + label: "DNS Configuration" + group: "Advanced DNS Settings" + schema: + type: dict + attrs: + - variable: options + label: "DNS Options" + schema: + type: list + items: + - variable: optionsEntry + label: "Option Entry Configuration" + schema: + type: dict + attrs: + - variable: name + label: "Option Name" + schema: + type: string + required: true + - variable: value + label: "Option Value" + schema: + type: string + required: true + + - variable: ownerUID + label: "Owner User ID" + group: Configuration + schema: + type: int + default: 568 + min: 1 + max: 65535 + + - variable: ownerGID + label: "Owner Group ID" + group: Configuration + schema: + type: int + default: 568 + min: 1 + max: 65535 + + - variable: environmentVariables + label: "Syncthing environment" + group: "Configuration" + schema: + type: list + default: [ ] + items: + - variable: environmentVariable + label: "Environment Variable" + schema: + type: dict + attrs: + - variable: name + label: "Name" + schema: + type: string + - variable: value + label: "Value" + schema: + type: string + + - variable: appVolumeMounts + label: "Syncthing Storage" + group: "Storage" + schema: + type: dict + attrs: + - variable: config + label: "Configuration Volume" + schema: + type: dict + attrs: + - variable: datasetName + label: "Configuration Volume Dataset Name" + schema: + type: string + hidden: true + $ref: + - "normalize/ixVolume" + show_if: [["hostPathEnabled", "=", false]] + default: "ix-syncthing_config" + editable: false + - variable: mountPath + label: "Configuration Mount Path" + description: "Path where the volume will be mounted inside the pod" + schema: + type: path + hidden: true + editable: true + default: "/var/syncthing" + - variable: hostPathEnabled + label: "Enable Custom Host Path for Syncthing Configuration Volume" + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: hostPath + label: "Host Path for Syncthing Configuration Volume" + schema: + type: hostpath + required: true + + - variable: extraAppVolumeMounts + label: "Extra Host Path Volumes" + group: "Storage" + schema: + type: list + items: + - variable: extraAppVolume + label: "Host Path Volume" + description: "Add an extra host path volume for Syncthing application" + schema: + type: dict + attrs: + - variable: mountPath + label: "Mount Path in Pod" + description: "Path where the volume will be mounted inside the pod" + schema: + type: path + required: true + - variable: hostPath + label: "Host Path" + description: "Host path" + schema: + type: hostpath + required: true \ No newline at end of file diff --git a/charts/syncthing/1.0.0/templates/deployment.yaml b/charts/syncthing/1.0.0/templates/deployment.yaml new file mode 100644 index 0000000000..d62171d17b --- /dev/null +++ b/charts/syncthing/1.0.0/templates/deployment.yaml @@ -0,0 +1,56 @@ +apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }} +kind: Deployment +metadata: + name: {{ template "common.names.fullname" . }} + labels: + app: {{ template "common.names.name" . }} + chart: {{ template "common.names.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + annotations: + rollme: {{ randAlphaNum 5 | quote }} +spec: + replicas: {{ (default 1 .Values.replicas) }} + strategy: + type: "Recreate" + selector: + matchLabels: + app: {{ template "common.names.name" . }} + release: {{ .Release.Name }} + template: + metadata: + name: {{ template "common.names.fullname" . }} + labels: + app: {{ template "common.names.name" . }} + release: {{ .Release.Name }} + {{- include "common.labels.selectorLabels" . | nindent 8 }} + annotations: {{ include "common.annotations" . | nindent 8 }} + spec: + hostNetwork: {{ .Values.hostNetwork }} + hostname: {{ .Release.Name }} + containers: + - name: {{ .Chart.Name }} + {{ include "common.containers.imageConfig" .Values.image | nindent 10 }} + volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }} + ports: + - name: web + containerPort: 8384 + - name: tcp + containerPort: 22000 + protocol: TCP + - name: udp + containerPort: 22000 + protocol: UDP + env: + {{ $envList := (default list .Values.environmentVariables) }} + {{ $envList = mustAppend $envList (dict "name" "PUID" "value" (printf "%d" (.Values.ownerUID | int))) }} + {{ $envList = mustAppend $envList (dict "name" "PGID" "value" (printf "%d" (.Values.ownerGID | int))) }} + {{ $envList = mustAppend $envList (dict "name" "STGUIADDRESS" "value" "0.0.0.0:8384") }} + {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }} +{{ include "common.networking.dnsConfiguration" .Values | nindent 6 }} + volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }} + {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }} + - name: extrappvolume-{{ $index }} + hostPath: + path: {{ $hostPathConfiguration.hostPath }} + {{ end }} diff --git a/charts/syncthing/1.0.0/templates/pre-install-job.yaml b/charts/syncthing/1.0.0/templates/pre-install-job.yaml new file mode 100644 index 0000000000..33c4cfb113 --- /dev/null +++ b/charts/syncthing/1.0.0/templates/pre-install-job.yaml @@ -0,0 +1,32 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: "{{ template "common.names.fullname" . }}-preinstall-job" + labels: + app.kubernetes.io/managed-by: {{ .Release.Service | quote }} + app.kubernetes.io/instance: {{ .Release.Name | quote }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + helm.sh/chart: {{ template "common.names.chart" . }} + annotations: + "helm.sh/hook": pre-install + "helm.sh/hook-delete-policy": hook-succeeded +spec: + template: + metadata: + name: "{{ template "common.names.fullname" . }}-preinstall-hook" + labels: + app.kubernetes.io/managed-by: {{ .Release.Service | quote }} + app.kubernetes.io/instance: {{ .Release.Name | quote }} + helm.sh/chart: {{ template "common.names.chart" . }} + spec: + restartPolicy: Never + containers: + - name: pre-install-job + image: "alpine:latest" + command: + - "chown" + - "-R" + - "{{ .Values.ownerUID }}:{{ .Values.ownerGID }}" + - "{{ .Values.appVolumeMounts.config.mountPath }}" + volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }} + volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }} diff --git a/charts/syncthing/1.0.0/templates/service.yaml b/charts/syncthing/1.0.0/templates/service.yaml new file mode 100644 index 0000000000..a35d1ffe18 --- /dev/null +++ b/charts/syncthing/1.0.0/templates/service.yaml @@ -0,0 +1,11 @@ +{{ $selectors := list }} +{{ $selectors = mustAppend $selectors (dict "key" "app" "value" (include "common.names.name" .) ) }} +{{ $selectors = mustAppend $selectors (dict "key" "release" "value" .Release.Name ) }} +{{ $ports := list }} +{{ $ports = mustAppend $ports (dict "name" "web" "port" .Values.web_port "nodePort" .Values.web_port "targetPort" 8384) }} +{{ $ports = mustAppend $ports (dict "name" "tcp" "port" .Values.tcp_port "nodePort" .Values.tcp_port "targetPort" 22000) }} +{{ $ports = mustAppend $ports (dict "name" "udp" "port" .Values.udp_port "nodePort" .Values.udp_port "targetPort" 22000 "protocol" "UDP") }} +{{ $params := . }} +{{ $_ := set $params "commonService" (dict "type" "NodePort" "ports" $ports ) }} +{{ $_1 := set .Values "extraSelectorLabels" $selectors }} +{{ include "common.classes.service" $params }} diff --git a/charts/syncthing/1.0.0/templates/tests/deployment-check.yaml b/charts/syncthing/1.0.0/templates/tests/deployment-check.yaml new file mode 100644 index 0000000000..64ebf08fa3 --- /dev/null +++ b/charts/syncthing/1.0.0/templates/tests/deployment-check.yaml @@ -0,0 +1,21 @@ +{{- $serviceName := (include "common.names.fullname" .) -}} +apiVersion: v1 +kind: Pod +metadata: + name: {{ .Release.Name }}-syncthing + labels: + app: {{ .Release.Name }} + release: {{ .Release.Name }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: test-curl + image: alpine/curl + imagePullPolicy: "IfNotPresent" + command: + - /bin/sh + - -ec + - | + curl --connect-timeout 5 --max-time 10 --retry 5 --retry-delay 15 --retry-max-time 90 --retry-all-errors -ksf http://{{ $serviceName }}:{{.Values.web_port}}/ + restartPolicy: Never diff --git a/charts/syncthing/1.0.0/test_values.yaml b/charts/syncthing/1.0.0/test_values.yaml new file mode 100644 index 0000000000..5cc96cc537 --- /dev/null +++ b/charts/syncthing/1.0.0/test_values.yaml @@ -0,0 +1,20 @@ +image: + pullPolicy: IfNotPresent + repository: syncthing/syncthing + tag: 1.19.2 +ownerUID: 568 +ownerGID: 568 +timezone: Europe/London +environmentVariables: [] +extraAppVolumeMounts: [] +web_port: 32000 +tcp_port: 32001 +udp_port: 32002 +dnsConfig: + options: [] +emptyDirVolumes: true +appVolumeMounts: + config: + emptyDir: true + mountPath: /config +hostNetwork: false diff --git a/charts/syncthing/item.yaml b/charts/syncthing/item.yaml new file mode 100644 index 0000000000..2b19477d9f --- /dev/null +++ b/charts/syncthing/item.yaml @@ -0,0 +1,4 @@ +icon_url: https://truecharts.org/_static/img/appicons/syncthing.png +categories: +- backup +- storage diff --git a/charts/syncthing/upgrade_info.json b/charts/syncthing/upgrade_info.json new file mode 100644 index 0000000000..5bf84fb901 --- /dev/null +++ b/charts/syncthing/upgrade_info.json @@ -0,0 +1 @@ +{"filename": "ix_values.yaml", "keys": ["image"]} diff --git a/charts/syncthing/upgrade_strategy b/charts/syncthing/upgrade_strategy new file mode 100755 index 0000000000..7b17b7c084 --- /dev/null +++ b/charts/syncthing/upgrade_strategy @@ -0,0 +1,25 @@ +#!/usr/bin/python3 +import json +import sys + +from catalog_update.upgrade_strategy import semantic_versioning + + +def newer_mapping(image_tags): + key = list(image_tags.keys())[0] + tags = {t: t for t in image_tags[key]} + version = semantic_versioning(list(tags)) + if not version: + return {} + + return { + 'tags': {key: tags[version]}, + 'app_version': version, + } + + +if __name__ == '__main__': + if len(sys.argv) != 2: + exit(1) + + print(json.dumps(newer_mapping(json.loads(sys.argv[1]))))