summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/simple
diff options
context:
space:
mode:
Diffstat (limited to 'krebs/5pkgs/simple')
-rw-r--r--krebs/5pkgs/simple/htgen-cyberlocker/src/htgen-cyberlocker14
-rw-r--r--krebs/5pkgs/simple/nomads-cloud/default.nix8
2 files changed, 17 insertions, 5 deletions
diff --git a/krebs/5pkgs/simple/htgen-cyberlocker/src/htgen-cyberlocker b/krebs/5pkgs/simple/htgen-cyberlocker/src/htgen-cyberlocker
index ab9c4e8e3..5ca0ddd3e 100644
--- a/krebs/5pkgs/simple/htgen-cyberlocker/src/htgen-cyberlocker
+++ b/krebs/5pkgs/simple/htgen-cyberlocker/src/htgen-cyberlocker
@@ -1,3 +1,10 @@
+emptyok_response() {(
+ printf "HTTP/1.1 204 OK\r\n"
+ printf 'Connection: close\r\n'
+ printf 'Server: %s\r\n' "$Server"
+ printf '\r\n'
+)}
+
delete_response() {
jq -n -r \
--arg server "$Server" \
@@ -44,7 +51,10 @@ read_uri() {
}
uri=$(read_uri "$Request_URI")
-path=$(jq -nr --argjson uri "$uri" '$uri.path')
+path=$(jq -nr --argjson uri "$uri" '
+ $uri.path |
+ gsub("/+"; "/")
+')
case "$Method $path" in
'POST /'*|'PUT /'*)
@@ -57,6 +67,8 @@ case "$Method $path" in
mkdir -v -p $STATEDIR/items >&2
cp -v $content $item >&2
+
+ emptyok_response
exit
;;
'GET /'*)
diff --git a/krebs/5pkgs/simple/nomads-cloud/default.nix b/krebs/5pkgs/simple/nomads-cloud/default.nix
index 97cf10d1f..cc9e7a964 100644
--- a/krebs/5pkgs/simple/nomads-cloud/default.nix
+++ b/krebs/5pkgs/simple/nomads-cloud/default.nix
@@ -1,10 +1,10 @@
{ writers, coreutils, grib2json, curl, jq, findutils, imagemagick }:
writers.writeDashBin "nomads-cloud" ''
prefix=$(mktemp -d)
- grib_path=$prefix.grib
- json_path=$prefix.json
- pgm_path=$prefix.pgm
- png_path="$1"
+ grib_path=$prefix/clouds.grib
+ json_path=$prefix/clouds.json
+ pgm_path=$prefix/clouds.pgm
+ png_path=$1
mkdir -p "$prefix"