commit e8160380cb6c539e6b48dcacf74d7233f331190a
parent 353431f16dc7fecbfa4a555b182e7dac7167ee07
Author: Andreas Gruhler <andreas.gruhler@adfinis.com>
Date: Sun, 21 Jul 2024 21:48:30 +0200
fix(0x0): replace consul keys
Diffstat:
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/hcl/default/0x0/templates/index.html.tmpl b/hcl/default/0x0/templates/index.html.tmpl
@@ -1,7 +1,8 @@
<pre>
THE NULL POINTER
================
-{{- $fhost := key "0x0/host" }}
+{{- with nomadVar "nomad/jobs/0x0" }}
+{{- $fhost := .host }}
{{- $fhost_url := (printf "http://%s" $fhost) }}
HTTP POST files here:
curl -F'file=@yourfile.png' {{ $fhost }}
@@ -9,6 +10,7 @@ You can also POST remote URLs:
curl -F'url=http://example.com/image.jpg' {{ $fhost }}
Or you can shorten URLs:
curl -F'shorten=http://example.com/some/long/url' {{ $fhost }}
+{{ end }}
File URLs are valid for at least 30 days and up to a year (see below).
Shortened URLs do not expire.
diff --git a/hcl/default/0x0/templates/nginx.conf.tmpl b/hcl/default/0x0/templates/nginx.conf.tmpl
@@ -3,7 +3,7 @@ server {
location / {
proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header Host {{ key "0x0/host" }};
+ proxy_set_header Host {{ with nomadVar "nomad/jobs/0x0" }}{{ .host }}{{ end }};
proxy_pass http://{{ env "NOMAD_ADDR_fhost" }};
}
}
@@ -16,7 +16,7 @@ server {
location / {
proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header Host {{ key "0x0/host" }};
+ proxy_set_header Host {{ with nomadVar "nomad/jobs/0x0" }}{{ .host }}{{ end }};
proxy_pass http://{{ env "NOMAD_ADDR_fhost" }};
}
}