From cf70f8ccc07929ab18f3310ca7aaf00de16ef76b Mon Sep 17 00:00:00 2001 From: sdomi Date: Wed, 2 Apr 2025 22:37:33 +0200 Subject: [PATCH 1/3] docker: hopefully fix --- Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4ce2fe1..a8bfc85 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,13 +2,13 @@ FROM alpine:3.21 RUN apk upgrade -U && apk add bash sed grep nmap-ncat socat file findutils jq curl argon2 -WORKDIR /app +WORKDIR /httpsh COPY . . EXPOSE 1337 -VOLUME /app/app -VOLUME /app/config -VOLUME /app/storage -VOLUME /app/secret +VOLUME /httpsh/app +VOLUME /httpsh/config +VOLUME /httpsh/storage +VOLUME /httpsh/secret -CMD ["/app/http.sh"] +CMD ["/httpsh/http.sh"] From 8aa0dcd2fa9e363f873dc504bfcd701b68d6feb9 Mon Sep 17 00:00:00 2001 From: sdomi Date: Wed, 2 Apr 2025 22:56:11 +0200 Subject: [PATCH 2/3] template: fix quoting issue causing a tr malfunction --- src/template.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/template.sh b/src/template.sh index e204ebc..656058d 100755 --- a/src/template.sh +++ b/src/template.sh @@ -1,15 +1,16 @@ #!/usr/bin/env bash # template.sh - basic templating engine -_tpl_newline=$'\01' -_tpl_ctrl=$'\02' # nightmare fuel # render(array, template_file, recurse) function render() { + local _tpl_newline=$'\01' + local _tpl_ctrl=$'\02' + if [[ "$3" != true ]]; then - local template="$(tr -d ${_tpl_newline}${_tpl_ctrl} < "$2" | sed 's/\&/�UwU�/g')" + local template="$(tr -d "${_tpl_newline}${_tpl_ctrl}" < "$2" | sed 's/\&/�UwU�/g')" else - local template="$(tr -d ${_tpl_ctrl} < "$2" | sed -E 's/\\/\\\\/g')" + local template="$(tr -d "${_tpl_ctrl}" < "$2" | sed -E 's/\\/\\\\/g')" fi local buf= local -n ref=$1 From 9f123a6d66bc85a64b339d400718e9ddba5fe8f1 Mon Sep 17 00:00:00 2001 From: sdomi Date: Thu, 3 Apr 2025 01:52:45 +0200 Subject: [PATCH 3/3] worker: create missing control files on startup --- src/worker.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/worker.sh b/src/worker.sh index 021b491..c8a0614 100755 --- a/src/worker.sh +++ b/src/worker.sh @@ -5,6 +5,7 @@ function worker_add() { if [[ -x "${cfg[namespace]}/workers/$1/worker.sh" ]]; then echo "[WRKR] adding worker $1" + touch "${cfg[namespace]}/workers/$1/control" { shopt -s extglob x() { declare -p data;} # for notORM