diff options
author | Mathias Magnusson <mathias@magnusson.space> | 2024-03-02 15:31:35 +0100 |
---|---|---|
committer | Mathias Magnusson <mathias@magnusson.space> | 2024-03-02 15:31:35 +0100 |
commit | dc867699f39d701fe73bcdeda78b65d87690d859 (patch) | |
tree | 71309949bd85c75438c26927c2b57683f531e5f8 /jobs/certificates.nomad.hcl | |
parent | 2a0a20ae245af94da46476df7ac2d52be17d6a48 (diff) | |
download | garm-dc867699f39d701fe73bcdeda78b65d87690d859.tar.gz |
I don't even know at this point. Fuck lego. I think, i don't even know
Diffstat (limited to 'jobs/certificates.nomad.hcl')
-rw-r--r-- | jobs/certificates.nomad.hcl | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/jobs/certificates.nomad.hcl b/jobs/certificates.nomad.hcl index e1cbc51..db7993d 100644 --- a/jobs/certificates.nomad.hcl +++ b/jobs/certificates.nomad.hcl @@ -2,7 +2,7 @@ job "certificates" { type = "batch" periodic { - cron = "@monthly" + crons = ["@monthly"] } group "lego" { @@ -17,7 +17,9 @@ job "certificates" { } network { - port "http" { } + port "http" { + # static = 80 + } } service { @@ -46,26 +48,23 @@ job "certificates" { data = <<EOF #!/usr/bin/env bash -function dns() { - [ -f "/lego/certificates/$1.key" ] && cmd="renew --no-random-sleep --days 45" || cmd=run +function cert() { + # --server "https://acme-staging-v02.api.letsencrypt.org/directory" /local/lego \ --accept-tos \ --path /lego \ --email mathias+certs@magnusson.space \ - --dns cloudflare \ - $${@/#/-d=} \ - $cmd + "$@" +} + +function dns() { + [ -f "/lego/certificates/$1.key" ] && cmd="renew --no-random-sleep --days 45" || cmd=run + cert --dns cloudflare $${@/#/-d=} $cmd } function http() { [ -f "/lego/certificates/$1.key" ] && cmd="renew --no-random-sleep --days 45" || cmd=run - /local/lego \ - --accept-tos \ - --path /lego \ - --email mathias+certs@magnusson.space \ - --http --http.port ":$NOMAD_PORT_http" \ - $${@/#/-d=} \ - $cmd + cert --http --http.port ":$NOMAD_PORT_http" $${@/#/-d=} $cmd } dns magnusson.space *.magnusson.space |