Move from Gitea to Nomad Vars for custom block and allow

DNS doesn't route to internal addresses for git.thefij.rocks because
list lookups use bootstrap DNS servers, which don't know about it.
This commit is contained in:
IamTheFij 2024-06-24 13:53:34 -07:00
parent 7477cb7227
commit bc620987b7
2 changed files with 36 additions and 6 deletions

View File

@ -121,6 +121,40 @@ job "blocky" {
max = "20s"
}
}
template {
data = <<EOF
{{ if nomadVarExists "nomad/jobs/blocky" }}
{{ with nomadVar "nomad/jobs/blocky" -}}
{{ .block_list.Value }}
{{- end }}
{{- end }}
EOF
destination = "$${NOMAD_TASK_DIR}/block"
change_mode = "noop"
wait {
min = "10s"
max = "20s"
}
}
template {
data = <<EOF
{{ if nomadVarExists "nomad/jobs/blocky" }}
{{ with nomadVar "nomad/jobs/blocky" -}}
{{ .allow_list.Value }}
{{- end }}
{{- end }}
EOF
destination = "$${NOMAD_TASK_DIR}/allow"
change_mode = "noop"
wait {
min = "10s"
max = "20s"
}
}
}
task "stunnel" {

View File

@ -96,15 +96,11 @@ blocking:
twitter.com
youtube.com
custom:
- https://git.thefij.rocks/iamthefij/blocklists/raw/branch/main/block
- {{ env "NOMAD_TASK_DIR" }}/block
whiteLists:
ads:
{{ with nomadVar "nomad/jobs/blocky" -}}
{{ .whitelists_ads.Value | indent 6 }}
{{- end }}
custom:
- https://git.thefij.rocks/iamthefij/blocklists/raw/branch/main/allow
- {{ env "NOMAD_TASK_DIR" }}/allow
clientGroupsBlock:
default: