From 769b3fd3d61fbdcb6743d01c0647f0ce921ec5bd Mon Sep 17 00:00:00 2001 From: cunningpike <117583036+cunningpike@users.noreply.github.com> Date: Mon, 6 Feb 2023 11:42:53 -0500 Subject: [PATCH 1/8] Removed static reference to conf file --- chart/templates/_helpers.tpl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl index 78e6610..a416d2d 100644 --- a/chart/templates/_helpers.tpl +++ b/chart/templates/_helpers.tpl @@ -51,14 +51,6 @@ app.kubernetes.io/name: {{ include "fediblockhole.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} -{{/* -Rolling pod annotations -*/}} -{{- define "fediblockhole.rollingPodAnnotations" -}} -rollme: {{ .Release.Revision | quote }} -checksum/config-configmap: {{ include ( print $.Template.BasePath "/configmap-conf-toml.yaml" ) . | sha256sum | quote }} -{{- end }} - {{/* Create the default conf file path and filename */}} @@ -68,3 +60,11 @@ Create the default conf file path and filename {{- define "fediblockhole.conf_file_filename" -}} {{- default "fediblockhole.conf.toml" .Values.fediblockhole.conf_file.filename }} {{- end }} + +{{/* +Rolling pod annotations +*/}} +{{- define "fediblockhole.rollingPodAnnotations" -}} +rollme: {{ .Release.Revision | quote }} +checksum/config-configmap: {{- include "fediblockhole.conf_file_path" . -}}{{- include "fediblockhole.conf_file_filename" . -}} | sha256sum | quote }} +{{- end }} From 56fbe062bb7b59b3bcf5906397948ad7d6fc092a Mon Sep 17 00:00:00 2001 From: cunningpike <117583036+cunningpike@users.noreply.github.com> Date: Mon, 6 Feb 2023 11:57:17 -0500 Subject: [PATCH 2/8] Reverted previous change --- chart/templates/_helpers.tpl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl index a416d2d..78e6610 100644 --- a/chart/templates/_helpers.tpl +++ b/chart/templates/_helpers.tpl @@ -51,6 +51,14 @@ app.kubernetes.io/name: {{ include "fediblockhole.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} +{{/* +Rolling pod annotations +*/}} +{{- define "fediblockhole.rollingPodAnnotations" -}} +rollme: {{ .Release.Revision | quote }} +checksum/config-configmap: {{ include ( print $.Template.BasePath "/configmap-conf-toml.yaml" ) . | sha256sum | quote }} +{{- end }} + {{/* Create the default conf file path and filename */}} @@ -60,11 +68,3 @@ Create the default conf file path and filename {{- define "fediblockhole.conf_file_filename" -}} {{- default "fediblockhole.conf.toml" .Values.fediblockhole.conf_file.filename }} {{- end }} - -{{/* -Rolling pod annotations -*/}} -{{- define "fediblockhole.rollingPodAnnotations" -}} -rollme: {{ .Release.Revision | quote }} -checksum/config-configmap: {{- include "fediblockhole.conf_file_path" . -}}{{- include "fediblockhole.conf_file_filename" . -}} | sha256sum | quote }} -{{- end }} From 3d76de04aaa98d2174eb1939ea2778f3b7bebe43 Mon Sep 17 00:00:00 2001 From: cunningpike <117583036+cunningpike@users.noreply.github.com> Date: Tue, 21 Feb 2023 14:27:41 -0500 Subject: [PATCH 3/8] Update values.yaml --- chart/values.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/chart/values.yaml b/chart/values.yaml index 0aa310f..e660da9 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -15,6 +15,15 @@ fediblockhole: conf_file: path: "" filename: "" + # location of the local allowlist file. Default is /etc/default/allowlist.csv. + # This file should at a minimum contain the web_domain of your own instance. + allow_file: + path: "" + filename: "" + # location of the local blocklist file. Default is /etc/default/blocklist.csv + block_file: + path: "" + filename: "" cron: # -- run `fediblock-sync` every hour sync: From 5fb81fa227f667f958ffa78d982f31e0a50087bc Mon Sep 17 00:00:00 2001 From: cunningpike <117583036+cunningpike@users.noreply.github.com> Date: Tue, 21 Feb 2023 14:30:14 -0500 Subject: [PATCH 4/8] Update _helpers.tpl --- chart/templates/_helpers.tpl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl index 78e6610..6501d6a 100644 --- a/chart/templates/_helpers.tpl +++ b/chart/templates/_helpers.tpl @@ -68,3 +68,23 @@ Create the default conf file path and filename {{- define "fediblockhole.conf_file_filename" -}} {{- default "fediblockhole.conf.toml" .Values.fediblockhole.conf_file.filename }} {{- end }} + +{{/* +Create the default allowlist file path and filename +*/}} +{{- define "fediblockhole.allow_file_path" -}} +{{- default "/etc/default/" .Values.fediblockhole.allow_file.path }} +{{- end }} +{{- define "fediblockhole.allow_file_filename" -}} +{{- default "allowlist.csv" .Values.fediblockhole.allow_file.filename }} +{{- end }} + +{{/* +Create the default blocklist file path and filename +*/}} +{{- define "fediblockhole.block_file_path" -}} +{{- default "/etc/default/" .Values.fediblockhole.block_file.path }} +{{- end }} +{{- define "fediblockhole.block_file_filename" -}} +{{- default "blocklist.csv" .Values.fediblockhole.block_file.filename }} +{{- end }} From d1bd8dc5a238123856458beee9defa9a9c839ef7 Mon Sep 17 00:00:00 2001 From: cunningpike <117583036+cunningpike@users.noreply.github.com> Date: Tue, 21 Feb 2023 14:35:06 -0500 Subject: [PATCH 5/8] Update cronjob-fediblock-sync.yaml --- chart/templates/cronjob-fediblock-sync.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/chart/templates/cronjob-fediblock-sync.yaml b/chart/templates/cronjob-fediblock-sync.yaml index b19302b..8e18aee 100644 --- a/chart/templates/cronjob-fediblock-sync.yaml +++ b/chart/templates/cronjob-fediblock-sync.yaml @@ -29,6 +29,10 @@ spec: volumeMounts: - name: config mountPath: {{ include "fediblockhole.conf_file_path" . | quote }} + - name: allow + mountPath: {{ include "fediblockhole.allow_file_path" . | quote }} + - name: block + mountPath: {{ include "fediblockhole.block_file_path" . | quote }} volumes: - name: config configMap: @@ -36,4 +40,16 @@ spec: items: - key: {{ include "fediblockhole.conf_file_filename" . | quote }} path: {{ include "fediblockhole.conf_file_filename" . | quote }} + - name: allow + configMap: + name: {{ include "fediblockhole.fullname" . }}-allow-csv + items: + - key: {{ include "fediblockhole.allow_file_filename" . | quote }} + path: {{ include "fediblockhole.allow_file_filename" . | quote }} + - name: config + configMap: + name: {{ include "fediblockhole.fullname" . }}-block-csv + items: + - key: {{ include "fediblockhole.block_file_filename" . | quote }} + path: {{ include "fediblockhole.block_file_filename" . | quote }} {{- end }} From b000b5e03a13bab0879ad95bcce80d746137fd42 Mon Sep 17 00:00:00 2001 From: cunningpike <117583036+cunningpike@users.noreply.github.com> Date: Tue, 21 Feb 2023 14:47:46 -0500 Subject: [PATCH 6/8] Update values.yaml --- chart/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chart/values.yaml b/chart/values.yaml index e660da9..3fb9ca8 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -20,7 +20,7 @@ fediblockhole: allow_file: path: "" filename: "" - # location of the local blocklist file. Default is /etc/default/blocklist.csv + # location of the local blocklist file. block_file: path: "" filename: "" From 190787a69a77585beb818e45e8999981ce79de40 Mon Sep 17 00:00:00 2001 From: cunningpike <117583036+cunningpike@users.noreply.github.com> Date: Tue, 21 Feb 2023 14:51:17 -0500 Subject: [PATCH 7/8] Update _helpers.tpl --- chart/templates/_helpers.tpl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl index 6501d6a..3ee4c22 100644 --- a/chart/templates/_helpers.tpl +++ b/chart/templates/_helpers.tpl @@ -80,11 +80,13 @@ Create the default allowlist file path and filename {{- end }} {{/* -Create the default blocklist file path and filename +Create the blocklist file path and filename */}} +{{- if .Values.fediblockhole.block_file.path && .Values.fediblockhole.block_file.filename }} {{- define "fediblockhole.block_file_path" -}} -{{- default "/etc/default/" .Values.fediblockhole.block_file.path }} +{{- .Values.fediblockhole.block_file.path }} {{- end }} {{- define "fediblockhole.block_file_filename" -}} -{{- default "blocklist.csv" .Values.fediblockhole.block_file.filename }} +{{- .Values.fediblockhole.block_file.filename }} +{{- end }} {{- end }} From df052f2c0c30eeb8ca1868cd86eb547d4b6ecd2c Mon Sep 17 00:00:00 2001 From: cunningpike <117583036+cunningpike@users.noreply.github.com> Date: Tue, 21 Feb 2023 15:00:37 -0500 Subject: [PATCH 8/8] Update cronjob-fediblock-sync.yaml --- chart/templates/cronjob-fediblock-sync.yaml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/chart/templates/cronjob-fediblock-sync.yaml b/chart/templates/cronjob-fediblock-sync.yaml index 8e18aee..c9c6774 100644 --- a/chart/templates/cronjob-fediblock-sync.yaml +++ b/chart/templates/cronjob-fediblock-sync.yaml @@ -31,8 +31,10 @@ spec: mountPath: {{ include "fediblockhole.conf_file_path" . | quote }} - name: allow mountPath: {{ include "fediblockhole.allow_file_path" . | quote }} + {{- with fediblockhole.block_file_path }} - name: block - mountPath: {{ include "fediblockhole.block_file_path" . | quote }} + mountPath: {{ . | quote }} + {{ end }} volumes: - name: config configMap: @@ -46,10 +48,14 @@ spec: items: - key: {{ include "fediblockhole.allow_file_filename" . | quote }} path: {{ include "fediblockhole.allow_file_filename" . | quote }} - - name: config + {{- with fediblockhole.block_file_path }} + - name: block configMap: name: {{ include "fediblockhole.fullname" . }}-block-csv + {{- with fediblockhole.block_file_filename }} items: - - key: {{ include "fediblockhole.block_file_filename" . | quote }} - path: {{ include "fediblockhole.block_file_filename" . | quote }} + - key: {{ . | quote }} + path: {{ . | quote }} + {{ end }} + {{end }} {{- end }}