Merge pull request #1 from cunningpike/cunningpike
Added local allow and block file support
This commit is contained in:
commit
b2cfb9659b
|
@ -68,3 +68,25 @@ Create the default conf file path and filename
|
||||||
{{- define "fediblockhole.conf_file_filename" -}}
|
{{- define "fediblockhole.conf_file_filename" -}}
|
||||||
{{- default "fediblockhole.conf.toml" .Values.fediblockhole.conf_file.filename }}
|
{{- default "fediblockhole.conf.toml" .Values.fediblockhole.conf_file.filename }}
|
||||||
{{- end }}
|
{{- 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 blocklist file path and filename
|
||||||
|
*/}}
|
||||||
|
{{- if .Values.fediblockhole.block_file.path && .Values.fediblockhole.block_file.filename }}
|
||||||
|
{{- define "fediblockhole.block_file_path" -}}
|
||||||
|
{{- .Values.fediblockhole.block_file.path }}
|
||||||
|
{{- end }}
|
||||||
|
{{- define "fediblockhole.block_file_filename" -}}
|
||||||
|
{{- .Values.fediblockhole.block_file.filename }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
|
@ -31,6 +31,12 @@ spec:
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: config
|
- name: config
|
||||||
mountPath: {{ include "fediblockhole.conf_file_path" . | quote }}
|
mountPath: {{ include "fediblockhole.conf_file_path" . | quote }}
|
||||||
|
- name: allow
|
||||||
|
mountPath: {{ include "fediblockhole.allow_file_path" . | quote }}
|
||||||
|
{{- with fediblockhole.block_file_path }}
|
||||||
|
- name: block
|
||||||
|
mountPath: {{ . | quote }}
|
||||||
|
{{ end }}
|
||||||
volumes:
|
volumes:
|
||||||
- name: config
|
- name: config
|
||||||
configMap:
|
configMap:
|
||||||
|
@ -38,4 +44,20 @@ spec:
|
||||||
items:
|
items:
|
||||||
- key: {{ include "fediblockhole.conf_file_filename" . | quote }}
|
- key: {{ include "fediblockhole.conf_file_filename" . | quote }}
|
||||||
path: {{ 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 }}
|
||||||
|
{{- with fediblockhole.block_file_path }}
|
||||||
|
- name: block
|
||||||
|
configMap:
|
||||||
|
name: {{ include "fediblockhole.fullname" . }}-block-csv
|
||||||
|
{{- with fediblockhole.block_file_filename }}
|
||||||
|
items:
|
||||||
|
- key: {{ . | quote }}
|
||||||
|
path: {{ . | quote }}
|
||||||
|
{{ end }}
|
||||||
|
{{end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -15,6 +15,15 @@ fediblockhole:
|
||||||
conf_file:
|
conf_file:
|
||||||
path: ""
|
path: ""
|
||||||
filename: ""
|
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.
|
||||||
|
block_file:
|
||||||
|
path: ""
|
||||||
|
filename: ""
|
||||||
cron:
|
cron:
|
||||||
# -- run `fediblock-sync` every hour
|
# -- run `fediblock-sync` every hour
|
||||||
sync:
|
sync:
|
||||||
|
|
Loading…
Reference in New Issue