Compare commits

...

3 commits

Author SHA1 Message Date
sdomi
9f123a6d66 worker: create missing control files on startup 2025-04-03 01:52:45 +02:00
sdomi
8aa0dcd2fa template: fix quoting issue causing a tr malfunction 2025-04-02 22:56:11 +02:00
sdomi
cf70f8ccc0 docker: hopefully fix 2025-04-02 22:37:33 +02:00
3 changed files with 12 additions and 10 deletions

View file

@ -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"]

View file

@ -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/\&/<2F>UwU<77>/g')"
local template="$(tr -d "${_tpl_newline}${_tpl_ctrl}" < "$2" | sed 's/\&/<2F>UwU<77>/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

View file

@ -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