Initial commit: Nosterm client (terminal-style Nostr chat SPA)
ci / build (push) Successful in 1m3s
ci / image (push) Successful in 41s

This commit is contained in:
Robert Goodall
2026-07-24 13:47:53 -04:00
commit cd2b900639
147 changed files with 16504 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
#!/bin/sh
# regenerate runtime client config from env before caddy starts.
#
# the SPA fetches /config.json at startup, so this lets one prebuilt image be
# deployed with different relays per environment without a rebuild. set
# NOSTERM_DEFAULT_RELAYS to a comma-separated list of relay websocket urls.
set -eu
CONFIG_PATH=/srv/config.json
RELAYS="${NOSTERM_DEFAULT_RELAYS:-}"
# build a json array from the comma-separated list, trimming blanks.
relays_json=""
IFS=','
for relay in $RELAYS; do
# trim surrounding whitespace.
trimmed="$(printf '%s' "$relay" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')"
[ -z "$trimmed" ] && continue
if [ -z "$relays_json" ]; then
relays_json="\"$trimmed\""
else
relays_json="$relays_json,\"$trimmed\""
fi
done
unset IFS
printf '{\n "relays": [%s]\n}\n' "$relays_json" > "$CONFIG_PATH"
if [ -n "$relays_json" ]; then
echo "[entrypoint] wrote $CONFIG_PATH with relays: $RELAYS"
else
echo "[entrypoint] no NOSTERM_DEFAULT_RELAYS set; wrote empty relay list"
fi
# hand off to the container command (caddy).
exec "$@"